[automerge] [RESTRICT AUTOMERGE][pm] still allow debuggable for system app downgrades 2p: 636cdf22b9
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21266989 Bug: 267232653 Bug: 256202273 Change-Id: Iba1c01bf07da821a05d3439df54e811ccfdf4505
This commit is contained in:
@@ -26891,10 +26891,13 @@ public class PackageManagerService extends IPackageManager.Stub
|
|||||||
if (disabledPs != null) {
|
if (disabledPs != null) {
|
||||||
dataOwnerPkg = disabledPs.getPkg();
|
dataOwnerPkg = disabledPs.getPkg();
|
||||||
}
|
}
|
||||||
|
if (!Build.IS_DEBUGGABLE && !dataOwnerPkg.isDebuggable()) {
|
||||||
|
// Only restrict non-debuggable builds and non-debuggable version of the app
|
||||||
try {
|
try {
|
||||||
checkDowngrade(dataOwnerPkg, pkgLite);
|
checkDowngrade(dataOwnerPkg, pkgLite);
|
||||||
} catch (PackageManagerException e) {
|
} catch (PackageManagerException e) {
|
||||||
String errorMsg = "System app: " + packageName + " cannot be downgraded to"
|
String errorMsg = "System app: " + packageName
|
||||||
|
+ " cannot be downgraded to"
|
||||||
+ " older than its preloaded version on the system image. "
|
+ " older than its preloaded version on the system image. "
|
||||||
+ e.getMessage();
|
+ e.getMessage();
|
||||||
Slog.w(TAG, errorMsg);
|
Slog.w(TAG, errorMsg);
|
||||||
@@ -26903,6 +26906,7 @@ public class PackageManagerService extends IPackageManager.Stub
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return PackageManager.INSTALL_SUCCEEDED;
|
return PackageManager.INSTALL_SUCCEEDED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user