frameworks/base: Add patch for using ro.build.version.incremental to trigger OTA
This commit is contained in:
parent
43a3af91c0
commit
ec7870219a
|
@ -1,7 +1,7 @@
|
|||
From a26d483d257bdb33553f43719cdad0b392fc6ea4 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Cai <peter@typeblog.net>
|
||||
Date: Tue, 12 Oct 2021 21:37:22 -0400
|
||||
Subject: [PATCH 1/3] PackageParser: support glob matching for properties
|
||||
Subject: [PATCH 1/4] PackageParser: support glob matching for properties
|
||||
|
||||
Needed to make phh's vendor overlays work
|
||||
---
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From 4182ca99bed1bed96178c382a75d4f747f206b1e Mon Sep 17 00:00:00 2001
|
||||
From: Danny Lin <danny@kdrag0n.dev>
|
||||
Date: Sat, 7 Nov 2020 23:47:30 -0800
|
||||
Subject: [PATCH 2/3] core: Use real security patch level property
|
||||
Subject: [PATCH 2/4] core: Use real security patch level property
|
||||
|
||||
The standard platform security patch level property may not reflect the
|
||||
real patch level due to SafetyNet hacks, so we need to check the custom
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From b2c3942e6eb0f899039f6be96f87b7b0727b41d3 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Cai <peter@typeblog.net>
|
||||
Date: Wed, 1 Jun 2022 16:56:20 -0400
|
||||
Subject: [PATCH 3/3] Implement a persistent property to override the default
|
||||
Subject: [PATCH 3/4] Implement a persistent property to override the default
|
||||
primary camera (0)
|
||||
|
||||
Change-Id: I49b45d00bf71d7932591b3516d49a680e1b6568b
|
||||
|
|
|
@ -0,0 +1,273 @@
|
|||
From 6da03d0eadcabe836e71d2d88d7d2d057ba9efa4 Mon Sep 17 00:00:00 2001
|
||||
From: dhacker29 <dhackerdvm@gmail.com>
|
||||
Date: Tue, 24 Nov 2015 01:53:47 -0500
|
||||
Subject: [PATCH 4/4] fw/b: Use ro.build.version.incremental to signal OTA
|
||||
upgrades
|
||||
|
||||
Squash of:
|
||||
|
||||
Author: dhacker29 <dhackerdvm@gmail.com>
|
||||
Date: Tue Nov 24 01:53:47 2015 -0500
|
||||
Core: Use ro.build.date to signal mIsUpgrade
|
||||
|
||||
M: We use a static fingerprint that is only changed when a new OEM build is released, so
|
||||
every flash shows Android is starting instead of upgrading. This will fix that.
|
||||
N: even though we dont have the dexopt sceen on N, this is still needed to delete the
|
||||
correct caches, and grant/deny specific runtime permissions like a true oem update
|
||||
would do.
|
||||
Updated for Nougat By: BeansTown106
|
||||
|
||||
Change-Id: I0e3ed5c8f0351e48944432ae6a0c5194ddeff1fa
|
||||
|
||||
Author: Sam Mortimer <sam@mortimer.me.uk>
|
||||
Date: Fri Sep 28 13:45:00 2018 -0700
|
||||
fw/b UserManagerService: Use ro.build.date to signal upgrades
|
||||
|
||||
*) We changed PackageManagerService to use Build.DATE instead of
|
||||
Build.FINGERPRINT to detect upgrade. Do the same for
|
||||
UserManagerService.
|
||||
*) Affects generation of preboot intent and app data migration.
|
||||
|
||||
Change-Id: I56887b7ca842afdcf3cf84b27b4c04667cf43307
|
||||
|
||||
Author: Wang Han <416810799@qq.com>
|
||||
Date: Sat Dec 29 23:33:20 2018 +0800
|
||||
ShortcutService: Use ro.build.date to signal package scanning
|
||||
|
||||
* Affects system apps scanning.
|
||||
|
||||
Change-Id: I5f6d6647929f5b5ae7e820b18e95bf5ed2ec8d1c
|
||||
|
||||
Author: maxwen <max.weninger@gmail.com>
|
||||
Date: Tue Nov 19 01:02:01 2019 +0100
|
||||
base: Use ro.build.date to clear cache dirs on update
|
||||
|
||||
instead of using ro.build.fingerprint we explictly need to use ro.build.date
|
||||
|
||||
Change-Id: Ib3e80e58eb8c9a21c108e9f5cd2dbdb7ada8e3a4
|
||||
|
||||
Author: maxwen <max.weninger@gmail.com>
|
||||
Date: Wed Oct 28 07:07:10 2020 -0400
|
||||
One more Build.FINGERPRINT to Build.DATE change
|
||||
|
||||
Change-Id: I13dbf3d7f6587d3fcd6591cc0f861b34b6d5561c
|
||||
|
||||
Change-Id: If0eb969ba509981f9209ffa37a949d9042ef4c2a
|
||||
---
|
||||
.../android/app/admin/SystemUpdateInfo.java | 4 ++--
|
||||
.../com/android/server/am/UserController.java | 2 +-
|
||||
.../server/pm/PackageManagerService.java | 24 ++++++++++---------
|
||||
.../java/com/android/server/pm/Settings.java | 6 ++---
|
||||
.../android/server/pm/ShortcutService.java | 2 +-
|
||||
.../android/server/pm/UserManagerService.java | 10 ++++----
|
||||
6 files changed, 26 insertions(+), 22 deletions(-)
|
||||
|
||||
diff --git a/core/java/android/app/admin/SystemUpdateInfo.java b/core/java/android/app/admin/SystemUpdateInfo.java
|
||||
index b88bf76c96ca..fdf2b3f54311 100644
|
||||
--- a/core/java/android/app/admin/SystemUpdateInfo.java
|
||||
+++ b/core/java/android/app/admin/SystemUpdateInfo.java
|
||||
@@ -132,7 +132,7 @@ public final class SystemUpdateInfo implements Parcelable {
|
||||
out.startTag(null, tag);
|
||||
out.attributeLong(null, ATTR_RECEIVED_TIME, mReceivedTime);
|
||||
out.attributeInt(null, ATTR_SECURITY_PATCH_STATE, mSecurityPatchState);
|
||||
- out.attribute(null, ATTR_ORIGINAL_BUILD , Build.FINGERPRINT);
|
||||
+ out.attribute(null, ATTR_ORIGINAL_BUILD , Build.VERSION.INCREMENTAL);
|
||||
out.endTag(null, tag);
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ public final class SystemUpdateInfo implements Parcelable {
|
||||
public static SystemUpdateInfo readFromXml(TypedXmlPullParser parser) {
|
||||
// If an OTA has been applied (build fingerprint has changed), discard stale info.
|
||||
final String buildFingerprint = parser.getAttributeValue(null, ATTR_ORIGINAL_BUILD );
|
||||
- if (!Build.FINGERPRINT.equals(buildFingerprint)) {
|
||||
+ if (!Build.VERSION.INCREMENTAL.equals(buildFingerprint)) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
diff --git a/services/core/java/com/android/server/am/UserController.java b/services/core/java/com/android/server/am/UserController.java
|
||||
index b28b1a66cd97..4187a1387f02 100644
|
||||
--- a/services/core/java/com/android/server/am/UserController.java
|
||||
+++ b/services/core/java/com/android/server/am/UserController.java
|
||||
@@ -711,7 +711,7 @@ class UserController implements Handler.Callback {
|
||||
// purposefully block sending BOOT_COMPLETED until after all
|
||||
// PRE_BOOT receivers are finished to avoid ANR'ing apps
|
||||
final UserInfo info = getUserInfo(userId);
|
||||
- if (!Objects.equals(info.lastLoggedInFingerprint, Build.FINGERPRINT)
|
||||
+ if (!Objects.equals(info.lastLoggedInFingerprint, Build.VERSION.INCREMENTAL)
|
||||
|| SystemProperties.getBoolean("persist.pm.mock-upgrade", false)) {
|
||||
// Suppress double notifications for managed profiles that
|
||||
// were unlocked automatically as part of their parent user
|
||||
diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java
|
||||
index 88435c12f0a7..048987482e65 100644
|
||||
--- a/services/core/java/com/android/server/pm/PackageManagerService.java
|
||||
+++ b/services/core/java/com/android/server/pm/PackageManagerService.java
|
||||
@@ -7126,7 +7126,7 @@ public class PackageManagerService extends IPackageManager.Stub
|
||||
}
|
||||
|
||||
PackageManagerService m = new PackageManagerService(injector, onlyCore, factoryTest,
|
||||
- Build.FINGERPRINT, Build.IS_ENG, Build.IS_USERDEBUG, Build.VERSION.SDK_INT,
|
||||
+ Build.VERSION.INCREMENTAL, Build.IS_ENG, Build.IS_USERDEBUG, Build.VERSION.SDK_INT,
|
||||
Build.VERSION.INCREMENTAL);
|
||||
t.traceEnd(); // "create package manager"
|
||||
|
||||
@@ -7616,7 +7616,7 @@ public class PackageManagerService extends IPackageManager.Stub
|
||||
!buildFingerprint.equals(ver.fingerprint);
|
||||
if (mIsUpgrade) {
|
||||
PackageManagerServiceUtils.logCriticalInfo(Log.INFO,
|
||||
- "Upgrading from " + ver.fingerprint + " to " + Build.FINGERPRINT);
|
||||
+ "Upgrading from " + ver.fingerprint + " to " + Build.VERSION.INCREMENTAL);
|
||||
}
|
||||
|
||||
// when upgrading from pre-M, promote system app permissions from install to runtime
|
||||
@@ -8003,8 +8003,9 @@ public class PackageManagerService extends IPackageManager.Stub
|
||||
// allow... it would be nice to have some better way to handle
|
||||
// this situation.
|
||||
if (mIsUpgrade) {
|
||||
- Slog.i(TAG, "Build fingerprint changed from " + ver.fingerprint + " to "
|
||||
- + Build.FINGERPRINT + "; regranting permissions for internal storage");
|
||||
+ Slog.i(TAG, "Build incremental version changed from " + ver.fingerprint + " to "
|
||||
+ + Build.VERSION.INCREMENTAL +
|
||||
+ "; regranting permissions for internal storage");
|
||||
}
|
||||
mPermissionManager.onStorageVolumeMounted(
|
||||
StorageManager.UUID_PRIVATE_INTERNAL, mIsUpgrade);
|
||||
@@ -8087,7 +8088,7 @@ public class PackageManagerService extends IPackageManager.Stub
|
||||
// across OTAs and are used to drive profile verification (post OTA) and
|
||||
// profile compilation (without waiting to collect a fresh set of profiles).
|
||||
if (mIsUpgrade && !mOnlyCore) {
|
||||
- Slog.i(TAG, "Build fingerprint changed; clearing code caches");
|
||||
+ Slog.i(TAG, "Build incremental version changed; clearing code caches");
|
||||
for (int i = 0; i < packageSettings.size(); i++) {
|
||||
final PackageSetting ps = packageSettings.valueAt(i);
|
||||
if (Objects.equals(StorageManager.UUID_PRIVATE_INTERNAL, ps.volumeUuid)) {
|
||||
@@ -8098,7 +8099,7 @@ public class PackageManagerService extends IPackageManager.Stub
|
||||
| Installer.FLAG_CLEAR_APP_DATA_KEEP_ART_PROFILES);
|
||||
}
|
||||
}
|
||||
- ver.fingerprint = Build.FINGERPRINT;
|
||||
+ ver.fingerprint = Build.VERSION.INCREMENTAL;
|
||||
}
|
||||
|
||||
// Legacy existing (installed before Q) non-system apps to hide
|
||||
@@ -8535,7 +8536,7 @@ public class PackageManagerService extends IPackageManager.Stub
|
||||
// identify cached items. In particular, changing the value of certain
|
||||
// feature flags should cause us to invalidate any caches.
|
||||
final String cacheName = FORCE_PACKAGE_PARSED_CACHE_ENABLED ? "debug"
|
||||
- : SystemProperties.digestOf("ro.build.fingerprint");
|
||||
+ : SystemProperties.digestOf("ro.build.version.incremental");
|
||||
|
||||
// Reconcile cache directories, keeping only what we'd actually use.
|
||||
for (File cacheDir : FileUtils.listFilesOrEmpty(cacheBaseDir)) {
|
||||
@@ -25579,7 +25580,7 @@ public class PackageManagerService extends IPackageManager.Stub
|
||||
Slog.w(TAG, "Failed to scan " + ps.getPath() + ": " + e.getMessage());
|
||||
}
|
||||
|
||||
- if (!Build.FINGERPRINT.equals(ver.fingerprint)) {
|
||||
+ if (!Build.VERSION.INCREMENTAL.equals(ver.fingerprint)) {
|
||||
clearAppDataLIF(ps.pkg, UserHandle.USER_ALL, FLAG_STORAGE_DE | FLAG_STORAGE_CE
|
||||
| FLAG_STORAGE_EXTERNAL | Installer.FLAG_CLEAR_CODE_CACHE_ONLY
|
||||
| Installer.FLAG_CLEAR_APP_DATA_KEEP_ART_PROFILES);
|
||||
@@ -25614,10 +25615,11 @@ public class PackageManagerService extends IPackageManager.Stub
|
||||
}
|
||||
|
||||
synchronized (mLock) {
|
||||
- final boolean isUpgrade = !Build.FINGERPRINT.equals(ver.fingerprint);
|
||||
+ final boolean isUpgrade = !Build.VERSION.INCREMENTAL.equals(ver.fingerprint);
|
||||
if (isUpgrade) {
|
||||
- logCriticalInfo(Log.INFO, "Build fingerprint changed from " + ver.fingerprint
|
||||
- + " to " + Build.FINGERPRINT + "; regranting permissions for "
|
||||
+ logCriticalInfo(Log.INFO, "Build incremental version changed from "
|
||||
+ + ver.fingerprint
|
||||
+ + " to " + Build.VERSION.INCREMENTAL + "; regranting permissions for "
|
||||
+ volumeUuid);
|
||||
}
|
||||
mPermissionManager.onStorageVolumeMounted(volumeUuid, isUpgrade);
|
||||
diff --git a/services/core/java/com/android/server/pm/Settings.java b/services/core/java/com/android/server/pm/Settings.java
|
||||
index 26aebbc1ea93..3bf3e1a1e3a3 100644
|
||||
--- a/services/core/java/com/android/server/pm/Settings.java
|
||||
+++ b/services/core/java/com/android/server/pm/Settings.java
|
||||
@@ -433,7 +433,7 @@ public final class Settings implements Watchable, Snappable {
|
||||
public void forceCurrent() {
|
||||
sdkVersion = Build.VERSION.SDK_INT;
|
||||
databaseVersion = CURRENT_DATABASE_VERSION;
|
||||
- fingerprint = Build.FINGERPRINT;
|
||||
+ fingerprint = Build.VERSION.INCREMENTAL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2972,7 +2972,7 @@ public final class Settings implements Watchable, Snappable {
|
||||
// on update drop the files before loading them.
|
||||
if (PackageManagerService.CLEAR_RUNTIME_PERMISSIONS_ON_UPGRADE) {
|
||||
final VersionInfo internal = getInternalVersion();
|
||||
- if (!Build.FINGERPRINT.equals(internal.fingerprint)) {
|
||||
+ if (!Build.VERSION.INCREMENTAL.equals(internal.fingerprint)) {
|
||||
for (UserInfo user : users) {
|
||||
mRuntimePermissionsPersistence.deleteUserRuntimePermissionsFile(user.id);
|
||||
}
|
||||
@@ -5346,7 +5346,7 @@ public final class Settings implements Watchable, Snappable {
|
||||
}
|
||||
|
||||
private String getExtendedFingerprint(long version) {
|
||||
- return Build.FINGERPRINT + "?pc_version=" + version;
|
||||
+ return Build.VERSION.INCREMENTAL + "?pc_version=" + version;
|
||||
}
|
||||
|
||||
public void writeStateForUserAsyncLPr(int userId) {
|
||||
diff --git a/services/core/java/com/android/server/pm/ShortcutService.java b/services/core/java/com/android/server/pm/ShortcutService.java
|
||||
index 62d6717e847a..4e9e7a026a90 100644
|
||||
--- a/services/core/java/com/android/server/pm/ShortcutService.java
|
||||
+++ b/services/core/java/com/android/server/pm/ShortcutService.java
|
||||
@@ -5240,7 +5240,7 @@ public class ShortcutService extends IShortcutService.Stub {
|
||||
|
||||
// Injection point.
|
||||
String injectBuildFingerprint() {
|
||||
- return Build.FINGERPRINT;
|
||||
+ return Build.VERSION.INCREMENTAL;
|
||||
}
|
||||
|
||||
final void wtf(String message) {
|
||||
diff --git a/services/core/java/com/android/server/pm/UserManagerService.java b/services/core/java/com/android/server/pm/UserManagerService.java
|
||||
index 6d8137e74061..826370006dca 100644
|
||||
--- a/services/core/java/com/android/server/pm/UserManagerService.java
|
||||
+++ b/services/core/java/com/android/server/pm/UserManagerService.java
|
||||
@@ -3657,7 +3657,7 @@ public class UserManagerService extends IUserManager.Stub {
|
||||
userInfo.creationTime = getCreationTime();
|
||||
userInfo.partial = true;
|
||||
userInfo.preCreated = preCreate;
|
||||
- userInfo.lastLoggedInFingerprint = Build.FINGERPRINT;
|
||||
+ userInfo.lastLoggedInFingerprint = Build.VERSION.INCREMENTAL;
|
||||
if (userTypeDetails.hasBadge() && parentId != UserHandle.USER_NULL) {
|
||||
userInfo.profileBadge = getFreeProfileBadgeLU(parentId, userType);
|
||||
}
|
||||
@@ -4785,7 +4785,8 @@ public class UserManagerService extends IUserManager.Stub {
|
||||
t.traceBegin("onBeforeStartUser-" + userId);
|
||||
final int userSerial = userInfo.serialNumber;
|
||||
// Migrate only if build fingerprints mismatch
|
||||
- boolean migrateAppsData = !Build.FINGERPRINT.equals(userInfo.lastLoggedInFingerprint);
|
||||
+ boolean migrateAppsData =
|
||||
+ !Build.VERSION.INCREMENTAL.equals(userInfo.lastLoggedInFingerprint);
|
||||
t.traceBegin("prepareUserData");
|
||||
mUserDataPreparer.prepareUserData(userId, userSerial, StorageManager.FLAG_STORAGE_DE);
|
||||
t.traceEnd();
|
||||
@@ -4814,7 +4815,8 @@ public class UserManagerService extends IUserManager.Stub {
|
||||
}
|
||||
final int userSerial = userInfo.serialNumber;
|
||||
// Migrate only if build fingerprints mismatch
|
||||
- boolean migrateAppsData = !Build.FINGERPRINT.equals(userInfo.lastLoggedInFingerprint);
|
||||
+ boolean migrateAppsData =
|
||||
+ !Build.VERSION.INCREMENTAL.equals(userInfo.lastLoggedInFingerprint);
|
||||
mUserDataPreparer.prepareUserData(userId, userSerial, StorageManager.FLAG_STORAGE_CE);
|
||||
|
||||
StorageManagerInternal smInternal = LocalServices.getService(StorageManagerInternal.class);
|
||||
@@ -4851,7 +4853,7 @@ public class UserManagerService extends IUserManager.Stub {
|
||||
if (now > EPOCH_PLUS_30_YEARS) {
|
||||
userData.info.lastLoggedInTime = now;
|
||||
}
|
||||
- userData.info.lastLoggedInFingerprint = Build.FINGERPRINT;
|
||||
+ userData.info.lastLoggedInFingerprint = Build.VERSION.INCREMENTAL;
|
||||
scheduleWriteUser(userData);
|
||||
}
|
||||
|
||||
--
|
||||
2.36.1
|
||||
|
Loading…
Reference in New Issue