diff options
author | Fabrice Di Meglio <fdimeglio@google.com> | 2015-05-07 21:29:14 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-05-07 21:29:15 +0000 |
commit | aef021042e1bc6851a9d66f40f00cea021d357c7 (patch) | |
tree | 1046e5ab310d2a0bfb1147b1775efb48f3c3b444 /services | |
parent | 3203f9a6a0669f270acce579b1cb30fac5e2af08 (diff) | |
parent | 1f09b8c0c2a08fa5169a36031efcb3f34ec5f163 (diff) | |
download | frameworks_base-aef021042e1bc6851a9d66f40f00cea021d357c7.zip frameworks_base-aef021042e1bc6851a9d66f40f00cea021d357c7.tar.gz frameworks_base-aef021042e1bc6851a9d66f40f00cea021d357c7.tar.bz2 |
Merge "Add IntentFilter auto verification - part 8" into mnc-dev
Diffstat (limited to 'services')
-rw-r--r-- | services/core/java/com/android/server/pm/PackageManagerService.java | 15 | ||||
-rw-r--r-- | services/core/java/com/android/server/pm/Settings.java | 11 |
2 files changed, 16 insertions, 10 deletions
diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java index f30a5674..a120c1f 100644 --- a/services/core/java/com/android/server/pm/PackageManagerService.java +++ b/services/core/java/com/android/server/pm/PackageManagerService.java @@ -11853,6 +11853,7 @@ public class PackageManagerService extends IPackageManager.Stub { synchronized (mPackages) { if (deletedPs != null) { if ((flags&PackageManager.DELETE_KEEP_DATA) == 0) { + clearIntentFilterVerificationsLPw(deletedPs.name, UserHandle.USER_ALL); if (outInfo != null) { mSettings.mKeySetManagerService.removeAppKeySetDataLPw(packageName); outInfo.removedAppId = mSettings.removePackageLPw(packageName); @@ -11883,7 +11884,6 @@ public class PackageManagerService extends IPackageManager.Stub { } } clearPackagePreferredActivitiesLPw(deletedPs.name, UserHandle.USER_ALL); - clearIntentFilterVerificationsLPw(deletedPs.name, UserHandle.USER_ALL); } // make sure to preserve per-user disabled state if this removal was just // a downgrade of a system app to the factory package @@ -12744,13 +12744,16 @@ public class PackageManagerService extends IPackageManager.Stub { /** This method takes a specific user id as well as UserHandle.USER_ALL. */ void clearIntentFilterVerificationsLPw(String packageName, int userId) { if (userId == UserHandle.USER_ALL) { - mSettings.removeIntentFilterVerificationLPw(packageName, sUserManager.getUserIds()); - for (int oneUserId : sUserManager.getUserIds()) { - scheduleWritePackageRestrictionsLocked(oneUserId); + if (mSettings.removeIntentFilterVerificationLPw(packageName, + sUserManager.getUserIds())) { + for (int oneUserId : sUserManager.getUserIds()) { + scheduleWritePackageRestrictionsLocked(oneUserId); + } } } else { - mSettings.removeIntentFilterVerificationLPw(packageName, userId); - scheduleWritePackageRestrictionsLocked(userId); + if (mSettings.removeIntentFilterVerificationLPw(packageName, userId)) { + scheduleWritePackageRestrictionsLocked(userId); + } } } diff --git a/services/core/java/com/android/server/pm/Settings.java b/services/core/java/com/android/server/pm/Settings.java index d476bfde..fd70ce1 100644 --- a/services/core/java/com/android/server/pm/Settings.java +++ b/services/core/java/com/android/server/pm/Settings.java @@ -1067,19 +1067,22 @@ final class Settings { return result; } - void removeIntentFilterVerificationLPw(String packageName, int userId) { + boolean removeIntentFilterVerificationLPw(String packageName, int userId) { PackageSetting ps = mPackages.get(packageName); if (ps == null) { Slog.w(PackageManagerService.TAG, "No package known for name: " + packageName); - return; + return false; } ps.clearDomainVerificationStatusForUser(userId); + return true; } - void removeIntentFilterVerificationLPw(String packageName, int[] userIds) { + boolean removeIntentFilterVerificationLPw(String packageName, int[] userIds) { + boolean result = false; for (int userId : userIds) { - removeIntentFilterVerificationLPw(packageName, userId); + result |= removeIntentFilterVerificationLPw(packageName, userId); } + return result; } boolean setDefaultBrowserPackageNameLPr(String packageName, int userId) { |