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

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

Merge "Update BiometricPrompt default title"

parents b1709f88 87fbeab1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1434,7 +1434,7 @@
    <string name="permdesc_mediaLocation">Allows the app to read locations from your media collection.</string>

    <!-- Title shown when the system-provided biometric dialog is shown, asking the user to authenticate. [CHAR LIMIT=40] -->
    <string name="biometric_dialog_default_title">Application <xliff:g id="app" example="Gmail">%s</xliff:g> wants to authenticate.</string>
    <string name="biometric_dialog_default_title">Verify it\u2018s you</string>
    <!-- Message shown when biometric hardware is not available [CHAR LIMIT=50] -->
    <string name="biometric_error_hw_unavailable">Biometric hardware unavailable</string>
    <!-- Message shown when biometric authentication was canceled by the user [CHAR LIMIT=50] -->
+3 −25
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@ package com.android.server.biometrics;
import static android.Manifest.permission.USE_BIOMETRIC;
import static android.Manifest.permission.USE_BIOMETRIC_INTERNAL;
import static android.Manifest.permission.USE_FINGERPRINT;
import static android.app.ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND;
import static android.hardware.biometrics.BiometricAuthenticator.TYPE_FACE;
import static android.hardware.biometrics.BiometricAuthenticator.TYPE_FINGERPRINT;
import static android.hardware.biometrics.BiometricAuthenticator.TYPE_IRIS;
@@ -576,30 +575,9 @@ public class BiometricService extends SystemService {
            if (useDefaultTitle) {
                checkInternalPermission();
                // Set the default title if necessary
                try {
                    final List<ActivityManager.RunningAppProcessInfo> procs =
                            ActivityManager.getService().getRunningAppProcesses();
                    for (int i = 0; i < procs.size(); i++) {
                        final ActivityManager.RunningAppProcessInfo info = procs.get(i);
                        if (info.uid == callingUid
                                && info.importance == IMPORTANCE_FOREGROUND) {
                            PackageManager pm = getContext().getPackageManager();
                            final CharSequence label = pm.getApplicationLabel(
                                    pm.getApplicationInfo(info.processName,
                                            PackageManager.GET_META_DATA));
                            final String title = getContext()
                                    .getString(R.string.biometric_dialog_default_title, label);
                            if (TextUtils.isEmpty(
                                    bundle.getCharSequence(BiometricPrompt.KEY_TITLE))) {
                                bundle.putCharSequence(BiometricPrompt.KEY_TITLE, title);
                            }
                            break;
                        }
                    }
                } catch (RemoteException e) {
                    Slog.e(TAG, "Remote exception", e);
                } catch (PackageManager.NameNotFoundException e) {
                    Slog.e(TAG, "Name not found", e);
                if (TextUtils.isEmpty(bundle.getCharSequence(BiometricPrompt.KEY_TITLE))) {
                    bundle.putCharSequence(BiometricPrompt.KEY_TITLE,
                            getContext().getString(R.string.biometric_dialog_default_title));
                }
            }