summaryrefslogtreecommitdiff
path: root/packages/Shell/src
diff options
context:
space:
mode:
authorFelipe Leme <felipeal@google.com>2016-07-15 10:40:00 -0700
committerFelipe Leme <felipeal@google.com>2016-07-18 13:29:46 -0700
commita86a3012ef689af659261b209da86f2e24ac21ec (patch)
tree6c4d5c9addfd39ce54cdce7ac9c4afcbe1de6b83 /packages/Shell/src
parent2b1fa7f9237c9d720d2885781b59e1acad98dad2 (diff)
Close details dialog when bugreport is canceled by user.
BUG: 30158896 Change-Id: I0eab22586f6b431f2abe837088d48a655e03d213
Diffstat (limited to 'packages/Shell/src')
-rw-r--r--packages/Shell/src/com/android/shell/BugreportProgressService.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/packages/Shell/src/com/android/shell/BugreportProgressService.java b/packages/Shell/src/com/android/shell/BugreportProgressService.java
index 6bc4df71fc5c..5a69b0ceaaae 100644
--- a/packages/Shell/src/com/android/shell/BugreportProgressService.java
+++ b/packages/Shell/src/com/android/shell/BugreportProgressService.java
@@ -17,6 +17,7 @@
package com.android.shell;
import static android.os.Process.THREAD_PRIORITY_BACKGROUND;
+
import static com.android.shell.BugreportPrefs.STATE_HIDE;
import static com.android.shell.BugreportPrefs.STATE_UNKNOWN;
import static com.android.shell.BugreportPrefs.getWarningState;
@@ -44,6 +45,7 @@ import libcore.io.Streams;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.logging.MetricsLogger;
import com.android.internal.logging.MetricsProto.MetricsEvent;
+
import com.google.android.collect.Lists;
import android.accounts.Account;
@@ -78,6 +80,7 @@ import android.text.format.DateUtils;
import android.util.Log;
import android.util.Patterns;
import android.util.SparseArray;
+import android.view.KeyEvent;
import android.view.View;
import android.view.WindowManager;
import android.view.View.OnFocusChangeListener;
@@ -543,6 +546,7 @@ public class BugreportProgressService extends Service {
deleteScreenshots(info);
}
stopProgress(id);
+ mInfoDialog.cancel();
}
/**
@@ -1404,7 +1408,7 @@ public class BugreportProgressService extends Service {
/**
* Sets its internal state and displays the dialog.
*/
- private void initialize(final Context context, BugreportInfo info) {
+ void initialize(final Context context, BugreportInfo info) {
final String dialogTitle =
context.getString(R.string.bugreport_info_dialog_title, info.id);
// First initializes singleton.
@@ -1450,6 +1454,7 @@ public class BugreportProgressService extends Service {
}
})
.create();
+ mDialog.setCancelable(true);
mDialog.getWindow().setAttributes(
new WindowManager.LayoutParams(
@@ -1545,13 +1550,18 @@ public class BugreportProgressService extends Service {
* <p>Once the bugreport is finished dumpstate has already generated the final files, so
* changing the name would have no effect.
*/
- private void onBugreportFinished(int id) {
+ void onBugreportFinished(int id) {
if (mInfoName != null) {
mInfoName.setEnabled(false);
mInfoName.setText(mSavedName);
}
}
+ void cancel() {
+ if (mDialog != null) {
+ mDialog.cancel();
+ }
+ }
}
/**