diff options
author | Xavier Ducrohet <xav@android.com> | 2010-01-29 18:11:14 -0800 |
---|---|---|
committer | Xavier Ducrohet <xav@android.com> | 2010-01-29 18:12:06 -0800 |
commit | 44783788698204a0dc3b311f5b6add970fb40f40 (patch) | |
tree | 2d63fa7208815aaefac2fe0844846665873ccd8e /ddms/app | |
parent | 596e21e9d9d043b4f90ad0cbbcc37a2b923bf737 (diff) | |
download | sdk-44783788698204a0dc3b311f5b6add970fb40f40.zip sdk-44783788698204a0dc3b311f5b6add970fb40f40.tar.gz sdk-44783788698204a0dc3b311f5b6add970fb40f40.tar.bz2 |
Add support for VMs that can stream hprof data through JDWP.
Change-Id: I0fcc8718685ddb7accd459e78821677f044135ba
Diffstat (limited to 'ddms/app')
-rw-r--r-- | ddms/app/src/com/android/ddms/UIThread.java | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/ddms/app/src/com/android/ddms/UIThread.java b/ddms/app/src/com/android/ddms/UIThread.java index c98b3f1..7940c74 100644 --- a/ddms/app/src/com/android/ddms/UIThread.java +++ b/ddms/app/src/com/android/ddms/UIThread.java @@ -292,7 +292,6 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener { mCurrentActivator.selectAll(); } } - } /** @@ -305,13 +304,15 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener { super(parentShell); } - public void onFailure(final Client client) { + public void onEndFailure(final Client client, final String message) { mDisplay.asyncExec(new Runnable() { public void run() { try { - displayError("Unable to create HPROF file for application '%1$s'.\n" + + displayErrorFromUiThread( + "Unable to create HPROF file for application '%1$s'\n\n%2$s" + "Check logcat for more information.", - client.getClientData().getClientDescription()); + client.getClientData().getClientDescription(), + message != null ? message + "\n\n" : ""); } finally { // this will make sure the dump hprof button is re-enabled for the // current selection. as the client is finished dumping an hprof file @@ -333,16 +334,16 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener { client.getClientData().getClientDescription() + ".hprof", remoteFilePath, "Save HPROF file"); if (result != null && result.getCode() != SyncService.RESULT_OK) { - displayError( + displayErrorFromUiThread( "Unable to download HPROF file from device '%1$s'.\n\n%2$s", device.getSerialNumber(), result.getMessage()); } } else { - displayError("Unable to download HPROF file from device '%1$s'.", + displayErrorFromUiThread("Unable to download HPROF file from device '%1$s'.", device.getSerialNumber()); } } catch (Exception e) { - displayError("Unable to download HPROF file from device '%1$s'.", + displayErrorFromUiThread("Unable to download HPROF file from device '%1$s'.", device.getSerialNumber()); } finally { @@ -354,9 +355,18 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener { }); } - private void displayError(String format, Object... args) { - MessageDialog.openError(mParentShell, "HPROF Error", - String.format(format, args)); + public void onSuccess(final byte[] data, final Client client) { + mDisplay.asyncExec(new Runnable() { + public void run() { + promptAndSave(client.getClientData().getClientDescription() + ".hprof", data, + "Save HPROF file"); + } + }); + } + + @Override + protected String getDialogTitle() { + return "HPROF Error"; } } |