diff options
| -rw-r--r-- | services/core/java/com/android/server/pm/Settings.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/pm/Settings.java b/services/core/java/com/android/server/pm/Settings.java index 898ecf3c26d2..f8bf9c45e8b1 100644 --- a/services/core/java/com/android/server/pm/Settings.java +++ b/services/core/java/com/android/server/pm/Settings.java @@ -844,7 +844,12 @@ public final class Settings { } // If what we are scanning is a system (and possibly privileged) package, // then make it so, regardless of whether it was previously installed only - // in the data partition. + // in the data partition. Reset first. + pkgSetting.pkgFlags &= ~ApplicationInfo.FLAG_SYSTEM; + pkgSetting.pkgPrivateFlags &= ~(ApplicationInfo.PRIVATE_FLAG_PRIVILEGED + | ApplicationInfo.PRIVATE_FLAG_OEM + | ApplicationInfo.PRIVATE_FLAG_VENDOR + | ApplicationInfo.PRIVATE_FLAG_PRODUCT); pkgSetting.pkgFlags |= pkgFlags & ApplicationInfo.FLAG_SYSTEM; pkgSetting.pkgPrivateFlags |= pkgPrivateFlags & ApplicationInfo.PRIVATE_FLAG_PRIVILEGED; |