From feabd2c7304f05eab30eebeb50016b073735443b Mon Sep 17 00:00:00 2001 From: Justin Koh Date: Fri, 2 May 2014 10:02:44 -0700 Subject: Make global action key timeout configurable. Make global action key timeout configurable: deprecated the old public method and created a new one: getDeviceGlobalActionKeyTimeout. Bug: 14441321 Change-Id: Ifa9b136984a9f02cfe4040baeff11275174967c5 --- core/java/android/view/ViewConfiguration.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'core/java/android/view/ViewConfiguration.java') diff --git a/core/java/android/view/ViewConfiguration.java b/core/java/android/view/ViewConfiguration.java index 7417abb881f7..4b8541eb710d 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. * -- cgit v1.2.3