Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 05ed7016 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Get velocitytracker strategy from InputManager"

parents 265539f5 6d0488d8
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -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;
+0 −13
Original line number Diff line number Diff line
@@ -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;
    }

    /**