summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCraig Mautner <cmautner@google.com>2014-07-07 21:30:57 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-07-07 21:30:57 +0000
commit95f621a1a4a0891075f1f9daf8e0323aab488793 (patch)
tree891930dcefc9150ab65e6ebb8f8cbe9a9eb7f9f6
parent26098f3b5bc6e659d542c035bd1122f8251f661d (diff)
parent3bc1bafabaedffede8963703cf3bfde2054ef91a (diff)
downloadframeworks_base-95f621a1a4a0891075f1f9daf8e0323aab488793.zip
frameworks_base-95f621a1a4a0891075f1f9daf8e0323aab488793.tar.gz
frameworks_base-95f621a1a4a0891075f1f9daf8e0323aab488793.tar.bz2
am 3bc1bafa: am 6d6d2189: am 08881385: Merge "[ActivityManager] Prevent potential deadlock from system error dialog and InputMethodManager."
* commit '3bc1bafabaedffede8963703cf3bfde2054ef91a': [ActivityManager] Prevent potential deadlock from system error dialog and InputMethodManager.
-rwxr-xr-x[-rw-r--r--]services/core/java/com/android/server/am/BaseErrorDialog.java15
1 files changed, 10 insertions, 5 deletions
diff --git a/services/core/java/com/android/server/am/BaseErrorDialog.java b/services/core/java/com/android/server/am/BaseErrorDialog.java
index 6ede8f8..35bdee0 100644..100755
--- a/services/core/java/com/android/server/am/BaseErrorDialog.java
+++ b/services/core/java/com/android/server/am/BaseErrorDialog.java
@@ -27,6 +27,11 @@ import android.view.WindowManager;
import android.widget.Button;
class BaseErrorDialog extends AlertDialog {
+ private static final int ENABLE_BUTTONS = 0;
+ private static final int DISABLE_BUTTONS = 1;
+
+ private boolean mConsuming = true;
+
public BaseErrorDialog(Context context) {
super(context, com.android.internal.R.style.Theme_Dialog_AppError);
@@ -41,8 +46,8 @@ class BaseErrorDialog extends AlertDialog {
public void onStart() {
super.onStart();
- setEnabled(false);
- mHandler.sendMessageDelayed(mHandler.obtainMessage(0), 1000);
+ mHandler.sendEmptyMessage(DISABLE_BUTTONS);
+ mHandler.sendMessageDelayed(mHandler.obtainMessage(ENABLE_BUTTONS), 1000);
}
public boolean dispatchKeyEvent(KeyEvent event) {
@@ -71,12 +76,12 @@ class BaseErrorDialog extends AlertDialog {
private Handler mHandler = new Handler() {
public void handleMessage(Message msg) {
- if (msg.what == 0) {
+ if (msg.what == ENABLE_BUTTONS) {
mConsuming = false;
setEnabled(true);
+ } else if (msg.what == DISABLE_BUTTONS) {
+ setEnabled(false);
}
}
};
-
- private boolean mConsuming = true;
}