Merge "Don't attempt caching for BiometricManager.Strings" into sc-dev am: 80cfdd10db

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15177519

Change-Id: I86c97a6f5f99c285db3cb8b294ec9fd40bdd632f
This commit is contained in:
Curtis Belmonte
2021-07-01 20:50:06 +00:00
committed by Automerger Merge Worker

View File

@@ -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,16 +255,13 @@ 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 { return mService.getButtonLabel(userId, opPackageName, mAuthenticators);
mButtonLabel = mService.getButtonLabel(userId, opPackageName, mAuthenticators); } catch (RemoteException e) {
} catch (RemoteException e) { throw e.rethrowFromSystemServer();
throw e.rethrowFromSystemServer();
}
} }
return mButtonLabel;
} }
/** /**
@@ -296,16 +289,13 @@ 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 { return mService.getPromptMessage(userId, opPackageName, mAuthenticators);
return mService.getPromptMessage(userId, opPackageName, mAuthenticators); } catch (RemoteException e) {
} catch (RemoteException e) { throw e.rethrowFromSystemServer();
throw e.rethrowFromSystemServer();
}
} }
return mPromptMessage;
} }
/** /**
@@ -335,16 +325,13 @@ 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 { return mService.getSettingName(userId, opPackageName, mAuthenticators);
return mService.getSettingName(userId, opPackageName, mAuthenticators); } catch (RemoteException e) {
} catch (RemoteException e) { throw e.rethrowFromSystemServer();
throw e.rethrowFromSystemServer();
}
} }
return mSettingName;
} }
} }