summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2022-06-01 00:24:55 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2022-06-01 00:24:55 +0000
commit05ed701655c134c78e2ab6ce75fb7d9971b71b8c (patch)
tree9cfedaafc045f72fcf5ff5d2c931371b58ad5a05
parent265539f56aa186bd10ab00b5ba715ef26c1acdd1 (diff)
parent6d0488d8661e4366b3a43080b7060388ef15e568 (diff)
Merge "Get velocitytracker strategy from InputManager"
-rw-r--r--core/java/android/view/VelocityTracker.java6
-rw-r--r--core/java/android/view/ViewConfiguration.java13
2 files changed, 2 insertions, 17 deletions
diff --git a/core/java/android/view/VelocityTracker.java b/core/java/android/view/VelocityTracker.java
index f838d7fed7cf..2d4da2c88ce8 100644
--- a/core/java/android/view/VelocityTracker.java
+++ b/core/java/android/view/VelocityTracker.java
@@ -17,8 +17,8 @@
package android.view;
import android.annotation.IntDef;
-import android.app.ActivityThread;
import android.compat.annotation.UnsupportedAppUsage;
+import android.hardware.input.InputManager;
import android.os.Build;
import android.util.ArrayMap;
import android.util.Pools.SynchronizedPool;
@@ -278,9 +278,7 @@ public final class VelocityTracker {
private VelocityTracker(@VelocityTrackerStrategy int strategy) {
// If user has not selected a specific strategy
if (strategy == VELOCITY_TRACKER_STRATEGY_DEFAULT) {
- final String strategyProperty = ViewConfiguration.get(
- ActivityThread.currentActivityThread().getApplication())
- .getVelocityTrackerStrategy();
+ final String strategyProperty = InputManager.getInstance().getVelocityTrackerStrategy();
// Check if user specified strategy by overriding system property.
if (strategyProperty == null || strategyProperty.isEmpty()) {
mStrategy = strategy;
diff --git a/core/java/android/view/ViewConfiguration.java b/core/java/android/view/ViewConfiguration.java
index 8a19a7b23b39..e5a535b59eb6 100644
--- a/core/java/android/view/ViewConfiguration.java
+++ b/core/java/android/view/ViewConfiguration.java
@@ -27,7 +27,6 @@ import android.content.Context;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Rect;
-import android.hardware.input.InputManager;
import android.os.Build;
import android.os.Bundle;
import android.os.RemoteException;
@@ -353,7 +352,6 @@ public class ViewConfiguration {
private final int mSmartSelectionInitializedTimeout;
private final int mSmartSelectionInitializingTimeout;
private final boolean mPreferKeepClearForFocusEnabled;
- private final String mVelocityTrackerStrategy;
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 123768915)
private boolean sHasPermanentMenuKey;
@@ -401,7 +399,6 @@ public class ViewConfiguration {
mSmartSelectionInitializedTimeout = SMART_SELECTION_INITIALIZED_TIMEOUT_IN_MILLISECOND;
mSmartSelectionInitializingTimeout = SMART_SELECTION_INITIALIZING_TIMEOUT_IN_MILLISECOND;
mPreferKeepClearForFocusEnabled = false;
- mVelocityTrackerStrategy = InputManager.getInstance().getVelocityTrackerStrategy();
}
/**
@@ -520,16 +517,6 @@ public class ViewConfiguration {
com.android.internal.R.integer.config_smartSelectionInitializingTimeoutMillis);
mPreferKeepClearForFocusEnabled = res.getBoolean(
com.android.internal.R.bool.config_preferKeepClearForFocus);
-
- mVelocityTrackerStrategy = InputManager.getInstance().getVelocityTrackerStrategy();
- }
-
- /**
- * Get the current VelocityTracker strategy
- * @hide
- */
- public String getVelocityTrackerStrategy() {
- return mVelocityTrackerStrategy;
}
/**