aboutsummaryrefslogtreecommitdiffstats
path: root/hierarchyviewer2
diff options
context:
space:
mode:
authorSiva Velusamy <vsiva@google.com>2012-08-09 15:19:11 -0700
committerSiva Velusamy <vsiva@google.com>2012-08-09 15:19:11 -0700
commitbe3bd5941c778a3612308fab1c1466030f3fd473 (patch)
tree351aa7c5255ac5d530ceea40be1ecfff104ac291 /hierarchyviewer2
parent333e659cd078a0cf687973309ae2a4025b478d51 (diff)
downloadsdk-be3bd5941c778a3612308fab1c1466030f3fd473.zip
sdk-be3bd5941c778a3612308fab1c1466030f3fd473.tar.gz
sdk-be3bd5941c778a3612308fab1c1466030f3fd473.tar.bz2
hv: Add more logging for when things go wrong.
Change-Id: Idbb0a32507c19aadb11544342d73e1be7d1d4272
Diffstat (limited to 'hierarchyviewer2')
-rw-r--r--hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/device/DeviceBridge.java1
-rw-r--r--hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/device/ViewNode.java3
2 files changed, 4 insertions, 0 deletions
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 07bb807..10308a3 100644
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/device/DeviceBridge.java
+++ b/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/device/DeviceBridge.java
@@ -468,6 +468,7 @@ public class DeviceBridge {
} catch (Exception e) {
Log.e(TAG, "Unable to load window data for window " + window.getTitle() + " on device "
+ window.getDevice());
+ Log.e(TAG, e.getMessage());
} finally {
if (connection != null) {
connection.close();
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/device/ViewNode.java b/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/device/ViewNode.java
index 76eaa10..4ab4fc6 100644
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/device/ViewNode.java
+++ b/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/device/ViewNode.java
@@ -125,6 +125,9 @@ public class ViewNode {
this.parent.children.add(this);
}
int delimIndex = data.indexOf('@');
+ if (delimIndex < 0) {
+ throw new IllegalArgumentException("Invalid format for ViewNode, missing @: " + data);
+ }
name = data.substring(0, delimIndex);
data = data.substring(delimIndex + 1);
delimIndex = data.indexOf(' ');