Merge "Don't attempt caching for BiometricManager.Strings" into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
80cfdd10db
@@ -223,10 +223,6 @@ public class BiometricManager {
|
|||||||
@NonNull private final IAuthService mService;
|
@NonNull private final IAuthService mService;
|
||||||
@Authenticators.Types int mAuthenticators;
|
@Authenticators.Types int mAuthenticators;
|
||||||
|
|
||||||
@Nullable CharSequence mButtonLabel;
|
|
||||||
@Nullable CharSequence mPromptMessage;
|
|
||||||
@Nullable CharSequence mSettingName;
|
|
||||||
|
|
||||||
private Strings(@NonNull Context context, @NonNull IAuthService service,
|
private Strings(@NonNull Context context, @NonNull IAuthService service,
|
||||||
@Authenticators.Types int authenticators) {
|
@Authenticators.Types int authenticators) {
|
||||||
mContext = context;
|
mContext = context;
|
||||||
@@ -259,17 +255,14 @@ public class BiometricManager {
|
|||||||
@RequiresPermission(USE_BIOMETRIC)
|
@RequiresPermission(USE_BIOMETRIC)
|
||||||
@Nullable
|
@Nullable
|
||||||
public CharSequence getButtonLabel() {
|
public CharSequence getButtonLabel() {
|
||||||
if (mButtonLabel == null) {
|
|
||||||
final int userId = mContext.getUserId();
|
final int userId = mContext.getUserId();
|
||||||
final String opPackageName = mContext.getOpPackageName();
|
final String opPackageName = mContext.getOpPackageName();
|
||||||
try {
|
try {
|
||||||
mButtonLabel = mService.getButtonLabel(userId, opPackageName, mAuthenticators);
|
return mService.getButtonLabel(userId, opPackageName, mAuthenticators);
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
throw e.rethrowFromSystemServer();
|
throw e.rethrowFromSystemServer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return mButtonLabel;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides a localized string that can be shown while the user is authenticating with
|
* Provides a localized string that can be shown while the user is authenticating with
|
||||||
@@ -296,7 +289,6 @@ public class BiometricManager {
|
|||||||
@RequiresPermission(USE_BIOMETRIC)
|
@RequiresPermission(USE_BIOMETRIC)
|
||||||
@Nullable
|
@Nullable
|
||||||
public CharSequence getPromptMessage() {
|
public CharSequence getPromptMessage() {
|
||||||
if (mPromptMessage == null) {
|
|
||||||
final int userId = mContext.getUserId();
|
final int userId = mContext.getUserId();
|
||||||
final String opPackageName = mContext.getOpPackageName();
|
final String opPackageName = mContext.getOpPackageName();
|
||||||
try {
|
try {
|
||||||
@@ -305,8 +297,6 @@ public class BiometricManager {
|
|||||||
throw e.rethrowFromSystemServer();
|
throw e.rethrowFromSystemServer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return mPromptMessage;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides a localized string that can be shown as the title for an app setting that
|
* Provides a localized string that can be shown as the title for an app setting that
|
||||||
@@ -335,7 +325,6 @@ public class BiometricManager {
|
|||||||
@RequiresPermission(USE_BIOMETRIC)
|
@RequiresPermission(USE_BIOMETRIC)
|
||||||
@Nullable
|
@Nullable
|
||||||
public CharSequence getSettingName() {
|
public CharSequence getSettingName() {
|
||||||
if (mSettingName == null) {
|
|
||||||
final int userId = mContext.getUserId();
|
final int userId = mContext.getUserId();
|
||||||
final String opPackageName = mContext.getOpPackageName();
|
final String opPackageName = mContext.getOpPackageName();
|
||||||
try {
|
try {
|
||||||
@@ -344,8 +333,6 @@ public class BiometricManager {
|
|||||||
throw e.rethrowFromSystemServer();
|
throw e.rethrowFromSystemServer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return mSettingName;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@NonNull private final Context mContext;
|
@NonNull private final Context mContext;
|
||||||
|
|||||||
Reference in New Issue
Block a user