am 5b972e73: Merge "Don\'t check whether dismiss() is called on the UI thread Bug #6436642" into jb-dev

* commit '5b972e730f99ea4cf74f8ccf3e2c57289255c4f6':
  Don't check whether dismiss() is called on the UI thread Bug #6436642
This commit is contained in:
Romain Guy
2012-05-04 17:28:51 -07:00
committed by Android Git Automerger

View File

@@ -103,7 +103,6 @@ public class Dialog implements DialogInterface, Window.Callback,
private boolean mShowing = false;
private boolean mCanceled = false;
private final Thread mUiThread;
private final Handler mHandler = new Handler();
private static final int DISMISS = 0x43;
@@ -162,7 +161,6 @@ public class Dialog implements DialogInterface, Window.Callback,
w.setCallback(this);
w.setWindowManager(mWindowManager, null, null);
w.setGravity(Gravity.CENTER);
mUiThread = Thread.currentThread();
mListenersHandler = new ListenersHandler(this);
}
@@ -299,12 +297,7 @@ public class Dialog implements DialogInterface, Window.Callback,
* that in {@link #onStop}.
*/
public void dismiss() {
if (Thread.currentThread() != mUiThread) {
mHandler.post(mDismissAction);
} else {
mHandler.removeCallbacks(mDismissAction);
mDismissAction.run();
}
mHandler.post(mDismissAction);
}
void dismissDialog() {