Make sure DPC knows if revoke fails
Bug: 183098396 Test: atest MixedDeviceOwnerTest#testKeyManagement Change-Id: I89b51a1fb4be3b53eb46a7c194924b5255cd262b
This commit is contained in:
@@ -66,7 +66,8 @@ interface IKeyChainService {
|
||||
boolean isCredentialManagementApp(String packageName);
|
||||
|
||||
// APIs used by KeyChainActivity
|
||||
void setGrant(int uid, String alias, boolean value);
|
||||
// setGrant may fail with value=false when ungrant operation fails in KeyStore.
|
||||
boolean setGrant(int uid, String alias, boolean value);
|
||||
boolean hasGrant(int uid, String alias);
|
||||
|
||||
// API used by Wifi
|
||||
|
||||
@@ -5657,8 +5657,7 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
|
||||
try (KeyChainConnection keyChainConnection =
|
||||
KeyChain.bindAsUser(mContext, userHandle)) {
|
||||
IKeyChainService keyChain = keyChainConnection.getService();
|
||||
keyChain.setGrant(granteeUid, alias, hasGrant);
|
||||
return true;
|
||||
return keyChain.setGrant(granteeUid, alias, hasGrant);
|
||||
} catch (RemoteException e) {
|
||||
Slogf.e(LOG_TAG, "Setting grant for package.", e);
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user