Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1101)

Unified Diff: editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/mobile/AndroidDebugBridge.java

Issue 334853002: merge cl for mobile support fixes and features in editor (Closed) Base URL: http://dart.googlecode.com/svn/trunk/dart/
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/mobile/AndroidDebugBridge.java
===================================================================
--- editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/mobile/AndroidDebugBridge.java (revision 37568)
+++ editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/mobile/AndroidDebugBridge.java (working copy)
@@ -245,7 +245,6 @@
DartCore.getConsole().println("Failed to launch ADB logcat");
return new Status(IStatus.ERROR, DartCore.PLUGIN_ID, "Failed to launch ADB logcat", e);
}
-
// Launch the service that tests the connection from mobile device to developer machine
List<String> args = buildAdbCommand(START_SERVICE);
args.add("-n");
@@ -255,6 +254,13 @@
args.add("-e");
args.add("prefix");
args.add(msgPrefix);
+
+ // wait for dialog for connection to browser on mobile, and then
+ // start the check for port forwarding.
+ while (DartCore.allowConnectionDialogOpen == true) {
+ threadSleep(500);
+ }
+
try {
if (!runAdb(args, "ADB: check port forwarding")) {
return new Status(
@@ -262,6 +268,7 @@
DartCore.PLUGIN_ID,
"Failed to launch port forwarding detection");
}
+
IStatus result = logcatRunner.waitForResult(3500);
if (result != null) {
if (!result.isOK()) {
@@ -481,6 +488,14 @@
return exitCode == 0 ? true : false;
}
+ private void threadSleep(long millisecs) {
+ try {
+ Thread.sleep(millisecs);
+ } catch (InterruptedException e) {
+
+ }
+ }
+
private boolean uninstall(AndroidDevice device, String apkId) {
List<String> args = buildAdbCommand(UNINSTALL_CMD);
if (device != null) {

Powered by Google App Engine
This is Rietveld 408576698