aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-02-20 09:46:54 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-02-20 09:46:54 +0000
commitf33cd267c31777a143ddf3b3a37b63cce66032ec (patch)
treec60113546fb28fc67043e1846edbe406d20d6cb3
parenta916dc321a4984ea4a41ecb8a801e84d15d9105a (diff)
parentd33a3ebbc43fa65768a21dfd612ea01de567c8f5 (diff)
downloadacloud-f33cd267c31777a143ddf3b3a37b63cce66032ec.tar.gz
Display webrtc AVD connection information on remote terminal. am: 820cea76fb am: d33a3ebbc4
Change-Id: I222cb945113536280508ecda43a0328cc8ce9334
-rwxr-xr-xinternal/lib/utils.py20
1 files changed, 14 insertions, 6 deletions
diff --git a/internal/lib/utils.py b/internal/lib/utils.py
index f248f544..a60c6c3f 100755
--- a/internal/lib/utils.py
+++ b/internal/lib/utils.py
@@ -918,14 +918,22 @@ def LaunchBrowserFromReport(report):
Args:
report: Report object, that stores and generates report.
"""
+ PrintColorString("(This is an experimental project for webrtc, and since "
+ "the certificate is self-signed, Chrome will mark it as "
+ "an insecure website. keep going.)",
+ TextColors.WARNING)
+
for device in report.data.get("devices", []):
if device.get("ip"):
- PrintColorString("(This is an experimental project for webrtc, and "
- "since the certificate is self-signed, Chrome will "
- "mark it as an insecure website. keep going.)",
- TextColors.WARNING)
- webbrowser.open_new_tab("%s%s:%s" % (
- _WEBRTC_URL, device.get("ip"), _WEBRTC_PORT))
+ webrtc_link = "%s%s:%s" % (_WEBRTC_URL, device.get("ip"),
+ _WEBRTC_PORT)
+ if os.environ.get(_ENV_DISPLAY, None):
+ webbrowser.open_new_tab(webrtc_link)
+ else:
+ PrintColorString("Remote terminal can't support launch webbrowser.",
+ TextColors.FAIL)
+ PrintColorString("Open %s to remotely control AVD on the "
+ "browser." % webrtc_link)
else:
PrintColorString("Auto-launch devices webrtc in browser failed!",
TextColors.FAIL)