diff options
| author | 2015-01-28 10:43:15 -0800 | |
|---|---|---|
| committer | 2015-01-28 10:46:39 -0800 | |
| commit | bd769a15abfcb23b16daaed10c09029bbb978eef (patch) | |
| tree | 61d5f22151b90acb09c8361482ae0db3320cc54e | |
| parent | 1061652a37e18683c994f9d4b872ecf990125a05 (diff) | |
Fix crash caused by disabling the Options panel on TVs
Address more cases where calls to getPanelState may cause a crash when the
options panel is disabled on a platform.
Bug: 19178531
Bug: 18780696
Change-Id: Ib72bb8483e636181788ed3919c4cb9e99a94b7b1
| -rw-r--r-- | core/java/android/app/Activity.java | 4 | ||||
| -rw-r--r-- | policy/src/com/android/internal/policy/impl/PhoneWindow.java | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java index d33c82b344ff..9568897dca61 100644 --- a/core/java/android/app/Activity.java +++ b/core/java/android/app/Activity.java @@ -3230,7 +3230,9 @@ public class Activity extends ContextThemeWrapper * Programmatically closes the most recently opened context menu, if showing. */ public void closeContextMenu() { - mWindow.closePanel(Window.FEATURE_CONTEXT_MENU); + if (mWindow.hasFeature(Window.FEATURE_CONTEXT_MENU)) { + mWindow.closePanel(Window.FEATURE_CONTEXT_MENU); + } } /** diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindow.java b/policy/src/com/android/internal/policy/impl/PhoneWindow.java index 281fde3c4d58..f5d43d84f609 100644 --- a/policy/src/com/android/internal/policy/impl/PhoneWindow.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindow.java @@ -3165,7 +3165,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { // If the user is chording a menu shortcut, release the chord since // this window lost focus - if (!hasWindowFocus && mPanelChordingKey != 0) { + if (hasFeature(FEATURE_OPTIONS_PANEL) && !hasWindowFocus && mPanelChordingKey != 0) { closePanel(FEATURE_OPTIONS_PANEL); } |