summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorFabrice Di Meglio <fdimeglio@google.com>2015-05-06 18:51:21 -0700
committerFabrice Di Meglio <fdimeglio@google.com>2015-05-06 19:11:17 -0700
commit1f09b8c0c2a08fa5169a36031efcb3f34ec5f163 (patch)
tree2a77f0de10ced55ac0182b45acfab463e7c2f1c8 /services
parent7d1a9d056261fdf304215c9b53b7cc4f4422e1db (diff)
downloadframeworks_base-1f09b8c0c2a08fa5169a36031efcb3f34ec5f163.zip
frameworks_base-1f09b8c0c2a08fa5169a36031efcb3f34ec5f163.tar.gz
frameworks_base-1f09b8c0c2a08fa5169a36031efcb3f34ec5f163.tar.bz2
Add IntentFilter auto verification - part 8
- fix clearing of Intent Verification Status: now do it at the correct time when the PackageSettings info is still there - reduce writing of Settings See bug #19628909 Change-Id: I9113333c330964249342108fa1ca7b8ec89c3322
Diffstat (limited to 'services')
-rw-r--r--services/core/java/com/android/server/pm/PackageManagerService.java15
-rw-r--r--services/core/java/com/android/server/pm/Settings.java11
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 bf8c20c..2df4538 100644
--- a/services/core/java/com/android/server/pm/PackageManagerService.java
+++ b/services/core/java/com/android/server/pm/PackageManagerService.java
@@ -11743,6 +11743,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);
@@ -11773,7 +11774,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
@@ -12635,13 +12635,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 fb2b31a..eec1298 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) {