am 4a40f7cc: Merge "Fix crash caused by disabling the Options panel on TVs" into lmp-mr1-dev automerge: 1f81973

automerge: 485f6a6

* commit '485f6a60e0182767d57a5ab08d6438124a69439e':
  Fix crash caused by disabling the Options panel on TVs
This commit is contained in:
Jose Lima
2015-01-28 21:32:37 +00:00
committed by android-build-merger
2 changed files with 4 additions and 2 deletions

View File

@@ -3226,7 +3226,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);
}
}
/**

View File

@@ -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);
}