am 227ba29e
: Merge "Clear only keystore credential entires" into mnc-dev
* commit '227ba29e3947c8d53cb4a8138f0c3f209ae414e3': Clear only keystore credential entires
This commit is contained in:
@@ -104,6 +104,12 @@ public final class CredentialStorage extends Activity {
|
|||||||
|
|
||||||
private final KeyStore mKeyStore = KeyStore.getInstance();
|
private final KeyStore mKeyStore = KeyStore.getInstance();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The UIDs that are used for system credential storage in keystore.
|
||||||
|
*/
|
||||||
|
private static final int[] SYSTEM_CREDENTIAL_UIDS = {Process.WIFI_UID, Process.VPN_UID,
|
||||||
|
Process.ROOT_UID, Process.SYSTEM_UID};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* When non-null, the bundle containing credentials to install.
|
* When non-null, the bundle containing credentials to install.
|
||||||
*/
|
*/
|
||||||
@@ -333,7 +339,14 @@ public final class CredentialStorage extends Activity {
|
|||||||
|
|
||||||
@Override protected Boolean doInBackground(Void... unused) {
|
@Override protected Boolean doInBackground(Void... unused) {
|
||||||
|
|
||||||
mKeyStore.reset();
|
// Clear all the users credentials could have been installed in for this user.
|
||||||
|
final UserManager um = (UserManager) getSystemService(USER_SERVICE);
|
||||||
|
for (UserInfo pi : um.getProfiles(UserHandle.getUserId(Process.myUid()))) {
|
||||||
|
for (int uid : SYSTEM_CREDENTIAL_UIDS) {
|
||||||
|
mKeyStore.clearUid(UserHandle.getUid(pi.id, uid));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
KeyChainConnection keyChainConnection = KeyChain.bind(CredentialStorage.this);
|
KeyChainConnection keyChainConnection = KeyChain.bind(CredentialStorage.this);
|
||||||
|
Reference in New Issue
Block a user