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

Commit 9352edba authored by Automerger Merge Worker's avatar Automerger Merge Worker Committed by Android (Google) Code Review
Browse files

Merge "Merge "Update udfps states on enrollment changes" into sc-v2-dev am:...

Merge "Merge "Update udfps states on enrollment changes" into sc-v2-dev am: 3379ab41" into sc-v2-dev-plus-aosp
parents 1ac40951 6aca424f
Loading
Loading
Loading
Loading
+13 −5
Original line number Original line Diff line number Diff line
@@ -102,7 +102,6 @@ import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.dagger.qualifiers.Background;
import com.android.systemui.dagger.qualifiers.Background;
import com.android.systemui.dagger.qualifiers.Main;
import com.android.systemui.dagger.qualifiers.Main;
import com.android.systemui.dump.DumpManager;
import com.android.systemui.dump.DumpManager;
import com.android.systemui.flags.FeatureFlags;
import com.android.systemui.plugins.statusbar.StatusBarStateController;
import com.android.systemui.plugins.statusbar.StatusBarStateController;
import com.android.systemui.shared.system.TaskStackChangeListener;
import com.android.systemui.shared.system.TaskStackChangeListener;
import com.android.systemui.shared.system.TaskStackChangeListeners;
import com.android.systemui.shared.system.TaskStackChangeListeners;
@@ -323,7 +322,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
    private boolean mLockIconPressed;
    private boolean mLockIconPressed;
    private int mActiveMobileDataSubscription = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
    private int mActiveMobileDataSubscription = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
    private final Executor mBackgroundExecutor;
    private final Executor mBackgroundExecutor;
    private int mLockScreenMode;


    /**
    /**
     * Short delay before restarting fingerprint authentication after a successful try. This should
     * Short delay before restarting fingerprint authentication after a successful try. This should
@@ -1736,11 +1734,11 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
            DumpManager dumpManager,
            DumpManager dumpManager,
            RingerModeTracker ringerModeTracker,
            RingerModeTracker ringerModeTracker,
            @Background Executor backgroundExecutor,
            @Background Executor backgroundExecutor,
            @Main Executor mainExecutor,
            StatusBarStateController statusBarStateController,
            StatusBarStateController statusBarStateController,
            LockPatternUtils lockPatternUtils,
            LockPatternUtils lockPatternUtils,
            AuthController authController,
            AuthController authController,
            TelephonyListenerManager telephonyListenerManager,
            TelephonyListenerManager telephonyListenerManager,
            FeatureFlags featureFlags,
            InteractionJankMonitor interactionJankMonitor,
            InteractionJankMonitor interactionJankMonitor,
            LatencyTracker latencyTracker) {
            LatencyTracker latencyTracker) {
        mContext = context;
        mContext = context;
@@ -1966,6 +1964,17 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
            mBiometricManager.registerEnabledOnKeyguardCallback(mBiometricEnabledCallback);
            mBiometricManager.registerEnabledOnKeyguardCallback(mBiometricEnabledCallback);
        }
        }


        // in case authenticators aren't registered yet at this point:
        mAuthController.addCallback(new AuthController.Callback() {
            @Override
            public void onAllAuthenticatorsRegistered() {
            }

            @Override
            public void onEnrollmentsChanged() {
                mainExecutor.execute(() -> updateBiometricListeningState());
            }
        });
        updateBiometricListeningState();
        updateBiometricListeningState();
        if (mFpm != null) {
        if (mFpm != null) {
            mFpm.addLockoutResetCallback(mFingerprintLockoutResetCallback);
            mFpm.addLockoutResetCallback(mFingerprintLockoutResetCallback);
@@ -2043,7 +2052,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab


    /**
    /**
     * @return if udfps is available on this device. will return true even if the user hasn't
     * @return if udfps is available on this device. will return true even if the user hasn't
     * enrolled udfps.
     * enrolled udfps. This may be false if called before onAllAuthenticatorsRegistered.
     */
     */
    public boolean isUdfpsAvailable() {
    public boolean isUdfpsAvailable() {
        return mAuthController.getUdfpsProps() != null
        return mAuthController.getUdfpsProps() != null
@@ -2092,7 +2101,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
            return;
            return;
        }
        }


        // TODO: Add support for multiple fingerprint sensors, b/173730729
        updateUdfpsEnrolled(getCurrentUser());
        updateUdfpsEnrolled(getCurrentUser());
        final boolean shouldListenForFingerprint = shouldListenForFingerprint(isUdfpsEnrolled());
        final boolean shouldListenForFingerprint = shouldListenForFingerprint(isUdfpsEnrolled());
        final boolean runningOrRestarting = mFingerprintRunningState == BIOMETRIC_STATE_RUNNING
        final boolean runningOrRestarting = mFingerprintRunningState == BIOMETRIC_STATE_RUNNING
+14 −5
Original line number Original line Diff line number Diff line
@@ -695,11 +695,20 @@ public class LockIconViewController extends ViewController<LockIconView> impleme
    private final AuthController.Callback mAuthControllerCallback = new AuthController.Callback() {
    private final AuthController.Callback mAuthControllerCallback = new AuthController.Callback() {
        @Override
        @Override
        public void onAllAuthenticatorsRegistered() {
        public void onAllAuthenticatorsRegistered() {
            updateUdfpsConfig();
        }

        @Override
        public void onEnrollmentsChanged() {
            updateUdfpsConfig();
        }
    };

    private void updateUdfpsConfig() {
        // must be called from the main thread since it may update the views
        // must be called from the main thread since it may update the views
        mExecutor.execute(() -> {
        mExecutor.execute(() -> {
            updateIsUdfpsEnrolled();
            updateIsUdfpsEnrolled();
            updateConfiguration();
            updateConfiguration();
        });
        });
    }
    }
    };
}
}
+10 −0
Original line number Original line Diff line number Diff line
@@ -142,6 +142,10 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks,
                    mUdfpsEnrolledForUser.put(userId, hasEnrollments);
                    mUdfpsEnrolledForUser.put(userId, hasEnrollments);
                }
                }
            }
            }

            for (Callback cb : mCallbacks) {
                cb.onEnrollmentsChanged();
            }
        }
        }
    };
    };


@@ -844,5 +848,11 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks,
         * registered before this call, this callback will never be triggered.
         * registered before this call, this callback will never be triggered.
         */
         */
        void onAllAuthenticatorsRegistered();
        void onAllAuthenticatorsRegistered();

        /**
         * Called when UDFPS enrollments have changed. This is called after boot and on changes to
         * enrollment.
         */
        void onEnrollmentsChanged();
    }
    }
}
}
+10 −4
Original line number Original line Diff line number Diff line
@@ -292,11 +292,17 @@ class AuthRippleController @Inject constructor(
            }
            }
        }
        }


    private val authControllerCallback = AuthController.Callback {
    private val authControllerCallback =
        object : AuthController.Callback {
            override fun onAllAuthenticatorsRegistered() {
                updateSensorLocation()
                updateSensorLocation()
                updateUdfpsDependentParams()
                updateUdfpsDependentParams()
            }
            }


            override fun onEnrollmentsChanged() {
            }
        }

    private fun updateUdfpsDependentParams() {
    private fun updateUdfpsDependentParams() {
        authController.udfpsProps?.let {
        authController.udfpsProps?.let {
            if (it.size > 0) {
            if (it.size > 0) {
+5 −0
Original line number Original line Diff line number Diff line
@@ -107,6 +107,11 @@ public class DozeScreenState implements DozeMachine.Part {
                public void onAllAuthenticatorsRegistered() {
                public void onAllAuthenticatorsRegistered() {
                    updateUdfpsController();
                    updateUdfpsController();
                }
                }

                @Override
                public void onEnrollmentsChanged() {
                    updateUdfpsController();
                }
            });
            });
        }
        }
    }
    }
Loading