diff options
author | Siva Velusamy <vsiva@google.com> | 2011-11-06 11:03:20 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-11-06 11:03:20 -0800 |
commit | 61ac57663f70be7788d62b19cd338369c6ef7e53 (patch) | |
tree | 7dd157af82d0a7383673e0c78aa5c9e5d42a0217 /ddms | |
parent | 39ef0d97bd4fc7b76d4b62c7983aace311f81f4f (diff) | |
parent | b2645269bfab7c04243dc2a4bea03b33463bc6d1 (diff) | |
download | sdk-61ac57663f70be7788d62b19cd338369c6ef7e53.zip sdk-61ac57663f70be7788d62b19cd338369c6ef7e53.tar.gz sdk-61ac57663f70be7788d62b19cd338369c6ef7e53.tar.bz2 |
Merge "nativeheap: Do not clean up display if a client is killed."
Diffstat (limited to 'ddms')
-rw-r--r-- | ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeHeapPanel.java | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeHeapPanel.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeHeapPanel.java index e085f2c..72cdc22 100644 --- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeHeapPanel.java +++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeHeapPanel.java @@ -326,30 +326,34 @@ public class NativeHeapPanel extends BaseHeapPanel { public void clientSelected() { Client c = getCurrentClient(); + if (c == null) { + // if there is no client selected, then we disable the buttons but leave the + // display as is so that whatever snapshots are displayed continue to stay + // visible to the user. + mSnapshotHeapButton.setEnabled(false); + mLoadHeapDataButton.setEnabled(false); + return; + } + mNativeHeapSnapshots = new ArrayList<NativeHeapSnapshot>(); mDiffSnapshots = new ArrayList<NativeHeapSnapshot>(); - if (c != null) { - mSnapshotHeapButton.setEnabled(true); - mLoadHeapDataButton.setEnabled(true); + mSnapshotHeapButton.setEnabled(true); + mLoadHeapDataButton.setEnabled(true); - List<NativeHeapSnapshot> importedSnapshots = mImportedSnapshotsPerPid.get( - c.getClientData().getPid()); - if (importedSnapshots != null) { - for (NativeHeapSnapshot n : importedSnapshots) { - addNativeHeapSnapshot(n); - } + List<NativeHeapSnapshot> importedSnapshots = mImportedSnapshotsPerPid.get( + c.getClientData().getPid()); + if (importedSnapshots != null) { + for (NativeHeapSnapshot n : importedSnapshots) { + addNativeHeapSnapshot(n); } + } - List<NativeAllocationInfo> allocations = c.getClientData().getNativeAllocationList(); - allocations = shallowCloneList(allocations); + List<NativeAllocationInfo> allocations = c.getClientData().getNativeAllocationList(); + allocations = shallowCloneList(allocations); - if (allocations.size() > 0) { - addNativeHeapSnapshot(new NativeHeapSnapshot(allocations)); - } - } else { - mSnapshotHeapButton.setEnabled(false); - mLoadHeapDataButton.setEnabled(false); + if (allocations.size() > 0) { + addNativeHeapSnapshot(new NativeHeapSnapshot(allocations)); } updateDisplay(); |