Remove getCurrentUser call to find an alternative
The call the framework uses to get the current user ID requires the INTERACT_ACROSS_USERS permission, which not a lot of apps will have. Find a better way to do that. Bug: 76430246 Test: CtsKeystoreTestCases Change-Id: I8a0637d351fff9cfbf40e02946325f90466b68c5
This commit is contained in:
committed by
Brian Young
parent
77fcc0da3b
commit
f5f6bb2d88
@ -547,9 +547,6 @@ public class KeyStore {
|
||||
try {
|
||||
args = args != null ? args : new KeymasterArguments();
|
||||
entropy = entropy != null ? entropy : new byte[0];
|
||||
if (!args.containsTag(KeymasterDefs.KM_TAG_USER_ID)) {
|
||||
args.addUnsignedInt(KeymasterDefs.KM_TAG_USER_ID, ActivityManager.getCurrentUser());
|
||||
}
|
||||
return mBinder.begin(getToken(), alias, purpose, pruneable, args, entropy, uid);
|
||||
} catch (RemoteException e) {
|
||||
Log.w(TAG, "Cannot connect to keystore", e);
|
||||
|
@ -101,7 +101,6 @@ public abstract class KeymasterUtils {
|
||||
* require user authentication.
|
||||
*/
|
||||
public static void addUserAuthArgs(KeymasterArguments args, UserAuthArgs spec) {
|
||||
args.addUnsignedInt(KeymasterDefs.KM_TAG_USER_ID, ActivityManager.getCurrentUser());
|
||||
|
||||
if (spec.isUserConfirmationRequired()) {
|
||||
args.addBoolean(KeymasterDefs.KM_TAG_TRUSTED_CONFIRMATION_REQUIRED);
|
||||
|
Reference in New Issue
Block a user