summaryrefslogtreecommitdiffstats
path: root/policy
diff options
context:
space:
mode:
authorAdam Powell <adamp@google.com>2011-02-28 21:25:37 -0800
committerAdam Powell <adamp@google.com>2011-02-28 21:40:26 -0800
commitd3c9704d3efee8a64de321aa96bc49013f2db7f3 (patch)
treeffa80741dbbeb251bdcc57a9b16cff3a8df565dd /policy
parentf37fccd9d867af5c1ea1770dea64e600fda04500 (diff)
downloadframeworks_base-d3c9704d3efee8a64de321aa96bc49013f2db7f3.zip
frameworks_base-d3c9704d3efee8a64de321aa96bc49013f2db7f3.tar.gz
frameworks_base-d3c9704d3efee8a64de321aa96bc49013f2db7f3.tar.bz2
Fix bug 3497307 - Fix issues with FEATURE_ACTION_MODE_OVERLAY
Properly close down overlay windows when decor is detached. Delay opening popup overlays to prevent issues when restoring instance state. Change-Id: I7ff44ce65e78c0172a12a9ddfe11460c885593ca
Diffstat (limited to 'policy')
-rw-r--r--policy/src/com/android/internal/policy/impl/PhoneWindow.java19
1 files changed, 17 insertions, 2 deletions
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindow.java b/policy/src/com/android/internal/policy/impl/PhoneWindow.java
index b746c37..d342d66 100644
--- a/policy/src/com/android/internal/policy/impl/PhoneWindow.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindow.java
@@ -1601,6 +1601,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
private ActionMode mActionMode;
private ActionBarContextView mActionModeView;
private PopupWindow mActionModePopup;
+ private Runnable mShowActionModePopup;
public DecorView(Context context, int featureId) {
super(context);
@@ -1976,6 +1977,12 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
final int height = TypedValue.complexToDimensionPixelSize(heightValue.data,
mContext.getResources().getDisplayMetrics());
mActionModePopup.setHeight(height);
+ mShowActionModePopup = new Runnable() {
+ public void run() {
+ mActionModePopup.showAtLocation(PhoneWindow.DecorView.this,
+ Gravity.TOP | Gravity.FILL_HORIZONTAL, 0, 0);
+ }
+ };
} else {
ViewStub stub = (ViewStub) findViewById(
com.android.internal.R.id.action_mode_bar_stub);
@@ -1994,8 +2001,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
mActionModeView.setVisibility(View.VISIBLE);
mActionMode = mode;
if (mActionModePopup != null) {
- mActionModePopup.showAtLocation(this,
- Gravity.TOP | Gravity.FILL_HORIZONTAL, 0, 0);
+ post(mShowActionModePopup);
}
} else {
mActionMode = null;
@@ -2183,6 +2189,14 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
}
mActionButtonPopup = null;
}
+
+ if (mActionModePopup != null) {
+ removeCallbacks(mShowActionModePopup);
+ if (mActionModePopup.isShowing()) {
+ mActionModePopup.dismiss();
+ }
+ mActionModePopup = null;
+ }
}
@Override
@@ -2246,6 +2260,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
public void onDestroyActionMode(ActionMode mode) {
mWrapped.onDestroyActionMode(mode);
if (mActionModePopup != null) {
+ removeCallbacks(mShowActionModePopup);
mActionModePopup.dismiss();
} else if (mActionModeView != null) {
mActionModeView.setVisibility(GONE);