diff --git a/api/current.txt b/api/current.txt
index 7bf1d58840b3c..3f875c0c3fbdf 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -31133,10 +31133,11 @@ package android.view {
public class ViewConfiguration {
ctor public deprecated ViewConfiguration();
method public static android.view.ViewConfiguration get(android.content.Context);
+ method public long getDeviceGlobalActionKeyTimeout();
method public static int getDoubleTapTimeout();
method public static deprecated int getEdgeSlop();
method public static deprecated int getFadingEdgeLength();
- method public static long getGlobalActionKeyTimeout();
+ method public static deprecated long getGlobalActionKeyTimeout();
method public static int getJumpTapTimeout();
method public static int getKeyRepeatDelay();
method public static int getKeyRepeatTimeout();
diff --git a/core/java/android/view/ViewConfiguration.java b/core/java/android/view/ViewConfiguration.java
index 48a5bd55a1366..20ef429eaf450 100644
--- a/core/java/android/view/ViewConfiguration.java
+++ b/core/java/android/view/ViewConfiguration.java
@@ -234,6 +234,7 @@ public class ViewConfiguration {
private final int mOverscrollDistance;
private final int mOverflingDistance;
private final boolean mFadingMarqueeEnabled;
+ private final long mGlobalActionsKeyTimeout;
private boolean sHasPermanentMenuKey;
private boolean sHasPermanentMenuKeySet;
@@ -261,6 +262,7 @@ public class ViewConfiguration {
mOverscrollDistance = OVERSCROLL_DISTANCE;
mOverflingDistance = OVERFLING_DISTANCE;
mFadingMarqueeEnabled = true;
+ mGlobalActionsKeyTimeout = GLOBAL_ACTIONS_KEY_TIMEOUT;
}
/**
@@ -342,6 +344,8 @@ public class ViewConfiguration {
com.android.internal.R.dimen.config_viewMinFlingVelocity);
mMaximumFlingVelocity = res.getDimensionPixelSize(
com.android.internal.R.dimen.config_viewMaxFlingVelocity);
+ mGlobalActionsKeyTimeout = res.getInteger(
+ com.android.internal.R.integer.config_globalActionsKeyTimeout);
}
/**
@@ -698,11 +702,23 @@ public class ViewConfiguration {
*
* @return how long a user needs to press the relevant key to bring up
* the global actions dialog.
+ * @deprecated use getDeviceGlobalActionKeyTimeout
*/
public static long getGlobalActionKeyTimeout() {
return GLOBAL_ACTIONS_KEY_TIMEOUT;
}
+ /**
+ * The amount of time a user needs to press the relevant key to bring up
+ * the global actions dialog.
+ *
+ * @return how long a user needs to press the relevant key to bring up
+ * the global actions dialog.
+ */
+ public long getDeviceGlobalActionKeyTimeout() {
+ return mGlobalActionsKeyTimeout;
+ }
+
/**
* The amount of friction applied to scrolls and flings.
*
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 624ed73371703..f39155b514b08 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -1212,6 +1212,9 @@
8000dp
+
+ 500
+
2
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index 516a13b1ae91d..7c6a91a5f179b 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -1649,6 +1649,7 @@
+
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
index 761e580d4865c..ae6aeeefb75cb 100644
--- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -667,7 +667,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
private void interceptPowerKeyDown(boolean handled) {
mPowerKeyHandled = handled;
if (!handled) {
- mHandler.postDelayed(mPowerLongPress, ViewConfiguration.getGlobalActionKeyTimeout());
+ mHandler.postDelayed(mPowerLongPress,
+ ViewConfiguration.get(mContext).getDeviceGlobalActionKeyTimeout());
}
}
@@ -706,9 +707,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {
if (mKeyguardDelegate.isShowing()) {
// Double the time it takes to take a screenshot from the keyguard
return (long) (KEYGUARD_SCREENSHOT_CHORD_DELAY_MULTIPLIER *
- ViewConfiguration.getGlobalActionKeyTimeout());
+ ViewConfiguration.get(mContext).getDeviceGlobalActionKeyTimeout());
}
- return ViewConfiguration.getGlobalActionKeyTimeout();
+ return ViewConfiguration.get(mContext).getDeviceGlobalActionKeyTimeout();
}
private void cancelPendingScreenshotChordAction() {