summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorCraig Mautner <cmautner@google.com>2013-06-10 11:27:26 -0700
committerCraig Mautner <cmautner@google.com>2013-06-10 11:39:21 -0700
commit92098c7c30bc76310a066b220e625fa9aa4b925d (patch)
treec3fdb07fba38dea942861d1df26a25b8ec27e661 /core
parentbe4e6aaa0252dd7da28b7aa85beba982538efa46 (diff)
downloadframeworks_base-92098c7c30bc76310a066b220e625fa9aa4b925d.zip
frameworks_base-92098c7c30bc76310a066b220e625fa9aa4b925d.tar.gz
frameworks_base-92098c7c30bc76310a066b220e625fa9aa4b925d.tar.bz2
Dismiss immediately to maintain consistent state.
Fix bug introduced by deferring nulling of mParent. In dismissDialog the removal was being put on a queue while the state of the Dialog was being updated immediately. This meant that if a show() was called before the remove was executed it would try and add the DecorView a second time. Boom! Fixes bug 9370301. Change-Id: I576d1e207c786bc2e21dfd40cb94f2b63a020fe2
Diffstat (limited to 'core')
-rw-r--r--core/java/android/app/Dialog.java5
-rw-r--r--core/java/android/view/WindowManagerGlobal.java8
2 files changed, 6 insertions, 7 deletions
diff --git a/core/java/android/app/Dialog.java b/core/java/android/app/Dialog.java
index 634fa30..cda2c5f 100644
--- a/core/java/android/app/Dialog.java
+++ b/core/java/android/app/Dialog.java
@@ -306,6 +306,7 @@ public class Dialog implements DialogInterface, Window.Callback,
* method to do cleanup when the dialog is dismissed, instead implement
* that in {@link #onStop}.
*/
+ @Override
public void dismiss() {
if (Looper.myLooper() == mHandler.getLooper()) {
dismissDialog();
@@ -325,7 +326,7 @@ public class Dialog implements DialogInterface, Window.Callback,
}
try {
- mWindowManager.removeView(mDecor);
+ mWindowManager.removeViewImmediate(mDecor);
} finally {
if (mActionMode != null) {
mActionMode.finish();
@@ -334,7 +335,7 @@ public class Dialog implements DialogInterface, Window.Callback,
mWindow.closeAllPanels();
onStop();
mShowing = false;
-
+
sendDismissMessage();
}
}
diff --git a/core/java/android/view/WindowManagerGlobal.java b/core/java/android/view/WindowManagerGlobal.java
index 6bcf863..f7b85cc 100644
--- a/core/java/android/view/WindowManagerGlobal.java
+++ b/core/java/android/view/WindowManagerGlobal.java
@@ -335,15 +335,13 @@ public final class WindowManagerGlobal {
}
}
root.die(immediate);
+ if (view != null) {
+ view.assignParent(null);
+ }
}
void doRemoveView(ViewRootImpl root) {
synchronized (mLock) {
- final View view = root.getView();
- if (view != null) {
- view.assignParent(null);
- }
-
final int index = mRoots.indexOf(root);
if (index >= 0) {
mRoots.remove(index);