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;
|
||||
@Authenticators.Types int mAuthenticators;
|
||||
|
||||
@Nullable CharSequence mButtonLabel;
|
||||
@Nullable CharSequence mPromptMessage;
|
||||
@Nullable CharSequence mSettingName;
|
||||
|
||||
private Strings(@NonNull Context context, @NonNull IAuthService service,
|
||||
@Authenticators.Types int authenticators) {
|
||||
mContext = context;
|
||||
@@ -259,16 +255,13 @@ public class BiometricManager {
|
||||
@RequiresPermission(USE_BIOMETRIC)
|
||||
@Nullable
|
||||
public CharSequence getButtonLabel() {
|
||||
if (mButtonLabel == null) {
|
||||
final int userId = mContext.getUserId();
|
||||
final String opPackageName = mContext.getOpPackageName();
|
||||
try {
|
||||
mButtonLabel = mService.getButtonLabel(userId, opPackageName, mAuthenticators);
|
||||
} catch (RemoteException e) {
|
||||
throw e.rethrowFromSystemServer();
|
||||
}
|
||||
final int userId = mContext.getUserId();
|
||||
final String opPackageName = mContext.getOpPackageName();
|
||||
try {
|
||||
return mService.getButtonLabel(userId, opPackageName, mAuthenticators);
|
||||
} catch (RemoteException e) {
|
||||
throw e.rethrowFromSystemServer();
|
||||
}
|
||||
return mButtonLabel;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -296,16 +289,13 @@ public class BiometricManager {
|
||||
@RequiresPermission(USE_BIOMETRIC)
|
||||
@Nullable
|
||||
public CharSequence getPromptMessage() {
|
||||
if (mPromptMessage == null) {
|
||||
final int userId = mContext.getUserId();
|
||||
final String opPackageName = mContext.getOpPackageName();
|
||||
try {
|
||||
return mService.getPromptMessage(userId, opPackageName, mAuthenticators);
|
||||
} catch (RemoteException e) {
|
||||
throw e.rethrowFromSystemServer();
|
||||
}
|
||||
final int userId = mContext.getUserId();
|
||||
final String opPackageName = mContext.getOpPackageName();
|
||||
try {
|
||||
return mService.getPromptMessage(userId, opPackageName, mAuthenticators);
|
||||
} catch (RemoteException e) {
|
||||
throw e.rethrowFromSystemServer();
|
||||
}
|
||||
return mPromptMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -335,16 +325,13 @@ public class BiometricManager {
|
||||
@RequiresPermission(USE_BIOMETRIC)
|
||||
@Nullable
|
||||
public CharSequence getSettingName() {
|
||||
if (mSettingName == null) {
|
||||
final int userId = mContext.getUserId();
|
||||
final String opPackageName = mContext.getOpPackageName();
|
||||
try {
|
||||
return mService.getSettingName(userId, opPackageName, mAuthenticators);
|
||||
} catch (RemoteException e) {
|
||||
throw e.rethrowFromSystemServer();
|
||||
}
|
||||
final int userId = mContext.getUserId();
|
||||
final String opPackageName = mContext.getOpPackageName();
|
||||
try {
|
||||
return mService.getSettingName(userId, opPackageName, mAuthenticators);
|
||||
} catch (RemoteException e) {
|
||||
throw e.rethrowFromSystemServer();
|
||||
}
|
||||
return mSettingName;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user