Loading core/java/android/view/ViewConfiguration.java +33 −6 Original line number Diff line number Diff line Loading @@ -212,6 +212,14 @@ public class ViewConfiguration { */ private static final int OVERFLING_DISTANCE = 6; /** * Configuration values for overriding {@link #hasPermanentMenuKey()} behavior. * These constants must match the definition in res/values/config.xml. */ private static final int HAS_PERMANENT_MENU_KEY_AUTODETECT = 0; private static final int HAS_PERMANENT_MENU_KEY_TRUE = 1; private static final int HAS_PERMANENT_MENU_KEY_FALSE = 2; private final int mEdgeSlop; private final int mFadingEdgeLength; private final int mMinimumFlingVelocity; Loading Loading @@ -296,6 +304,12 @@ public class ViewConfiguration { mOverflingDistance = (int) (sizeAndDensity * OVERFLING_DISTANCE + 0.5f); if (!sHasPermanentMenuKeySet) { final int configVal = res.getInteger( com.android.internal.R.integer.config_overrideHasPermanentMenuKey); switch (configVal) { default: case HAS_PERMANENT_MENU_KEY_AUTODETECT: { IWindowManager wm = WindowManagerGlobal.getWindowManagerService(); try { sHasPermanentMenuKey = !wm.hasNavigationBar(); Loading @@ -304,6 +318,19 @@ public class ViewConfiguration { sHasPermanentMenuKey = false; } } break; case HAS_PERMANENT_MENU_KEY_TRUE: sHasPermanentMenuKey = true; sHasPermanentMenuKeySet = true; break; case HAS_PERMANENT_MENU_KEY_FALSE: sHasPermanentMenuKey = false; sHasPermanentMenuKeySet = true; break; } } mFadingMarqueeEnabled = res.getBoolean( com.android.internal.R.bool.config_ui_enableFadingMarquee); Loading core/res/res/values/config.xml +8 −0 Original line number Diff line number Diff line Loading @@ -1304,4 +1304,12 @@ <item>333</item> <item>353</item> </string-array> <!-- Override the default detection behavior for the framework method android.view.ViewConfiguration#hasPermanentMenuKey(). Valid settings are: 0 - No change. Use the default autodetection behavior. 1 - The device DOES have a permanent menu key; ignore autodetection. 2 - The device DOES NOT have a permanent menu key; ignore autodetection. --> <integer name="config_overrideHasPermanentMenuKey">0</integer> </resources> core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -318,6 +318,7 @@ <java-symbol type="integer" name="config_mobile_mtu" /> <java-symbol type="integer" name="config_volte_replacement_rat"/> <java-symbol type="integer" name="config_valid_wappush_index" /> <java-symbol type="integer" name="config_overrideHasPermanentMenuKey" /> <java-symbol type="color" name="tab_indicator_text_v4" /> Loading Loading
core/java/android/view/ViewConfiguration.java +33 −6 Original line number Diff line number Diff line Loading @@ -212,6 +212,14 @@ public class ViewConfiguration { */ private static final int OVERFLING_DISTANCE = 6; /** * Configuration values for overriding {@link #hasPermanentMenuKey()} behavior. * These constants must match the definition in res/values/config.xml. */ private static final int HAS_PERMANENT_MENU_KEY_AUTODETECT = 0; private static final int HAS_PERMANENT_MENU_KEY_TRUE = 1; private static final int HAS_PERMANENT_MENU_KEY_FALSE = 2; private final int mEdgeSlop; private final int mFadingEdgeLength; private final int mMinimumFlingVelocity; Loading Loading @@ -296,6 +304,12 @@ public class ViewConfiguration { mOverflingDistance = (int) (sizeAndDensity * OVERFLING_DISTANCE + 0.5f); if (!sHasPermanentMenuKeySet) { final int configVal = res.getInteger( com.android.internal.R.integer.config_overrideHasPermanentMenuKey); switch (configVal) { default: case HAS_PERMANENT_MENU_KEY_AUTODETECT: { IWindowManager wm = WindowManagerGlobal.getWindowManagerService(); try { sHasPermanentMenuKey = !wm.hasNavigationBar(); Loading @@ -304,6 +318,19 @@ public class ViewConfiguration { sHasPermanentMenuKey = false; } } break; case HAS_PERMANENT_MENU_KEY_TRUE: sHasPermanentMenuKey = true; sHasPermanentMenuKeySet = true; break; case HAS_PERMANENT_MENU_KEY_FALSE: sHasPermanentMenuKey = false; sHasPermanentMenuKeySet = true; break; } } mFadingMarqueeEnabled = res.getBoolean( com.android.internal.R.bool.config_ui_enableFadingMarquee); Loading
core/res/res/values/config.xml +8 −0 Original line number Diff line number Diff line Loading @@ -1304,4 +1304,12 @@ <item>333</item> <item>353</item> </string-array> <!-- Override the default detection behavior for the framework method android.view.ViewConfiguration#hasPermanentMenuKey(). Valid settings are: 0 - No change. Use the default autodetection behavior. 1 - The device DOES have a permanent menu key; ignore autodetection. 2 - The device DOES NOT have a permanent menu key; ignore autodetection. --> <integer name="config_overrideHasPermanentMenuKey">0</integer> </resources>
core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -318,6 +318,7 @@ <java-symbol type="integer" name="config_mobile_mtu" /> <java-symbol type="integer" name="config_volte_replacement_rat"/> <java-symbol type="integer" name="config_valid_wappush_index" /> <java-symbol type="integer" name="config_overrideHasPermanentMenuKey" /> <java-symbol type="color" name="tab_indicator_text_v4" /> Loading