summaryrefslogtreecommitdiff
path: root/services
diff options
context:
space:
mode:
author Christopher Tate <ctate@google.com> 2019-03-20 12:40:13 -0700
committer Christopher Tate <ctate@google.com> 2019-03-21 15:43:09 -0700
commit237aab5aff2adb8ff092d00f42682b09d0e51c79 (patch)
treeb04374e71daa3617440c8f7bb83ded5bac6dd4a9 /services
parent47119cf9772dd704cad8106c2930197805566d3e (diff)
Sysconfig takes precedence over update-time autoVerify
autoVerify is re-evaluated whenever an apk is updated, and in the normal case a verification failure here results in the app being demoted out of 'always' status for handling web link Intents. However, bundled app policy for this is supposed to be set statically via sysconfig -- so now we make sure that sysconfig policy takes precedence in this case. Fixes: 127838380 Test: manual (update bundled sysconfig-cited app and force failure) Test: atest OsHostTests#testIntentFilterHostValidation Change-Id: If80511ce47847bb21a48634b191acfacda606331
Diffstat (limited to 'services')
-rw-r--r--services/core/java/com/android/server/pm/PackageManagerService.java23
1 files changed, 17 insertions, 6 deletions
diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java
index e5b6397e863d..fd04a3ad525b 100644
--- a/services/core/java/com/android/server/pm/PackageManagerService.java
+++ b/services/core/java/com/android/server/pm/PackageManagerService.java
@@ -160,9 +160,9 @@ import android.content.pm.InstantAppInfo;
import android.content.pm.InstantAppRequest;
import android.content.pm.InstrumentationInfo;
import android.content.pm.IntentFilterVerificationInfo;
-import android.content.pm.PackageBackwardCompatibility;
import android.content.pm.KeySet;
import android.content.pm.ModuleInfo;
+import android.content.pm.PackageBackwardCompatibility;
import android.content.pm.PackageInfo;
import android.content.pm.PackageInfoLite;
import android.content.pm.PackageInstaller;
@@ -1127,11 +1127,22 @@ public class PackageManagerService extends IPackageManager.Stub
switch (userStatus) {
case INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ALWAYS:
if (!verified) {
- // updatedStatus is already UNDEFINED
- needUpdate = true;
-
- if (DEBUG_DOMAIN_VERIFICATION) {
- Slog.d(TAG, "Formerly validated but now failing; demoting");
+ // Don't demote if sysconfig says 'always'
+ SystemConfig systemConfig = SystemConfig.getInstance();
+ ArraySet<String> packages = systemConfig.getLinkedApps();
+ if (!packages.contains(packageName)) {
+ // updatedStatus is already UNDEFINED
+ needUpdate = true;
+
+ if (DEBUG_DOMAIN_VERIFICATION) {
+ Slog.d(TAG, "Formerly validated but now failing; demoting");
+ }
+ } else {
+ if (DEBUG_DOMAIN_VERIFICATION) {
+ Slog.d(TAG, "Updating bundled package " + packageName
+ + " failed autoVerify, but sysconfig supersedes");
+ }
+ // leave needUpdate == false here intentionally
}
}
break;