diff options
author | Kenny Root <kroot@google.com> | 2013-04-03 18:29:24 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2013-04-03 18:29:24 +0000 |
commit | a7e4795bb35986164294e6f7ef56e31c9de0c06d (patch) | |
tree | 82eca0dda5ff7418b2dffaf09eb11cde43fcca70 /services | |
parent | c9a1ca3c1a9f8591b675b980c1e390be8d901b39 (diff) | |
parent | 95e3ee3971915b323e5c13dcfe3b12a4180850cd (diff) | |
download | frameworks_base-a7e4795bb35986164294e6f7ef56e31c9de0c06d.zip frameworks_base-a7e4795bb35986164294e6f7ef56e31c9de0c06d.tar.gz frameworks_base-a7e4795bb35986164294e6f7ef56e31c9de0c06d.tar.bz2 |
Merge "Remove keystore entries when package removed"
Diffstat (limited to 'services')
-rw-r--r-- | services/java/com/android/server/pm/PackageManagerService.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/services/java/com/android/server/pm/PackageManagerService.java b/services/java/com/android/server/pm/PackageManagerService.java index b8324ee..c16f0ee 100644 --- a/services/java/com/android/server/pm/PackageManagerService.java +++ b/services/java/com/android/server/pm/PackageManagerService.java @@ -111,7 +111,9 @@ import android.os.SystemClock; import android.os.SystemProperties; import android.os.UserHandle; import android.os.Environment.UserEnvironment; +import android.os.UserManager; import android.provider.Settings.Secure; +import android.security.KeyStore; import android.security.SystemKeyStore; import android.util.DisplayMetrics; import android.util.EventLog; @@ -8219,6 +8221,17 @@ public class PackageManagerService extends IPackageManager.Stub { mSettings.writeLPr(); } } + // A user ID was deleted here. Go through all users and remove it from + // KeyStore. + final int appId = outInfo.removedAppId; + if (appId != -1) { + final KeyStore keyStore = KeyStore.getInstance(); + if (keyStore != null) { + for (final int userId : sUserManager.getUserIds()) { + keyStore.clearUid(UserHandle.getUid(userId, appId)); + } + } + } } /* |