diff options
author | Romain Guy <romainguy@google.com> | 2011-05-19 15:00:26 -0700 |
---|---|---|
committer | Xavier Ducrohet <xav@android.com> | 2011-05-20 14:14:12 -0700 |
commit | ee0334d3f419224d26485f6271e44ee0ee5b5249 (patch) | |
tree | 4f4b1943958fa7406d2db1ece47578580bea170b | |
parent | 27fda5abce4c9b9567f2c34d59b03992b115e43f (diff) | |
download | sdk-ee0334d3f419224d26485f6271e44ee0ee5b5249.zip sdk-ee0334d3f419224d26485f6271e44ee0ee5b5249.tar.gz sdk-ee0334d3f419224d26485f6271e44ee0ee5b5249.tar.bz2 |
Allow HV to work on user builds.
Change-Id: If0f2a79b54abf9a9d8782827b083f10d5d2f2a7e
-rw-r--r-- | hierarchyviewer/src/com/android/hierarchyviewer/device/DeviceBridge.java | 10 | ||||
-rw-r--r-- | hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/device/DeviceBridge.java | 3 |
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); |