DivestOS/Patches/LineageOS-20.0/android_frameworks_base/0007-Always_Restict_Serial.patch
Tavi 4020f2cbaa
18.1/19.1/20.0: January ASB picks
Signed-off-by: Tavi <tavi@divested.dev>
2024-01-07 20:56:01 -05:00

30 lines
1.6 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Daniel Micay <danielmicay@gmail.com>
Date: Wed, 6 Sep 2017 21:40:48 -0400
Subject: [PATCH] always set deprecated Build.SERIAL to UNKNOWN
Only support fetching the serial number via the new Build.getSerial()
requiring the READ_PHONE_STATE permission.
---
.../java/com/android/server/am/ActivityManagerService.java | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index 70bef605b567..7605d05d6287 100644
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -4866,12 +4866,7 @@ public class ActivityManagerService extends IActivityManager.Stub
ProfilerInfo profilerInfo = mAppProfiler.setupProfilerInfoLocked(thread, app, instr);
- // We deprecated Build.SERIAL and it is not accessible to
- // Instant Apps and target APIs higher than O MR1. Since access to the serial
- // is now behind a permission we push down the value.
- final String buildSerial = (!appInfo.isInstantApp()
- && appInfo.targetSdkVersion < Build.VERSION_CODES.P)
- ? sTheRealBuildSerial : Build.UNKNOWN;
+ final String buildSerial = Build.UNKNOWN;
// Figure out whether the app needs to run in autofill compat mode.
AutofillOptions autofillOptions = null;