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

Commit 681d6c08 authored by Kevin Chyn's avatar Kevin Chyn Committed by Android (Google) Code Review
Browse files

Merge "Require signature permission when controlling biometric dialog"

parents d4092c18 95c27e0f
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -3756,6 +3756,10 @@
    <permission android:name="android.permission.USE_BIOMETRIC_INTERNAL"
        android:protectionLevel="signature" />

    <!-- Allows the system to control the BiometricDialog (SystemUI). Reserved for the system. @hide -->
    <permission android:name="android.permission.MANAGE_BIOMETRIC_DIALOG"
        android:protectionLevel="signature" />

    <!-- Allows an app to reset face authentication attempt counter. Reserved for the system. @hide -->
    <permission android:name="android.permission.RESET_FACE_LOCKOUT"
        android:protectionLevel="signature" />
+11 −0
Original line number Diff line number Diff line
@@ -566,6 +566,7 @@ public class StatusBarManagerService extends IStatusBarService.Stub {

    @Override
    public void showBiometricDialog(Bundle bundle, IBiometricPromptReceiver receiver, int type) {
        enforceBiometricDialog();
        if (mBar != null) {
            try {
                mBar.showBiometricDialog(bundle, receiver, type);
@@ -576,6 +577,7 @@ public class StatusBarManagerService extends IStatusBarService.Stub {

    @Override
    public void onBiometricAuthenticated() {
        enforceBiometricDialog();
        if (mBar != null) {
            try {
                mBar.onBiometricAuthenticated();
@@ -586,6 +588,7 @@ public class StatusBarManagerService extends IStatusBarService.Stub {

    @Override
    public void onBiometricHelp(String message) {
        enforceBiometricDialog();
        if (mBar != null) {
            try {
                mBar.onBiometricHelp(message);
@@ -596,6 +599,7 @@ public class StatusBarManagerService extends IStatusBarService.Stub {

    @Override
    public void onBiometricError(String error) {
        enforceBiometricDialog();
        if (mBar != null) {
            try {
                mBar.onBiometricError(error);
@@ -606,6 +610,7 @@ public class StatusBarManagerService extends IStatusBarService.Stub {

    @Override
    public void hideBiometricDialog() {
        enforceBiometricDialog();
        if (mBar != null) {
            try {
                mBar.hideBiometricDialog();
@@ -866,6 +871,12 @@ public class StatusBarManagerService extends IStatusBarService.Stub {
                "StatusBarManagerService");
    }

    private void enforceBiometricDialog() {
        mContext.enforceCallingOrSelfPermission(
                android.Manifest.permission.MANAGE_BIOMETRIC_DIALOG,
                "StatusBarManagerService");
    }

    // ================================================================================
    // Callbacks from the status bar service.
    // ================================================================================