diff options
author | Justin Koh <justinkoh@google.com> | 2014-05-02 17:25:50 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-05-02 17:25:50 +0000 |
commit | 6015844578dc4d725c7ab3d3004d18ffea446087 (patch) | |
tree | a26ba8945cb043c35227a867b8e8f700695ab771 | |
parent | 11b1469144d73ad0280ef9d0c2e478d180f17074 (diff) | |
parent | feabd2c7304f05eab30eebeb50016b073735443b (diff) | |
download | frameworks_base-6015844578dc4d725c7ab3d3004d18ffea446087.zip frameworks_base-6015844578dc4d725c7ab3d3004d18ffea446087.tar.gz frameworks_base-6015844578dc4d725c7ab3d3004d18ffea446087.tar.bz2 |
Merge "Make global action key timeout configurable." into klp-modular-dev
-rw-r--r-- | api/current.txt | 3 | ||||
-rw-r--r-- | core/java/android/view/ViewConfiguration.java | 16 | ||||
-rw-r--r-- | core/res/res/values/config.xml | 3 | ||||
-rw-r--r-- | core/res/res/values/symbols.xml | 1 | ||||
-rw-r--r-- | policy/src/com/android/internal/policy/impl/PhoneWindowManager.java | 7 |
5 files changed, 26 insertions, 4 deletions
diff --git a/api/current.txt b/api/current.txt index 2464e38..2638ee4 100644 --- a/api/current.txt +++ b/api/current.txt @@ -28382,10 +28382,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 7417abb..4b8541e 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,12 +702,24 @@ 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. * * @return A scalar dimensionless value representing the coefficient of diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index 602c4f6..9d27164 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -1191,6 +1191,9 @@ <!-- Maximum velocity to initiate a fling, as measured in dips per second. --> <dimen name="config_viewMaxFlingVelocity">8000dp</dimen> + <!-- Amount of time in ms the user needs to press the relevant key to bring up the global actions dialog --> + <integer name="config_globalActionsKeyTimeout">500</integer> + <!-- Maximum number of grid columns permitted in the ResolverActivity used for picking activities to handle an intent. --> <integer name="config_maxResolverActivityColumns">2</integer> diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index f027da0..e2e7a34 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -1637,6 +1637,7 @@ <java-symbol type="id" name="resolver_list" /> <java-symbol type="id" name="button_once" /> <java-symbol type="id" name="button_always" /> + <java-symbol type="integer" name="config_globalActionsKeyTimeout" /> <java-symbol type="integer" name="config_maxResolverActivityColumns" /> <java-symbol type="array" name="config_notificationScorers" /> diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java index 2b7bbd0..dd7abb6 100644 --- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java @@ -668,7 +668,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()); } } @@ -707,9 +708,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() { |