aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--hierarchyviewer/src/com/android/hierarchyviewer/device/DeviceBridge.java10
-rw-r--r--hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/device/DeviceBridge.java3
2 files changed, 9 insertions, 4 deletions
diff --git a/hierarchyviewer/src/com/android/hierarchyviewer/device/DeviceBridge.java b/hierarchyviewer/src/com/android/hierarchyviewer/device/DeviceBridge.java
index 2d2cea1..f585ea6 100644
--- a/hierarchyviewer/src/com/android/hierarchyviewer/device/DeviceBridge.java
+++ b/hierarchyviewer/src/com/android/hierarchyviewer/device/DeviceBridge.java
@@ -23,6 +23,7 @@ import com.android.ddmlib.Log;
import com.android.ddmlib.MultiLineReceiver;
import com.android.ddmlib.ShellCommandUnresponsiveException;
import com.android.ddmlib.TimeoutException;
+import com.android.hierarchyviewer.scene.VersionLoader;
import java.io.IOException;
import java.io.File;
@@ -56,10 +57,6 @@ public class DeviceBridge {
AndroidDebugBridge.addDeviceChangeListener(listener);
}
- public static void stopListenForDevices(AndroidDebugBridge.IDeviceChangeListener listener) {
- AndroidDebugBridge.removeDeviceChangeListener(listener);
- }
-
public static IDevice[] getDevices() {
return bridge.getDevices();
}
@@ -71,6 +68,11 @@ public class DeviceBridge {
if (device.isOnline()) {
device.executeShellCommand(buildIsServerRunningShellCommand(),
new BooleanResultReader(result));
+ if (!result[0]) {
+ if (VersionLoader.loadProtocolVersion(device) > 2) {
+ result[0] = true;
+ }
+ }
}
} catch (IOException e) {
e.printStackTrace();
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/device/DeviceBridge.java b/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/device/DeviceBridge.java
index 610f7b3..33cb5e9 100644
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/device/DeviceBridge.java
+++ b/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/device/DeviceBridge.java
@@ -194,6 +194,9 @@ public class DeviceBridge {
if (device.isOnline()) {
device.executeShellCommand(buildIsServerRunningShellCommand(),
new BooleanResultReader(result));
+ if (!result[0] && loadViewServerInfo(device).protocolVersion > 2) {
+ result[0] = true;
+ }
}
} catch (TimeoutException e) {
Log.e(TAG, "Timeout checking status of view server on device " + device);