summaryrefslogtreecommitdiffstats
path: root/core/java/android/view
diff options
context:
space:
mode:
Diffstat (limited to 'core/java/android/view')
-rw-r--r--core/java/android/view/ViewConfiguration.java17
1 files changed, 16 insertions, 1 deletions
diff --git a/core/java/android/view/ViewConfiguration.java b/core/java/android/view/ViewConfiguration.java
index 499075e..73295a2 100644
--- a/core/java/android/view/ViewConfiguration.java
+++ b/core/java/android/view/ViewConfiguration.java
@@ -223,6 +223,8 @@ public class ViewConfiguration {
private boolean sHasPermanentMenuKey;
private boolean sHasPermanentMenuKeySet;
+ private Context mContext;
+
static final SparseArray<ViewConfiguration> sConfigurations =
new SparseArray<ViewConfiguration>(2);
@@ -270,6 +272,8 @@ public class ViewConfiguration {
sizeAndDensity = density;
}
+ mContext = context;
+
mEdgeSlop = (int) (sizeAndDensity * EDGE_SLOP + 0.5f);
mFadingEdgeLength = (int) (sizeAndDensity * FADING_EDGE_LENGTH + 0.5f);
mMinimumFlingVelocity = (int) (density * MINIMUM_FLING_VELOCITY + 0.5f);
@@ -678,7 +682,18 @@ public class ViewConfiguration {
* @return true if a permanent menu key is present, false otherwise.
*/
public boolean hasPermanentMenuKey() {
- return sHasPermanentMenuKey;
+ // The action overflow button within app UI can
+ // be controlled with a system setting
+ int showOverflowButton = Settings.System.getInt(
+ mContext.getContentResolver(),
+ Settings.System.UI_FORCE_OVERFLOW_BUTTON, 0);
+ if (showOverflowButton == 1) {
+ // Force overflow button on by reporting that
+ // the device has no permanent menu key
+ return false;
+ } else {
+ return sHasPermanentMenuKey;
+ }
}
/**