Changes for April 2024

This commit is contained in:
Andy CrossGate Yan
2024-04-21 16:27:08 +08:00
parent dbc6fa9ce3
commit 101f11cb07
49 changed files with 272 additions and 115897 deletions

View File

@@ -1,7 +1,7 @@
From 3ef127e42298fa7ea378186cde99459424dba137 Mon Sep 17 00:00:00 2001
From 03045580151af4e94d9e99cd52a29e1430dd9aae Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Tue, 5 Oct 2021 17:59:16 -0400
Subject: [PATCH 01/35] Fallback to stupid autobrightness if brightness values
Subject: [PATCH 01/34] Fallback to stupid autobrightness if brightness values
are broken
This is needed because of:
@@ -32,5 +32,5 @@ index 255494f98667..022870870222 100644
config = getConfigFromPmValues(context);
}
--
2.25.1
2.34.1

View File

@@ -1,7 +1,7 @@
From 89b38938e3470b765f036d17c2f6c11c95fdcd22 Mon Sep 17 00:00:00 2001
From 48842a510804a982dfebd825b9de10227fb155e6 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Tue, 28 Nov 2017 18:28:04 +0100
Subject: [PATCH 02/35] Relax requirement for visible flag to sdcards
Subject: [PATCH 02/34] Relax requirement for visible flag to sdcards
The vast majority of sdcard readers are stable enough to be declared by
the API. (I see no counter-example)
@@ -27,5 +27,5 @@ index 85f74e3ee169..5e4b1791d13f 100644
} else if (vol.disk.isSd()) {
vol.mountFlags |= VolumeInfo.MOUNT_FLAG_VISIBLE;
--
2.25.1
2.34.1

View File

@@ -1,7 +1,7 @@
From 698fa45b258f1770e51091f619237a56a558dba7 Mon Sep 17 00:00:00 2001
From 19d8799aa0c975b9ddb9b46bf76312151c180148 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Thu, 17 May 2018 20:28:35 +0200
Subject: [PATCH 03/35] Don't crash if there is IR HAL is not declared
Subject: [PATCH 03/34] Don't crash if there is IR HAL is not declared
Change-Id: I3afded27441bbee8244d5fda544b3e6d1238dc1b
---
@@ -41,5 +41,5 @@ index 2ca348b3ae46..148fba9a688c 100644
}
--
2.25.1
2.34.1

View File

@@ -1,7 +1,7 @@
From 0741a644a5d038b31f3f6df1a9ad03228de620c2 Mon Sep 17 00:00:00 2001
From 29341ad5f5f5e19364df075b2b30ad9dd73a0451 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Mon, 6 Aug 2018 12:49:00 +0200
Subject: [PATCH 04/35] Show APN Settings for CDMA carriers
Subject: [PATCH 04/34] Show APN Settings for CDMA carriers
---
telephony/java/android/telephony/CarrierConfigManager.java | 2 +-
@@ -21,5 +21,5 @@ index 1ca251d370ab..cb05839ba220 100644
sDefaults.putBoolean(KEY_SMS_REQUIRES_DESTINATION_NUMBER_CONVERSION_BOOL, false);
sDefaults.putBoolean(KEY_SUPPORT_EMERGENCY_SMS_OVER_IMS_BOOL, false);
--
2.25.1
2.34.1

View File

@@ -1,7 +1,7 @@
From 298e26f824578dc6949cf6e844295821c324f432 Mon Sep 17 00:00:00 2001
From b8a724815836fe9eadae760a43c8a58ed017dd0d Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Thu, 8 Nov 2018 23:04:03 +0100
Subject: [PATCH 05/35] Re-order services so that it works even without qtaguid
Subject: [PATCH 05/34] Re-order services so that it works even without qtaguid
Change-Id: I0c0f527b3ae151d45c68f7ac6c205da3f34e74df
---
@@ -35,5 +35,5 @@ index 7d70b6d73497..3faace448bb5 100644
synchronized (mNetworkPoliciesSecondLock) {
updatePowerSaveWhitelistUL();
--
2.25.1
2.34.1

View File

@@ -1,7 +1,7 @@
From 34a2141186d697e13c7085b4b194dfa23d959549 Mon Sep 17 00:00:00 2001
From 8424f81c8b318f26ca7eb70cc3a96b15fe8a1d80 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Sun, 24 Mar 2019 23:05:14 +0100
Subject: [PATCH 06/35] Support samsung Pie and Q light hal
Subject: [PATCH 06/34] Support samsung Pie and Q light hal
Change-Id: I01f94acd7d0672733e48854d80368f9ac6f861c6
---
@@ -10,10 +10,10 @@ Change-Id: I01f94acd7d0672733e48854d80368f9ac6f861c6
2 files changed, 53 insertions(+)
diff --git a/services/core/jni/Android.bp b/services/core/jni/Android.bp
index 53401fd47178..59256cc73df1 100644
index b8d3eed46705..69ff0f5cbedd 100644
--- a/services/core/jni/Android.bp
+++ b/services/core/jni/Android.bp
@@ -183,6 +183,8 @@ cc_defaults {
@@ -190,6 +190,8 @@ cc_defaults {
"android.system.suspend.control.internal-cpp",
"android.system.suspend@1.0",
"service.incremental",
@@ -101,5 +101,5 @@ index 35d8219651d7..b45b2137d0e6 100644
LightState state = constructState(
colorARGB, flashMode, onMS, offMS, brightnessMode);
--
2.25.1
2.34.1

View File

@@ -1,7 +1,7 @@
From e6b2a294c9a2fa8c688c9a99a889d205ae68a4ee Mon Sep 17 00:00:00 2001
From 3fe86386f385bc213db080c6bfd8b07dc9cf95af Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Mon, 12 Aug 2019 23:08:26 +0200
Subject: [PATCH 07/35] Add support for samsung touch, physical and hover
Subject: [PATCH 07/34] Add support for samsung touch, physical and hover
proximity sensor as fallback to real proximity sensor
Change-Id: I7a0f8b4665c802140d19197d850b77b2a7ac1865
@@ -63,5 +63,5 @@ index d590ae8fa6d0..2bdad4cf61e2 100644
boolean positive = distance >= 0.0f && distance < mProximityThreshold;
handleProximitySensorEvent(time, positive);
--
2.25.1
2.34.1

View File

@@ -1,7 +1,7 @@
From 725e5dc4ce032c2541005b3a8db0124649ee7a72 Mon Sep 17 00:00:00 2001
From 79eac5eecdd497119f262a2d1ffae68607739cad Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Sun, 5 Apr 2020 16:32:46 +0200
Subject: [PATCH 08/35] Always allow overriding the number of work profiles
Subject: [PATCH 08/34] Always allow overriding the number of work profiles
Change-Id: I6eb09aa71663c6fbe7563e3038bffcabdba0ff6a
---
@@ -9,10 +9,10 @@ Change-Id: I6eb09aa71663c6fbe7563e3038bffcabdba0ff6a
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/services/core/java/com/android/server/pm/UserManagerService.java b/services/core/java/com/android/server/pm/UserManagerService.java
index dbc4c22f6609..f32c6e014fe1 100644
index 08b9ee9a06e8..925a63a97dd1 100644
--- a/services/core/java/com/android/server/pm/UserManagerService.java
+++ b/services/core/java/com/android/server/pm/UserManagerService.java
@@ -5908,12 +5908,8 @@ public class UserManagerService extends IUserManager.Stub {
@@ -5926,12 +5926,8 @@ public class UserManagerService extends IUserManager.Stub {
*/
private static int getMaxUsersOfTypePerParent(UserTypeDetails userTypeDetails) {
final int defaultMax = userTypeDetails.getMaxAllowedPerParent();
@@ -28,5 +28,5 @@ index dbc4c22f6609..f32c6e014fe1 100644
return defaultMax;
}
--
2.25.1
2.34.1

View File

@@ -1,7 +1,7 @@
From 52e0d6e8b64f763e778ae2ba586530ec07ee183f Mon Sep 17 00:00:00 2001
From e270f843d51fd4f0e6c18ea81a060de5848eaa2a Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Sat, 6 Jun 2020 18:21:56 +0200
Subject: [PATCH 09/35] HOME deserves to wake-up devices just as well as back
Subject: [PATCH 09/34] HOME deserves to wake-up devices just as well as back
and menu
Change-Id: Ia562bafd8c620d00c17e8eb338e4701c6c4a3c3a
@@ -22,5 +22,5 @@ index 63fa3323b5b5..b1a845990df3 100644
case KeyEvent.KEYCODE_STEM_1:
case KeyEvent.KEYCODE_STEM_2:
--
2.25.1
2.34.1

View File

@@ -1,7 +1,7 @@
From f75c51d6ad79690ea7670821a0bcb78ff419b2d0 Mon Sep 17 00:00:00 2001
From 99e14a3ffe8061416fcccde37156c0b4f859bb2c Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Tue, 29 Sep 2020 22:39:47 +0200
Subject: [PATCH 10/35] Some devices have proximity sensor reporting NaN as max
Subject: [PATCH 10/34] Some devices have proximity sensor reporting NaN as max
range for some reason. Make them behave standard way by setting 5 cm
Change-Id: I3c39e3e914a05903c140235702e0480d2d58a612
@@ -24,5 +24,5 @@ index 2bdad4cf61e2..c418e446d48a 100644
}
--
2.25.1
2.34.1

View File

@@ -1,7 +1,7 @@
From eb2b5a69e99c21138e3d666c0dc21d7f0babe19a Mon Sep 17 00:00:00 2001
From b9039cf046bdde39c59e5276ad1167ef6336a80c Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Tue, 29 Sep 2020 22:40:10 +0200
Subject: [PATCH 11/35] Fix brightness range not being complete on Samsung
Subject: [PATCH 11/34] Fix brightness range not being complete on Samsung
devices
On some devices, minimum brightness is 0, which totally messes with
@@ -33,5 +33,5 @@ index 53b2b8ba5bda..07d858986539 100644
mContext.getResources().getInteger(com.android.internal.R.integer
.config_screenBrightnessSettingMaximum));
--
2.25.1
2.34.1

View File

@@ -1,7 +1,7 @@
From c155f5412d40bffe53e4efb3bf37d6489b053ee7 Mon Sep 17 00:00:00 2001
From a05a148250d7afbdf59776d8c8e5f98620caf28b Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Sun, 25 Oct 2020 23:57:26 +0100
Subject: [PATCH 12/35] Re-implement fnmatch-like behaviour for RRO java-side
Subject: [PATCH 12/34] Re-implement fnmatch-like behaviour for RRO java-side
Change-Id: Id38292a9a1453aa87b8401c1fdb390fa4e63c7d1
---
@@ -33,5 +33,5 @@ index f92c2951fdef..7ab0185e04bf 100644
}
return true;
--
2.25.1
2.34.1

View File

@@ -1,7 +1,7 @@
From c67644842d8ad141ebe666ae42333f8ec211768a Mon Sep 17 00:00:00 2001
From 3cdc100937182ba4844a47f902d503adc2f9ec92 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Sun, 6 Dec 2020 12:20:08 +0100
Subject: [PATCH 13/35] Make rounded corners padding overridable with
Subject: [PATCH 13/34] Make rounded corners padding overridable with
persist.sys.phh.rounded_corners_padding
Change-Id: I481c1c8849b2f22a7cdfb2896a6d3c2e7e3b44d9
@@ -62,7 +62,7 @@ index eb41536e21d0..b11843cd5d1f 100644
private void updateVisibilities() {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarContentInsetsProvider.kt b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarContentInsetsProvider.kt
index b7988bcc6f45..72b8e971306c 100644
index ac3eee12752a..7302ec5095d4 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarContentInsetsProvider.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarContentInsetsProvider.kt
@@ -23,7 +23,7 @@ import android.graphics.Rect
@@ -86,5 +86,5 @@ index b7988bcc6f45..72b8e971306c 100644
val minDotPadding = if (isPrivacyDotEnabled)
rotatedResources.getDimensionPixelSize(R.dimen.ongoing_appops_dot_min_padding)
--
2.25.1
2.34.1

View File

@@ -1,7 +1,7 @@
From 39fad63d453806ab6eac68d4c79a2e9c50c07302 Mon Sep 17 00:00:00 2001
From fc976607621ac9a5a07e3a3b0a53eb4285221691 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Fri, 11 Dec 2020 14:41:09 +0100
Subject: [PATCH 14/35] Remove useless notification about "console" service
Subject: [PATCH 14/34] Remove useless notification about "console" service
being running
---
@@ -9,10 +9,10 @@ Subject: [PATCH 14/35] Remove useless notification about "console" service
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index a32aa6d895ef..38553b8a5b46 100644
index 9a9c05060a4c..1b20157267ec 100644
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -4802,7 +4802,7 @@ public class ActivityManagerService extends IActivityManager.Stub
@@ -4849,7 +4849,7 @@ public class ActivityManagerService extends IActivityManager.Stub
}
private void showConsoleNotificationIfActive() {
@@ -22,5 +22,5 @@ index a32aa6d895ef..38553b8a5b46 100644
}
String title = mContext
--
2.25.1
2.34.1

View File

@@ -1,7 +1,7 @@
From 08ae2303cb18e3ecfab91c3e28689df1660cda83 Mon Sep 17 00:00:00 2001
From 49344fb50973bdf6a3edebd037e9ae185e500c75 Mon Sep 17 00:00:00 2001
From: Peter Cai <peter@typeblog.net>
Date: Wed, 16 Dec 2020 21:24:12 +0800
Subject: [PATCH 15/35] Revert "Remove unused SystemProperties.set"
Subject: [PATCH 15/34] Revert "Remove unused SystemProperties.set"
This reverts commit debb4616ef67f9ed5054eca51ec58592358ff55f.
@@ -91,5 +91,5 @@ index 8bc4d381e2dd..616ab6b22081 100644
* Inserts or updates a list property. Expands the list if its length is not enough.
*/
--
2.25.1
2.34.1

View File

@@ -1,7 +1,7 @@
From 2a94ed85920e4fa4e45b67e6aa7d69b15172aa2a Mon Sep 17 00:00:00 2001
From 8e0b5d7b8d3806a0eb009b7aaf39118120c29ebc Mon Sep 17 00:00:00 2001
From: Peter Cai <peter@typeblog.net>
Date: Wed, 16 Dec 2020 13:46:15 +0800
Subject: [PATCH 16/35] TelephonyManager: bring back getNetworkClass()
Subject: [PATCH 16/34] TelephonyManager: bring back getNetworkClass()
This partially reverts commit c058cac051ab083dc7fb7ea6aa85699110b2e9bf.
@@ -80,5 +80,5 @@ index 616ab6b22081..967ad10f697d 100644
* Returns a string representation of the radio technology (network type)
* currently in use on the device.
--
2.25.1
2.34.1

View File

@@ -1,7 +1,7 @@
From a85ce10c8a23579c5c2cb85891b84079109dcda2 Mon Sep 17 00:00:00 2001
From bd9d20237ad9642f397d93f6c9fda65810478888 Mon Sep 17 00:00:00 2001
From: Peter Cai <peter@typeblog.net>
Date: Wed, 16 Dec 2020 21:26:45 +0800
Subject: [PATCH 17/35] TelephonyManager: add API annotations for
Subject: [PATCH 17/34] TelephonyManager: add API annotations for
setTelephonyProperty
* This method was added back by reverting commit
@@ -37,5 +37,5 @@ index 967ad10f697d..e5b80e4cee30 100644
value = "";
}
--
2.25.1
2.34.1

View File

@@ -1,7 +1,7 @@
From b0cd7883fd66c27496d2ea3386f6060620cd572d Mon Sep 17 00:00:00 2001
From c436fa9426b2b269e6d631a35cf23f642a700b36 Mon Sep 17 00:00:00 2001
From: Alberto Ponces <ponces26@gmail.com>
Date: Tue, 2 Feb 2021 10:20:51 +0000
Subject: [PATCH 18/35] Fix Wakelock issue
Subject: [PATCH 18/34] Fix Wakelock issue
Prevent SystemUI crash due to "WakeLock under-locked Doze" (issue #12) by only releasing a wakelock that was not already released
---
@@ -24,5 +24,5 @@ index 8d77c4a194a9..e9f253433740 100644
/** @see PowerManager.WakeLock#wrap(Runnable) */
--
2.25.1
2.34.1

View File

@@ -1,7 +1,7 @@
From 889cea5c57d6c4e3900c22082f57af5a30798024 Mon Sep 17 00:00:00 2001
From 1c126b308b02da8a5a60515bb2ee9bc4b87adc42 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Sat, 20 Mar 2021 14:31:01 +0100
Subject: [PATCH 19/35] Automatically detect pick up sensor, so that an overlay
Subject: [PATCH 19/34] Automatically detect pick up sensor, so that an overlay
is required for the sole purpose of enabling pulse doze on pick up sensor
---
@@ -45,5 +45,5 @@ index 0b1ed65ef937..61a7522f38f4 100644
/** {@hide} */
--
2.25.1
2.34.1

View File

@@ -1,7 +1,7 @@
From 8edbad3ddd427e421d4b13f8b84566bfe58d3150 Mon Sep 17 00:00:00 2001
From f5530e7472dabf303731cdba67435e34443d275a Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Tue, 23 Mar 2021 19:43:26 +0100
Subject: [PATCH 20/35] Catch broken mainBuiltInDisplayCutoutRectApproximation
Subject: [PATCH 20/34] Catch broken mainBuiltInDisplayCutoutRectApproximation
Some devices (Redmi Note 9T) have:
mainBuiltInDisplayCutoutRectApproximation = @android:mainBuiltInDisplayCutout
@@ -44,5 +44,5 @@ index c1a5636b7b34..2f3d71c963c8 100644
/**
--
2.25.1
2.34.1

View File

@@ -1,7 +1,7 @@
From 8abd1e72a2cf0ea9a10e2f28136f795b1aeec5d7 Mon Sep 17 00:00:00 2001
From 42ba749331a9c3848d94689e3aca6cd4a6d627d7 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Sat, 24 Mar 2018 08:01:48 +0100
Subject: [PATCH 21/35] backlight: Fix backlight control on Galaxy S9(+)
Subject: [PATCH 21/34] backlight: Fix backlight control on Galaxy S9(+)
Change-Id: I1fbbb47939c377597ef8ad6b88b2acea5f4acaa6
@@ -117,5 +117,5 @@ index fea6b29d9260..caf9eba7d9a8 100644
color = 0xff000000 | (color << 16) | (color << 8) | color;
setLightLocked(color, LIGHT_FLASH_NONE, 0, 0, brightnessMode);
--
2.25.1
2.34.1

View File

@@ -1,161 +0,0 @@
From 41187ad1cdd62e7829a11a51241438025398c04b Mon Sep 17 00:00:00 2001
From: Danny Lin <danny@kdrag0n.dev>
Date: Sat, 16 Oct 2021 05:27:57 -0700
Subject: [PATCH 22/35] Add support for app signature spoofing
This is needed by microG GmsCore to pretend to be the official Google
Play Services package, because client apps check the package signature
to make sure it matches Google's official certificate.
This was forward-ported from the Android 10 patch by gudenau:
https://github.com/microg/android_packages_apps_GmsCore/pull/957
Changes made for Android 11:
- Updated PackageInfo calls
- Added new permission to public API surface, needed for
PermissionController which is now an updatable APEX on 11
- Added a dummy permission group to allow users to manage the
permission through the PermissionController UI
(by Vachounet <vachounet@live.fr>)
- Updated location provider comment for conciseness
Changes made for Android 12:
- Moved mayFakeSignature into lock-free Computer subclass
- Always get permissions for packages that request signature spoofing
(otherwise permissions are usually ommitted and thus the permission
check doesn't work properly)
- Optimize mayFakeSignature check order to improve performance
Link: https://github.com/microg/GmsCore/pull/1586
Change-Id: Ied7d6ce0b83a2d2345c3abba0429998d86494a88
---
core/api/current.txt | 2 ++
core/res/AndroidManifest.xml | 15 +++++++++
core/res/res/values/strings.xml | 12 +++++++
.../server/pm/PackageManagerService.java | 31 +++++++++++++++++--
4 files changed, 57 insertions(+), 3 deletions(-)
diff --git a/core/api/current.txt b/core/api/current.txt
index 1dd401d04e2b..ada2c59ff24c 100644
--- a/core/api/current.txt
+++ b/core/api/current.txt
@@ -84,6 +84,7 @@ package android {
field public static final String DUMP = "android.permission.DUMP";
field public static final String EXPAND_STATUS_BAR = "android.permission.EXPAND_STATUS_BAR";
field public static final String FACTORY_TEST = "android.permission.FACTORY_TEST";
+ field public static final String FAKE_PACKAGE_SIGNATURE = "android.permission.FAKE_PACKAGE_SIGNATURE";
field public static final String FOREGROUND_SERVICE = "android.permission.FOREGROUND_SERVICE";
field public static final String GET_ACCOUNTS = "android.permission.GET_ACCOUNTS";
field public static final String GET_ACCOUNTS_PRIVILEGED = "android.permission.GET_ACCOUNTS_PRIVILEGED";
@@ -200,6 +201,7 @@ package android {
field public static final String CALL_LOG = "android.permission-group.CALL_LOG";
field public static final String CAMERA = "android.permission-group.CAMERA";
field public static final String CONTACTS = "android.permission-group.CONTACTS";
+ field public static final String FAKE_PACKAGE = "android.permission-group.FAKE_PACKAGE";
field public static final String LOCATION = "android.permission-group.LOCATION";
field public static final String MICROPHONE = "android.permission-group.MICROPHONE";
field public static final String NEARBY_DEVICES = "android.permission-group.NEARBY_DEVICES";
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index cb6ef5a8f1ae..896c89bc5f50 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -3203,6 +3203,21 @@
android:description="@string/permdesc_getPackageSize"
android:protectionLevel="normal" />
+ <!-- Dummy user-facing group for faking package signature -->
+ <permission-group android:name="android.permission-group.FAKE_PACKAGE"
+ android:label="@string/permgrouplab_fake_package_signature"
+ android:description="@string/permgroupdesc_fake_package_signature"
+ android:request="@string/permgrouprequest_fake_package_signature"
+ android:priority="100" />
+
+ <!-- Allows an application to change the package signature as
+ seen by applications -->
+ <permission android:name="android.permission.FAKE_PACKAGE_SIGNATURE"
+ android:permissionGroup="android.permission-group.UNDEFINED"
+ android:protectionLevel="signature|privileged"
+ android:label="@string/permlab_fakePackageSignature"
+ android:description="@string/permdesc_fakePackageSignature" />
+
<!-- @deprecated No longer useful, see
{@link android.content.pm.PackageManager#addPackageToPreferred}
for details. -->
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index 166d6abd1809..cba87ff17600 100644
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -880,6 +880,18 @@
<!-- Permissions -->
+ <!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
+ <string name="permlab_fakePackageSignature">Spoof package signature</string>
+ <!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
+ <string name="permdesc_fakePackageSignature">Allows the app to pretend to be a different app. Malicious applications might be able to use this to access private application data. Legitimate uses include an emulator pretending to be what it emulates. Grant this permission with caution only!</string>
+ <!-- Title of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
+ <string name="permgrouplab_fake_package_signature">Spoof package signature</string>
+ <!-- Description of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
+ <string name="permgroupdesc_fake_package_signature">allow to spoof package signature</string>
+ <!-- Message shown to the user when the apps requests permission from this group. If ever possible this should stay below 80 characters (assuming the parameters takes 20 characters). Don't abbreviate until the message reaches 120 characters though. [CHAR LIMIT=120] -->
+ <string name="permgrouprequest_fake_package_signature">Allow
+ &lt;b><xliff:g id="app_name" example="Gmail">%1$s</xliff:g>&lt;/b> to spoof package signature?</string>
+
<!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
<string name="permlab_statusBar">disable or modify status bar</string>
<!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java
index fbe436007cd8..ccbbd72a08f5 100644
--- a/services/core/java/com/android/server/pm/PackageManagerService.java
+++ b/services/core/java/com/android/server/pm/PackageManagerService.java
@@ -3330,6 +3330,29 @@ public class PackageManagerService extends IPackageManager.Stub
return result;
}
+ private boolean requestsFakeSignature(AndroidPackage p) {
+ return p.getMetaData() != null &&
+ p.getMetaData().getString("fake-signature") != null;
+ }
+
+ private PackageInfo mayFakeSignature(AndroidPackage p, PackageInfo pi,
+ Set<String> permissions) {
+ try {
+ if (p.getMetaData() != null &&
+ p.getTargetSdkVersion() > Build.VERSION_CODES.LOLLIPOP_MR1) {
+ String sig = p.getMetaData().getString("fake-signature");
+ if (sig != null &&
+ permissions.contains("android.permission.FAKE_PACKAGE_SIGNATURE")) {
+ pi.signatures = new Signature[] {new Signature(sig)};
+ }
+ }
+ } catch (Throwable t) {
+ // We should never die because of any failures, this is system code!
+ Log.w("PackageManagerService.FAKE_PACKAGE_SIGNATURE", t);
+ }
+ return pi;
+ }
+
public final PackageInfo generatePackageInfo(PackageSetting ps, int flags, int userId) {
if (!mUserManager.exists(userId)) return null;
if (ps == null) {
@@ -3358,12 +3381,14 @@ public class PackageManagerService extends IPackageManager.Stub
final int[] gids = (flags & PackageManager.GET_GIDS) == 0 ? EMPTY_INT_ARRAY
: mPermissionManager.getGidsForUid(UserHandle.getUid(userId, ps.appId));
// Compute granted permissions only if package has requested permissions
- final Set<String> permissions = ((flags & PackageManager.GET_PERMISSIONS) == 0
+ final Set<String> permissions = (((flags & PackageManager.GET_PERMISSIONS) == 0
+ && !requestsFakeSignature(p))
|| ArrayUtils.isEmpty(p.getRequestedPermissions())) ? Collections.emptySet()
: mPermissionManager.getGrantedPermissions(ps.name, userId);
- PackageInfo packageInfo = PackageInfoUtils.generate(p, gids, flags,
- ps.firstInstallTime, ps.lastUpdateTime, permissions, state, userId, ps);
+ PackageInfo packageInfo = mayFakeSignature(p, PackageInfoUtils.generate(p, gids, flags,
+ ps.firstInstallTime, ps.lastUpdateTime, permissions, state, userId, ps),
+ permissions);
if (packageInfo == null) {
return null;
--
2.25.1

View File

@@ -1,7 +1,7 @@
From c2817ecca6b800fe6bd0207f934599ec6e9ccbb6 Mon Sep 17 00:00:00 2001
From 1b383c3fcac4852b7fec422277aa90bdc70f1286 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sat, 4 Sep 2021 08:26:30 +0000
Subject: [PATCH 23/35] Revert "Switch long-press power behavior in AOSP."
Subject: [PATCH 22/34] Revert "Switch long-press power behavior in AOSP."
This reverts commit 803c77a0a24624111944832098c6f65158051dc4.
---
@@ -31,5 +31,5 @@ index a7d55479d2c3..13a0a3935691 100644
<!-- Control the behavior when the user long presses the back button. Non-zero values are only
valid for watches as part of CDD/CTS.
--
2.25.1
2.34.1

View File

@@ -1,7 +1,7 @@
From 5c190b0bcc4e71a0aa1d1dc3687a308809eec331 Mon Sep 17 00:00:00 2001
From 2658af2de12846cc75c109dad00abe4f5b145cae Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Fri, 17 Dec 2021 17:16:14 -0500
Subject: [PATCH 24/35] Reduce the size of udfps enroll progress bar. Some
Subject: [PATCH 23/34] Reduce the size of udfps enroll progress bar. Some
devices have their udfps pretty low, and the progress bar would make the icon
at the wrong place
@@ -24,5 +24,5 @@ index 636413c5d2d8..53523e3f4f5a 100644
<!-- package name of a built-in camera app to use to restrict implicit intent resolution
--
2.25.1
2.34.1

View File

@@ -1,7 +1,7 @@
From 43a98edc778a0dccb4b598de90e1b83340b331f6 Mon Sep 17 00:00:00 2001
From 10982906e96a4593600189dbc762fbd273315bcc Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Sun, 19 Dec 2021 17:08:22 -0500
Subject: [PATCH 25/35] Add UDFPS support for various devices
Subject: [PATCH 24/34] Add UDFPS support for various devices
Successfully tested on Galaxy A51, Xiaomi Mi 9, and OnePlus Nord 2
@@ -593,5 +593,5 @@ index 29661d46f328..e97f70d7bffd 100644
public static boolean isValidAcquisitionMessage(@NonNull Context context,
--
2.25.1
2.34.1

View File

@@ -1,7 +1,7 @@
From 3d76474ed616173bc0ce7b0276f16475f899e870 Mon Sep 17 00:00:00 2001
From 5c9127edb1f7cdaafeb8d1f9407e7c534ab90633 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Mon, 20 Dec 2021 15:01:41 -0500
Subject: [PATCH 26/35] Dynamically resize boot animation to match screen size
Subject: [PATCH 25/34] Dynamically resize boot animation to match screen size
Change-Id: I54e49fc6b8c670103852e212d1416e27ff976205
---
@@ -9,10 +9,10 @@ Change-Id: I54e49fc6b8c670103852e212d1416e27ff976205
1 file changed, 20 insertions(+)
diff --git a/cmds/bootanimation/BootAnimation.cpp b/cmds/bootanimation/BootAnimation.cpp
index f7cd1c6d78eb..2185c7d271a8 100644
index 217c7ce47e79..8b7e650c1ebc 100644
--- a/cmds/bootanimation/BootAnimation.cpp
+++ b/cmds/bootanimation/BootAnimation.cpp
@@ -600,6 +600,26 @@ status_t BootAnimation::readyToRun() {
@@ -601,6 +601,26 @@ status_t BootAnimation::readyToRun() {
mFlingerSurface = s;
mTargetInset = -1;
@@ -40,5 +40,5 @@ index f7cd1c6d78eb..2185c7d271a8 100644
// Register a display event receiver
--
2.25.1
2.34.1

View File

@@ -1,7 +1,7 @@
From cce35950a87dcc320a6a31d46f5abf98af6357f8 Mon Sep 17 00:00:00 2001
From ac307d9181a2919d33fb37a2cf048118c54abb43 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Mon, 27 Dec 2021 17:57:11 -0500
Subject: [PATCH 27/35] Once we integrate Samsung Power hal in libpowermanager,
Subject: [PATCH 26/34] Once we integrate Samsung Power hal in libpowermanager,
libpowermanager and its deps require linking against
vendor.samsung.hardware.miscpower@2.0
@@ -11,10 +11,10 @@ Change-Id: I9084f64e505009abe9420d28b44199605cee52d8
1 file changed, 1 insertion(+)
diff --git a/services/core/jni/Android.bp b/services/core/jni/Android.bp
index 59256cc73df1..17736c3623c9 100644
index 69ff0f5cbedd..1df9f65446bb 100644
--- a/services/core/jni/Android.bp
+++ b/services/core/jni/Android.bp
@@ -185,6 +185,7 @@ cc_defaults {
@@ -192,6 +192,7 @@ cc_defaults {
"service.incremental",
"vendor.samsung.hardware.light@2.0",
"vendor.samsung.hardware.light@3.0",
@@ -23,5 +23,5 @@ index 59256cc73df1..17736c3623c9 100644
static_libs: [
--
2.25.1
2.34.1

View File

@@ -1,7 +1,7 @@
From f5afb1366c7218e27a5e37c73c8987c6650bcc2d Mon Sep 17 00:00:00 2001
From fbfba1b2f3684e727931afb5f6a8674cbe827c0e Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Thu, 3 Mar 2022 09:15:32 -0500
Subject: [PATCH 28/35] Add persist.sys.phh.ultrasonic_udfps property to
Subject: [PATCH 27/34] Add persist.sys.phh.ultrasonic_udfps property to
disable green circle for udfps
---
@@ -35,5 +35,5 @@ index 341b08262ed4..718dbf85bdcd 100644
sensorType = FingerprintSensorProperties.TYPE_POWER_BUTTON;
} else {
--
2.25.1
2.34.1

View File

@@ -1,7 +1,7 @@
From c73d4efd8b693efd50ef38807bad19c3ea548754 Mon Sep 17 00:00:00 2001
From b22b10e452e74743af42c071d00411caf214066c Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Thu, 3 Mar 2022 09:17:17 -0500
Subject: [PATCH 29/35] Allow 128bits SHA1 IPSec keys. This is required to
Subject: [PATCH 28/34] Allow 128bits SHA1 IPSec keys. This is required to
implement VoLTE with this API
---
@@ -22,5 +22,5 @@ index 7ef5bac092f6..326573818655 100644
break;
case AUTH_HMAC_SHA256:
--
2.25.1
2.34.1

View File

@@ -1,7 +1,7 @@
From da1da18e246c6a1951e6f65ba2c4083e86296069 Mon Sep 17 00:00:00 2001
From 18ec5017c5147acb9a51bc6a91a1fe9d54ac8005 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Fri, 4 Mar 2022 19:26:53 -0500
Subject: [PATCH 30/35] Fix FOD on ZF8
Subject: [PATCH 29/34] Fix FOD on ZF8
Goodix HAL expects events in this order:
- Fingerprint down when touchscreen says fp down
@@ -63,5 +63,5 @@ index 718dbf85bdcd..f49b73f6922a 100644
}
--
2.25.1
2.34.1

View File

@@ -1,7 +1,7 @@
From efe8d80cf3c36772ab711b8721568efb49f8cc23 Mon Sep 17 00:00:00 2001
From c0abd8442f3c45ed3fa1ac2850b38d39180dcad2 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Sat, 2 Apr 2022 18:04:01 -0400
Subject: [PATCH 31/35] Allow disabling of fingerprint cleanups, needed on some
Subject: [PATCH 30/34] Allow disabling of fingerprint cleanups, needed on some
Realme devices that cant enumerate
---
@@ -22,5 +22,5 @@ index 6feb5fa418bb..f2e5d77dec63 100644
scheduleUpdateActiveUserWithoutHandler(userId);
--
2.25.1
2.34.1

View File

@@ -1,7 +1,7 @@
From 539b36f10555416f5500f63ed35371b7f28c136c Mon Sep 17 00:00:00 2001
From 4fd3a0a140e29888752294701ed1dd98c10c36bc Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Mon, 2 May 2022 18:02:25 -0400
Subject: [PATCH 32/35] Switch FOD to WHITE
Subject: [PATCH 31/34] Switch FOD to WHITE
---
.../src/com/android/systemui/biometrics/UdfpsSurfaceView.java | 2 +-
@@ -21,5 +21,5 @@ index 51409b9c533a..77fad35d32d4 100644
}
--
2.25.1
2.34.1

View File

@@ -1,7 +1,7 @@
From 75ed311adebc4339904177875d9e724bc2db3a7a Mon Sep 17 00:00:00 2001
From e36b5c92f58ded71e1a2e7bf99dcabff7baf75b8 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Mon, 2 May 2022 18:02:40 -0400
Subject: [PATCH 33/35] Support samsung ultrasonic udfps
Subject: [PATCH 32/34] Support samsung ultrasonic udfps
---
.../systemui/biometrics/UdfpsView.java | 4 +++-
@@ -79,5 +79,5 @@ index e97f70d7bffd..8e99392cf545 100644
IGoodixFingerprintDaemon goodixDaemon = IGoodixFingerprintDaemon.getService();
if(android.os.SystemProperties.get("ro.vendor.build.fingerprint").contains("ASUS")) {
--
2.25.1
2.34.1

View File

@@ -1,7 +1,7 @@
From 27935fa95d92df6e7fc627431452696370609e20 Mon Sep 17 00:00:00 2001
From 3bc7eca92f26aa92398b3554aa73b799e26c83ab Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Thu, 9 Jun 2022 14:08:46 -0400
Subject: [PATCH 34/35] Allow FOD color to be customized with
Subject: [PATCH 33/34] Allow FOD color to be customized with
persist.sys.phh.fod_color
---
@@ -43,5 +43,5 @@ index 77fad35d32d4..d46f041c066c 100644
}
--
2.25.1
2.34.1

View File

@@ -1,7 +1,7 @@
From 104e691c4ff897207be632ed281738642459f5a5 Mon Sep 17 00:00:00 2001
From cdb39412d46b23498fe459db74cc10e1c264d88a Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Wed, 14 Dec 2022 17:21:00 -0500
Subject: [PATCH 35/35] Call Samsung's ISehSysInputDev to report screen state
Subject: [PATCH 34/34] Call Samsung's ISehSysInputDev to report screen state
to touchscreen driver
This fixes touchscreen not waking up on Galaxy F23
@@ -96,5 +96,5 @@ index 5a9efd707f5d..4c11f86d457a 100644
// have a sidekick available, tell it now that it can take control.
if (Display.isSuspendedState(state) && state != Display.STATE_OFF
--
2.25.1
2.34.1