Loading core/java/android/hardware/fingerprint/IUdfpsOverlayController.aidl +5 −1 Original line number Diff line number Diff line Loading @@ -20,8 +20,12 @@ package android.hardware.fingerprint; * @hide */ oneway interface IUdfpsOverlayController { const int REASON_UNKNOWN = 0; const int REASON_ENROLL = 1; const int REASON_AUTH = 2; // Shows the overlay. void showUdfpsOverlay(int sensorId); void showUdfpsOverlay(int sensorId, int reason); // Hides the overlay. void hideUdfpsOverlay(int sensorId); Loading packages/SystemUI/res/values-night/colors.xml +3 −0 Original line number Diff line number Diff line Loading @@ -77,6 +77,9 @@ <color name="biometric_dialog_accent">#ff80cbc4</color> <!-- light teal --> <color name="biometric_dialog_error">#fff28b82</color> <!-- red 300 --> <!-- UDFPS colors --> <color name="udfps_enroll_icon">#ffffff</color> <!-- 100% white --> <color name="GM2_green_500">#FF41Af6A</color> <color name="GM2_blue_500">#5195EA</color> <color name="GM2_red_500">#E25142</color> Loading packages/SystemUI/res/values/colors.xml +3 −0 Original line number Diff line number Diff line Loading @@ -178,6 +178,9 @@ <color name="biometric_dialog_accent">#ff008577</color> <!-- dark teal --> <color name="biometric_dialog_error">#ffd93025</color> <!-- red 600 --> <!-- UDFPS colors --> <color name="udfps_enroll_icon">#000000</color> <!-- 100% black --> <!-- Logout button --> <color name="logout_button_bg_color">#ccffffff</color> Loading packages/SystemUI/src/com/android/systemui/biometrics/AuthController.java +6 −4 Original line number Diff line number Diff line Loading @@ -546,6 +546,12 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks, protected void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); // UdfpsController is not BiometricPrompt-specific. It can be active for keyguard or // enrollment. if (mUdfpsController != null) { mUdfpsController.onConfigurationChanged(); } // Save the state of the current dialog (buttons showing, etc) if (mCurrentDialog != null) { final Bundle savedState = new Bundle(); Loading @@ -567,10 +573,6 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks, promptInfo.setAuthenticators(Authenticators.DEVICE_CREDENTIAL); } if (mUdfpsController != null) { mUdfpsController.onConfigurationChanged(); } showDialog(mCurrentDialogArgs, true /* skipAnimation */, savedState); } } Loading packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java +22 −8 Original line number Diff line number Diff line Loading @@ -108,6 +108,8 @@ class UdfpsController implements DozeReceiver { private boolean mIsOverlayShowing; // Indicates whether the overlay has been requested. private boolean mIsOverlayRequested; // Reason the overlay has been requested. See IUdfpsOverlayController for definitions. private int mRequestReason; // The fingerprint AOD trigger doesn't provide an ACTION_UP/ACTION_CANCEL event to tell us when // to turn off high brightness mode. To get around this limitation, the state of the AOD Loading @@ -118,13 +120,13 @@ class UdfpsController implements DozeReceiver { public class UdfpsOverlayController extends IUdfpsOverlayController.Stub { @Override public void showUdfpsOverlay(int sensorId) { UdfpsController.this.setShowOverlay(true); public void showUdfpsOverlay(int sensorId, int reason) { UdfpsController.this.showOverlay(reason); } @Override public void hideUdfpsOverlay(int sensorId) { UdfpsController.this.setShowOverlay(false); UdfpsController.this.hideOverlay(); } @Override Loading Loading @@ -285,17 +287,27 @@ class UdfpsController implements DozeReceiver { return mView.getSensorRect(); } private void setShowOverlay(boolean show) { if (show == mIsOverlayRequested) { private void showOverlay(int reason) { if (mIsOverlayRequested) { return; } mIsOverlayRequested = true; mRequestReason = reason; updateOverlay(); } private void hideOverlay() { if (!mIsOverlayRequested) { return; } mIsOverlayRequested = show; mIsOverlayRequested = false; mRequestReason = IUdfpsOverlayController.REASON_UNKNOWN; updateOverlay(); } private void updateOverlay() { if (mIsOverlayRequested) { showUdfpsOverlay(); showUdfpsOverlay(mRequestReason); } else { hideUdfpsOverlay(); } Loading Loading @@ -323,11 +335,12 @@ class UdfpsController implements DozeReceiver { updateOverlay(); } private void showUdfpsOverlay() { private void showUdfpsOverlay(int reason) { mFgExecutor.execute(() -> { if (!mIsOverlayShowing) { try { Log.v(TAG, "showUdfpsOverlay | adding window"); mView.setShowReason(reason); mWindowManager.addView(mView, computeLayoutParams()); mIsOverlayShowing = true; mView.setOnTouchListener(mOnTouchListener); Loading @@ -344,6 +357,7 @@ class UdfpsController implements DozeReceiver { mFgExecutor.execute(() -> { if (mIsOverlayShowing) { Log.v(TAG, "hideUdfpsOverlay | removing window"); mView.setShowReason(IUdfpsOverlayController.REASON_UNKNOWN); mView.setOnTouchListener(null); // Reset the controller back to its starting state. onFingerUp(); Loading Loading
core/java/android/hardware/fingerprint/IUdfpsOverlayController.aidl +5 −1 Original line number Diff line number Diff line Loading @@ -20,8 +20,12 @@ package android.hardware.fingerprint; * @hide */ oneway interface IUdfpsOverlayController { const int REASON_UNKNOWN = 0; const int REASON_ENROLL = 1; const int REASON_AUTH = 2; // Shows the overlay. void showUdfpsOverlay(int sensorId); void showUdfpsOverlay(int sensorId, int reason); // Hides the overlay. void hideUdfpsOverlay(int sensorId); Loading
packages/SystemUI/res/values-night/colors.xml +3 −0 Original line number Diff line number Diff line Loading @@ -77,6 +77,9 @@ <color name="biometric_dialog_accent">#ff80cbc4</color> <!-- light teal --> <color name="biometric_dialog_error">#fff28b82</color> <!-- red 300 --> <!-- UDFPS colors --> <color name="udfps_enroll_icon">#ffffff</color> <!-- 100% white --> <color name="GM2_green_500">#FF41Af6A</color> <color name="GM2_blue_500">#5195EA</color> <color name="GM2_red_500">#E25142</color> Loading
packages/SystemUI/res/values/colors.xml +3 −0 Original line number Diff line number Diff line Loading @@ -178,6 +178,9 @@ <color name="biometric_dialog_accent">#ff008577</color> <!-- dark teal --> <color name="biometric_dialog_error">#ffd93025</color> <!-- red 600 --> <!-- UDFPS colors --> <color name="udfps_enroll_icon">#000000</color> <!-- 100% black --> <!-- Logout button --> <color name="logout_button_bg_color">#ccffffff</color> Loading
packages/SystemUI/src/com/android/systemui/biometrics/AuthController.java +6 −4 Original line number Diff line number Diff line Loading @@ -546,6 +546,12 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks, protected void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); // UdfpsController is not BiometricPrompt-specific. It can be active for keyguard or // enrollment. if (mUdfpsController != null) { mUdfpsController.onConfigurationChanged(); } // Save the state of the current dialog (buttons showing, etc) if (mCurrentDialog != null) { final Bundle savedState = new Bundle(); Loading @@ -567,10 +573,6 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks, promptInfo.setAuthenticators(Authenticators.DEVICE_CREDENTIAL); } if (mUdfpsController != null) { mUdfpsController.onConfigurationChanged(); } showDialog(mCurrentDialogArgs, true /* skipAnimation */, savedState); } } Loading
packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java +22 −8 Original line number Diff line number Diff line Loading @@ -108,6 +108,8 @@ class UdfpsController implements DozeReceiver { private boolean mIsOverlayShowing; // Indicates whether the overlay has been requested. private boolean mIsOverlayRequested; // Reason the overlay has been requested. See IUdfpsOverlayController for definitions. private int mRequestReason; // The fingerprint AOD trigger doesn't provide an ACTION_UP/ACTION_CANCEL event to tell us when // to turn off high brightness mode. To get around this limitation, the state of the AOD Loading @@ -118,13 +120,13 @@ class UdfpsController implements DozeReceiver { public class UdfpsOverlayController extends IUdfpsOverlayController.Stub { @Override public void showUdfpsOverlay(int sensorId) { UdfpsController.this.setShowOverlay(true); public void showUdfpsOverlay(int sensorId, int reason) { UdfpsController.this.showOverlay(reason); } @Override public void hideUdfpsOverlay(int sensorId) { UdfpsController.this.setShowOverlay(false); UdfpsController.this.hideOverlay(); } @Override Loading Loading @@ -285,17 +287,27 @@ class UdfpsController implements DozeReceiver { return mView.getSensorRect(); } private void setShowOverlay(boolean show) { if (show == mIsOverlayRequested) { private void showOverlay(int reason) { if (mIsOverlayRequested) { return; } mIsOverlayRequested = true; mRequestReason = reason; updateOverlay(); } private void hideOverlay() { if (!mIsOverlayRequested) { return; } mIsOverlayRequested = show; mIsOverlayRequested = false; mRequestReason = IUdfpsOverlayController.REASON_UNKNOWN; updateOverlay(); } private void updateOverlay() { if (mIsOverlayRequested) { showUdfpsOverlay(); showUdfpsOverlay(mRequestReason); } else { hideUdfpsOverlay(); } Loading Loading @@ -323,11 +335,12 @@ class UdfpsController implements DozeReceiver { updateOverlay(); } private void showUdfpsOverlay() { private void showUdfpsOverlay(int reason) { mFgExecutor.execute(() -> { if (!mIsOverlayShowing) { try { Log.v(TAG, "showUdfpsOverlay | adding window"); mView.setShowReason(reason); mWindowManager.addView(mView, computeLayoutParams()); mIsOverlayShowing = true; mView.setOnTouchListener(mOnTouchListener); Loading @@ -344,6 +357,7 @@ class UdfpsController implements DozeReceiver { mFgExecutor.execute(() -> { if (mIsOverlayShowing) { Log.v(TAG, "hideUdfpsOverlay | removing window"); mView.setShowReason(IUdfpsOverlayController.REASON_UNKNOWN); mView.setOnTouchListener(null); // Reset the controller back to its starting state. onFingerUp(); Loading