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: I840e33ed338a39f3af229c6f91606b5b4647d27d
This commit is contained in:
@@ -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;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user