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

Commit 9397f24d authored by Manali Bhutiyani's avatar Manali Bhutiyani Committed by Automerger Merge Worker
Browse files

Merge "[displayModeDirector] Ignore UDFPS vote when configured to do so" into...

Merge "[displayModeDirector] Ignore UDFPS vote when configured to do so" into udc-dev am: 8ea6ef0c

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/22119180



Change-Id: I5aea66404b2c3da4bd9feaafe70d0eae6a7c0f71
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents a99d3159 8ea6ef0c
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2895,6 +2895,9 @@
         mirror the content of the default display. -->
    <bool name="config_localDisplaysMirrorContent">true</bool>

    <!-- When true, udfps vote is ignored. This feature is disabled by default. -->
    <bool name="config_ignoreUdfpsVote">false</bool>

    <!-- Controls if local secondary displays should be private or not. Value specified in the array
         represents physical port address of each display and display in this list will be marked
         as private. {@see android.view.Display#FLAG_PRIVATE} -->
+1 −0
Original line number Diff line number Diff line
@@ -414,6 +414,7 @@
  <java-symbol type="bool" name="config_guestUserAutoCreated" />
  <java-symbol type="bool" name="config_guestUserAllowEphemeralStateChange" />
  <java-symbol type="bool" name="config_localDisplaysMirrorContent" />
  <java-symbol type="bool" name="config_ignoreUdfpsVote" />
  <java-symbol type="array" name="config_localPrivateDisplayPorts" />
  <java-symbol type="integer" name="config_defaultDisplayDefaultColorMode" />
  <java-symbol type="bool" name="config_enableAppWidgetService" />
+21 −11
Original line number Diff line number Diff line
@@ -60,6 +60,7 @@ import android.view.accessibility.AccessibilityManager;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.android.internal.R;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.logging.InstanceId;
import com.android.internal.util.LatencyTracker;
@@ -171,6 +172,7 @@ public class UdfpsController implements DozeReceiver, Dumpable {
    @NonNull private final SecureSettings mSecureSettings;
    @NonNull private final UdfpsUtils mUdfpsUtils;
    @NonNull private final InputManager mInputManager;
    private final boolean mIgnoreRefreshRate;

    // Currently the UdfpsController supports a single UDFPS sensor. If devices have multiple
    // sensors, this, in addition to a lot of the code here, will be updated.
@@ -816,6 +818,8 @@ public class UdfpsController implements DozeReceiver, Dumpable {
        mExecution = execution;
        mVibrator = vibrator;
        mInflater = inflater;
        mIgnoreRefreshRate = mContext.getResources()
                    .getBoolean(R.bool.config_ignoreUdfpsVote);
        // The fingerprint manager is queried for UDFPS before this class is constructed, so the
        // fingerprint manager should never be null.
        mFingerprintManager = checkNotNull(fingerprintManager);
@@ -1069,6 +1073,18 @@ public class UdfpsController implements DozeReceiver, Dumpable {
        return mOnFingerDown;
    }

    private void dispatchOnUiReady(long requestId) {
        if (mAlternateTouchProvider != null) {
            mBiometricExecutor.execute(() -> {
                mAlternateTouchProvider.onUiReady();
                mLatencyTracker.onActionEnd(LatencyTracker.ACTION_UDFPS_ILLUMINATE);
            });
        } else {
            mFingerprintManager.onUiReady(requestId, mSensorProps.sensorId);
            mLatencyTracker.onActionEnd(LatencyTracker.ACTION_UDFPS_ILLUMINATE);
        }
    }

    private void onFingerDown(
            long requestId,
            int x,
@@ -1146,17 +1162,11 @@ public class UdfpsController implements DozeReceiver, Dumpable {
        Trace.endAsyncSection("UdfpsController.e2e.onPointerDown", 0);
        final UdfpsView view = mOverlay.getOverlayView();
        if (view != null && isOptical()) {
            view.configureDisplay(() -> {
                if (mAlternateTouchProvider != null) {
                    mBiometricExecutor.execute(() -> {
                        mAlternateTouchProvider.onUiReady();
                        mLatencyTracker.onActionEnd(LatencyTracker.ACTION_UDFPS_ILLUMINATE);
                    });
            if (mIgnoreRefreshRate) {
                dispatchOnUiReady(requestId);
            } else {
                    mFingerprintManager.onUiReady(requestId, mSensorProps.sensorId);
                    mLatencyTracker.onActionEnd(LatencyTracker.ACTION_UDFPS_ILLUMINATE);
                view.configureDisplay(() -> dispatchOnUiReady(requestId));
            }
            });
        }

        for (Callback cb : mCallbacks) {
+9 −1
Original line number Diff line number Diff line
@@ -2643,7 +2643,15 @@ public class DisplayModeDirector {
        public void observe() {
            StatusBarManagerInternal statusBar =
                    LocalServices.getService(StatusBarManagerInternal.class);
            if (statusBar != null) {
            if (statusBar == null) {
                return;
            }

            // Allow UDFPS vote by registering callback, only
            // if the device is configured to not ignore UDFPS vote.
            boolean ignoreUdfpsVote = mContext.getResources()
                        .getBoolean(R.bool.config_ignoreUdfpsVote);
            if (!ignoreUdfpsVote) {
                statusBar.setUdfpsRefreshRateCallback(this);
            }
        }