Merge "Update BiometricPrompt default title" into qt-dev
This commit is contained in:
@@ -1434,7 +1434,7 @@
|
|||||||
<string name="permdesc_mediaLocation">Allows the app to read locations from your media collection.</string>
|
<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] -->
|
<!-- 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] -->
|
<!-- Message shown when biometric hardware is not available [CHAR LIMIT=50] -->
|
||||||
<string name="biometric_error_hw_unavailable">Biometric hardware unavailable</string>
|
<string name="biometric_error_hw_unavailable">Biometric hardware unavailable</string>
|
||||||
<!-- Message shown when biometric authentication was canceled by the user [CHAR LIMIT=50] -->
|
<!-- Message shown when biometric authentication was canceled by the user [CHAR LIMIT=50] -->
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ package com.android.server.biometrics;
|
|||||||
import static android.Manifest.permission.USE_BIOMETRIC;
|
import static android.Manifest.permission.USE_BIOMETRIC;
|
||||||
import static android.Manifest.permission.USE_BIOMETRIC_INTERNAL;
|
import static android.Manifest.permission.USE_BIOMETRIC_INTERNAL;
|
||||||
import static android.Manifest.permission.USE_FINGERPRINT;
|
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_FACE;
|
||||||
import static android.hardware.biometrics.BiometricAuthenticator.TYPE_FINGERPRINT;
|
import static android.hardware.biometrics.BiometricAuthenticator.TYPE_FINGERPRINT;
|
||||||
import static android.hardware.biometrics.BiometricAuthenticator.TYPE_IRIS;
|
import static android.hardware.biometrics.BiometricAuthenticator.TYPE_IRIS;
|
||||||
@@ -584,30 +583,9 @@ public class BiometricService extends SystemService {
|
|||||||
if (useDefaultTitle) {
|
if (useDefaultTitle) {
|
||||||
checkInternalPermission();
|
checkInternalPermission();
|
||||||
// Set the default title if necessary
|
// Set the default title if necessary
|
||||||
try {
|
if (TextUtils.isEmpty(bundle.getCharSequence(BiometricPrompt.KEY_TITLE))) {
|
||||||
final List<ActivityManager.RunningAppProcessInfo> procs =
|
bundle.putCharSequence(BiometricPrompt.KEY_TITLE,
|
||||||
ActivityManager.getService().getRunningAppProcesses();
|
getContext().getString(R.string.biometric_dialog_default_title));
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user