Refresh patches for AOSP 14 r29

This commit is contained in:
Peter Cai 2024-03-12 19:41:47 -04:00
parent d05b445c89
commit c5a6c7eb2a
39 changed files with 440 additions and 688 deletions

View file

@ -1,4 +1,4 @@
From ee3be511ddfa2474c7c5890cea4725e908996b9f Mon Sep 17 00:00:00 2001
From 13537c3a17b60050d431d7d5b9dbfc591ee41762 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Sat, 19 Feb 2022 08:20:25 -0500
Subject: [PATCH] Add new mechanism to fake vendor props on a per-process basis
@ -17,10 +17,10 @@ Squashed: Rework property overriding
1 file changed, 79 insertions(+), 2 deletions(-)
diff --git a/libc/system_properties/system_properties.cpp b/libc/system_properties/system_properties.cpp
index 1cb15c3df..40ff48bad 100644
index 9dd5e35ce..4524f8410 100644
--- a/libc/system_properties/system_properties.cpp
+++ b/libc/system_properties/system_properties.cpp
@@ -35,6 +35,8 @@
@@ -36,6 +36,8 @@
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
@ -29,9 +29,9 @@ index 1cb15c3df..40ff48bad 100644
#include <new>
@@ -50,6 +52,79 @@
#define SERIAL_DIRTY(serial) ((serial)&1)
@@ -53,6 +55,79 @@
#define SERIAL_VALUE_LEN(serial) ((serial) >> 24)
#define APPCOMPAT_PREFIX "ro.appcompat_override."
+static char comm[128];
+static bool self_ok = false;
@ -109,7 +109,7 @@ index 1cb15c3df..40ff48bad 100644
static bool is_dir(const char* pathname) {
struct stat info;
if (stat(pathname, &info) == -1) {
@@ -123,17 +198,19 @@ uint32_t SystemProperties::AreaSerial() {
@@ -156,17 +231,19 @@ uint32_t SystemProperties::AreaSerial() {
}
const prop_info* SystemProperties::Find(const char* name) {
@ -130,7 +130,7 @@ index 1cb15c3df..40ff48bad 100644
+ return pa->find(newName);
}
static bool is_read_only(const char* name) {
static bool is_appcompat_override(const char* name) {
--
2.41.0
2.43.1

View file

@ -1,4 +1,4 @@
From f8b9cb1d3cdf0274414bb7d100844d2707999558 Mon Sep 17 00:00:00 2001
From ea475bf0af44eaaa124ce6113f9aa05d6d6daa1a Mon Sep 17 00:00:00 2001
From: Peter Cai <peter@typeblog.net>
Date: Wed, 24 Aug 2022 15:42:39 -0400
Subject: [PATCH 1/5] APM: Optionally force-load audio policy for system-side
@ -14,7 +14,7 @@ Change-Id: I279fff541a531f922f3fa55b8f14d00237db59ff
1 file changed, 25 insertions(+)
diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
index 3d5c1d2e42..881c188e4c 100644
index 6f19a7a145..08836377b7 100644
--- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
+++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
@@ -25,6 +25,7 @@
@ -25,7 +25,7 @@ index 3d5c1d2e42..881c188e4c 100644
#include <utils/Log.h>
#include <utils/StrongPointer.h>
#include <utils/Errors.h>
@@ -885,6 +886,30 @@ status_t PolicySerializer::deserialize(const char *configFile, AudioPolicyConfig
@@ -895,6 +896,30 @@ status_t PolicySerializer::deserialize(const char *configFile, AudioPolicyConfig
if (status != NO_ERROR) {
return status;
}
@ -57,5 +57,5 @@ index 3d5c1d2e42..881c188e4c 100644
// Global Configuration
--
2.41.0
2.43.1

View file

@ -1,4 +1,4 @@
From d60a1b5fc58a7cc84b48c554cb2cffaeff14d86e Mon Sep 17 00:00:00 2001
From bb39db1a329a76edb2f936fbec305dc561638177 Mon Sep 17 00:00:00 2001
From: Peter Cai <peter@typeblog.net>
Date: Thu, 25 Aug 2022 13:30:29 -0400
Subject: [PATCH 2/5] APM: Remove A2DP audio ports from the primary HAL
@ -16,7 +16,7 @@ Change-Id: I3305594a17285da113167b419543543f0ef71122
1 file changed, 22 insertions(+), 4 deletions(-)
diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
index 881c188e4c..8519cfdc04 100644
index 08836377b7..0f7c903909 100644
--- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
+++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
@@ -26,6 +26,7 @@
@ -40,7 +40,7 @@ index 881c188e4c..8519cfdc04 100644
}
}
if (!xmlStrcmp(cur->name, reinterpret_cast<const xmlChar*>(Trait::tag))) {
@@ -679,6 +677,7 @@ std::variant<status_t, ModuleTraits::Element> PolicySerializer::deserialize<Modu
@@ -683,6 +681,7 @@ std::variant<status_t, ModuleTraits::Element> PolicySerializer::deserialize<Modu
ALOGE("%s: No %s found", __func__, Attributes::name);
return BAD_VALUE;
}
@ -48,7 +48,7 @@ index 881c188e4c..8519cfdc04 100644
uint32_t versionMajor = 0, versionMinor = 0;
std::string versionLiteral = getXmlAttribute(cur, Attributes::version);
if (!versionLiteral.empty()) {
@@ -704,6 +703,25 @@ std::variant<status_t, ModuleTraits::Element> PolicySerializer::deserialize<Modu
@@ -708,6 +707,25 @@ std::variant<status_t, ModuleTraits::Element> PolicySerializer::deserialize<Modu
if (status != NO_ERROR) {
return status;
}
@ -75,5 +75,5 @@ index 881c188e4c..8519cfdc04 100644
RouteTraits::Collection routes;
--
2.41.0
2.43.1

View file

@ -1,4 +1,4 @@
From aa1f3595b06e6d3d7027a5dd40ae183d71d032f0 Mon Sep 17 00:00:00 2001
From b0898400ce6154291505edb284a63f2991cac382 Mon Sep 17 00:00:00 2001
From: ponces <ponces26@gmail.com>
Date: Mon, 24 Oct 2022 09:38:34 +0100
Subject: [PATCH 3/5] voip: Fix high pitched voice on Qualcomm devices
@ -9,7 +9,7 @@ Change-Id: I6d314912169776b76d07d8c0301ec5249c1870a2
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
index 8519cfdc04..d23d55677d 100644
index 0f7c903909..c4474cf1c2 100644
--- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
+++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
@@ -252,6 +252,7 @@ private:
@ -52,5 +52,5 @@ index 8519cfdc04..d23d55677d 100644
ALOGE("%s: No %s found", __func__, Attributes::name);
return BAD_VALUE;
--
2.41.0
2.43.1

View file

@ -1,4 +1,4 @@
From 1a9a9faca4d5c28747a3b7d9843b67c641ed91c9 Mon Sep 17 00:00:00 2001
From ecc5b31e7fbc1875deee1befd4d1b29e98db8836 Mon Sep 17 00:00:00 2001
From: Peter Cai <peter@typeblog.net>
Date: Thu, 18 Aug 2022 15:44:46 -0400
Subject: [PATCH 4/5] APM: Restore S, R and Q behavior respectively for
@ -36,12 +36,12 @@ Change-Id: I56d36d2aef4319935cb88a3e4771b23c6d5b2145
2 files changed, 147 insertions(+), 62 deletions(-)
diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
index f093e685ba..9a90009f9e 100644
index 135548fb9c..fc99bdbd78 100644
--- a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
+++ b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
@@ -689,6 +689,17 @@ status_t AudioPolicyManager::updateCallRoutingInternal(
disconnectTelephonyAudioSource(mCallRxSourceClient);
disconnectTelephonyAudioSource(mCallTxSourceClient);
@@ -692,6 +692,17 @@ status_t AudioPolicyManager::updateCallRoutingInternal(
ALOGV("%s device rxDevice %s txDevice %s", __func__,
rxDevices.itemAt(0)->toString().c_str(), txSourceDevice->toString().c_str());
+ // release existing RX patch if any
+ if (mCallRxPatch != 0) {
@ -57,7 +57,7 @@ index f093e685ba..9a90009f9e 100644
auto telephonyRxModule =
mHwModules.getModuleForDeviceType(AUDIO_DEVICE_IN_TELEPHONY_RX, AUDIO_FORMAT_DEFAULT);
auto telephonyTxModule =
@@ -711,9 +722,20 @@ status_t AudioPolicyManager::updateCallRoutingInternal(
@@ -714,9 +725,20 @@ status_t AudioPolicyManager::updateCallRoutingInternal(
ALOGE("%s() no telephony Tx and/or RX device", __func__);
return INVALID_OPERATION;
}
@ -81,9 +81,9 @@ index f093e685ba..9a90009f9e 100644
} else {
// If the RX device is on the primary HW module, then use legacy routing method for
// voice calls via setOutputDevice() on primary output.
@@ -730,7 +752,14 @@ status_t AudioPolicyManager::updateCallRoutingInternal(
if (!createRxPatch) {
muteWaitMs = setOutputDevices(mPrimaryOutput, rxDevices, true, delayMs);
@@ -737,7 +759,14 @@ status_t AudioPolicyManager::updateCallRoutingInternal(
}
muteWaitMs = setOutputDevices(__func__, mPrimaryOutput, rxDevices, true, delayMs);
} else { // create RX path audio patch
- connectTelephonyRxAudioSource();
+ if (property_get_int32("ro.vndk.version", 31) >= 31) {
@ -97,7 +97,7 @@ index f093e685ba..9a90009f9e 100644
// If the TX device is on the primary HW module but RX device is
// on other HW module, SinkMetaData of telephony input should handle it
// assuming the device uses audio HAL V5.0 and above
@@ -745,7 +774,12 @@ status_t AudioPolicyManager::updateCallRoutingInternal(
@@ -752,7 +781,12 @@ status_t AudioPolicyManager::updateCallRoutingInternal(
closeActiveClients(activeDesc);
}
}
@ -111,7 +111,7 @@ index f093e685ba..9a90009f9e 100644
}
if (waitMs != nullptr) {
*waitMs = muteWaitMs;
@@ -753,6 +787,36 @@ status_t AudioPolicyManager::updateCallRoutingInternal(
@@ -760,6 +794,36 @@ status_t AudioPolicyManager::updateCallRoutingInternal(
return NO_ERROR;
}
@ -148,7 +148,7 @@ index f093e685ba..9a90009f9e 100644
bool AudioPolicyManager::isDeviceOfModule(
const sp<DeviceDescriptor>& devDesc, const char *moduleId) const {
sp<HwModule> module = mHwModules.getModuleFromName(moduleId);
@@ -4958,83 +5022,101 @@ status_t AudioPolicyManager::createAudioPatchInternal(const struct audio_patch *
@@ -5087,83 +5151,101 @@ status_t AudioPolicyManager::createAudioPatchInternal(const struct audio_patch *
// in config XML to reach the sink so that is can be declared as available.
audio_io_handle_t output = AUDIO_IO_HANDLE_NONE;
sp<SwAudioOutputDescriptor> outputDesc;
@ -308,10 +308,10 @@ index f093e685ba..9a90009f9e 100644
AUDIO_STREAM_PATCH;
patchBuilder.addSource(srcMixPortConfig);
diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.h b/services/audiopolicy/managerdefault/AudioPolicyManager.h
index 88bafefdb1..188b5732b3 100644
index a1c8f6202c..ee1b595e30 100644
--- a/services/audiopolicy/managerdefault/AudioPolicyManager.h
+++ b/services/audiopolicy/managerdefault/AudioPolicyManager.h
@@ -953,6 +953,9 @@ protected:
@@ -964,6 +964,9 @@ protected:
SoundTriggerSessionCollection mSoundTriggerSessions;
@ -322,5 +322,5 @@ index 88bafefdb1..188b5732b3 100644
SourceClientCollection mAudioSources;
--
2.41.0
2.43.1

View file

@ -1,4 +1,4 @@
From 97421e35dd716c9b07ec44ec05265944efc96294 Mon Sep 17 00:00:00 2001
From 91ae0a3a9df1e37856cf0065bb24b7c27bb40ba4 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Mon, 5 Aug 2019 18:09:50 +0200
Subject: [PATCH 5/5] Fix BT in-call on CAF devices
@ -16,10 +16,10 @@ Change-Id: Ifea0f88276ec9a0811f3cb1973c4b06f2c82077b
1 file changed, 93 insertions(+)
diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
index d23d55677d..4f896111cb 100644
index c4474cf1c2..c1df8f278b 100644
--- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
+++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
@@ -672,6 +672,98 @@ std::variant<status_t, RouteTraits::Element> PolicySerializer::deserialize<Route
@@ -676,6 +676,98 @@ std::variant<status_t, RouteTraits::Element> PolicySerializer::deserialize<Route
return route;
}
@ -118,7 +118,7 @@ index d23d55677d..4f896111cb 100644
template<>
std::variant<status_t, ModuleTraits::Element> PolicySerializer::deserialize<ModuleTraits>(
const xmlNode *cur, ModuleTraits::PtrSerializingCtx ctx)
@@ -739,6 +831,7 @@ std::variant<status_t, ModuleTraits::Element> PolicySerializer::deserialize<Modu
@@ -743,6 +835,7 @@ std::variant<status_t, ModuleTraits::Element> PolicySerializer::deserialize<Modu
if (status != NO_ERROR) {
return status;
}
@ -127,5 +127,5 @@ index d23d55677d..4f896111cb 100644
for (const xmlNode *children = cur->xmlChildrenNode; children != NULL;
--
2.41.0
2.43.1

View file

@ -1,7 +1,7 @@
From 8def4ecfdf6f04417ba886679e386be40fc713ec Mon Sep 17 00:00:00 2001
From ceeeecf00329e2b0c50aa71c7c4da5aec6a0080b Mon Sep 17 00:00:00 2001
From: Peter Cai <peter@typeblog.net>
Date: Tue, 12 Oct 2021 21:37:22 -0400
Subject: [PATCH 01/11] PackageParser: support glob matching for properties
Subject: [PATCH 01/10] PackageParser: support glob matching for properties
Needed to make phh's vendor overlays work
---
@ -9,7 +9,7 @@ Needed to make phh's vendor overlays work
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java
index 048289f56a0c..0d88d7ab97a4 100644
index 4b579e7db9f8..8176cf8e8567 100644
--- a/core/java/android/content/pm/PackageParser.java
+++ b/core/java/android/content/pm/PackageParser.java
@@ -2545,8 +2545,16 @@ public class PackageParser {
@ -32,5 +32,5 @@ index 048289f56a0c..0d88d7ab97a4 100644
}
return true;
--
2.41.0
2.43.1

View file

@ -1,163 +0,0 @@
From db57e0cf315286e83e3855d8aaf465fe5ea22dcb Mon Sep 17 00:00:00 2001
From: Danny Lin <danny@kdrag0n.dev>
Date: Sat, 16 Oct 2021 05:27:57 -0700
Subject: [PATCH 02/11] 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
Changes made for Android 13:
- Computer subclass is now an independent class.
Change-Id: Ied7d6ce0b83a2d2345c3abba0429998d86494a88
---
core/api/current.txt | 2 ++
core/res/AndroidManifest.xml | 15 ++++++++++
core/res/res/values/strings.xml | 12 ++++++++
.../com/android/server/pm/ComputerEngine.java | 30 +++++++++++++++++--
4 files changed, 56 insertions(+), 3 deletions(-)
diff --git a/core/api/current.txt b/core/api/current.txt
index 288ab479c0fb..2124d89c6e6f 100644
--- a/core/api/current.txt
+++ b/core/api/current.txt
@@ -95,6 +95,7 @@ package android {
field public static final String EXECUTE_APP_ACTION = "android.permission.EXECUTE_APP_ACTION";
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 FOREGROUND_SERVICE_CAMERA = "android.permission.FOREGROUND_SERVICE_CAMERA";
field public static final String FOREGROUND_SERVICE_CONNECTED_DEVICE = "android.permission.FOREGROUND_SERVICE_CONNECTED_DEVICE";
@@ -326,6 +327,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 8c9a3ff5149f..4a55643dc503 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -4250,6 +4250,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 9c018c30f9e3..966fec172070 100644
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -991,6 +991,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/ComputerEngine.java b/services/core/java/com/android/server/pm/ComputerEngine.java
index 78f1fa60b69f..fb2f7da97cda 100644
--- a/services/core/java/com/android/server/pm/ComputerEngine.java
+++ b/services/core/java/com/android/server/pm/ComputerEngine.java
@@ -1450,6 +1450,29 @@ public class ComputerEngine implements Computer {
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(PackageStateInternal ps,
@PackageManager.PackageInfoFlagsBits long flags, int userId) {
if (!mUserManager.exists(userId)) return null;
@@ -1483,13 +1506,14 @@ public class ComputerEngine implements Computer {
|| ArrayUtils.isEmpty(p.getPermissions())) ? Collections.emptySet()
: mPermissionManager.getInstalledPermissions(ps.getPackageName());
// Compute granted permissions only if package has requested permissions
- final Set<String> grantedPermissions = ((flags & PackageManager.GET_PERMISSIONS) == 0
+ final Set<String> grantedPermissions = (((flags & PackageManager.GET_PERMISSIONS) == 0
+ && !requestsFakeSignature(p))
|| ArrayUtils.isEmpty(p.getRequestedPermissions())) ? Collections.emptySet()
: mPermissionManager.getGrantedPermissions(ps.getPackageName(), userId);
- PackageInfo packageInfo = PackageInfoUtils.generate(p, gids, flags,
+ PackageInfo packageInfo = mayFakeSignature(p, PackageInfoUtils.generate(p, gids, flags,
state.getFirstInstallTimeMillis(), ps.getLastUpdateTime(), installedPermissions,
- grantedPermissions, state, userId, ps);
+ grantedPermissions, state, userId, ps), grantedPermissions);
if (packageInfo == null) {
return null;
--
2.41.0

View file

@ -1,7 +1,7 @@
From 3df53ee5075cc7db5065531a157f97960097cfb3 Mon Sep 17 00:00:00 2001
From a16e57cffc48223fb6e756b03ebbd16d6d7f1276 Mon Sep 17 00:00:00 2001
From: Peter Cai <peter@typeblog.net>
Date: Fri, 2 Sep 2022 21:36:06 -0400
Subject: [PATCH 03/11] FrameworkParsingPackageUtils: Add glob matching support
Subject: [PATCH 02/10] FrameworkParsingPackageUtils: Add glob matching support
for properties
This is now required in addition to the one in PackageParser in order
@ -13,7 +13,7 @@ Change-Id: Ie8679c0ffe03cead4a68bd2d0eb429f05af2d417
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/core/java/android/content/pm/parsing/FrameworkParsingPackageUtils.java b/core/java/android/content/pm/parsing/FrameworkParsingPackageUtils.java
index 3e1c5bb3d7ec..f15978c57574 100644
index 153dd9a93490..900151440ca9 100644
--- a/core/java/android/content/pm/parsing/FrameworkParsingPackageUtils.java
+++ b/core/java/android/content/pm/parsing/FrameworkParsingPackageUtils.java
@@ -215,8 +215,16 @@ public class FrameworkParsingPackageUtils {
@ -36,5 +36,5 @@ index 3e1c5bb3d7ec..f15978c57574 100644
}
return true;
--
2.41.0
2.43.1

View file

@ -1,7 +1,7 @@
From 7b3ac6fb32bc619235aab6d06c2ed356dd684b4d Mon Sep 17 00:00:00 2001
From 2d871d0c51d43d0c3e4ce15a3f811fd5a9c316ad Mon Sep 17 00:00:00 2001
From: Oliver Scott <olivercscott@gmail.com>
Date: Thu, 8 Jul 2021 10:41:43 -0400
Subject: [PATCH 04/11] Global VPN feature [1/2]
Subject: [PATCH 03/10] Global VPN feature [1/2]
* Modify existing VPN user range functions to conditionally have traffic
from all users pass through the global VPN.
@ -28,10 +28,10 @@ Signed-off-by: Mohammad Hasan Keramat J <ikeramat@protonmail.com>
3 files changed, 46 insertions(+), 5 deletions(-)
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index a55183c0f7c5..faa16d0c8aad 100644
index 2cc56d838b79..af98f07e9669 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -16838,6 +16838,12 @@ public final class Settings {
@@ -17352,6 +17352,12 @@ public final class Settings {
CLOCKWORK_HOME_READY,
};
@ -45,7 +45,7 @@ index a55183c0f7c5..faa16d0c8aad 100644
* Keys we no longer back up under the current schema, but want to continue to
* process when restoring historical backup datasets.
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/SecurityControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/SecurityControllerImpl.java
index 03656f000c07..fddf8167beb5 100644
index 4a4d4e1f27b2..a5e06164d0b8 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/SecurityControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/SecurityControllerImpl.java
@@ -39,6 +39,7 @@ import android.os.Handler;
@ -72,10 +72,10 @@ index 03656f000c07..fddf8167beb5 100644
mVpnUserId = newUserInfo.restrictedProfileParentId;
} else {
diff --git a/services/core/java/com/android/server/connectivity/Vpn.java b/services/core/java/com/android/server/connectivity/Vpn.java
index e3262cfbd30b..614628f42e39 100644
index c5170585a1b3..53d1f6c2c52f 100644
--- a/services/core/java/com/android/server/connectivity/Vpn.java
+++ b/services/core/java/com/android/server/connectivity/Vpn.java
@@ -915,6 +915,15 @@ public class Vpn {
@@ -776,6 +776,15 @@ public class Vpn {
return mAlwaysOn;
}
@ -91,7 +91,7 @@ index e3262cfbd30b..614628f42e39 100644
/**
* Checks if a VPN app supports always-on mode.
*
@@ -1864,6 +1873,7 @@ public class Vpn {
@@ -1718,6 +1727,7 @@ public class Vpn {
try {
// Restricted users are not allowed to create VPNs, they are tied to Owner
enforceNotRestrictedUser();
@ -99,7 +99,7 @@ index e3262cfbd30b..614628f42e39 100644
final PackageManager packageManager = mUserIdContext.getPackageManager();
if (packageManager == null) {
@@ -2016,7 +2026,7 @@ public class Vpn {
@@ -1868,7 +1878,7 @@ public class Vpn {
addUserToRanges(ranges, userId, allowedApplications, disallowedApplications);
// If the user can have restricted profiles, assign all its restricted profiles too
@ -108,7 +108,7 @@ index e3262cfbd30b..614628f42e39 100644
final long token = Binder.clearCallingIdentity();
List<UserInfo> users;
try {
@@ -2025,7 +2035,8 @@ public class Vpn {
@@ -1877,7 +1887,8 @@ public class Vpn {
Binder.restoreCallingIdentity(token);
}
for (UserInfo user : users) {
@ -118,7 +118,7 @@ index e3262cfbd30b..614628f42e39 100644
addUserToRanges(ranges, user.id, allowedApplications, disallowedApplications);
}
}
@@ -2106,7 +2117,8 @@ public class Vpn {
@@ -1958,7 +1969,8 @@ public class Vpn {
public void onUserAdded(int userId) {
// If the user is restricted tie them to the parent user's VPN
UserInfo user = mUserManager.getUserInfo(userId);
@ -128,7 +128,7 @@ index e3262cfbd30b..614628f42e39 100644
synchronized(Vpn.this) {
final Set<Range<Integer>> existingRanges = mNetworkCapabilities.getUids();
if (existingRanges != null) {
@@ -2135,7 +2147,8 @@ public class Vpn {
@@ -1987,7 +1999,8 @@ public class Vpn {
public void onUserRemoved(int userId) {
// clean up if restricted
UserInfo user = mUserManager.getUserInfo(userId);
@ -138,7 +138,7 @@ index e3262cfbd30b..614628f42e39 100644
synchronized(Vpn.this) {
final Set<Range<Integer>> existingRanges = mNetworkCapabilities.getUids();
if (existingRanges != null) {
@@ -2580,6 +2593,17 @@ public class Vpn {
@@ -2412,6 +2425,17 @@ public class Vpn {
}
}
@ -156,15 +156,15 @@ index e3262cfbd30b..614628f42e39 100644
/**
* Start legacy VPN, controlling native daemons as needed. Creates a
* secondary thread to perform connection work, returning quickly.
@@ -2664,6 +2688,7 @@ public class Vpn {
@@ -2495,6 +2519,7 @@ public class Vpn {
new UserHandle(mUserId))) {
throw new SecurityException("Restricted users cannot establish VPNs");
}
+ enforceNotGlobalVpn();
final RouteInfo ipv4DefaultRoute = findIPv4DefaultRoute(egress);
final String gateway = ipv4DefaultRoute.getGateway().getHostAddress();
@@ -4621,6 +4646,7 @@ public class Vpn {
// Load certificates.
String privateKey = "";
@@ -4029,6 +4054,7 @@ public class Vpn {
verifyCallingUidAndPackage(packageName);
enforceNotRestrictedUser();
@ -172,7 +172,7 @@ index e3262cfbd30b..614628f42e39 100644
validateRequiredFeatures(profile);
if (profile.isRestrictedToTestNetworks) {
@@ -4663,6 +4689,7 @@ public class Vpn {
@@ -4071,6 +4097,7 @@ public class Vpn {
verifyCallingUidAndPackage(packageName);
enforceNotRestrictedUser();
@ -180,7 +180,7 @@ index e3262cfbd30b..614628f42e39 100644
final long token = Binder.clearCallingIdentity();
try {
@@ -4732,6 +4759,7 @@ public class Vpn {
@@ -4140,6 +4167,7 @@ public class Vpn {
requireNonNull(packageName, "No package name provided");
enforceNotRestrictedUser();
@ -188,7 +188,7 @@ index e3262cfbd30b..614628f42e39 100644
// Prepare VPN for startup
if (!prepare(packageName, null /* newPackage */, VpnManager.TYPE_VPN_PLATFORM)) {
@@ -4856,6 +4884,7 @@ public class Vpn {
@@ -4262,6 +4290,7 @@ public class Vpn {
requireNonNull(packageName, "No package name provided");
enforceNotRestrictedUser();
@ -197,5 +197,5 @@ index e3262cfbd30b..614628f42e39 100644
// To stop the VPN profile, the caller must be the current prepared package and must be
// running an Ikev2VpnProfile.
--
2.41.0
2.43.1

View file

@ -1,7 +1,7 @@
From 37122c75c56d08b1c07d95f1d1ef040a7d9c6564 Mon Sep 17 00:00:00 2001
From 46413dd5f5d3ea13e25327b95f087b063006887d 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 06/11] Dynamically resize boot animation to match screen size
Subject: [PATCH 04/10] Dynamically resize boot animation to match screen size
Change-Id: I54e49fc6b8c670103852e212d1416e27ff976205
---
@ -9,10 +9,10 @@ Change-Id: I54e49fc6b8c670103852e212d1416e27ff976205
1 file changed, 22 insertions(+)
diff --git a/cmds/bootanimation/BootAnimation.cpp b/cmds/bootanimation/BootAnimation.cpp
index a8b6c0b70804..9c50e954cee5 100644
index 820d2b0d607e..56dfa8af31c4 100644
--- a/cmds/bootanimation/BootAnimation.cpp
+++ b/cmds/bootanimation/BootAnimation.cpp
@@ -605,6 +605,28 @@ status_t BootAnimation::readyToRun() {
@@ -618,6 +618,28 @@ status_t BootAnimation::readyToRun() {
mFlingerSurface = s;
mTargetInset = -1;
@ -42,5 +42,5 @@ index a8b6c0b70804..9c50e954cee5 100644
// ro.bootanim.set_orientation_<display_id>. Four values are supported: ORIENTATION_0,
// ORIENTATION_90, ORIENTATION_180 and ORIENTATION_270.
--
2.41.0
2.43.1

View file

@ -1,7 +1,7 @@
From 831c7dd6fbb57a3ccd722e5387f811dfd0e21349 Mon Sep 17 00:00:00 2001
From 4b49ad5b8f7401ec6ae02a4db674721ce10ac4ea Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Wed, 2 Aug 2023 20:59:53 +0800
Subject: [PATCH 07/11] Restore getSimStateForSlotIndex in SubscriptionManager
Subject: [PATCH 05/10] Restore getSimStateForSlotIndex in SubscriptionManager
MTK IMS still needs it here
@ -11,10 +11,10 @@ Change-Id: I41bac57c68055f369232359a464642daab94403b
1 file changed, 14 insertions(+)
diff --git a/telephony/java/android/telephony/SubscriptionManager.java b/telephony/java/android/telephony/SubscriptionManager.java
index 8e4ec0914563..a65a7e9ec2e6 100644
index 326b6f5af613..b994888362b0 100644
--- a/telephony/java/android/telephony/SubscriptionManager.java
+++ b/telephony/java/android/telephony/SubscriptionManager.java
@@ -2558,6 +2558,20 @@ public class SubscriptionManager {
@@ -2693,6 +2693,20 @@ public class SubscriptionManager {
return TelephonyManager.getDefault().isNetworkRoaming(subId);
}
@ -36,5 +36,5 @@ index 8e4ec0914563..a65a7e9ec2e6 100644
* Set a field in the subscription database. Note not all fields are supported.
*
--
2.41.0
2.43.1

View file

@ -1,110 +0,0 @@
From 69e129d654ccc2fb9d364d64fe65e7ea7302f85a Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sat, 15 Oct 2022 09:33:56 +0000
Subject: [PATCH 05/11] Revert "Remove more FDE methods from StorageManager"
This reverts commit bd13f84152449a3ead6fa8604fd31f48c0224676.
Change-Id: Ic394934ec27b1a486c60123130825d44dad73412
---
.../android/os/storage/StorageManager.java | 57 +++++++++++++++++++
.../internal/os/RoSystemProperties.java | 4 ++
2 files changed, 61 insertions(+)
diff --git a/core/java/android/os/storage/StorageManager.java b/core/java/android/os/storage/StorageManager.java
index ee387e7c284f..0adc55598d9b 100644
--- a/core/java/android/os/storage/StorageManager.java
+++ b/core/java/android/os/storage/StorageManager.java
@@ -1669,6 +1669,15 @@ public class StorageManager {
return false;
}
+ /** {@hide}
+ * Is this device encryptable or already encrypted?
+ * @return true for encryptable or encrypted
+ * false not encrypted and not encryptable
+ */
+ public static boolean isEncryptable() {
+ return RoSystemProperties.CRYPTO_ENCRYPTABLE;
+ }
+
/** {@hide}
* Is this device encrypted?
* <p>
@@ -1702,6 +1711,54 @@ public class StorageManager {
return isFileEncrypted();
}
+ /** {@hide}
+ * Is this device block encrypted?
+ * @return true for block encrypted. (Implies isEncrypted() == true)
+ * false not encrypted or file encrypted
+ */
+ public static boolean isBlockEncrypted() {
+ return false;
+ }
+
+ /** {@hide}
+ * Is this device block encrypted with credentials?
+ * @return true for crediential block encrypted.
+ * (Implies isBlockEncrypted() == true)
+ * false not encrypted, file encrypted or default block encrypted
+ */
+ public static boolean isNonDefaultBlockEncrypted() {
+ return false;
+ }
+
+ /** {@hide}
+ * Is this device in the process of being block encrypted?
+ * @return true for encrypting.
+ * false otherwise
+ * Whether device isEncrypted at this point is undefined
+ * Note that only system services and CryptKeeper will ever see this return
+ * true - no app will ever be launched in this state.
+ * Also note that this state will not change without a teardown of the
+ * framework, so no service needs to check for changes during their lifespan
+ */
+ public static boolean isBlockEncrypting() {
+ return false;
+ }
+
+ /** {@hide}
+ * Is this device non default block encrypted and in the process of
+ * prompting for credentials?
+ * @return true for prompting for credentials.
+ * (Implies isNonDefaultBlockEncrypted() == true)
+ * false otherwise
+ * Note that only system services and CryptKeeper will ever see this return
+ * true - no app will ever be launched in this state.
+ * Also note that this state will not change without a teardown of the
+ * framework, so no service needs to check for changes during their lifespan
+ */
+ public static boolean inCryptKeeperBounce() {
+ return false;
+ }
+
/** {@hide}
* @deprecated Use {@link #isFileEncrypted} instead, since emulated FBE is no longer supported.
*/
diff --git a/core/java/com/android/internal/os/RoSystemProperties.java b/core/java/com/android/internal/os/RoSystemProperties.java
index 40d5c4761dff..66288706b0f1 100644
--- a/core/java/com/android/internal/os/RoSystemProperties.java
+++ b/core/java/com/android/internal/os/RoSystemProperties.java
@@ -68,10 +68,14 @@ public class RoSystemProperties {
public static final CryptoProperties.type_values CRYPTO_TYPE =
CryptoProperties.type().orElse(CryptoProperties.type_values.NONE);
// These are pseudo-properties
+ public static final boolean CRYPTO_ENCRYPTABLE =
+ CRYPTO_STATE != CryptoProperties.state_values.UNSUPPORTED;
public static final boolean CRYPTO_ENCRYPTED =
CRYPTO_STATE == CryptoProperties.state_values.ENCRYPTED;
public static final boolean CRYPTO_FILE_ENCRYPTED =
CRYPTO_TYPE == CryptoProperties.type_values.FILE;
+ public static final boolean CRYPTO_BLOCK_ENCRYPTED =
+ CRYPTO_TYPE == CryptoProperties.type_values.BLOCK;
public static final boolean CONTROL_PRIVAPP_PERMISSIONS_LOG =
"log".equalsIgnoreCase(CONTROL_PRIVAPP_PERMISSIONS);
--
2.41.0

View file

@ -1,18 +1,18 @@
From 28cd1a43c63151391142a54fe6c3067a0f40f73b Mon Sep 17 00:00:00 2001
From 1d03233fbd587b33b92c1017f5682db1a7887692 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sat, 12 Aug 2023 20:11:17 +0800
Subject: [PATCH 08/11] Add runWithCleanCallingIdentity variant with both
Subject: [PATCH 06/10] Add runWithCleanCallingIdentity variant with both
executor and return value
This complements the fixup to ImsPhoneCallTracker (in fw/o/t) for U
Change-Id: If444290787025e130dce4bdeaf92372ae32793fe
---
.../telephony/util/TelephonyUtils.java | 32 ++++++++++++++++++-
1 file changed, 31 insertions(+), 1 deletion(-)
.../telephony/util/TelephonyUtils.java | 30 +++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/telephony/common/com/android/internal/telephony/util/TelephonyUtils.java b/telephony/common/com/android/internal/telephony/util/TelephonyUtils.java
index 9a8c9655375d..454080144d35 100644
index aed8fb8c4503..1467e7f2fc29 100644
--- a/telephony/common/com/android/internal/telephony/util/TelephonyUtils.java
+++ b/telephony/common/com/android/internal/telephony/util/TelephonyUtils.java
@@ -42,7 +42,9 @@ import com.android.internal.telephony.ITelephony;
@ -60,13 +60,6 @@ index 9a8c9655375d..454080144d35 100644
/**
* Filter values in bundle to only basic types.
*/
@@ -319,4 +349,4 @@ public final class TelephonyUtils {
return false;
}
-}
\ No newline at end of file
+}
--
2.41.0
2.43.1

View file

@ -1,7 +1,7 @@
From 8abbc55bf9452f935c59e869f6713da27fbec24f Mon Sep 17 00:00:00 2001
From 696e378fac49c9a90032b588dd4bb0887b44452f Mon Sep 17 00:00:00 2001
From: dhacker29 <dhackerdvm@gmail.com>
Date: Tue, 24 Nov 2015 01:53:47 -0500
Subject: [PATCH 09/11] fw/b: Use ro.build.version.incremental to signal OTA
Subject: [PATCH 07/10] fw/b: Use ro.build.version.incremental to signal OTA
upgrades
Squash of:
@ -85,10 +85,10 @@ index 9e6c91f4ec31..7459b0e05e3a 100644
}
try {
diff --git a/services/core/java/com/android/server/am/UserController.java b/services/core/java/com/android/server/am/UserController.java
index 99c2f8a5cc56..d6b55f9d1e8c 100644
index a6b532cdef09..7f41474c63f4 100644
--- a/services/core/java/com/android/server/am/UserController.java
+++ b/services/core/java/com/android/server/am/UserController.java
@@ -90,6 +90,7 @@ import android.content.pm.UserInfo;
@@ -89,6 +89,7 @@ import android.content.pm.UserInfo;
import android.content.pm.UserProperties;
import android.os.BatteryStats;
import android.os.Binder;
@ -96,7 +96,7 @@ index 99c2f8a5cc56..d6b55f9d1e8c 100644
import android.os.Bundle;
import android.os.Debug;
import android.os.Handler;
@@ -753,7 +754,7 @@ class UserController implements Handler.Callback {
@@ -774,7 +775,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);
@ -106,10 +106,10 @@ index 99c2f8a5cc56..d6b55f9d1e8c 100644
// Suppress double notifications for managed profiles that
// were unlocked automatically as part of their parent user being
diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java
index c583f1767b41..912eaafc5b4a 100644
index bc441b84c58b..68e3f9f73c74 100644
--- a/services/core/java/com/android/server/pm/PackageManagerService.java
+++ b/services/core/java/com/android/server/pm/PackageManagerService.java
@@ -1616,7 +1616,7 @@ public class PackageManagerService implements PackageSender, TestUtilityService
@@ -1746,7 +1746,7 @@ public class PackageManagerService implements PackageSender, TestUtilityService
}
PackageManagerService m = new PackageManagerService(injector, factoryTest,
@ -118,7 +118,7 @@ index c583f1767b41..912eaafc5b4a 100644
Build.VERSION.SDK_INT, Build.VERSION.INCREMENTAL);
t.traceEnd(); // "create package manager"
@@ -2083,9 +2083,8 @@ public class PackageManagerService implements PackageSender, TestUtilityService
@@ -2225,9 +2225,8 @@ public class PackageManagerService implements PackageSender, TestUtilityService
mIsUpgrade =
!partitionsFingerprint.equals(ver.fingerprint);
if (mIsUpgrade) {
@ -130,7 +130,7 @@ index c583f1767b41..912eaafc5b4a 100644
}
mInitAppsHelper = new InitAppsHelper(this, mApexManager, mInstallPackageHelper,
@@ -2222,8 +2221,8 @@ public class PackageManagerService implements PackageSender, TestUtilityService
@@ -2364,8 +2363,8 @@ public class PackageManagerService implements PackageSender, TestUtilityService
// allow... it would be nice to have some better way to handle
// this situation.
if (mIsUpgrade) {
@ -141,7 +141,7 @@ index c583f1767b41..912eaafc5b4a 100644
+ "; regranting permissions for internal storage");
}
mPermissionManager.onStorageVolumeMounted(
@@ -2243,7 +2242,7 @@ public class PackageManagerService implements PackageSender, TestUtilityService
@@ -2387,7 +2386,7 @@ public class PackageManagerService implements PackageSender, TestUtilityService
// 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) {
@ -150,7 +150,7 @@ index c583f1767b41..912eaafc5b4a 100644
for (int i = 0; i < packageSettings.size(); i++) {
final PackageSetting ps = packageSettings.valueAt(i);
if (Objects.equals(StorageManager.UUID_PRIVATE_INTERNAL, ps.getVolumeUuid())) {
@@ -2255,7 +2254,7 @@ public class PackageManagerService implements PackageSender, TestUtilityService
@@ -2399,7 +2398,7 @@ public class PackageManagerService implements PackageSender, TestUtilityService
}
}
ver.buildFingerprint = Build.FINGERPRINT;
@ -160,10 +160,10 @@ index c583f1767b41..912eaafc5b4a 100644
// Defer the app data fixup until we are done with app data clearing above.
diff --git a/services/core/java/com/android/server/pm/Settings.java b/services/core/java/com/android/server/pm/Settings.java
index 677a5d11cc6b..3c7080996875 100644
index d6952262d82e..d03a3522a67a 100644
--- a/services/core/java/com/android/server/pm/Settings.java
+++ b/services/core/java/com/android/server/pm/Settings.java
@@ -465,7 +465,7 @@ public final class Settings implements Watchable, Snappable, ResilientAtomicFile
@@ -481,7 +481,7 @@ public final class Settings implements Watchable, Snappable, ResilientAtomicFile
sdkVersion = Build.VERSION.SDK_INT;
databaseVersion = CURRENT_DATABASE_VERSION;
buildFingerprint = Build.FINGERPRINT;
@ -172,7 +172,7 @@ index 677a5d11cc6b..3c7080996875 100644
}
}
@@ -5732,7 +5732,7 @@ public final class Settings implements Watchable, Snappable, ResilientAtomicFile
@@ -5983,7 +5983,7 @@ public final class Settings implements Watchable, Snappable, ResilientAtomicFile
}
private String getExtendedFingerprint(long version) {
@ -182,10 +182,10 @@ index 677a5d11cc6b..3c7080996875 100644
private static long uniformRandom(double low, double high) {
diff --git a/services/core/java/com/android/server/pm/ShortcutService.java b/services/core/java/com/android/server/pm/ShortcutService.java
index c6aba2ab9cbe..1aad29efa322 100644
index 3adeb4b5925f..4895a71c1322 100644
--- a/services/core/java/com/android/server/pm/ShortcutService.java
+++ b/services/core/java/com/android/server/pm/ShortcutService.java
@@ -5206,7 +5206,7 @@ public class ShortcutService extends IShortcutService.Stub {
@@ -5208,7 +5208,7 @@ public class ShortcutService extends IShortcutService.Stub {
// Injection point.
String injectBuildFingerprint() {
@ -195,10 +195,10 @@ index c6aba2ab9cbe..1aad29efa322 100644
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 d2929aef8a63..ba0b597bb2ce 100644
index c48eccf2aac5..9033d8ee5e7a 100644
--- a/services/core/java/com/android/server/pm/UserManagerService.java
+++ b/services/core/java/com/android/server/pm/UserManagerService.java
@@ -4889,7 +4889,7 @@ public class UserManagerService extends IUserManager.Stub {
@@ -5100,7 +5100,7 @@ public class UserManagerService extends IUserManager.Stub {
userInfo.creationTime = getCreationTime();
userInfo.partial = true;
userInfo.preCreated = preCreate;
@ -207,25 +207,25 @@ index d2929aef8a63..ba0b597bb2ce 100644
if (userTypeDetails.hasBadge() && parentId != UserHandle.USER_NULL) {
userInfo.profileBadge = getFreeProfileBadgeLU(parentId, userType);
}
@@ -6219,7 +6219,7 @@ public class UserManagerService extends IUserManager.Stub {
@@ -6401,7 +6401,7 @@ public class UserManagerService extends IUserManager.Stub {
TimingsTraceAndSlog t = new TimingsTraceAndSlog();
t.traceBegin("onBeforeStartUser-" + userId);
final int userSerial = userInfo.serialNumber;
// Migrate only if build fingerprints mismatch
- boolean migrateAppsData = !PackagePartitions.FINGERPRINT.equals(
+ boolean migrateAppsData = !Build.VERSION.INCREMENTAL.equals(
userInfo.lastLoggedInFingerprint);
t.traceBegin("prepareUserData");
mUserDataPreparer.prepareUserData(userId, userSerial, StorageManager.FLAG_STORAGE_DE);
@@ -6250,7 +6250,7 @@ public class UserManagerService extends IUserManager.Stub {
mUserDataPreparer.prepareUserData(userInfo, StorageManager.FLAG_STORAGE_DE);
@@ -6431,7 +6431,7 @@ public class UserManagerService extends IUserManager.Stub {
return;
}
final int userSerial = userInfo.serialNumber;
// Migrate only if build fingerprints mismatch
- boolean migrateAppsData = !PackagePartitions.FINGERPRINT.equals(
+ boolean migrateAppsData = !Build.VERSION.INCREMENTAL.equals(
userInfo.lastLoggedInFingerprint);
final TimingsTraceAndSlog t = new TimingsTraceAndSlog();
@@ -6295,7 +6295,7 @@ public class UserManagerService extends IUserManager.Stub {
@@ -6476,7 +6476,7 @@ public class UserManagerService extends IUserManager.Stub {
if (now > EPOCH_PLUS_30_YEARS) {
userData.info.lastLoggedInTime = now;
}
@ -235,5 +235,5 @@ index d2929aef8a63..ba0b597bb2ce 100644
}
--
2.41.0
2.43.1

View file

@ -1,7 +1,7 @@
From f35f1213d1221cde06ee24956649e5ecb4ac5277 Mon Sep 17 00:00:00 2001
From eeeb323b495245354be3b98089a430ee04f67ae5 Mon Sep 17 00:00:00 2001
From: Peter Cai <peter@typeblog.net>
Date: Sat, 9 Dec 2023 18:37:08 -0500
Subject: [PATCH 10/11] Revert "Convert BubbleDataRepositoryTest to use
Subject: [PATCH 08/10] Revert "Convert BubbleDataRepositoryTest to use
mockito-kotlin"
This reverts commit 625a23ff22f0a9327b9a24341dfa0b8fbaf61a1b.
@ -11,16 +11,16 @@ This reverts commit 625a23ff22f0a9327b9a24341dfa0b8fbaf61a1b.
2 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/libs/WindowManager/Shell/tests/unittest/Android.bp b/libs/WindowManager/Shell/tests/unittest/Android.bp
index c2f184a03380..ad4d97f6fe40 100644
index aadadd604d3e..70106c3d41b4 100644
--- a/libs/WindowManager/Shell/tests/unittest/Android.bp
+++ b/libs/WindowManager/Shell/tests/unittest/Android.bp
@@ -43,7 +43,6 @@ android_test {
@@ -44,7 +44,6 @@ android_test {
"frameworks-base-testutils",
"kotlinx-coroutines-android",
"kotlinx-coroutines-core",
- "mockito-kotlin2",
"mockito-target-extended-minus-junit4",
"truth-prebuilt",
"truth",
"testables",
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/bubbles/BubbleDataRepositoryTest.kt b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/bubbles/BubbleDataRepositoryTest.kt
index e35995775f76..0e05e01a8da3 100644
@ -71,5 +71,5 @@ index e35995775f76..0e05e01a8da3 100644
}
\ No newline at end of file
--
2.41.0
2.43.1

View file

@ -1,7 +1,7 @@
From 3d3312bd96d2c8a74e4a27b5567a24f92ad8d243 Mon Sep 17 00:00:00 2001
From 9c7aba6023ca7fe010300d1c92af0c9e461afd10 Mon Sep 17 00:00:00 2001
From: Peter Cai <peter@typeblog.net>
Date: Fri, 15 Dec 2023 22:48:39 -0500
Subject: [PATCH 11/11] FingerprintService: Do not use HIDL providers when AIDL
Subject: [PATCH 09/10] FingerprintService: Do not use HIDL providers when AIDL
is present
This fixes duplicated sensor ID when config_biometric_sensors is defined
@ -13,10 +13,10 @@ Change-Id: I9942e91a95106a7a11ab7ddf145d87562d1b7c0d
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/services/core/java/com/android/server/biometrics/sensors/fingerprint/FingerprintService.java b/services/core/java/com/android/server/biometrics/sensors/fingerprint/FingerprintService.java
index 5ce0c8b384ef..a4e4a1b347d3 100644
index 83b306b07c27..7f144a0f615f 100644
--- a/services/core/java/com/android/server/biometrics/sensors/fingerprint/FingerprintService.java
+++ b/services/core/java/com/android/server/biometrics/sensors/fingerprint/FingerprintService.java
@@ -885,8 +885,9 @@ public class FingerprintService extends SystemService {
@@ -889,8 +889,9 @@ public class FingerprintService extends SystemService {
filteredInstances = filterAvailableHalInstances(hidlSensors, aidlSensors);
final List<ServiceProvider> providers = new ArrayList<>();
@ -28,5 +28,5 @@ index 5ce0c8b384ef..a4e4a1b347d3 100644
return providers;
});
--
2.41.0
2.43.1

View file

@ -0,0 +1,130 @@
From ae82395ce31a35c73b817fc25b8b7d5f96c32770 Mon Sep 17 00:00:00 2001
From: LuK1337 <priv.luk@gmail.com>
Date: Mon, 19 Feb 2024 16:20:04 +0100
Subject: [PATCH 10/10] Allow signature spoofing for microG Companion/Services
This patch enables signature spoofing when the following conditions are
met:
* Build is debuggable (userdebug/eng)
* Package name is com.android.vending or com.google.android.gms
* Package is signed with microG release keys
* Fake signature is correct
Additionally, we let these apps be forceQueryable if they so desire.
phh change: No need to be debuggable
Change-Id: I8fc82ed266a2cc59636b662c7ea7e29c94f509b5
---
.../com/android/server/pm/AppsFilterImpl.java | 2 +
.../com/android/server/pm/ComputerEngine.java | 46 +++++++++++++++++++
2 files changed, 48 insertions(+)
diff --git a/services/core/java/com/android/server/pm/AppsFilterImpl.java b/services/core/java/com/android/server/pm/AppsFilterImpl.java
index 82622d9a4ea8..277c9abe2e1c 100644
--- a/services/core/java/com/android/server/pm/AppsFilterImpl.java
+++ b/services/core/java/com/android/server/pm/AppsFilterImpl.java
@@ -36,6 +36,7 @@ import static com.android.server.pm.AppsFilterUtils.canQueryAsUpdateOwner;
import static com.android.server.pm.AppsFilterUtils.canQueryViaComponents;
import static com.android.server.pm.AppsFilterUtils.canQueryViaPackage;
import static com.android.server.pm.AppsFilterUtils.canQueryViaUsesLibrary;
+import static com.android.server.pm.ComputerEngine.isMicrogSigned;
import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -599,6 +600,7 @@ public final class AppsFilterImpl extends AppsFilterLocked implements Watchable,
newIsForceQueryable = mForceQueryable.contains(newPkgSetting.getAppId())
/* shared user that is already force queryable */
|| newPkgSetting.isForceQueryableOverride() /* adb override */
+ || (newPkg.isForceQueryable() && isMicrogSigned(newPkg))
|| (newPkgSetting.isSystem() && (mSystemAppsQueryable
|| newPkg.isForceQueryable()
|| ArrayUtils.contains(mForceQueryableByDevicePackageNames,
diff --git a/services/core/java/com/android/server/pm/ComputerEngine.java b/services/core/java/com/android/server/pm/ComputerEngine.java
index 3cb2420cd223..b0d9be30edc1 100644
--- a/services/core/java/com/android/server/pm/ComputerEngine.java
+++ b/services/core/java/com/android/server/pm/ComputerEngine.java
@@ -100,6 +100,7 @@ import android.content.pm.UserPackage;
import android.content.pm.VersionedPackage;
import android.os.Binder;
import android.os.Build;
+import android.os.Bundle;
import android.os.IBinder;
import android.os.ParcelableException;
import android.os.PatternMatcher;
@@ -172,6 +173,7 @@ import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Objects;
+import java.util.Optional;
import java.util.Set;
import java.util.UUID;
@@ -421,6 +423,10 @@ public class ComputerEngine implements Computer {
private final PackageManagerInternal.ExternalSourcesPolicy mExternalSourcesPolicy;
private final CrossProfileIntentResolverEngine mCrossProfileIntentResolverEngine;
+ // Signatures used by microG
+ private static final Signature MICROG_FAKE_SIGNATURE = new Signature("308204433082032ba003020102020900c2e08746644a308d300d06092a864886f70d01010405003074310b3009060355040613025553311330110603550408130a43616c69666f726e6961311630140603550407130d4d6f756e7461696e205669657731143012060355040a130b476f6f676c6520496e632e3110300e060355040b1307416e64726f69643110300e06035504031307416e64726f6964301e170d3038303832313233313333345a170d3336303130373233313333345a3074310b3009060355040613025553311330110603550408130a43616c69666f726e6961311630140603550407130d4d6f756e7461696e205669657731143012060355040a130b476f6f676c6520496e632e3110300e060355040b1307416e64726f69643110300e06035504031307416e64726f696430820120300d06092a864886f70d01010105000382010d00308201080282010100ab562e00d83ba208ae0a966f124e29da11f2ab56d08f58e2cca91303e9b754d372f640a71b1dcb130967624e4656a7776a92193db2e5bfb724a91e77188b0e6a47a43b33d9609b77183145ccdf7b2e586674c9e1565b1f4c6a5955bff251a63dabf9c55c27222252e875e4f8154a645f897168c0b1bfc612eabf785769bb34aa7984dc7e2ea2764cae8307d8c17154d7ee5f64a51a44a602c249054157dc02cd5f5c0e55fbef8519fbe327f0b1511692c5a06f19d18385f5c4dbc2d6b93f68cc2979c70e18ab93866b3bd5db8999552a0e3b4c99df58fb918bedc182ba35e003c1b4b10dd244a8ee24fffd333872ab5221985edab0fc0d0b145b6aa192858e79020103a381d93081d6301d0603551d0e04160414c77d8cc2211756259a7fd382df6be398e4d786a53081a60603551d2304819e30819b8014c77d8cc2211756259a7fd382df6be398e4d786a5a178a4763074310b3009060355040613025553311330110603550408130a43616c69666f726e6961311630140603550407130d4d6f756e7461696e205669657731143012060355040a130b476f6f676c6520496e632e3110300e060355040b1307416e64726f69643110300e06035504031307416e64726f6964820900c2e08746644a308d300c0603551d13040530030101ff300d06092a864886f70d010104050003820101006dd252ceef85302c360aaace939bcff2cca904bb5d7a1661f8ae46b2994204d0ff4a68c7ed1a531ec4595a623ce60763b167297a7ae35712c407f208f0cb109429124d7b106219c084ca3eb3f9ad5fb871ef92269a8be28bf16d44c8d9a08e6cb2f005bb3fe2cb96447e868e731076ad45b33f6009ea19c161e62641aa99271dfd5228c5c587875ddb7f452758d661f6cc0cccb7352e424cc4365c523532f7325137593c4ae341f4db41edda0d0b1071a7c440f0fe9ea01cb627ca674369d084bd2fd911ff06cdbf2cfa10dc0f893ae35762919048c7efc64c7144178342f70581c9de573af55b390dd7fdb9418631895d5f759f30112687ff621410c069308a");
+ private static final Signature MICROG_REAL_SIGNATURE = new Signature("308202ed308201d5a003020102020426ffa009300d06092a864886f70d01010b05003027310b300906035504061302444531183016060355040a130f4e4f47415050532050726f6a656374301e170d3132313030363132303533325a170d3337303933303132303533325a3027310b300906035504061302444531183016060355040a130f4e4f47415050532050726f6a65637430820122300d06092a864886f70d01010105000382010f003082010a02820101009a8d2a5336b0eaaad89ce447828c7753b157459b79e3215dc962ca48f58c2cd7650df67d2dd7bda0880c682791f32b35c504e43e77b43c3e4e541f86e35a8293a54fb46e6b16af54d3a4eda458f1a7c8bc1b7479861ca7043337180e40079d9cdccb7e051ada9b6c88c9ec635541e2ebf0842521c3024c826f6fd6db6fd117c74e859d5af4db04448965ab5469b71ce719939a06ef30580f50febf96c474a7d265bb63f86a822ff7b643de6b76e966a18553c2858416cf3309dd24278374bdd82b4404ef6f7f122cec93859351fc6e5ea947e3ceb9d67374fe970e593e5cd05c905e1d24f5a5484f4aadef766e498adf64f7cf04bddd602ae8137b6eea40722d0203010001a321301f301d0603551d0e04160414110b7aa9ebc840b20399f69a431f4dba6ac42a64300d06092a864886f70d01010b0500038201010007c32ad893349cf86952fb5a49cfdc9b13f5e3c800aece77b2e7e0e9c83e34052f140f357ec7e6f4b432dc1ed542218a14835acd2df2deea7efd3fd5e8f1c34e1fb39ec6a427c6e6f4178b609b369040ac1f8844b789f3694dc640de06e44b247afed11637173f36f5886170fafd74954049858c6096308fc93c1bc4dd5685fa7a1f982a422f2a3b36baa8c9500474cf2af91c39cbec1bc898d10194d368aa5e91f1137ec115087c31962d8f76cd120d28c249cf76f4c70f5baa08c70a7234ce4123be080cee789477401965cfe537b924ef36747e8caca62dfefdd1a6288dcb1c4fd2aaa6131a7ad254e9742022cfd597d2ca5c660ce9e41ff537e5a4041e37");
+
// PackageManagerService attributes that are primitives are referenced through the
// pms object directly. Primitives are the only attributes so referenced.
protected final PackageManagerService mService;
@@ -1463,6 +1469,42 @@ public class ComputerEngine implements Computer {
return result;
}
+ public static boolean isMicrogSigned(AndroidPackage p) {
+ // Allowlist the following apps:
+ // * com.android.vending - microG Companion
+ // * com.google.android.gms - microG Services
+ if (!p.getPackageName().equals("com.android.vending") &&
+ !p.getPackageName().equals("com.google.android.gms")) {
+ return false;
+ }
+ return Signature.areExactMatch(
+ p.getSigningDetails(), new Signature[]{MICROG_REAL_SIGNATURE});
+ }
+
+ private static Optional<Signature> generateFakeSignature(AndroidPackage p) {
+ if (!isMicrogSigned(p)) {
+ return Optional.empty();
+ }
+
+ Bundle metadata = p.getMetaData();
+ if (metadata == null) {
+ return Optional.empty();
+ }
+
+ String fakeSignatureStr = metadata.getString("fake-signature");
+ if (TextUtils.isEmpty(fakeSignatureStr)) {
+ return Optional.empty();
+ }
+
+ // Only MICROG_FAKE_SIGNATURE can be faked
+ Signature fakeSignature = new Signature(fakeSignatureStr);
+ if (!fakeSignature.equals(MICROG_FAKE_SIGNATURE)) {
+ return Optional.empty();
+ }
+
+ return Optional.of(fakeSignature);
+ }
+
public final PackageInfo generatePackageInfo(PackageStateInternal ps,
@PackageManager.PackageInfoFlagsBits long flags, int userId) {
if (!mUserManager.exists(userId)) return null;
@@ -1511,6 +1553,10 @@ public class ComputerEngine implements Computer {
packageInfo.packageName = packageInfo.applicationInfo.packageName =
resolveExternalPackageName(p);
+ generateFakeSignature(p).ifPresent(fakeSignature -> {
+ packageInfo.signatures = new Signature[]{fakeSignature};
+ });
+
return packageInfo;
} else if ((flags & (MATCH_UNINSTALLED_PACKAGES | MATCH_ARCHIVED_PACKAGES)) != 0
&& PackageUserStateUtils.isAvailable(state, flags)) {
--
2.43.1

View file

@ -1,7 +1,7 @@
From d8c305abadf223aef7237029d9b58c6756922a7d Mon Sep 17 00:00:00 2001
From ab08eec99a802be5014b876823cab89c2d2e9ef6 Mon Sep 17 00:00:00 2001
From: ironydelerium <42721860+ironydelerium@users.noreply.github.com>
Date: Fri, 31 Dec 2021 02:20:28 -0800
Subject: [PATCH 1/5] Reintroduce 'public void
Subject: [PATCH 1/4] Reintroduce 'public void
TelephonyMetrics.writeRilSendSms(int, int, int, int)'. (#8)
The MediaTek IMS package for Android Q, at the very least (likely for the rest, too)
@ -42,5 +42,5 @@ index 3fdbfe0ed7..fb8011c3df 100644
* Write Send SMS event using ImsService. Expecting response from
* {@link #writeOnSmsSolicitedResponse}.
--
2.41.0
2.43.1

View file

@ -1,7 +1,7 @@
From 2861b7ed720286f3a69782d4fc18128e742d8949 Mon Sep 17 00:00:00 2001
From ca7d875358b275da98fcd55d583a9121bb68f309 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Mon, 6 Dec 2021 16:28:22 -0500
Subject: [PATCH 3/5] Fix baseband being too long to fit into a 91 chars
Subject: [PATCH 2/4] Fix baseband being too long to fit into a 91 chars
property, preventing telephony subsystem from starting
Change-Id: I1762e4a8cc137626be89f350229d6be162bdaf57
@ -10,10 +10,10 @@ Change-Id: I1762e4a8cc137626be89f350229d6be162bdaf57
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/java/com/android/internal/telephony/GsmCdmaPhone.java b/src/java/com/android/internal/telephony/GsmCdmaPhone.java
index 5eae06112c..d5302413bc 100644
index 620b8711e2..951ef23115 100644
--- a/src/java/com/android/internal/telephony/GsmCdmaPhone.java
+++ b/src/java/com/android/internal/telephony/GsmCdmaPhone.java
@@ -3282,7 +3282,7 @@ public class GsmCdmaPhone extends Phone {
@@ -3373,7 +3373,7 @@ public class GsmCdmaPhone extends Phone {
String version = (String)ar.result;
if (version != null) {
int length = version.length();
@ -23,5 +23,5 @@ index 5eae06112c..d5302413bc 100644
length <= MAX_VERSION_LEN ? version
: version.substring(length - MAX_VERSION_LEN, length));
--
2.41.0
2.43.1

View file

@ -1,53 +0,0 @@
From b299cb6cb26268d1a0a58b8df42ea334d7bdc950 Mon Sep 17 00:00:00 2001
From: LuK1337 <priv.luk@gmail.com>
Date: Fri, 21 Oct 2022 20:55:05 +0200
Subject: [PATCH 2/5] Pass correct value to setPreferredNetworkType() for RIL
version < 1.4
Change-Id: Id14be66a2ea4e85b6504bc03fd7d2f038185c17d
---
src/java/com/android/internal/telephony/RIL.java | 3 ++-
.../com/android/internal/telephony/RadioNetworkProxy.java | 5 +++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/java/com/android/internal/telephony/RIL.java b/src/java/com/android/internal/telephony/RIL.java
index 5ecdfcbbd4..174b89c141 100644
--- a/src/java/com/android/internal/telephony/RIL.java
+++ b/src/java/com/android/internal/telephony/RIL.java
@@ -3027,7 +3027,8 @@ public class RIL extends BaseCommands implements CommandsInterface {
mMetrics.writeSetPreferredNetworkType(mPhoneId, networkType);
try {
- networkProxy.setPreferredNetworkTypeBitmap(rr.mSerial, mAllowedNetworkTypesBitmask);
+ networkProxy.setPreferredNetworkTypeBitmap(
+ rr.mSerial, mAllowedNetworkTypesBitmask, networkType);
} catch (RemoteException | RuntimeException e) {
handleRadioProxyExceptionForRR(HAL_SERVICE_NETWORK, "setPreferredNetworkType", e);
}
diff --git a/src/java/com/android/internal/telephony/RadioNetworkProxy.java b/src/java/com/android/internal/telephony/RadioNetworkProxy.java
index 246c2e0204..2e352a96b4 100644
--- a/src/java/com/android/internal/telephony/RadioNetworkProxy.java
+++ b/src/java/com/android/internal/telephony/RadioNetworkProxy.java
@@ -389,16 +389,17 @@ public class RadioNetworkProxy extends RadioServiceProxy {
* Call IRadioNetwork#setPreferredNetworkTypeBitmap
* @param serial Serial number of request
* @param networkTypesBitmask Preferred network types bitmask to set
+ * @param networkType Preferred network type to set for RIL version < 1.4
* @throws RemoteException
*/
- public void setPreferredNetworkTypeBitmap(int serial, int networkTypesBitmask)
+ public void setPreferredNetworkTypeBitmap(int serial, int networkTypesBitmask, int networkType)
throws RemoteException {
if (isEmpty() || mHalVersion.greaterOrEqual(RIL.RADIO_HAL_VERSION_1_6)) return;
if (mHalVersion.greaterOrEqual(RIL.RADIO_HAL_VERSION_1_4)) {
((android.hardware.radio.V1_4.IRadio) mRadioProxy).setPreferredNetworkTypeBitmap(serial,
RILUtils.convertToHalRadioAccessFamily(networkTypesBitmask));
} else {
- mRadioProxy.setPreferredNetworkType(serial, networkTypesBitmask);
+ mRadioProxy.setPreferredNetworkType(serial, networkType);
}
}
--
2.41.0

View file

@ -1,7 +1,7 @@
From ec5993b869fc758bd48c1636ee009bad8d4205bf Mon Sep 17 00:00:00 2001
From 8a28ea8c3ecb378dba2aff1d93e87095d71df873 Mon Sep 17 00:00:00 2001
From: ExactExampl <exactxmpl@pixelexperience.org>
Date: Tue, 11 Oct 2022 12:38:00 +0300
Subject: [PATCH 4/5] Conditionally revert "Block Binder thread until incoming
Subject: [PATCH 3/4] Conditionally revert "Block Binder thread until incoming
call process completes"
* Legacy IMS packages handling incoming calls in such a way that
@ -17,7 +17,7 @@ Change-Id: I55a8f3bbca4a2b9a6bc7511e9fe2d0884a8818e5
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/src/java/com/android/internal/telephony/imsphone/ImsPhoneCallTracker.java b/src/java/com/android/internal/telephony/imsphone/ImsPhoneCallTracker.java
index c3ee0f6060..f11b921c08 100644
index e95433c2ee..7e4fdf6b41 100644
--- a/src/java/com/android/internal/telephony/imsphone/ImsPhoneCallTracker.java
+++ b/src/java/com/android/internal/telephony/imsphone/ImsPhoneCallTracker.java
@@ -70,6 +70,7 @@ import android.os.Registrant;
@ -28,7 +28,7 @@ index c3ee0f6060..f11b921c08 100644
import android.preference.PreferenceManager;
import android.provider.Settings;
import android.sysprop.TelephonyProperties;
@@ -385,7 +386,19 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
@@ -389,7 +390,19 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
@Nullable
public IImsCallSessionListener onIncomingCall(
@NonNull IImsCallSession c, @Nullable String callId, @Nullable Bundle extras) {
@ -50,5 +50,5 @@ index c3ee0f6060..f11b921c08 100644
@Override
--
2.41.0
2.43.1

View file

@ -1,7 +1,7 @@
From 2685c843046fcfb12b42f530ed4d5b8fa28cdc9e Mon Sep 17 00:00:00 2001
From d7626b9015a9505c225254dcf36e5472f4c4e4a8 Mon Sep 17 00:00:00 2001
From: Peter Cai <peter@typeblog.net>
Date: Mon, 5 Sep 2022 14:02:37 -0400
Subject: [PATCH 5/5] SubscriptionController: Do not override default calling
Subject: [PATCH 4/4] SubscriptionController: Do not override default calling
account from third-party apps
When the user has selected a calling account from a third-party app as
@ -18,10 +18,10 @@ Change-Id: Iccab64e9b3b3ab4773bd8944d47c2006f229d472
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/src/java/com/android/internal/telephony/subscription/SubscriptionManagerService.java b/src/java/com/android/internal/telephony/subscription/SubscriptionManagerService.java
index 8e773c072d..1efe9ba3b4 100644
index a8d05a334b..42310ccc3f 100644
--- a/src/java/com/android/internal/telephony/subscription/SubscriptionManagerService.java
+++ b/src/java/com/android/internal/telephony/subscription/SubscriptionManagerService.java
@@ -78,6 +78,7 @@ import android.util.Base64;
@@ -81,6 +81,7 @@ import android.util.Base64;
import android.util.EventLog;
import android.util.IndentingPrintWriter;
import android.util.LocalLog;
@ -29,7 +29,7 @@ index 8e773c072d..1efe9ba3b4 100644
import com.android.internal.R;
import com.android.internal.annotations.VisibleForTesting;
@@ -2839,7 +2840,22 @@ public class SubscriptionManagerService extends ISub.Stub {
@@ -3023,7 +3024,22 @@ public class SubscriptionManagerService extends ISub.Stub {
TelecomManager telecomManager = mContext.getSystemService(TelecomManager.class);
if (telecomManager != null) {
@ -54,5 +54,5 @@ index 8e773c072d..1efe9ba3b4 100644
updateDefaultSubId();
--
2.41.0
2.43.1

View file

@ -1,4 +1,4 @@
From 079ec0124a642a3a473697c23da5907380930dd0 Mon Sep 17 00:00:00 2001
From ab27acf28b7e01c2fe9933849eaeb1622f5dfb6a Mon Sep 17 00:00:00 2001
From: Danny Lin <danny@kdrag0n.dev>
Date: Mon, 11 Oct 2021 20:48:44 -0700
Subject: [PATCH 1/3] Expose themed icon setting in ThemePicker
@ -38,5 +38,5 @@ index c6e2d8cb74..1d7405e345 100644
</application>
--
2.41.0
2.43.1

View file

@ -1,4 +1,4 @@
From f3f90de4d2440dcff4fab813b45862a9912bccf4 Mon Sep 17 00:00:00 2001
From 910c5a085260dfd33a0a2377b03a3c0eeb647cc5 Mon Sep 17 00:00:00 2001
From: Luca Stefani <luca.stefani.ge1@gmail.com>
Date: Fri, 1 Nov 2019 23:17:59 +0100
Subject: [PATCH 2/3] Properly expose GridCustomizationsProvider
@ -9,10 +9,10 @@ Change-Id: I8268a215257ae0e399c56ac8b44cdfdff8cc92a0
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/AndroidManifest-common.xml b/AndroidManifest-common.xml
index 14605d8053..89ebe026f9 100644
index 7e824ec15c..b87972e0ac 100644
--- a/AndroidManifest-common.xml
+++ b/AndroidManifest-common.xml
@@ -137,7 +137,9 @@
@@ -138,7 +138,9 @@
<provider
android:name="com.android.launcher3.graphics.GridCustomizationsProvider"
android:authorities="${packageName}.grid_control"
@ -24,5 +24,5 @@ index 14605d8053..89ebe026f9 100644
<!--
The settings activity. To extend point settings_fragment_name to appropriate fragment class
--
2.41.0
2.43.1

View file

@ -1,4 +1,4 @@
From 6de82b193ca71f4e9c9f578b8168fcfd11d9a95b Mon Sep 17 00:00:00 2001
From a87776a7970affcfbf86a8e22d9f109869d0163f Mon Sep 17 00:00:00 2001
From: Peter Cai <peter@typeblog.net>
Date: Fri, 7 Jul 2023 18:13:32 -0400
Subject: [PATCH 3/3] Disable QSB in BuildConfig
@ -9,7 +9,7 @@ Change-Id: I3150ef1d9b8c161ed2a6569d1ae75bba0060b36f
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src_build_config/com/android/launcher3/BuildConfig.java b/src_build_config/com/android/launcher3/BuildConfig.java
index 1f2e0e5387..ab6c528580 100644
index 3841969e9d..ae151abe75 100644
--- a/src_build_config/com/android/launcher3/BuildConfig.java
+++ b/src_build_config/com/android/launcher3/BuildConfig.java
@@ -24,7 +24,7 @@ public final class BuildConfig {
@ -20,7 +20,7 @@ index 1f2e0e5387..ab6c528580 100644
+ public static final boolean QSB_ON_FIRST_SCREEN = false;
/**
* Flag to control various developer centric features
* Flag to state if the widget on the top of the first screen should be shown.
--
2.41.0
2.43.1

View file

@ -1,4 +1,4 @@
From a70d53f488f7cfc9e5296df4fbc23e1c8a3955b3 Mon Sep 17 00:00:00 2001
From 22b752c0770f00c92ad91ab2c17b52a1c2c651a9 Mon Sep 17 00:00:00 2001
From: Oliver Scott <olivercscott@gmail.com>
Date: Thu, 8 Jul 2021 10:40:49 -0400
Subject: [PATCH] Global VPN feature [2/2]
@ -15,13 +15,13 @@ Signed-off-by: Mohammad Hasan Keramat J <ikeramat@protonmail.com>
3 files changed, 59 insertions(+), 1 deletion(-)
diff --git a/res/values/strings.xml b/res/values/strings.xml
index fa79cbbb33..d14a25abd1 100644
index 630aeed0049..20902850060 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -12129,4 +12129,10 @@
<!-- Warning message when we try to dock an app not supporting multiple instances split into multiple sides [CHAR LIMIT=NONE] -->
<string name="dock_multi_instances_not_supported_text">"This app can only be opened in 1 window"</string>
@@ -12633,4 +12633,10 @@
<string name="content_protection_preference_subpage_summary"></string>
<!-- Default information at the bottom of the subpage of content protection settings. Will be overlaid by OEM. -->
<string name="content_protection_preference_subpage_info"></string>
+
+ <!-- VPN app management screen, global VPN -->
+ <string name="global_vpn_title">Global VPN</string>
@ -30,7 +30,7 @@ index fa79cbbb33..d14a25abd1 100644
+ <string name="global_vpn_summary_any_vpn_active">You need to disable all active VPN connections first to enable this</string>
</resources>
diff --git a/res/xml/vpn_app_management.xml b/res/xml/vpn_app_management.xml
index dffbbbe311..93df378fd7 100644
index dffbbbe3116..93df378fd76 100644
--- a/res/xml/vpn_app_management.xml
+++ b/res/xml/vpn_app_management.xml
@@ -23,6 +23,12 @@
@ -47,7 +47,7 @@ index dffbbbe311..93df378fd7 100644
android:key="always_on_vpn"
android:title="@string/vpn_menu_lockdown"
diff --git a/src/com/android/settings/vpn2/AppManagementFragment.java b/src/com/android/settings/vpn2/AppManagementFragment.java
index 7d17541fd9..260d3ad94d 100644
index 1d5b3cc6d51..c1180ea1a8e 100644
--- a/src/com/android/settings/vpn2/AppManagementFragment.java
+++ b/src/com/android/settings/vpn2/AppManagementFragment.java
@@ -28,10 +28,12 @@ import android.content.pm.ApplicationInfo;
@ -88,7 +88,7 @@ index 7d17541fd9..260d3ad94d 100644
private RestrictedSwitchPreference mPreferenceLockdown;
private RestrictedPreference mPreferenceForget;
@@ -126,10 +131,16 @@ public class AppManagementFragment extends SettingsPreferenceFragment
mFeatureProvider = FeatureFactory.getFactory(getContext()).getAdvancedVpnFeatureProvider();
mFeatureProvider = FeatureFactory.getFeatureFactory().getAdvancedVpnFeatureProvider();
mPreferenceVersion = findPreference(KEY_VERSION);
+ mPreferenceGlobal = (SwitchPreference) findPreference(KEY_GLOBAL_VPN);
@ -177,5 +177,5 @@ index 7d17541fd9..260d3ad94d 100644
private static final String TAG = "CannotConnect";
private static final String ARG_VPN_LABEL = "label";
--
2.41.0
2.43.1

View file

@ -1,26 +1,25 @@
From 1752966cf96e7c037db368e62f93233b5905ed64 Mon Sep 17 00:00:00 2001
From d5cd47a4f197ab1d30b3ab03adfa27a602e94d70 Mon Sep 17 00:00:00 2001
From: Luca Stefani <luca.stefani.ge1@gmail.com>
Date: Fri, 1 Nov 2019 21:14:29 +0100
Subject: [PATCH 1/5] Add wallpaper privapp whitelist
Subject: [PATCH 1/4] Add wallpaper privapp whitelist
Change-Id: I044b1d9201ac0b8780fc37a387f401f3dd0ddeac
---
Android.bp | 10 +++++++++
Android.bp | 9 ++++++++
privapp_whitelist_com.android.wallpaper.xml | 24 +++++++++++++++++++++
2 files changed, 34 insertions(+)
2 files changed, 33 insertions(+)
create mode 100644 privapp_whitelist_com.android.wallpaper.xml
diff --git a/Android.bp b/Android.bp
index f6c85581..e25c6e3d 100644
index d3a7c514..e23d0c84 100644
--- a/Android.bp
+++ b/Android.bp
@@ -118,5 +118,15 @@ android_app {
@@ -141,5 +141,14 @@ android_app {
platform_apis: true,
manifest: "AndroidManifest.xml",
additional_manifests: [":WallpaperPicker2_Manifest"],
+
+ required: ["privapp_whitelist_com.android.wallpaper.xml"],
overrides: ["WallpaperPicker2"],
overrides: ["WallpaperPicker", "WallpaperPicker2"],
}
+
+prebuilt_etc_xml {
@ -61,5 +60,5 @@ index 00000000..e3f3b658
+ </privapp-permissions>
+</permissions>
--
2.41.0
2.43.1

View file

@ -1,33 +1,32 @@
From 0c493c5d97381bc1f809f15a4c948b47631a4346 Mon Sep 17 00:00:00 2001
From 17911eaa692b1b4db729ab0662827a50f9e7e2ff Mon Sep 17 00:00:00 2001
From: LuK1337 <priv.luk@gmail.com>
Date: Tue, 15 Sep 2020 03:27:19 +0200
Subject: [PATCH 3/5] Add wallpaper default permissions
Subject: [PATCH 2/4] Add wallpaper default permissions
Change-Id: If43a594da31fbab9280ce45b049737f6c534b620
---
Android.bp | 14 ++++++-
Android.bp | 13 ++++++-
default_permissions_com.android.wallpaper.xml | 37 +++++++++++++++++++
2 files changed, 50 insertions(+), 1 deletion(-)
2 files changed, 49 insertions(+), 1 deletion(-)
create mode 100644 default_permissions_com.android.wallpaper.xml
diff --git a/Android.bp b/Android.bp
index f2efc94e..1a525b0e 100644
index e23d0c84..44319052 100644
--- a/Android.bp
+++ b/Android.bp
@@ -119,7 +119,11 @@ android_app {
@@ -141,7 +141,10 @@ android_app {
platform_apis: true,
manifest: "AndroidManifest.xml",
additional_manifests: [":WallpaperPicker2_Manifest"],
- required: ["privapp_whitelist_com.android.wallpaper.xml"],
+ required: [
+ "privapp_whitelist_com.android.wallpaper.xml",
+ "default_permissions_com.android.wallpaper.xml",
+ ],
+
overrides: ["WallpaperPicker2", "WallpaperPicker"],
overrides: ["WallpaperPicker", "WallpaperPicker2"],
}
@@ -130,3 +134,11 @@ prebuilt_etc_xml {
@@ -152,3 +155,11 @@ prebuilt_etc_xml {
filename_from_src: true,
sub_dir: "permissions",
}
@ -83,5 +82,5 @@ index 00000000..41b23ce1
+ </exception>
+</exceptions>
--
2.41.0
2.43.1

View file

@ -1,26 +0,0 @@
From e2fec57334a92244d36ba79cbdd25a469400603b Mon Sep 17 00:00:00 2001
From: Danny Lin <danny@kdrag0n.dev>
Date: Tue, 5 Oct 2021 19:00:36 -0700
Subject: [PATCH 2/5] Override legacy WallpaperPicker app
Change-Id: I9a1907527eea0e8e7cd10bab64ba79c2c4006c59
---
Android.bp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Android.bp b/Android.bp
index e25c6e3d..f2efc94e 100644
--- a/Android.bp
+++ b/Android.bp
@@ -120,7 +120,7 @@ android_app {
additional_manifests: [":WallpaperPicker2_Manifest"],
required: ["privapp_whitelist_com.android.wallpaper.xml"],
- overrides: ["WallpaperPicker2"],
+ overrides: ["WallpaperPicker2", "WallpaperPicker"],
}
prebuilt_etc_xml {
--
2.41.0

View file

@ -1,7 +1,7 @@
From bb52f513459c59ad25248dc98c632ed455dfd4c5 Mon Sep 17 00:00:00 2001
From b20465459c5c8848bd4c31ff4499f5bbb51afc48 Mon Sep 17 00:00:00 2001
From: Luca Stefani <luca.stefani.ge1@gmail.com>
Date: Fri, 1 Nov 2019 23:17:08 +0100
Subject: [PATCH 4/5] Specify we read and write launcher settings
Subject: [PATCH 3/4] Specify we read and write launcher settings
Change-Id: Ifc8196588443b007602118389ca76d34ab531f14
---
@ -9,10 +9,10 @@ Change-Id: Ifc8196588443b007602118389ca76d34ab531f14
1 file changed, 3 insertions(+)
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 4e71bcc6..26f4fce0 100755
index b8126e55..2dd11fbb 100755
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -45,6 +45,9 @@
@@ -54,6 +54,9 @@
</intent>
</queries>
@ -23,5 +23,5 @@ index 4e71bcc6..26f4fce0 100755
tools:replace="android:icon,android:name"
android:extractNativeLibs="false"
--
2.41.0
2.43.1

View file

@ -1,7 +1,7 @@
From 0226fd9e4610eb6db37426afe6c7cb05e31aa5e6 Mon Sep 17 00:00:00 2001
From 20d38bfa9324501ac1c1c183c72427f2662bcd28 Mon Sep 17 00:00:00 2001
From: Danny Lin <danny@kdrag0n.dev>
Date: Tue, 5 Oct 2021 22:40:58 -0700
Subject: [PATCH 5/5] Add permission for launcher preview rendering
Subject: [PATCH 4/4] Add permission for launcher preview rendering
Change-Id: Ie707dcd98161e8f5993b0504295fddc3f395cd20
---
@ -10,7 +10,7 @@ Change-Id: Ie707dcd98161e8f5993b0504295fddc3f395cd20
2 files changed, 2 insertions(+)
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 26f4fce0..40281cf9 100755
index 2dd11fbb..63d76b8e 100755
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -8,6 +8,7 @@
@ -33,5 +33,5 @@ index e3f3b658..47133be8 100644
</privapp-permissions>
</permissions>
--
2.41.0
2.43.1

View file

@ -1,4 +1,4 @@
From 184dbd4770340934511622b0bac58eb45d0cb905 Mon Sep 17 00:00:00 2001
From 638bd11ae1854619a40a5abbedcfdf397e2e1f53 Mon Sep 17 00:00:00 2001
From: Peter Cai <peter@typeblog.net>
Date: Wed, 24 Aug 2022 10:41:29 -0400
Subject: [PATCH 1/2] gd: hci: Ignore unexpected status events
@ -13,10 +13,10 @@ Change-Id: Ifb9a65fd77f21d15a8dc1ced9240194d38218ef6
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/system/gd/hci/hci_layer.cc b/system/gd/hci/hci_layer.cc
index c3312a557c..3e8ab78371 100644
index 0889aa69e9..0b61fd4a4a 100644
--- a/system/gd/hci/hci_layer.cc
+++ b/system/gd/hci/hci_layer.cc
@@ -211,14 +211,13 @@ struct HciLayer::impl {
@@ -213,14 +213,13 @@ struct HciLayer::impl {
command_queue_.front().GetCallback<CommandCompleteView>()->Invoke(
std::move(command_complete_view));
} else {
@ -39,5 +39,5 @@ index c3312a557c..3e8ab78371 100644
command_queue_.pop_front();
--
2.41.0
2.43.1

View file

@ -1,4 +1,4 @@
From a105602829eba6d179d3bfd4f117f2169f724b91 Mon Sep 17 00:00:00 2001
From 1e1aee85f08b67be4b8805c9c0727ce826b0793a Mon Sep 17 00:00:00 2001
From: Peter Cai <peter@typeblog.net>
Date: Wed, 24 Aug 2022 15:45:18 -0400
Subject: [PATCH 2/2] audio_hal_interface: Optionally use sysbta HAL
@ -7,16 +7,16 @@ Required to support sysbta, our system-side bt audio implementation.
Change-Id: I59973e6ec84c5923be8a7c67b36b2e237f000860
---
system/audio_hal_interface/aidl/client_interface_aidl.cc | 8 ++++----
system/audio_hal_interface/aidl/client_interface_aidl.h | 7 +++++++
system/audio_hal_interface/hal_version_manager.cc | 9 ++++++++-
.../audio_hal_interface/aidl/client_interface_aidl.cc | 6 +++---
.../audio_hal_interface/aidl/client_interface_aidl.h | 7 +++++++
system/audio_hal_interface/hal_version_manager.cc | 11 +++++++++--
3 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/system/audio_hal_interface/aidl/client_interface_aidl.cc b/system/audio_hal_interface/aidl/client_interface_aidl.cc
index 897b891aa7..ed41627c3e 100644
index 9faa725022..f6706d98f1 100644
--- a/system/audio_hal_interface/aidl/client_interface_aidl.cc
+++ b/system/audio_hal_interface/aidl/client_interface_aidl.cc
@@ -56,7 +56,7 @@ BluetoothAudioClientInterface::BluetoothAudioClientInterface(
@@ -58,7 +58,7 @@ BluetoothAudioClientInterface::BluetoothAudioClientInterface(
bool BluetoothAudioClientInterface::is_aidl_available() {
return AServiceManager_isDeclared(
@ -25,7 +25,7 @@ index 897b891aa7..ed41627c3e 100644
}
std::vector<AudioCapabilities>
@@ -72,7 +72,7 @@ BluetoothAudioClientInterface::GetAudioCapabilities(SessionType session_type) {
@@ -74,7 +74,7 @@ BluetoothAudioClientInterface::GetAudioCapabilities(SessionType session_type) {
}
auto provider_factory = IBluetoothAudioProviderFactory::fromBinder(
::ndk::SpAIBinder(AServiceManager_waitForService(
@ -34,7 +34,7 @@ index 897b891aa7..ed41627c3e 100644
if (provider_factory == nullptr) {
LOG(ERROR) << __func__ << ", can't get capability from unknown factory";
@@ -99,7 +99,7 @@ void BluetoothAudioClientInterface::FetchAudioProvider() {
@@ -101,7 +101,7 @@ void BluetoothAudioClientInterface::FetchAudioProvider() {
}
auto provider_factory = IBluetoothAudioProviderFactory::fromBinder(
::ndk::SpAIBinder(AServiceManager_waitForService(
@ -43,17 +43,8 @@ index 897b891aa7..ed41627c3e 100644
if (provider_factory == nullptr) {
LOG(ERROR) << __func__ << ", can't get capability from unknown factory";
@@ -266,7 +266,7 @@ int BluetoothAudioClientInterface::GetAidlInterfaceVersion() {
auto provider_factory = IBluetoothAudioProviderFactory::fromBinder(
::ndk::SpAIBinder(AServiceManager_waitForService(
- kDefaultAudioProviderFactoryInterface.c_str())));
+ audioProviderFactoryInterface().c_str())));
if (provider_factory == nullptr) {
LOG(ERROR) << __func__ << ", can't get aidl version from unknown factory";
diff --git a/system/audio_hal_interface/aidl/client_interface_aidl.h b/system/audio_hal_interface/aidl/client_interface_aidl.h
index 8a40c1d7d7..6d962d3473 100644
index 0dd9575acb..d28e8e46fb 100644
--- a/system/audio_hal_interface/aidl/client_interface_aidl.h
+++ b/system/audio_hal_interface/aidl/client_interface_aidl.h
@@ -28,6 +28,7 @@
@ -64,7 +55,7 @@ index 8a40c1d7d7..6d962d3473 100644
#define BLUETOOTH_AUDIO_HAL_PROP_DISABLED \
"persist.bluetooth.bluetooth_audio_hal.disabled"
@@ -119,6 +120,12 @@ class BluetoothAudioClientInterface {
@@ -160,6 +161,12 @@ class BluetoothAudioClientInterface {
// "android.hardware.bluetooth.audio.IBluetoothAudioProviderFactory/default";
static inline const std::string kDefaultAudioProviderFactoryInterface =
std::string() + IBluetoothAudioProviderFactory::descriptor + "/default";
@ -78,18 +69,18 @@ index 8a40c1d7d7..6d962d3473 100644
private:
IBluetoothTransportInstance* transport_;
diff --git a/system/audio_hal_interface/hal_version_manager.cc b/system/audio_hal_interface/hal_version_manager.cc
index a2c192f37d..c3d1cf35c2 100644
index 275bbb067e..032856ef0e 100644
--- a/system/audio_hal_interface/hal_version_manager.cc
+++ b/system/audio_hal_interface/hal_version_manager.cc
@@ -24,6 +24,7 @@
#include <memory>
@@ -25,6 +25,7 @@
#include "aidl/audio_aidl_interfaces.h"
#include "osi/include/log.h"
+#include "osi/include/properties.h"
namespace bluetooth {
namespace audio {
@@ -33,6 +34,12 @@ using ::aidl::android::hardware::bluetooth::audio::
@@ -34,6 +35,12 @@ using ::aidl::android::hardware::bluetooth::audio::
static const std::string kDefaultAudioProviderFactoryInterface =
std::string() + IBluetoothAudioProviderFactory::descriptor + "/default";
@ -102,15 +93,24 @@ index a2c192f37d..c3d1cf35c2 100644
std::unique_ptr<HalVersionManager> HalVersionManager::instance_ptr =
std::make_unique<HalVersionManager>();
@@ -92,7 +99,7 @@ HalVersionManager::GetProvidersFactory_2_0() {
@@ -88,7 +95,7 @@ BluetoothAudioHalVersion GetAidlInterfaceVersion() {
auto provider_factory = IBluetoothAudioProviderFactory::fromBinder(
::ndk::SpAIBinder(AServiceManager_waitForService(
- kDefaultAudioProviderFactoryInterface.c_str())));
+ audioProviderFactoryInterface().c_str())));
if (provider_factory == nullptr) {
LOG_ERROR("Can't get aidl version from unknown factory");
@@ -122,7 +129,7 @@ BluetoothAudioHalVersion GetAidlInterfaceVersion() {
HalVersionManager::HalVersionManager() {
hal_transport_ = BluetoothAudioHalTransport::UNKNOWN;
if (AServiceManager_checkService(
- kDefaultAudioProviderFactoryInterface.c_str()) != nullptr) {
+ audioProviderFactoryInterface().c_str()) != nullptr) {
hal_version_ = BluetoothAudioHalVersion::VERSION_AIDL_V1;
hal_version_ = GetAidlInterfaceVersion();
hal_transport_ = BluetoothAudioHalTransport::AIDL;
return;
}
--
2.41.0
2.43.1

View file

@ -1,34 +0,0 @@
From 89613b61836c202b6ba3d3f35be16e24500ffe6c Mon Sep 17 00:00:00 2001
From: Peter Cai <peter@typeblog.net>
Date: Tue, 6 Dec 2022 18:30:32 -0500
Subject: [PATCH] Revert "detect inability to write to index != 0 of bpf map
array"
This reverts commit ead9d83423877458023056f6ccf9390950d6726f.
---
bpfloader/BpfLoader.cpp | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/bpfloader/BpfLoader.cpp b/bpfloader/BpfLoader.cpp
index e53669a..2816161 100644
--- a/bpfloader/BpfLoader.cpp
+++ b/bpfloader/BpfLoader.cpp
@@ -307,15 +307,6 @@ int main(int argc, char** argv) {
}
}
- int key = 1;
- int value = 123;
- android::base::unique_fd map(
- android::bpf::createMap(BPF_MAP_TYPE_ARRAY, sizeof(key), sizeof(value), 2, 0));
- if (android::bpf::writeToMapEntry(map, &key, &value, BPF_ANY)) {
- ALOGE("Critical kernel bug - failure to write into index 1 of 2 element bpf map array.");
- return 1;
- }
-
if (android::base::SetProperty("bpf.progs_loaded", "1") == false) {
ALOGE("Failed to set bpf.progs_loaded property");
return 1;
--
2.41.0

View file

@ -1,7 +1,7 @@
From 332fec7a7f18271f42c50ad85d955604aaff8777 Mon Sep 17 00:00:00 2001
From 9a08bf33057b2fe1ec3e4e2d922a67462bafe347 Mon Sep 17 00:00:00 2001
From: Isaac Chen <tingyi364@gmail.com>
Date: Wed, 23 Jun 2021 13:07:30 +0800
Subject: [PATCH 1/3] init: Do not start console service when debuggable
Subject: [PATCH 1/2] init: Do not start console service when debuggable
Google added a check for this in R, when it's running it will show a
notification about that performance is impacted.
@ -13,10 +13,10 @@ Change-Id: I34cfd6b42d3b9aee4b3e63181480cfb8b1255f29
1 file changed, 3 deletions(-)
diff --git a/rootdir/init.rc b/rootdir/init.rc
index 7da264611..8b037bc9a 100644
index 317f80908..9dc09ea4a 100644
--- a/rootdir/init.rc
+++ b/rootdir/init.rc
@@ -1312,9 +1312,6 @@ on property:ro.debuggable=1
@@ -1290,9 +1290,6 @@ on property:ro.debuggable=1
# Give reads to anyone for the accessibility trace folder on debug builds.
chmod 0775 /data/misc/a11ytrace
@ -27,5 +27,5 @@ index 7da264611..8b037bc9a 100644
# TODO(b/135984674): reset all necessary properties here.
setprop sys.boot_completed ""
--
2.41.0
2.43.1

View file

@ -1,32 +0,0 @@
From a644ef7d888b90a768564e0be805fd1975514e1a Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Fri, 21 Apr 2023 13:08:48 -0400
Subject: [PATCH 2/3] Let system override some properties (ro.apex.updatable,
ro.adb.secure, etc.)
Change-Id: I3c84fa617f0ab7990abb0d905230a8703cf39bf7
---
init/property_service.cpp | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/init/property_service.cpp b/init/property_service.cpp
index 8da69822c..0680b8e06 100644
--- a/init/property_service.cpp
+++ b/init/property_service.cpp
@@ -787,7 +787,12 @@ static void LoadProperties(char* data, const char* filter, const char* filename,
} else if (it->second != value) {
LOG(WARNING) << "Overriding previous property '" << key << "':'" << it->second
<< "' with new value '" << value << "'";
- it->second = value;
+ if (strcmp("ro.apex.updatable", key) == 0 || strcmp("ro.control_privapp_permissions", key) == 0
+ || strstr(key, "adb") || strstr(key, "secure")) {
+ LOG(WARNING) << "... Ignored";
+ } else {
+ it->second = value;
+ }
}
} else {
LOG(ERROR) << "Do not have permissions to set '" << key << "' to '" << value
--
2.41.0

View file

@ -0,0 +1,87 @@
From a0aa4c41f921134482737cf32437854816aba057 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Wed, 23 Feb 2022 17:37:47 -0500
Subject: [PATCH 2/2] init: Override select system properties
* ro.apex.updatable is overridden based on the kernel version and
vendor.
* adb secure props and logd can be overridden from system.
Change-Id: I94efa3f108ae97711026f099f367b6bea325629f
---
init/property_service.cpp | 42 +++++++++++++++++++++++++++++++++++----
1 file changed, 38 insertions(+), 4 deletions(-)
diff --git a/init/property_service.cpp b/init/property_service.cpp
index 013924778..90c6fa538 100644
--- a/init/property_service.cpp
+++ b/init/property_service.cpp
@@ -64,6 +64,8 @@
#include <selinux/android.h>
#include <selinux/label.h>
#include <selinux/selinux.h>
+#include <sys/utsname.h>
+
#include "debug_ramdisk.h"
#include "epoll.h"
#include "init.h"
@@ -704,6 +706,26 @@ uint32_t InitPropertySet(const std::string& name, const std::string& value) {
static Result<void> load_properties_from_file(const char*, const char*,
std::map<std::string, std::string>*);
+static bool kernel_supports_capex() {
+ // Put a threshold at >= 5.0
+ struct utsname buf;
+ uname(&buf);
+ const char *where = buf.release;
+ int a = atoi(where);
+ if (a >= 5) return true;
+
+ // If there are vendor apexes, we most likely actually need them
+ auto dir = std::unique_ptr<DIR, decltype(&closedir)>{opendir("/vendor/apex"), closedir};
+ if (!dir) {
+ return false;
+ }
+ for (struct dirent* ent = readdir(dir.get()); ent; ent = readdir(dir.get())) {
+ if(strstr(ent->d_name, "apex")) return true;
+ }
+
+ return false;
+}
+
/*
* Filter is used to decide which properties to load: NULL loads all keys,
* "ro.foo.*" is a prefix match, and "ro.foo.bar" is an exact match.
@@ -796,13 +818,25 @@ static void LoadProperties(char* data, const char* filter, const char* filename,
std::string error;
if (CheckPermissions(key, value, context, cr, &error) == PROP_SUCCESS) {
auto it = properties->find(key);
+ const char *new_value = value;
+
+ if (strcmp("ro.apex.updatable", key) == 0) {
+ new_value = kernel_supports_capex() ? "true" : "false";
+ }
if (it == properties->end()) {
- (*properties)[key] = value;
- } else if (it->second != value) {
+ (*properties)[key] = new_value;
+ } else if (it->second != new_value) {
LOG(WARNING) << "Overriding previous property '" << key << "':'" << it->second
<< "' with new value '" << value << "'";
- it->second = value;
- }
+ if (strcmp("ro.apex.updatable", key) == 0) {
+ LOG(WARNING) << "... Ignored apex by kernel version";
+ } else if (strstr(key, "adb") || strstr(key, "secure") || strstr(key, "ro.logd.kernel")
+ || strcmp("ro.control_privapp_permissions", key) == 0) {
+ LOG(WARNING) << "... Ignored";
+ } else {
+ it->second = new_value;
+ }
+ }
} else {
LOG(ERROR) << "Do not have permissions to set '" << key << "' to '" << value
<< "' in property file '" << filename << "': " << error;
--
2.43.1

View file

@ -1,38 +0,0 @@
From 896473ddb7ddc7eed869360ab2e06af6c5f882e1 Mon Sep 17 00:00:00 2001
From: Peter Cai <peter@typeblog.net>
Date: Fri, 15 Dec 2023 22:47:32 -0500
Subject: [PATCH 3/3] init: Don't override ro.apex.updatable for newer devices
...where apexes may be required for hardware features to work.
Change-Id: Ieed7de617231c93419f03aa31c9182018df131ec
---
init/property_service.cpp | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/init/property_service.cpp b/init/property_service.cpp
index 0680b8e06..5edf246a1 100644
--- a/init/property_service.cpp
+++ b/init/property_service.cpp
@@ -33,6 +33,7 @@
#include <sys/select.h>
#include <sys/types.h>
#include <sys/un.h>
+#include <sys/utsname.h>
#include <unistd.h>
#include <wchar.h>
@@ -787,7 +788,9 @@ static void LoadProperties(char* data, const char* filter, const char* filename,
} else if (it->second != value) {
LOG(WARNING) << "Overriding previous property '" << key << "':'" << it->second
<< "' with new value '" << value << "'";
- if (strcmp("ro.apex.updatable", key) == 0 || strcmp("ro.control_privapp_permissions", key) == 0
+ struct utsname uts;
+ if ((strcmp("ro.apex.updatable", key) == 0 && !(uname(&uts) == 0 && atoi(uts.release) >= 5))
+ || strcmp("ro.control_privapp_permissions", key) == 0
|| strstr(key, "adb") || strstr(key, "secure")) {
LOG(WARNING) << "... Ignored";
} else {
--
2.41.0