summaryrefslogtreecommitdiff
path: root/core/java/android/view/ViewConfiguration.java
diff options
context:
space:
mode:
authorSvetoslav Ganov <svetoslavganov@google.com>2011-03-02 12:58:40 -0800
committerSvetoslav Ganov <svetoslavganov@google.com>2011-03-02 18:22:49 -0800
commit54d068ec6af0ee6d261a135400efe6816c6f5ffe (patch)
tree066b6a2ef26c1b18c446a46803cf7429c0fe5bae /core/java/android/view/ViewConfiguration.java
parent5a39c95c004d856b47a844c962b1c2b18f4e96aa (diff)
Add system wide management of core settings
bug:3505060 Since we want to have some settings that are used very frequently by many applications (long-press timeout is one example) these should be managed efficiently to reduce lookups from different processes because in the case of a cache miss a disk I/O is performed. Now the system manages such core settings and propagates them to the application processes. Change-Id: Ie793211baf8770f2181ac8ba9d7c2609dfaa32a7
Diffstat (limited to 'core/java/android/view/ViewConfiguration.java')
-rw-r--r--core/java/android/view/ViewConfiguration.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/core/java/android/view/ViewConfiguration.java b/core/java/android/view/ViewConfiguration.java
index cc4e89cce417..d95c5b0cd775 100644
--- a/core/java/android/view/ViewConfiguration.java
+++ b/core/java/android/view/ViewConfiguration.java
@@ -16,8 +16,11 @@
package android.view;
+import android.app.AppGlobals;
import android.content.Context;
import android.content.res.Configuration;
+import android.os.Bundle;
+import android.provider.Settings;
import android.util.DisplayMetrics;
import android.util.SparseArray;
@@ -74,7 +77,7 @@ public class ViewConfiguration {
* Defines the duration in milliseconds before a press turns into
* a long press
*/
- private static final int LONG_PRESS_TIMEOUT = 500;
+ private static final int DEFAULTLONG_PRESS_TIMEOUT = 500;
/**
* Defines the duration in milliseconds a user needs to hold down the
@@ -320,15 +323,16 @@ public class ViewConfiguration {
public static int getPressedStateDuration() {
return PRESSED_STATE_DURATION;
}
-
+
/**
* @return the duration in milliseconds before a press turns into
* a long press
*/
public static int getLongPressTimeout() {
- return LONG_PRESS_TIMEOUT;
+ return AppGlobals.getIntCoreSetting(Settings.Secure.LONG_PRESS_TIMEOUT,
+ DEFAULTLONG_PRESS_TIMEOUT);
}
-
+
/**
* @return the duration in milliseconds we will wait to see if a touch event
* is a tap or a scroll. If the user does not move within this interval, it is