summaryrefslogtreecommitdiffstats
path: root/policy
diff options
context:
space:
mode:
authorAdam Powell <adamp@google.com>2011-01-08 15:07:08 -0800
committerAdam Powell <adamp@google.com>2011-01-08 15:08:27 -0800
commit0d69fae5e6b138f951cf6461a353bed32a1f556a (patch)
tree31285a00e3295105c09abd4402a270f85cc954ae /policy
parent2ebac69419c5ae9b439178424482ae5ffd3a7e0c (diff)
downloadframeworks_base-0d69fae5e6b138f951cf6461a353bed32a1f556a.zip
frameworks_base-0d69fae5e6b138f951cf6461a353bed32a1f556a.tar.gz
frameworks_base-0d69fae5e6b138f951cf6461a353bed32a1f556a.tar.bz2
Fix bug 3330683 - Do not show the legacy menu panel for HC apps on
xlarge devices. Change-Id: Ic268684570a429d8da499c142b23bb20b3fe2b82
Diffstat (limited to 'policy')
-rw-r--r--policy/src/com/android/internal/policy/impl/PhoneWindow.java17
1 files changed, 15 insertions, 2 deletions
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindow.java b/policy/src/com/android/internal/policy/impl/PhoneWindow.java
index 5098a98..2fcd04e 100644
--- a/policy/src/com/android/internal/policy/impl/PhoneWindow.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindow.java
@@ -21,7 +21,6 @@ import static android.view.WindowManager.LayoutParams.FLAG_FULLSCREEN;
import static android.view.WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR;
import static android.view.WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN;
import static android.view.WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER;
-import static android.view.WindowManager.LayoutParams.FLAG_NEEDS_MENU_KEY;
import static android.view.WindowManager.LayoutParams.FLAG_SPLIT_TOUCH;
import com.android.internal.view.BaseSurfaceHolder;
@@ -57,7 +56,6 @@ import android.util.SparseArray;
import android.util.TypedValue;
import android.view.ActionMode;
import android.view.Gravity;
-import android.view.HardwareRenderer;
import android.view.InputQueue;
import android.view.KeyCharacterMap;
import android.view.KeyEvent;
@@ -430,6 +428,21 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
return;
}
+ // Don't open an options panel for honeycomb apps on xlarge devices.
+ // (The app should be using an action bar for menu items.)
+ if (st.featureId == FEATURE_OPTIONS_PANEL) {
+ Context context = getContext();
+ Configuration config = context.getResources().getConfiguration();
+ boolean isXLarge = (config.screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) ==
+ Configuration.SCREENLAYOUT_SIZE_XLARGE;
+ boolean isHoneycombApp = context.getApplicationInfo().targetSdkVersion >=
+ android.os.Build.VERSION_CODES.HONEYCOMB;
+
+ if (isXLarge && isHoneycombApp) {
+ return;
+ }
+ }
+
Callback cb = getCallback();
if ((cb != null) && (!cb.onMenuOpened(st.featureId, st.menu))) {
// Callback doesn't want the menu to open, reset any state