diff options
author | Adam Powell <adamp@google.com> | 2015-07-15 02:31:18 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-07-15 02:31:21 +0000 |
commit | 18709f9a0095afe6dba11f9dd71e3210c5f4e1db (patch) | |
tree | 0d4ec1d211f0b7c352af7e3e5f6de801c8ad2a6c /core/java/com | |
parent | 63461e61b9aba2514fb39f87b8741b6db1f7e5d7 (diff) | |
parent | c3cb6c9b22ffd9907fd602fcace763c4ba9525e9 (diff) | |
download | frameworks_base-18709f9a0095afe6dba11f9dd71e3210c5f4e1db.zip frameworks_base-18709f9a0095afe6dba11f9dd71e3210c5f4e1db.tar.gz frameworks_base-18709f9a0095afe6dba11f9dd71e3210c5f4e1db.tar.bz2 |
Merge "Relax strict ActionMode instance checking when finishing action modes" into mnc-dev
Diffstat (limited to 'core/java/com')
-rw-r--r-- | core/java/com/android/internal/policy/PhoneWindow.java | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/core/java/com/android/internal/policy/PhoneWindow.java b/core/java/com/android/internal/policy/PhoneWindow.java index 016d010..9bd2eec 100644 --- a/core/java/com/android/internal/policy/PhoneWindow.java +++ b/core/java/com/android/internal/policy/PhoneWindow.java @@ -27,6 +27,7 @@ import android.animation.Animator; import android.animation.ObjectAnimator; import android.app.ActivityManagerNative; import android.app.SearchManager; +import android.os.Build; import android.os.UserHandle; import android.view.ActionMode; @@ -3531,7 +3532,28 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { public void onDestroyActionMode(ActionMode mode) { mWrapped.onDestroyActionMode(mode); - if (mode == mPrimaryActionMode) { + final boolean isMncApp = mContext.getApplicationInfo().targetSdkVersion + >= Build.VERSION_CODES.MNC; + final boolean isPrimary; + final boolean isFloating; + if (isMncApp) { + isPrimary = mode == mPrimaryActionMode; + isFloating = mode == mFloatingActionMode; + if (!isPrimary && mode.getType() == ActionMode.TYPE_PRIMARY) { + Log.e(TAG, "Destroying unexpected ActionMode instance of TYPE_PRIMARY; " + + mode + " was not the current primary action mode! Expected " + + mPrimaryActionMode); + } + if (!isFloating && mode.getType() == ActionMode.TYPE_FLOATING) { + Log.e(TAG, "Destroying unexpected ActionMode instance of TYPE_FLOATING; " + + mode + " was not the current floating action mode! Expected " + + mFloatingActionMode); + } + } else { + isPrimary = mode.getType() == ActionMode.TYPE_PRIMARY; + isFloating = mode.getType() == ActionMode.TYPE_FLOATING; + } + if (isPrimary) { if (mPrimaryActionModePopup != null) { removeCallbacks(mShowPrimaryActionModePopup); } @@ -3569,7 +3591,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { } mPrimaryActionMode = null; - } else if (mode == mFloatingActionMode) { + } else if (isFloating) { cleanupFloatingActionModeViews(); mFloatingActionMode = null; } |