am 2eca6133: Merge "Fix bug 5528574 - "View not attached to window manager" upon orientation change when there is a dialog with ActionMode on" into ics-mr1

* commit '2eca6133b69db0a649b8429dcef4ed46b209bf41':
  Fix bug 5528574 - "View not attached to window manager" upon orientation change when there is a dialog with ActionMode on
This commit is contained in:
Adam Powell
2011-11-02 17:50:12 +00:00
committed by Android Git Automerger

View File

@@ -110,6 +110,8 @@ public class Dialog implements DialogInterface, Window.Callback,
private Handler mListenersHandler;
private ActionMode mActionMode;
private final Runnable mDismissAction = new Runnable() {
public void run() {
dismissDialog();
@@ -310,6 +312,9 @@ public class Dialog implements DialogInterface, Window.Callback,
try {
mWindowManager.removeView(mDecor);
} finally {
if (mActionMode != null) {
mActionMode.finish();
}
mDecor = null;
mWindow.closeAllPanels();
onStop();
@@ -952,10 +957,26 @@ public class Dialog implements DialogInterface, Window.Callback,
return null;
}
/**
* {@inheritDoc}
*
* Note that if you override this method you should always call through
* to the superclass implementation by calling super.onActionModeStarted(mode).
*/
public void onActionModeStarted(ActionMode mode) {
mActionMode = mode;
}
/**
* {@inheritDoc}
*
* Note that if you override this method you should always call through
* to the superclass implementation by calling super.onActionModeFinished(mode).
*/
public void onActionModeFinished(ActionMode mode) {
if (mode == mActionMode) {
mActionMode = null;
}
}
/**