From 87fbeab12f708b3e987f89ad0c547f2315baac2a Mon Sep 17 00:00:00 2001 From: Kevin Chyn Date: Thu, 28 Mar 2019 21:14:19 -0700 Subject: [PATCH] Update BiometricPrompt default title Fixes: 117466084 Test: manual Change-Id: I3b82396694a26d63a79334e7e86c4e9121a370f6 --- core/res/res/values/strings.xml | 2 +- .../server/biometrics/BiometricService.java | 28 ++----------------- 2 files changed, 4 insertions(+), 26 deletions(-) diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml index bb473705b4162..1f502e28ddf2c 100644 --- a/core/res/res/values/strings.xml +++ b/core/res/res/values/strings.xml @@ -1464,7 +1464,7 @@ Allows the app to read locations from your media collection. - Application %s wants to authenticate. + Verify it\u2018s you Biometric hardware unavailable diff --git a/services/core/java/com/android/server/biometrics/BiometricService.java b/services/core/java/com/android/server/biometrics/BiometricService.java index 516844d85484b..a64eacb0139db 100644 --- a/services/core/java/com/android/server/biometrics/BiometricService.java +++ b/services/core/java/com/android/server/biometrics/BiometricService.java @@ -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 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)); } }