diff options
| -rw-r--r-- | core/res/res/values-sw600dp/bools.xml | 1 | ||||
| -rw-r--r-- | core/res/res/values/bools.xml | 1 | ||||
| -rw-r--r-- | policy/src/com/android/internal/policy/impl/PhoneWindow.java | 11 |
3 files changed, 11 insertions, 2 deletions
diff --git a/core/res/res/values-sw600dp/bools.xml b/core/res/res/values-sw600dp/bools.xml index a453ac13576d..2097049e3229 100644 --- a/core/res/res/values-sw600dp/bools.xml +++ b/core/res/res/values-sw600dp/bools.xml @@ -18,4 +18,5 @@ <bool name="preferences_prefer_dual_pane">true</bool> <bool name="show_ongoing_ime_switcher">false</bool> <bool name="action_bar_expanded_action_views_exclusive">false</bool> + <bool name="target_honeycomb_needs_options_menu">false</bool> </resources> diff --git a/core/res/res/values/bools.xml b/core/res/res/values/bools.xml index 6e4db5e93dfd..87a98e2c220d 100644 --- a/core/res/res/values/bools.xml +++ b/core/res/res/values/bools.xml @@ -20,4 +20,5 @@ <bool name="preferences_prefer_dual_pane">false</bool> <bool name="show_ongoing_ime_switcher">true</bool> <bool name="action_bar_expanded_action_views_exclusive">true</bool> + <bool name="target_honeycomb_needs_options_menu">true</bool> </resources> diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindow.java b/policy/src/com/android/internal/policy/impl/PhoneWindow.java index 431a6bb6b9e8..e2d6c5f3edf7 100644 --- a/policy/src/com/android/internal/policy/impl/PhoneWindow.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindow.java @@ -2512,8 +2512,15 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { a.getValue(com.android.internal.R.styleable.Window_windowMinWidthMajor, mMinWidthMajor); a.getValue(com.android.internal.R.styleable.Window_windowMinWidthMinor, mMinWidthMinor); - if (getContext().getApplicationInfo().targetSdkVersion - < android.os.Build.VERSION_CODES.HONEYCOMB) { + final Context context = getContext(); + final int targetSdk = context.getApplicationInfo().targetSdkVersion; + final boolean targetPreHoneycomb = targetSdk < android.os.Build.VERSION_CODES.HONEYCOMB; + final boolean targetPreIcs = targetSdk < android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH; + final boolean targetHcNeedsOptions = context.getResources().getBoolean( + com.android.internal.R.bool.target_honeycomb_needs_options_menu); + final boolean noActionBar = !hasFeature(FEATURE_ACTION_BAR) || hasFeature(FEATURE_NO_TITLE); + + if (targetPreHoneycomb || (targetPreIcs && targetHcNeedsOptions && noActionBar)) { addFlags(WindowManager.LayoutParams.FLAG_NEEDS_MENU_KEY); } |