summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Songchun Fan <schfan@google.com> 2020-04-17 14:04:55 -0700
committer Songchun Fan <schfan@google.com> 2020-04-22 15:30:06 -0700
commit4f9bf27edd65eab9d64162c70db34656ddcd8481 (patch)
treed375fd9421d1b24f51eb233825191f1414d6f1ab
parent8650e9aa11e3ad5c72b11e651170060d9fa19cde (diff)
[pm] restore ABI info on system stub install after update removal
Fix a boolean check BUG: 153001171 Test: manual with installing an update and uninstall it for webview. Change-Id: I83bd4d2e235a359ea09846cedf5010f4bf314c67
-rw-r--r--services/core/java/com/android/server/pm/PackageManagerService.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java
index 7adafe3ed658..822bd4dbb554 100644
--- a/services/core/java/com/android/server/pm/PackageManagerService.java
+++ b/services/core/java/com/android/server/pm/PackageManagerService.java
@@ -11203,8 +11203,16 @@ public class PackageManagerService extends IPackageManager.Stub
boolean needToDeriveAbi = (scanFlags & SCAN_FIRST_BOOT_OR_UPGRADE) != 0;
if (!needToDeriveAbi) {
if (pkgSetting != null) {
- primaryCpuAbiFromSettings = pkgSetting.primaryCpuAbiString;
- secondaryCpuAbiFromSettings = pkgSetting.secondaryCpuAbiString;
+ // TODO(b/154610922): if it is not first boot or upgrade, we should directly use
+ // API info from existing package setting. However, stub packages currently do not
+ // preserve ABI info, thus the special condition check here. Remove the special
+ // check after we fix the stub generation.
+ if (pkgSetting.pkg != null && pkgSetting.pkg.isStub()) {
+ needToDeriveAbi = true;
+ } else {
+ primaryCpuAbiFromSettings = pkgSetting.primaryCpuAbiString;
+ secondaryCpuAbiFromSettings = pkgSetting.secondaryCpuAbiString;
+ }
} else {
// Re-scanning a system package after uninstalling updates; need to derive ABI
needToDeriveAbi = true;