[pm] still allow debuggable for system app downgrades
Turns out we do have internal tests that downgrades system apps, so adding this exception to allow for that. BUG: 267232653 BUG: 256202273 Test: manual Change-Id: Ie281bbdc8788ee64ff99a7c5150da7ce7926235e
This commit is contained in:
committed by
Song Chun Fan
parent
1ba51e8e6d
commit
ceeca68b8c
@@ -2570,15 +2570,19 @@ final class InstallPackageHelper {
|
||||
if (disabledPs != null) {
|
||||
dataOwnerPkg = disabledPs.getPkg();
|
||||
}
|
||||
try {
|
||||
PackageManagerServiceUtils.checkDowngrade(dataOwnerPkg, pkgLite);
|
||||
} catch (PackageManagerException e) {
|
||||
String errorMsg = "System app: " + packageName + " cannot be downgraded to"
|
||||
+ " older than its preloaded version on the system image. "
|
||||
+ e.getMessage();
|
||||
Slog.w(TAG, errorMsg);
|
||||
return Pair.create(
|
||||
PackageManager.INSTALL_FAILED_VERSION_DOWNGRADE, errorMsg);
|
||||
if (!Build.IS_DEBUGGABLE && !dataOwnerPkg.isDebuggable()) {
|
||||
// Only restrict non-debuggable builds and non-debuggable version of the app
|
||||
try {
|
||||
PackageManagerServiceUtils.checkDowngrade(dataOwnerPkg, pkgLite);
|
||||
} catch (PackageManagerException e) {
|
||||
String errorMsg =
|
||||
"System app: " + packageName + " cannot be downgraded to"
|
||||
+ " older than its preloaded version on the system"
|
||||
+ " image. " + e.getMessage();
|
||||
Slog.w(TAG, errorMsg);
|
||||
return Pair.create(
|
||||
PackageManager.INSTALL_FAILED_VERSION_DOWNGRADE, errorMsg);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user