From 84f4936dee660d7bfbfb7adec3cd831f3bdded4c Mon Sep 17 00:00:00 2001 From: Adam Powell Date: Thu, 18 Aug 2011 11:09:57 -0700 Subject: [PATCH] Fix bug 5183332 - monkeys are jerks Change-Id: I15beb7b55ff5809b95dc869a9b0c43c49d1571c6 --- .../android/internal/policy/impl/PhoneWindow.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindow.java b/policy/src/com/android/internal/policy/impl/PhoneWindow.java index 73e4338641fdb..c580f0899ab89 100644 --- a/policy/src/com/android/internal/policy/impl/PhoneWindow.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindow.java @@ -386,8 +386,10 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { // Ditch the menu created above st.menu = null; - // Don't show it in the action bar either - mActionBar.setMenu(null, mActionMenuPresenterCallback); + if (mActionBar != null) { + // Don't show it in the action bar either + mActionBar.setMenu(null, mActionMenuPresenterCallback); + } return false; } @@ -409,9 +411,11 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { } if (!cb.onPreparePanel(st.featureId, st.createdPanelView, st.menu)) { - // The app didn't want to show the menu for now but it still exists. - // Clear it out of the action bar. - mActionBar.setMenu(null, mActionMenuPresenterCallback); + if (mActionBar != null) { + // The app didn't want to show the menu for now but it still exists. + // Clear it out of the action bar. + mActionBar.setMenu(null, mActionMenuPresenterCallback); + } st.menu.startDispatchingItemsChanged(); return false; }