Compare commits

...

18 commits

Author SHA1 Message Date
Peter Cai 714720852e s/core: Remove useless ro.apex.updatable override
This doesn't work anymore on r29; remove it. If we want to boot on
devices where apexes are broken, we have to find another way.
2024-04-05 20:09:08 -04:00
Peter Cai 2eb02ceb6b f/av: Remove unneeded vendor tag id fix for r31 2024-04-05 20:06:11 -04:00
Peter Cai 23d4cb289c f/a: Add Lineage patch for camera service 2024-03-27 20:13:12 -04:00
Peter Cai bc7032fc54 packages/modules/Connectivity: Fix for R vendors with 4.19 kernels 2024-03-16 15:40:07 -04:00
Peter Cai 6e4f421edb bluetooth: Revert utterly broken MTK patch
MTK please stop sending completely broken patches to AOSP thanks
2024-03-12 22:50:46 -04:00
Peter Cai c5a6c7eb2a Refresh patches for AOSP 14 r29 2024-03-12 19:41:47 -04:00
Peter Cai d05b445c89 Fix fingerprint sensor error on Pixel 7 Pro 2023-12-15 22:49:57 -05:00
Peter Cai 09dbc007f5 Refresh patches for r17 2023-12-09 18:37:32 -05:00
Peter Cai 173c8dfd9d fw/b: Add patch for proper upgrades 2023-10-14 15:50:39 -04:00
Peter Cai 0cd77ab28c [6/6] Android 14 port 2023-10-08 10:59:33 -04:00
Peter Cai 87b06501bc [5/n] Android 14 port 2023-10-08 10:50:51 -04:00
Peter Cai 4435ddab0a frameworks/av: Include more forward-ports from TD 2023-10-08 10:42:20 -04:00
Peter Cai 4b704639a2 Add patch for qcom voip_rx pitch issue 2023-10-08 10:39:23 -04:00
Peter Cai ccca70ec25 Fixup sysbta for Android 14 2023-10-07 23:19:37 -04:00
Peter Cai c4daf7d004 [4/n] Android 14 port
Refresh Bluetooth patches
2023-10-07 20:22:56 -04:00
Peter Cai c06b6e26a2 [3/n] Android 14 port
More required fwb patches
2023-10-07 19:38:33 -04:00
Peter Cai edbcfc74f2 [2/n] Android 14 port 2023-10-07 19:36:35 -04:00
Peter Cai ebc4ea1e26 [1/n] Android 14 port 2023-10-07 19:15:00 -04:00
45 changed files with 1182 additions and 865 deletions

View file

@ -1,4 +1,4 @@
From ea0f283eec1e7750351302dbc2009fa905cef375 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.40.0
2.43.1

View file

@ -1,7 +1,7 @@
From 5ae18168ff97d9e4eb66fc6dc8e087bd0ead8f31 Mon Sep 17 00:00:00 2001
From 682110b814e507f7ab30f0027fb3d41519fc809d Mon Sep 17 00:00:00 2001
From: Peter Cai <peter@typeblog.net>
Date: Wed, 24 Aug 2022 15:42:39 -0400
Subject: [PATCH 2/4] APM: Optionally force-load audio policy for system-side
Subject: [PATCH 1/5] APM: Optionally force-load audio policy for system-side
bt audio HAL
Required to support our system-side bt audio implementation, i.e.
@ -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 d446e9667b..f5233f2a42 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 d446e9667b..f5233f2a42 100644
#include <utils/Log.h>
#include <utils/StrongPointer.h>
#include <utils/Errors.h>
@@ -890,6 +891,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 d446e9667b..f5233f2a42 100644
// Global Configuration
--
2.39.2
2.44.0

View file

@ -1,7 +1,7 @@
From d11e204968cbf01851042f03fe2a12aabbe84a93 Mon Sep 17 00:00:00 2001
From 4dc4f2ff0eb1df7d8bfaab7d5d6a006035c3b403 Mon Sep 17 00:00:00 2001
From: Peter Cai <peter@typeblog.net>
Date: Thu, 25 Aug 2022 13:30:29 -0400
Subject: [PATCH 3/4] APM: Remove A2DP audio ports from the primary HAL
Subject: [PATCH 2/5] APM: Remove A2DP audio ports from the primary HAL
These ports defined in the primary HAL are intended for A2DP offloading,
however they do not work in general on GSIs, and will interfere with
@ -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 f5233f2a42..6630d06f6d 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 f5233f2a42..6630d06f6d 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 f5233f2a42..6630d06f6d 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 f5233f2a42..6630d06f6d 100644
RouteTraits::Collection routes;
--
2.39.2
2.44.0

View file

@ -0,0 +1,56 @@
From 819c95781f525035656b02f00d5251d1328f5073 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
Change-Id: I6d314912169776b76d07d8c0301ec5249c1870a2
---
.../common/managerdefinitions/src/Serializer.cpp | 12 +++++++++++-
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 0f7c903909..c4474cf1c2 100644
--- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
+++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
@@ -252,6 +252,7 @@ private:
std::string mChannelMasksSeparator = ",";
std::string mSamplingRatesSeparator = ",";
std::string mFlagsSeparator = "|";
+ std::string mMixPortName = "";
// Children: ModulesTraits, VolumeTraits, SurroundSoundTraits (optional)
};
@@ -426,13 +427,21 @@ PolicySerializer::deserialize<AudioProfileTraits>(
std::string samplingRates = getXmlAttribute(cur, Attributes::samplingRates);
std::string format = getXmlAttribute(cur, Attributes::format);
std::string channels = getXmlAttribute(cur, Attributes::channelMasks);
+ ChannelTraits::Collection channelsMask = channelMasksFromString(channels, mChannelMasksSeparator.c_str());
+
+ // This breaks in-game voice chat and audio in some messaging apps causing it to play with a higher pitch and speed
+ bool disableStereoVoip = property_get_bool("persist.sys.phh.disable_stereo_voip", false);
+ if (disableStereoVoip && mMixPortName == "voip_rx") {
+ ALOGI("%s: disabling stereo support on voip_rx", __func__);
+ channelsMask = channelMasksFromString("AUDIO_CHANNEL_OUT_MONO", ",");
+ }
if (mIgnoreVendorExtensions && maybeVendorExtension(format)) {
ALOGI("%s: vendor extension format \"%s\" skipped", __func__, format.c_str());
return NO_INIT;
}
AudioProfileTraits::Element profile = new AudioProfile(formatFromString(format, gDynamicFormat),
- channelMasksFromString(channels, mChannelMasksSeparator.c_str()),
+ channelsMask,
samplingRatesFromString(samplingRates, mSamplingRatesSeparator.c_str()));
profile->setDynamicFormat(profile->getFormat() == gDynamicFormat);
@@ -449,6 +458,7 @@ std::variant<status_t, MixPortTraits::Element> PolicySerializer::deserialize<Mix
using Attributes = MixPortTraits::Attributes;
std::string name = getXmlAttribute(child, Attributes::name);
+ mMixPortName = name;
if (name.empty()) {
ALOGE("%s: No %s found", __func__, Attributes::name);
return BAD_VALUE;
--
2.44.0

View file

@ -1,7 +1,7 @@
From f9be27ef60cd4ccca6803458ff29ee7a2236769c Mon Sep 17 00:00:00 2001
From 96765f345007ee59522f839a6e994f571dc782d3 Mon Sep 17 00:00:00 2001
From: Peter Cai <peter@typeblog.net>
Date: Thu, 18 Aug 2022 15:44:46 -0400
Subject: [PATCH 1/4] APM: Restore S, R and Q behavior respectively for
Subject: [PATCH 4/5] APM: Restore S, R and Q behavior respectively for
telephony audio
This conditionally reverts part of b2e5cb (T), 51c9cc (S) and afd4ce (R)
@ -31,17 +31,17 @@ relying on the value of `ro.vndk.version`.
Change-Id: I56d36d2aef4319935cb88a3e4771b23c6d5b2145
---
.../managerdefault/AudioPolicyManager.cpp | 103 ++++++++++++++++--
.../managerdefault/AudioPolicyManager.cpp | 206 ++++++++++++------
.../managerdefault/AudioPolicyManager.h | 3 +
2 files changed, 96 insertions(+), 10 deletions(-)
2 files changed, 147 insertions(+), 62 deletions(-)
diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
index 4573382a06..c218c7ce2d 100644
index 135548fb9c..fc99bdbd78 100644
--- a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
+++ b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
@@ -675,6 +675,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 4573382a06..c218c7ce2d 100644
auto telephonyRxModule =
mHwModules.getModuleForDeviceType(AUDIO_DEVICE_IN_TELEPHONY_RX, AUDIO_FORMAT_DEFAULT);
auto telephonyTxModule =
@@ -697,9 +708,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 4573382a06..c218c7ce2d 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.
@@ -716,7 +738,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 4573382a06..c218c7ce2d 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
@@ -731,7 +760,12 @@ status_t AudioPolicyManager::updateCallRoutingInternal(
@@ -752,7 +781,12 @@ status_t AudioPolicyManager::updateCallRoutingInternal(
closeActiveClients(activeDesc);
}
}
@ -111,7 +111,7 @@ index 4573382a06..c218c7ce2d 100644
}
if (waitMs != nullptr) {
*waitMs = muteWaitMs;
@@ -739,6 +773,36 @@ status_t AudioPolicyManager::updateCallRoutingInternal(
@@ -760,6 +794,36 @@ status_t AudioPolicyManager::updateCallRoutingInternal(
return NO_ERROR;
}
@ -148,25 +148,119 @@ index 4573382a06..c218c7ce2d 100644
bool AudioPolicyManager::isDeviceOfModule(
const sp<DeviceDescriptor>& devDesc, const char *moduleId) const {
sp<HwModule> module = mHwModules.getModuleFromName(moduleId);
@@ -4541,6 +4605,7 @@ 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;
+ if (sourceDesc != nullptr) { // Ignore indentation, we don't want to cuase huge conflicts...
if (!sourceDesc->isInternal()) {
// take care of dynamic routing for SwOutput selection,
audio_attributes_t attributes = sourceDesc->attributes();
@@ -4586,33 +4651,51 @@ status_t AudioPolicyManager::createAudioPatchInternal(const struct audio_patch *
outputDesc = mOutputs.valueFor(output);
if (outputDesc->isDuplicated()) {
ALOGV("%s output for device %s is duplicated",
- if (!sourceDesc->isInternal()) {
- // take care of dynamic routing for SwOutput selection,
- audio_attributes_t attributes = sourceDesc->attributes();
- audio_stream_type_t stream = sourceDesc->stream();
- audio_attributes_t resultAttr;
- audio_config_t config = AUDIO_CONFIG_INITIALIZER;
- config.sample_rate = sourceDesc->config().sample_rate;
- audio_channel_mask_t sourceMask = sourceDesc->config().channel_mask;
- config.channel_mask =
- (audio_channel_mask_get_representation(sourceMask)
- == AUDIO_CHANNEL_REPRESENTATION_INDEX) ? sourceMask
- : audio_channel_mask_in_to_out(sourceMask);
- config.format = sourceDesc->config().format;
- audio_output_flags_t flags = AUDIO_OUTPUT_FLAG_NONE;
- audio_port_handle_t selectedDeviceId = AUDIO_PORT_HANDLE_NONE;
- bool isRequestedDeviceForExclusiveUse = false;
- output_type_t outputType;
- bool isSpatialized;
- bool isBitPerfect;
- getOutputForAttrInt(&resultAttr, &output, AUDIO_SESSION_NONE, &attributes,
- &stream, sourceDesc->uid(), &config, &flags,
- &selectedDeviceId, &isRequestedDeviceForExclusiveUse,
- nullptr, &outputType, &isSpatialized, &isBitPerfect);
- if (output == AUDIO_IO_HANDLE_NONE) {
- ALOGV("%s no output for device %s",
- __FUNCTION__, sinkDevice->toString().c_str());
- return INVALID_OPERATION;
- }
- outputDesc = mOutputs.valueFor(output);
- if (outputDesc->isDuplicated()) {
- ALOGE("%s output is duplicated", __func__);
- return INVALID_OPERATION;
- }
- bool closeOutput = outputDesc->mDirectOpenCount != 0;
- sourceDesc->setSwOutput(outputDesc, closeOutput);
- } else {
- // Same for "raw patches" aka created from createAudioPatch API
- SortedVector<audio_io_handle_t> outputs =
- getOutputsForDevices(DeviceVector(sinkDevice), mOutputs);
- // if the sink device is reachable via an opened output stream, request to
- // go via this output stream by adding a second source to the patch
- // description
- output = selectOutput(outputs);
- if (output == AUDIO_IO_HANDLE_NONE) {
- ALOGE("%s no output available for internal patch sink", __func__);
- return INVALID_OPERATION;
- }
- outputDesc = mOutputs.valueFor(output);
- if (outputDesc->isDuplicated()) {
- ALOGV("%s output for device %s is duplicated",
- __func__, sinkDevice->toString().c_str());
+ __func__, sinkDevice->toString().c_str());
return INVALID_OPERATION;
- return INVALID_OPERATION;
+ if (sourceDesc != nullptr) {
+ if (!sourceDesc->isInternal()) {
+ // take care of dynamic routing for SwOutput selection,
+ audio_attributes_t attributes = sourceDesc->attributes();
+ audio_stream_type_t stream = sourceDesc->stream();
+ audio_attributes_t resultAttr;
+ audio_config_t config = AUDIO_CONFIG_INITIALIZER;
+ config.sample_rate = sourceDesc->config().sample_rate;
+ audio_channel_mask_t sourceMask = sourceDesc->config().channel_mask;
+ config.channel_mask =
+ (audio_channel_mask_get_representation(sourceMask)
+ == AUDIO_CHANNEL_REPRESENTATION_INDEX) ? sourceMask
+ : audio_channel_mask_in_to_out(sourceMask);
+ config.format = sourceDesc->config().format;
+ audio_output_flags_t flags = AUDIO_OUTPUT_FLAG_NONE;
+ audio_port_handle_t selectedDeviceId = AUDIO_PORT_HANDLE_NONE;
+ bool isRequestedDeviceForExclusiveUse = false;
+ output_type_t outputType;
+ bool isSpatialized;
+ bool isBitPerfect;
+ getOutputForAttrInt(&resultAttr, &output, AUDIO_SESSION_NONE, &attributes,
+ &stream, sourceDesc->uid(), &config, &flags,
+ &selectedDeviceId, &isRequestedDeviceForExclusiveUse,
+ nullptr, &outputType, &isSpatialized, &isBitPerfect);
+ if (output == AUDIO_IO_HANDLE_NONE) {
+ ALOGV("%s no output for device %s",
+ __FUNCTION__, sinkDevice->toString().c_str());
+ return INVALID_OPERATION;
+ }
+ outputDesc = mOutputs.valueFor(output);
+ if (outputDesc->isDuplicated()) {
+ ALOGE("%s output is duplicated", __func__);
+ return INVALID_OPERATION;
+ }
+ bool closeOutput = outputDesc->mDirectOpenCount != 0;
+ sourceDesc->setSwOutput(outputDesc, closeOutput);
+ } else {
+ // Same for "raw patches" aka created from createAudioPatch API
+ SortedVector<audio_io_handle_t> outputs =
+ getOutputsForDevices(DeviceVector(sinkDevice), mOutputs);
+ // if the sink device is reachable via an opened output stream, request to
+ // go via this output stream by adding a second source to the patch
+ // description
+ output = selectOutput(outputs);
+ if (output == AUDIO_IO_HANDLE_NONE) {
+ ALOGE("%s no output available for internal patch sink", __func__);
+ return INVALID_OPERATION;
+ }
+ outputDesc = mOutputs.valueFor(output);
+ if (outputDesc->isDuplicated()) {
+ ALOGV("%s output for device %s is duplicated",
+ __func__, sinkDevice->toString().c_str());
+ return INVALID_OPERATION;
+ }
}
sourceDesc->setSwOutput(outputDesc, /* closeOutput= */ false);
- sourceDesc->setSwOutput(outputDesc, /* closeOutput= */ false);
}
+ }
// create a software bridge in PatchPanel if:
// - source and sink devices are on different HW modules OR
// - audio HAL version is < 3.0
@ -209,15 +303,15 @@ index 4573382a06..c218c7ce2d 100644
// for volume control, we may need a valid stream
srcMixPortConfig.ext.mix.usecase.stream =
- (!sourceDesc->isInternal() || isCallTxAudioSource(sourceDesc)) ?
+ ((sourceDesc != nullptr && !sourceDesc->isInternal()) || isCallTxAudioSource(sourceDesc)) ?
+ (sourceDesc != nullptr && (!sourceDesc->isInternal() || isCallTxAudioSource(sourceDesc))) ?
mEngine->getStreamTypeForAttributes(sourceDesc->attributes()) :
AUDIO_STREAM_PATCH;
patchBuilder.addSource(srcMixPortConfig);
diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.h b/services/audiopolicy/managerdefault/AudioPolicyManager.h
index a69e08871b..f8762016db 100644
index a1c8f6202c..ee1b595e30 100644
--- a/services/audiopolicy/managerdefault/AudioPolicyManager.h
+++ b/services/audiopolicy/managerdefault/AudioPolicyManager.h
@@ -944,6 +944,9 @@ protected:
@@ -964,6 +964,9 @@ protected:
SoundTriggerSessionCollection mSoundTriggerSessions;
@ -228,5 +322,5 @@ index a69e08871b..f8762016db 100644
SourceClientCollection mAudioSources;
--
2.39.2
2.44.0

View file

@ -1,43 +0,0 @@
From 628ff965d6ade74843a58cab6fe58069ef0ec3ad Mon Sep 17 00:00:00 2001
From: Emilian Peev <epeev@google.com>
Date: Fri, 5 Aug 2022 17:28:06 -0700
Subject: [PATCH 4/4] Camera: Avoid unnecessary close of buffer acquire fence
fds
According to the gralloc lock documentation:
The ownership of acquireFence is always transferred to the callee, even
on errors.
Bug: 241455881
Test: Manual using camera application
Change-Id: Ieec34b54aaa7f0d773eccb593c3daaa3e41bae0b
Merged-In: Ieec34b54aaa7f0d773eccb593c3daaa3e41bae0b
---
.../camera/libcameraservice/device3/Camera3OutputStream.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/services/camera/libcameraservice/device3/Camera3OutputStream.cpp b/services/camera/libcameraservice/device3/Camera3OutputStream.cpp
index 396104c4fd..c725aadb79 100644
--- a/services/camera/libcameraservice/device3/Camera3OutputStream.cpp
+++ b/services/camera/libcameraservice/device3/Camera3OutputStream.cpp
@@ -331,7 +331,7 @@ status_t Camera3OutputStream::fixUpHidlJpegBlobHeader(ANativeWindowBuffer* anwBu
status_t res =
gbLocker.lockAsync(
GraphicBuffer::USAGE_SW_READ_OFTEN | GraphicBuffer::USAGE_SW_WRITE_RARELY,
- &mapped, fenceFd.get());
+ &mapped, fenceFd.release());
if (res != OK) {
ALOGE("%s: Failed to lock the buffer: %s (%d)", __FUNCTION__, strerror(-res), res);
return res;
@@ -1327,7 +1327,7 @@ void Camera3OutputStream::dumpImageToDisk(nsecs_t timestamp,
void* mapped = nullptr;
base::unique_fd fenceFd(dup(fence));
status_t res = graphicBuffer->lockAsync(GraphicBuffer::USAGE_SW_READ_OFTEN, &mapped,
- fenceFd.get());
+ fenceFd.release());
if (res != OK) {
ALOGE("%s: Failed to lock the buffer: %s (%d)", __FUNCTION__, strerror(-res), res);
return;
--
2.39.2

View file

@ -0,0 +1,131 @@
From caaf4d4bd4fcc3fd59a2185b69ba0d77fe2e66c6 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
See https://github.com/phhusson/treble_experimentations/issues/374
In Qualcomm's BSP audio_policy_configuration.xml, one route is missing,
from primary output and telephony to BT SCO.
Add it if we detect telephony and bt sco, but no such route.
Change-Id: Ifea0f88276ec9a0811f3cb1973c4b06f2c82077b
---
.../managerdefinitions/src/Serializer.cpp | 93 +++++++++++++++++++
1 file changed, 93 insertions(+)
diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
index c4474cf1c2..c1df8f278b 100644
--- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
+++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
@@ -676,6 +676,98 @@ std::variant<status_t, RouteTraits::Element> PolicySerializer::deserialize<Route
return route;
}
+static void fixupQualcommBtScoRoute(RouteTraits::Collection& routes, DevicePortTraits::Collection& devicePorts, HwModule* ctx) {
+ // On many Qualcomm devices, there is a BT SCO Headset Mic => primary input mix
+ // But Telephony Rx => BT SCO Headset route is missing
+ // When we detect such case, add the missing route
+
+ // If we have:
+ // <route type="mix" sink="Telephony Tx" sources="voice_tx"/>
+ // <route type="mix" sink="primary input" sources="Built-In Mic,Built-In Back Mic,Wired Headset Mic,BT SCO Headset Mic"/>
+ // <devicePort tagName="BT SCO Headset" type="AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET" role="sink" />
+ // And no <route type="mix" sink="BT SCO Headset" />
+
+ // Add:
+ // <route type="mix" sink="BT SCO Headset" sources="primary output,deep_buffer,compressed_offload,Telephony Rx"/>
+ bool foundBtScoHeadsetDevice = false;
+ for(const auto& device: devicePorts) {
+ if(device->getTagName() == "BT SCO Headset") {
+ foundBtScoHeadsetDevice = true;
+ break;
+ }
+ }
+ if(!foundBtScoHeadsetDevice) {
+ ALOGE("No BT SCO Headset device found, don't patch policy");
+ return;
+ }
+
+ bool foundTelephony = false;
+ bool foundBtScoInput = false;
+ bool foundScoHeadsetRoute = false;
+ for(const auto& route: routes) {
+ ALOGE("Looking at route %d\n", route->getType());
+ if(route->getType() != AUDIO_ROUTE_MIX)
+ continue;
+ auto sink = route->getSink();
+ ALOGE("... With sink %s\n", sink->getTagName().c_str());
+ if(sink->getTagName() == "Telephony Tx") {
+ foundTelephony = true;
+ continue;
+ }
+ if(sink->getTagName() == "BT SCO Headset") {
+ foundScoHeadsetRoute = true;
+ break;
+ }
+ for(const auto& source: route->getSources()) {
+ ALOGE("... With source %s\n", source->getTagName().c_str());
+ if(source->getTagName() == "BT SCO Headset Mic") {
+ foundBtScoInput = true;
+ break;
+ }
+ }
+ }
+ //The route we want to add is already there
+ ALOGE("Done looking for existing routes");
+ if(foundScoHeadsetRoute)
+ return;
+
+ ALOGE("No existing route found... %d %d", foundTelephony ? 1 : 0, foundBtScoInput ? 1 : 0);
+ //We couldn't find the routes we assume are required for the function we want to add
+ if(!foundTelephony || !foundBtScoInput)
+ return;
+ ALOGE("Adding our own.");
+
+ // Add:
+ // <route type="mix" sink="BT SCO Headset" sources="primary output,deep_buffer,compressed_offload,Telephony Rx"/>
+ AudioRoute *newRoute = new AudioRoute(AUDIO_ROUTE_MIX);
+
+ auto sink = ctx->findPortByTagName("BT SCO Headset");
+ ALOGE("Got sink %p\n", sink.get());
+ newRoute->setSink(sink);
+
+ Vector<sp<PolicyAudioPort>> sources;
+ for(const auto& sourceName: {
+ "primary output",
+ "deep_buffer",
+ "compressed_offload",
+ "Telephony Rx"
+ }) {
+ auto source = ctx->findPortByTagName(sourceName);
+ ALOGE("Got source %p\n", source.get());
+ if (source.get() != nullptr) {
+ sources.add(source);
+ source->addRoute(newRoute);
+ }
+ }
+
+ newRoute->setSources(sources);
+
+ sink->addRoute(newRoute);
+
+ auto ret = routes.add(newRoute);
+ ALOGE("route add returned %zd", ret);
+}
+
template<>
std::variant<status_t, ModuleTraits::Element> PolicySerializer::deserialize<ModuleTraits>(
const xmlNode *cur, ModuleTraits::PtrSerializingCtx ctx)
@@ -743,6 +835,7 @@ std::variant<status_t, ModuleTraits::Element> PolicySerializer::deserialize<Modu
if (status != NO_ERROR) {
return status;
}
+ fixupQualcommBtScoRoute(routes, devicePorts, module.get());
module->setRoutes(routes);
for (const xmlNode *children = cur->xmlChildrenNode; children != NULL;
--
2.44.0

View file

@ -1,7 +1,7 @@
From 5e94fc70ba1963ed33eb6633702cce706b6814d1 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 1/6] 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 c15b3e0b80c3..05bb843c0c4d 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 c15b3e0b80c3..05bb843c0c4d 100644
}
return true;
--
2.41.0
2.43.1

View file

@ -1,163 +0,0 @@
From 3199a7f449d08acf306aafb180ccbcbacd993616 Mon Sep 17 00:00:00 2001
From: Danny Lin <danny@kdrag0n.dev>
Date: Sat, 16 Oct 2021 05:27:57 -0700
Subject: [PATCH 2/6] 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 487e57d114c9..04e69741b9fd 100644
--- a/core/api/current.txt
+++ b/core/api/current.txt
@@ -87,6 +87,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";
@@ -222,6 +223,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 0e95e30a99b8..a456ac6b7129 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -3569,6 +3569,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 2091c0502b6f..6888edcf7d3c 100644
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -982,6 +982,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 46b7460dff1b..40549962436f 100644
--- a/services/core/java/com/android/server/pm/ComputerEngine.java
+++ b/services/core/java/com/android/server/pm/ComputerEngine.java
@@ -1603,6 +1603,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;
@@ -1632,13 +1655,14 @@ public class ComputerEngine implements Computer {
final int[] gids = (flags & PackageManager.GET_GIDS) == 0 ? EMPTY_INT_ARRAY
: mPermissionManager.getGidsForUid(UserHandle.getUid(userId, ps.getAppId()));
// 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.getPackageName(), userId);
- PackageInfo packageInfo = PackageInfoUtils.generate(p, gids, flags,
+ PackageInfo packageInfo = mayFakeSignature(p, PackageInfoUtils.generate(p, gids, flags,
state.getFirstInstallTime(), ps.getLastUpdateTime(), permissions, state, userId,
- ps);
+ ps), permissions);
if (packageInfo == null) {
return null;
--
2.41.0

View file

@ -1,7 +1,7 @@
From 734839b7918f93cb746ebbe82179a9cbcf165424 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 3/6] 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 af0cbe50e889694dc72ab84c4e1af816bdd199b9 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 4/6] 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 8d8379831e87..bd6cc1d4d7bf 100644
index 2cc56d838b79..af98f07e9669 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -16060,6 +16060,12 @@ public final class Settings {
@@ -17352,6 +17352,12 @@ public final class Settings {
CLOCKWORK_HOME_READY,
};
@ -45,7 +45,7 @@ index 8d8379831e87..bd6cc1d4d7bf 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 ba947149d287..e5eb04c7818d 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;
@ -56,7 +56,7 @@ index ba947149d287..e5eb04c7818d 100644
import android.security.KeyChain;
import android.util.ArrayMap;
import android.util.Log;
@@ -332,8 +333,13 @@ public class SecurityControllerImpl implements SecurityController {
@@ -338,8 +339,13 @@ public class SecurityControllerImpl implements SecurityController {
@Override
public void onUserSwitched(int newUserId) {
mCurrentUserId = newUserId;
@ -72,10 +72,10 @@ index ba947149d287..e5eb04c7818d 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 8510de4ef201..7c02924a711d 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
@@ -691,6 +691,15 @@ public class Vpn {
@@ -776,6 +776,15 @@ public class Vpn {
return mAlwaysOn;
}
@ -91,7 +91,7 @@ index 8510de4ef201..7c02924a711d 100644
/**
* Checks if a VPN app supports always-on mode.
*
@@ -1559,6 +1568,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 8510de4ef201..7c02924a711d 100644
final PackageManager packageManager = mUserIdContext.getPackageManager();
if (packageManager == null) {
@@ -1720,7 +1730,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 8510de4ef201..7c02924a711d 100644
final long token = Binder.clearCallingIdentity();
List<UserInfo> users;
try {
@@ -1729,7 +1739,8 @@ public class Vpn {
@@ -1877,7 +1887,8 @@ public class Vpn {
Binder.restoreCallingIdentity(token);
}
for (UserInfo user : users) {
@ -118,7 +118,7 @@ index 8510de4ef201..7c02924a711d 100644
addUserToRanges(ranges, user.id, allowedApplications, disallowedApplications);
}
}
@@ -1810,7 +1821,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 8510de4ef201..7c02924a711d 100644
synchronized(Vpn.this) {
final Set<Range<Integer>> existingRanges = mNetworkCapabilities.getUids();
if (existingRanges != null) {
@@ -1839,7 +1851,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 8510de4ef201..7c02924a711d 100644
synchronized(Vpn.this) {
final Set<Range<Integer>> existingRanges = mNetworkCapabilities.getUids();
if (existingRanges != null) {
@@ -2278,6 +2291,17 @@ public class Vpn {
@@ -2412,6 +2425,17 @@ public class Vpn {
}
}
@ -156,15 +156,15 @@ index 8510de4ef201..7c02924a711d 100644
/**
* Start legacy VPN, controlling native daemons as needed. Creates a
* secondary thread to perform connection work, returning quickly.
@@ -2362,6 +2386,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();
@@ -3859,6 +3884,7 @@ public class Vpn {
// Load certificates.
String privateKey = "";
@@ -4029,6 +4054,7 @@ public class Vpn {
verifyCallingUidAndPackage(packageName);
enforceNotRestrictedUser();
@ -172,7 +172,7 @@ index 8510de4ef201..7c02924a711d 100644
validateRequiredFeatures(profile);
if (profile.isRestrictedToTestNetworks) {
@@ -3901,6 +3927,7 @@ public class Vpn {
@@ -4071,6 +4097,7 @@ public class Vpn {
verifyCallingUidAndPackage(packageName);
enforceNotRestrictedUser();
@ -180,7 +180,7 @@ index 8510de4ef201..7c02924a711d 100644
final long token = Binder.clearCallingIdentity();
try {
@@ -3964,6 +3991,7 @@ public class Vpn {
@@ -4140,6 +4167,7 @@ public class Vpn {
requireNonNull(packageName, "No package name provided");
enforceNotRestrictedUser();
@ -188,7 +188,7 @@ index 8510de4ef201..7c02924a711d 100644
// Prepare VPN for startup
if (!prepare(packageName, null /* newPackage */, VpnManager.TYPE_VPN_PLATFORM)) {
@@ -4085,6 +4113,7 @@ public class Vpn {
@@ -4262,6 +4290,7 @@ public class Vpn {
requireNonNull(packageName, "No package name provided");
enforceNotRestrictedUser();
@ -197,5 +197,5 @@ index 8510de4ef201..7c02924a711d 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

@ -0,0 +1,46 @@
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 04/10] Dynamically resize boot animation to match screen size
Change-Id: I54e49fc6b8c670103852e212d1416e27ff976205
---
cmds/bootanimation/BootAnimation.cpp | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/cmds/bootanimation/BootAnimation.cpp b/cmds/bootanimation/BootAnimation.cpp
index 820d2b0d607e..56dfa8af31c4 100644
--- a/cmds/bootanimation/BootAnimation.cpp
+++ b/cmds/bootanimation/BootAnimation.cpp
@@ -618,6 +618,28 @@ status_t BootAnimation::readyToRun() {
mFlingerSurface = s;
mTargetInset = -1;
+ if ( mAnimation != nullptr ) {
+ SLOGE("Got screen size %d, animation size %d", mWidth, mAnimation->width);
+ int origWidth = mAnimation->width;
+ if ( mAnimation->width*2 < mWidth ) {
+ SLOGE("Making animation bigger");
+ mAnimation->width *= 2;
+ mAnimation->height *= 2;
+ } else if ( mWidth < mAnimation->width ) {
+ SLOGE("Making animation smaller");
+ mAnimation->width /= 2;
+ mAnimation->height /= 2;
+ }
+ for (Animation::Part& part : mAnimation->parts) {
+ for(auto& frame: part.frames) {
+ if(frame.trimWidth == origWidth && frame.trimX == 0 && frame.trimY == 0) {
+ frame.trimWidth = mAnimation->width;
+ frame.trimHeight = mAnimation->height;
+ }
+ }
+ }
+ }
+
// Rotate the boot animation according to the value specified in the sysprop
// ro.bootanim.set_orientation_<display_id>. Four values are supported: ORIENTATION_0,
// ORIENTATION_90, ORIENTATION_180 and ORIENTATION_270.
--
2.43.1

View file

@ -0,0 +1,40 @@
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 05/10] Restore getSimStateForSlotIndex in SubscriptionManager
MTK IMS still needs it here
Change-Id: I41bac57c68055f369232359a464642daab94403b
---
.../android/telephony/SubscriptionManager.java | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/telephony/java/android/telephony/SubscriptionManager.java b/telephony/java/android/telephony/SubscriptionManager.java
index 326b6f5af613..b994888362b0 100644
--- a/telephony/java/android/telephony/SubscriptionManager.java
+++ b/telephony/java/android/telephony/SubscriptionManager.java
@@ -2693,6 +2693,20 @@ public class SubscriptionManager {
return TelephonyManager.getDefault().isNetworkRoaming(subId);
}
+ /**
+ * Returns a constant indicating the state of sim for the slot index.
+ *
+ * @param slotIndex Logical SIM slot index.
+ *
+ * @see TelephonyManager.SimState
+ *
+ * @hide
+ */
+ @TelephonyManager.SimState
+ public static int getSimStateForSlotIndex(int slotIndex) {
+ return TelephonyManager.getSimStateForSlotIndex(slotIndex);
+ }
+
/**
* Set a field in the subscription database. Note not all fields are supported.
*
--
2.43.1

View file

@ -0,0 +1,65 @@
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 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 | 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 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;
import java.io.PrintWriter;
import java.util.Collections;
import java.util.List;
+import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.ExecutionException;
import java.util.concurrent.Executor;
import java.util.concurrent.TimeUnit;
import java.util.function.Supplier;
@@ -151,6 +153,34 @@ public final class TelephonyUtils {
}
}
+ /**
+ * Convenience method for running the provided action in the provided
+ * executor enclosed in
+ * {@link Binder#clearCallingIdentity}/{@link Binder#restoreCallingIdentity} and return
+ * the result.
+ *
+ * Any exception thrown by the given action will need to be handled by caller.
+ *
+ */
+ public static <T> T runWithCleanCallingIdentity(
+ @NonNull Supplier<T> action, @NonNull Executor executor) {
+ if (action != null) {
+ if (executor != null) {
+ try {
+ return CompletableFuture.supplyAsync(
+ () -> runWithCleanCallingIdentity(action), executor).get();
+ } catch (ExecutionException | InterruptedException e) {
+ Log.w(LOG_TAG, "TelephonyUtils : runWithCleanCallingIdentity exception: "
+ + e.getMessage());
+ return null;
+ }
+ } else {
+ return runWithCleanCallingIdentity(action);
+ }
+ }
+ return null;
+ }
+
/**
* Filter values in bundle to only basic types.
*/
--
2.43.1

View file

@ -1,127 +0,0 @@
From 54e70eb7ce231f6a1bef4ffdedb6008b3a949820 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 6/6] Revert "Remove more FDE methods from StorageManager"
This reverts commit bd13f84152449a3ead6fa8604fd31f48c0224676.
---
.../android/os/storage/StorageManager.java | 69 ++++++++++++++++---
.../internal/os/RoSystemProperties.java | 4 ++
2 files changed, 65 insertions(+), 8 deletions(-)
diff --git a/core/java/android/os/storage/StorageManager.java b/core/java/android/os/storage/StorageManager.java
index d9604b3f0145..603612e82007 100644
--- a/core/java/android/os/storage/StorageManager.java
+++ b/core/java/android/os/storage/StorageManager.java
@@ -1681,13 +1681,18 @@ public class StorageManager {
}
/** {@hide}
- * Is this device encrypted?
- * <p>
- * Note: all devices launching with Android 10 (API level 29) or later are
- * required to be encrypted. This should only ever return false for
- * in-development devices on which encryption has not yet been configured.
- *
- * @return true if encrypted, false if not encrypted
+ * 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 already encrypted?
+ * @return true for encrypted. (Implies isEncryptable() == true)
+ * false not encrypted
*/
public static boolean isEncrypted() {
return RoSystemProperties.CRYPTO_ENCRYPTED;
@@ -1696,7 +1701,7 @@ public class StorageManager {
/** {@hide}
* Is this device file encrypted?
* @return true for file encrypted. (Implies isEncrypted() == true)
- * false not encrypted or using "managed" encryption
+ * false not encrypted or block encrypted
*/
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
public static boolean isFileEncryptedNativeOnly() {
@@ -1706,6 +1711,54 @@ public class StorageManager {
return RoSystemProperties.CRYPTO_FILE_ENCRYPTED;
}
+ /** {@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} */
public static boolean isFileEncryptedEmulatedOnly() {
return SystemProperties.getBoolean(StorageManager.PROP_EMULATE_FBE, false);
diff --git a/core/java/com/android/internal/os/RoSystemProperties.java b/core/java/com/android/internal/os/RoSystemProperties.java
index cccd80e82420..adb5c107bc62 100644
--- a/core/java/com/android/internal/os/RoSystemProperties.java
+++ b/core/java/com/android/internal/os/RoSystemProperties.java
@@ -62,10 +62,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,7 +1,7 @@
From 628ab41923ce082cd68ab8d4a184823b62a75ab3 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 5/6] 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:
@ -54,19 +54,19 @@ Date: Wed Oct 28 07:07:10 2020 -0400
Change-Id: If0eb969ba509981f9209ffa37a949d9042ef4c2a
---
core/java/android/app/admin/SystemUpdateInfo.java | 4 ++--
.../java/com/android/server/am/UserController.java | 3 ++-
.../com/android/server/pm/PackageManagerService.java | 12 ++++++------
.../core/java/com/android/server/pm/Settings.java | 4 ++--
.../java/com/android/server/pm/ShortcutService.java | 2 +-
.../com/android/server/pm/UserManagerService.java | 8 ++++----
6 files changed, 17 insertions(+), 16 deletions(-)
core/java/android/app/admin/SystemUpdateInfo.java | 4 ++--
.../com/android/server/am/UserController.java | 3 ++-
.../android/server/pm/PackageManagerService.java | 15 +++++++--------
.../core/java/com/android/server/pm/Settings.java | 4 ++--
.../com/android/server/pm/ShortcutService.java | 2 +-
.../com/android/server/pm/UserManagerService.java | 8 ++++----
6 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/core/java/android/app/admin/SystemUpdateInfo.java b/core/java/android/app/admin/SystemUpdateInfo.java
index b88bf76c96ca..fdf2b3f54311 100644
index 9e6c91f4ec31..7459b0e05e3a 100644
--- a/core/java/android/app/admin/SystemUpdateInfo.java
+++ b/core/java/android/app/admin/SystemUpdateInfo.java
@@ -132,7 +132,7 @@ public final class SystemUpdateInfo implements Parcelable {
@@ -133,7 +133,7 @@ public final class SystemUpdateInfo implements Parcelable {
out.startTag(null, tag);
out.attributeLong(null, ATTR_RECEIVED_TIME, mReceivedTime);
out.attributeInt(null, ATTR_SECURITY_PATCH_STATE, mSecurityPatchState);
@ -75,7 +75,7 @@ index b88bf76c96ca..fdf2b3f54311 100644
out.endTag(null, tag);
}
@@ -141,7 +141,7 @@ public final class SystemUpdateInfo implements Parcelable {
@@ -142,7 +142,7 @@ public final class SystemUpdateInfo implements Parcelable {
public static SystemUpdateInfo readFromXml(TypedXmlPullParser parser) {
// If an OTA has been applied (build fingerprint has changed), discard stale info.
final String buildFingerprint = parser.getAttributeValue(null, ATTR_ORIGINAL_BUILD );
@ -85,18 +85,18 @@ index b88bf76c96ca..fdf2b3f54311 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 44b186e1541f..9470a728389f 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
@@ -71,6 +71,7 @@ import android.content.pm.PackagePartitions;
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;
+import android.os.Build;
import android.os.Bundle;
import android.os.Debug;
import android.os.Handler;
@@ -761,7 +762,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,70 +106,73 @@ index 44b186e1541f..9470a728389f 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 47860373156b..858bf1aad92f 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
@@ -1492,7 +1492,7 @@ public class PackageManagerService implements PackageSender, TestUtilityService
@@ -1746,7 +1746,7 @@ public class PackageManagerService implements PackageSender, TestUtilityService
}
PackageManagerService m = new PackageManagerService(injector, onlyCore, factoryTest,
PackageManagerService m = new PackageManagerService(injector, factoryTest,
- PackagePartitions.FINGERPRINT, Build.IS_ENG, Build.IS_USERDEBUG,
+ Build.VERSION.INCREMENTAL, Build.IS_ENG, Build.IS_USERDEBUG,
Build.VERSION.SDK_INT, Build.VERSION.INCREMENTAL);
t.traceEnd(); // "create package manager"
@@ -1954,7 +1954,7 @@ public class PackageManagerService implements PackageSender, TestUtilityService
!buildFingerprint.equals(ver.fingerprint);
@@ -2225,9 +2225,8 @@ public class PackageManagerService implements PackageSender, TestUtilityService
mIsUpgrade =
!partitionsFingerprint.equals(ver.fingerprint);
if (mIsUpgrade) {
PackageManagerServiceUtils.logCriticalInfo(Log.INFO, "Upgrading from "
- + ver.fingerprint + " to " + PackagePartitions.FINGERPRINT);
- PackageManagerServiceUtils.logCriticalInfo(Log.INFO,
- "Upgrading from " + ver.fingerprint + " (" + ver.buildFingerprint + ") to "
- + PackagePartitions.FINGERPRINT + " (" + Build.FINGERPRINT + ")");
+ PackageManagerServiceUtils.logCriticalInfo(Log.INFO, "Upgrading from "
+ + ver.fingerprint + " to " + Build.VERSION.INCREMENTAL);
}
mInitAppsHelper = new InitAppsHelper(this, mApexManager, mInstallPackageHelper,
@@ -2068,8 +2068,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) {
- Slog.i(TAG, "Build fingerprint changed from " + ver.fingerprint + " to "
- Slog.i(TAG, "Partitions fingerprint changed from " + ver.fingerprint + " to "
- + PackagePartitions.FINGERPRINT
+ Slog.i(TAG, "Build incremental version changed from " + ver.fingerprint + " to "
+ + Build.VERSION.INCREMENTAL
+ "; regranting permissions for internal storage");
}
mPermissionManager.onStorageVolumeMounted(
@@ -2091,7 +2091,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 && !mOnlyCore) {
if (mIsUpgrade) {
- Slog.i(TAG, "Build fingerprint changed; clearing code caches");
+ Slog.i(TAG, "Build incremental version changed; clearing code caches");
for (int i = 0; i < packageSettings.size(); i++) {
final PackageSetting ps = packageSettings.valueAt(i);
if (Objects.equals(StorageManager.UUID_PRIVATE_INTERNAL, ps.getVolumeUuid())) {
@@ -2102,7 +2102,7 @@ public class PackageManagerService implements PackageSender, TestUtilityService
| Installer.FLAG_CLEAR_APP_DATA_KEEP_ART_PROFILES);
@@ -2399,7 +2398,7 @@ public class PackageManagerService implements PackageSender, TestUtilityService
}
}
ver.buildFingerprint = Build.FINGERPRINT;
- ver.fingerprint = PackagePartitions.FINGERPRINT;
+ ver.fingerprint = Build.VERSION.INCREMENTAL;
}
// 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 cfd029346340..a9b624653b92 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
@@ -445,7 +445,7 @@ public final class Settings implements Watchable, Snappable {
public void forceCurrent() {
@@ -481,7 +481,7 @@ public final class Settings implements Watchable, Snappable, ResilientAtomicFile
sdkVersion = Build.VERSION.SDK_INT;
databaseVersion = CURRENT_DATABASE_VERSION;
buildFingerprint = Build.FINGERPRINT;
- fingerprint = PackagePartitions.FINGERPRINT;
+ fingerprint = Build.VERSION.INCREMENTAL;
}
}
@@ -5527,7 +5527,7 @@ public final class Settings implements Watchable, Snappable {
@@ -5983,7 +5983,7 @@ public final class Settings implements Watchable, Snappable, ResilientAtomicFile
}
private String getExtendedFingerprint(long version) {
@ -179,10 +182,10 @@ index cfd029346340..a9b624653b92 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 a2b2983a8f35..4564e9dccc13 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
@@ -5168,7 +5168,7 @@ public class ShortcutService extends IShortcutService.Stub {
@@ -5208,7 +5208,7 @@ public class ShortcutService extends IShortcutService.Stub {
// Injection point.
String injectBuildFingerprint() {
@ -192,10 +195,10 @@ index a2b2983a8f35..4564e9dccc13 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 88aeb17dc2b4..af7b481dd311 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
@@ -4104,7 +4104,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;
@ -204,33 +207,33 @@ index 88aeb17dc2b4..af7b481dd311 100644
if (userTypeDetails.hasBadge() && parentId != UserHandle.USER_NULL) {
userInfo.profileBadge = getFreeProfileBadgeLU(parentId, userType);
}
@@ -5390,7 +5390,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);
@@ -5421,7 +5421,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();
@@ -5466,7 +5466,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;
}
- userData.info.lastLoggedInFingerprint = PackagePartitions.FINGERPRINT;
+ userData.info.lastLoggedInFingerprint = Build.VERSION.INCREMENTAL;
scheduleWriteUser(userData);
scheduleWriteUser(userId);
}
--
2.41.0
2.43.1

View file

@ -0,0 +1,75 @@
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 08/10] Revert "Convert BubbleDataRepositoryTest to use
mockito-kotlin"
This reverts commit 625a23ff22f0a9327b9a24341dfa0b8fbaf61a1b.
---
.../Shell/tests/unittest/Android.bp | 1 -
.../shell/bubbles/BubbleDataRepositoryTest.kt | 17 ++++++++++-------
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 aadadd604d3e..70106c3d41b4 100644
--- a/libs/WindowManager/Shell/tests/unittest/Android.bp
+++ b/libs/WindowManager/Shell/tests/unittest/Android.bp
@@ -44,7 +44,6 @@ android_test {
"frameworks-base-testutils",
"kotlinx-coroutines-android",
"kotlinx-coroutines-core",
- "mockito-kotlin2",
"mockito-target-extended-minus-junit4",
"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
--- 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
@@ -29,11 +29,11 @@ import com.google.common.truth.Truth.assertThat
import org.junit.After
import org.junit.Before
import org.junit.Test
-import org.mockito.kotlin.any
-import org.mockito.kotlin.mock
-import org.mockito.kotlin.never
-import org.mockito.kotlin.spy
-import org.mockito.kotlin.verify
+import org.mockito.Mockito
+import org.mockito.Mockito.mock
+import org.mockito.Mockito.never
+import org.mockito.Mockito.spy
+import org.mockito.Mockito.verify
class BubbleDataRepositoryTest : ShellTestCase() {
@@ -124,7 +124,7 @@ class BubbleDataRepositoryTest : ShellTestCase() {
private val testHandler = Handler(Looper.getMainLooper())
private val mainExecutor = HandlerExecutor(testHandler)
- private val launcherApps = mock<LauncherApps>()
+ private val launcherApps = mock(LauncherApps::class.java)
private val persistedBubbles = SparseArray<List<BubbleEntity>>()
@@ -158,7 +158,8 @@ class BubbleDataRepositoryTest : ShellTestCase() {
assertThat(persistedBubbles).isEqualTo(validEntitiesByUser)
// No invalid users, so no persist to disk happened
- verify(dataRepository, never()).persistToDisk(any())
+ verify(dataRepository, never()).persistToDisk(
+ any(SparseArray<List<BubbleEntity>>()::class.java))
}
@Test
@@ -198,4 +199,6 @@ class BubbleDataRepositoryTest : ShellTestCase() {
// Verify that persist to disk happened with the new valid entities list.
verify(dataRepository).persistToDisk(validEntitiesByUser)
}
+
+ fun <T> any(type: Class<T>): T = Mockito.any<T>(type)
}
\ No newline at end of file
--
2.43.1

View file

@ -0,0 +1,32 @@
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 09/10] FingerprintService: Do not use HIDL providers when AIDL
is present
This fixes duplicated sensor ID when config_biometric_sensors is defined
on AIDL devices.
Change-Id: I9942e91a95106a7a11ab7ddf145d87562d1b7c0d
---
.../biometrics/sensors/fingerprint/FingerprintService.java | 3 ++-
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 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
@@ -889,8 +889,9 @@ public class FingerprintService extends SystemService {
filteredInstances = filterAvailableHalInstances(hidlSensors, aidlSensors);
final List<ServiceProvider> providers = new ArrayList<>();
- providers.addAll(getHidlProviders(filteredInstances.first));
providers.addAll(getAidlProviders(filteredInstances.second));
+ if (providers.isEmpty()) // Only use HIDL providers if AIDL ones are not found
+ providers.addAll(getHidlProviders(filteredInstances.first));
return providers;
});
--
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,4 +1,4 @@
From 9f88617d1af3f068efdff111984a7a631464a205 Mon Sep 17 00:00:00 2001
From 45ee12fd0ac92b5e6a07de927716b8b03c18f1fd Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Sun, 14 Nov 2021 13:47:29 -0500
Subject: [PATCH] Pie MTK IMS calls static
@ -10,10 +10,10 @@ Change-Id: I3dd66d436629d37c8ec795df6569736195ae570e
1 file changed, 8 insertions(+)
diff --git a/src/java/com/android/ims/ImsManager.java b/src/java/com/android/ims/ImsManager.java
index c41426d0..2c6d656f 100644
index b5a1168b..547a3a16 100644
--- a/src/java/com/android/ims/ImsManager.java
+++ b/src/java/com/android/ims/ImsManager.java
@@ -1667,6 +1667,14 @@ public class ImsManager implements FeatureUpdates {
@@ -1666,6 +1666,14 @@ public class ImsManager implements FeatureUpdates {
}
}
@ -29,5 +29,5 @@ index c41426d0..2c6d656f 100644
* Push configuration updates to the ImsService implementation.
*/
--
2.40.0
2.41.0

View file

@ -1,7 +1,7 @@
From bcaff4d8a493c657519ae50cf7f3661da6c4a46b 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 2/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.40.0
2.43.1

View file

@ -1,45 +0,0 @@
From 02041484d88e3c8a6cd62e1253f4b12b15be6852 Mon Sep 17 00:00:00 2001
From: Peter Cai <peter@typeblog.net>
Date: Mon, 5 Sep 2022 14:02:37 -0400
Subject: [PATCH 1/5] 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
default, it should not be overridden by the rest of the telephony
subsystem (e.g. SIM subcription updates, or default SIM slot selection).
Otherwise, it creates a somewhat annoying situation where the user has
to keep re-selecting the desired calling account after every reboot.
Test: manual
Change-Id: Iccab64e9b3b3ab4773bd8944d47c2006f229d472
---
.../internal/telephony/SubscriptionController.java | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/java/com/android/internal/telephony/SubscriptionController.java b/src/java/com/android/internal/telephony/SubscriptionController.java
index 82799bea8b..5105d3a183 100644
--- a/src/java/com/android/internal/telephony/SubscriptionController.java
+++ b/src/java/com/android/internal/telephony/SubscriptionController.java
@@ -2855,8 +2855,17 @@ public class SubscriptionController extends ISub.Stub {
subId);
TelecomManager telecomManager = mContext.getSystemService(TelecomManager.class);
+ PhoneAccountHandle currentHandle = telecomManager.getUserSelectedOutgoingPhoneAccount();
+ String currentPackageName =
+ currentHandle == null ? null : currentHandle.getComponentName().getPackageName();
+ boolean currentIsSim = "com.android.phone".equals(currentPackageName);
+ // Do not override user selected outgoing calling account
+ // if the user has selected a third-party app as default
+ boolean shouldKeepOutgoingAccount = currentHandle != null && !currentIsSim;
- telecomManager.setUserSelectedOutgoingPhoneAccount(newHandle);
+ if (!shouldKeepOutgoingAccount) {
+ telecomManager.setUserSelectedOutgoingPhoneAccount(newHandle);
+ }
logd("[setDefaultVoiceSubId] requesting change to phoneAccountHandle=" + newHandle);
if (previousDefaultSub != getDefaultSubId()) {
--
2.40.0

View file

@ -1,7 +1,7 @@
From 53160d33c83afe4f56862c3c12d4b61e2970209b 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 5/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 76a8d57246..9a72712c59 100644
index 620b8711e2..951ef23115 100644
--- a/src/java/com/android/internal/telephony/GsmCdmaPhone.java
+++ b/src/java/com/android/internal/telephony/GsmCdmaPhone.java
@@ -3124,7 +3124,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 76a8d57246..9a72712c59 100644
length <= MAX_VERSION_LEN ? version
: version.substring(length - MAX_VERSION_LEN, length));
--
2.40.0
2.43.1

View file

@ -1,7 +1,7 @@
From c527732943bc02fd434cbecbd07787e2d429023d 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
@ -13,14 +13,14 @@ This conditionally reverts commit 75c3dc9ba272b43971f519caba0382f9871c7d9d.
Change-Id: I55a8f3bbca4a2b9a6bc7511e9fe2d0884a8818e5
---
.../imsphone/ImsPhoneCallTracker.java | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
.../telephony/imsphone/ImsPhoneCallTracker.java | 15 ++++++++++++++-
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 5968ba6fa1..86034f6fa1 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
@@ -50,6 +50,7 @@ import android.os.Registrant;
@@ -70,6 +70,7 @@ import android.os.Registrant;
import android.os.RegistrantList;
import android.os.RemoteException;
import android.os.SystemClock;
@ -28,30 +28,27 @@ index 5968ba6fa1..86034f6fa1 100644
import android.preference.PreferenceManager;
import android.provider.Settings;
import android.sysprop.TelephonyProperties;
@@ -322,10 +323,19 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
@Override
public void onIncomingCall(IImsCallSession c, Bundle extras) {
- // we want to ensure we block this binder thread until incoming call setup completes
- // as to avoid race conditions where the ImsService tries to update the state of the
- // call before the listeners have been attached.
- executeAndWait(()-> processIncomingCall(c, extras));
@@ -389,7 +390,19 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
@Nullable
public IImsCallSessionListener onIncomingCall(
@NonNull IImsCallSession c, @Nullable String callId, @Nullable Bundle extras) {
- return executeAndWaitForReturn(()-> processIncomingCall(c, callId, extras));
+ final boolean shouldBlockBinderThreadOnIncomingCalls = SystemProperties.getBoolean(
+ "ro.telephony.block_binder_thread_on_incoming_calls", true);
+ if (shouldBlockBinderThreadOnIncomingCalls) {
+ // we want to ensure we block this binder thread until incoming call setup completes
+ // as to avoid race conditions where the ImsService tries to update the state of the
+ // call before the listeners have been attached.
+ executeAndWait(()-> processIncomingCall(c, extras));
+ return executeAndWaitForReturn(()-> processIncomingCall(c, callId, extras));
+ } else {
+ // for legacy IMS we want to avoid blocking the binder thread, otherwise
+ // we end up with half dead incoming calls with unattached call session
+ TelephonyUtils.runWithCleanCallingIdentity(()-> processIncomingCall(c, extras),
+ return TelephonyUtils.runWithCleanCallingIdentity(()-> processIncomingCall(c, callId, extras),
+ mExecutor);
+ }
}
@Override
--
2.40.0
2.43.1

View file

@ -1,53 +0,0 @@
From 9550951ff96e643d143da826cb9560da572850a1 Mon Sep 17 00:00:00 2001
From: LuK1337 <priv.luk@gmail.com>
Date: Fri, 21 Oct 2022 20:55:05 +0200
Subject: [PATCH 3/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 6de66527e1..0c1b7cdf8c 100644
--- a/src/java/com/android/internal/telephony/RIL.java
+++ b/src/java/com/android/internal/telephony/RIL.java
@@ -2879,7 +2879,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(NETWORK_SERVICE, "setPreferredNetworkType", e);
}
diff --git a/src/java/com/android/internal/telephony/RadioNetworkProxy.java b/src/java/com/android/internal/telephony/RadioNetworkProxy.java
index b88103510a..661fa56954 100644
--- a/src/java/com/android/internal/telephony/RadioNetworkProxy.java
+++ b/src/java/com/android/internal/telephony/RadioNetworkProxy.java
@@ -379,16 +379,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.40.0

View file

@ -0,0 +1,58 @@
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 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
default, it should not be overridden by the rest of the telephony
subsystem (e.g. SIM subcription updates, or default SIM slot selection).
Otherwise, it creates a somewhat annoying situation where the user has
to keep re-selecting the desired calling account after every reboot.
Test: manual
Change-Id: Iccab64e9b3b3ab4773bd8944d47c2006f229d472
---
.../SubscriptionManagerService.java | 18 +++++++++++++++++-
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 a8d05a334b..42310ccc3f 100644
--- a/src/java/com/android/internal/telephony/subscription/SubscriptionManagerService.java
+++ b/src/java/com/android/internal/telephony/subscription/SubscriptionManagerService.java
@@ -81,6 +81,7 @@ import android.util.Base64;
import android.util.EventLog;
import android.util.IndentingPrintWriter;
import android.util.LocalLog;
+import android.util.Log;
import com.android.internal.R;
import com.android.internal.annotations.VisibleForTesting;
@@ -3023,7 +3024,22 @@ public class SubscriptionManagerService extends ISub.Stub {
TelecomManager telecomManager = mContext.getSystemService(TelecomManager.class);
if (telecomManager != null) {
- telecomManager.setUserSelectedOutgoingPhoneAccount(newHandle);
+ PhoneAccountHandle currentHandle = telecomManager.getUserSelectedOutgoingPhoneAccount();
+ log("[setDefaultVoiceSubId] current phoneAccountHandle=" + currentHandle);
+
+ String currentPackageName =
+ currentHandle == null ? null : currentHandle.getComponentName().getPackageName();
+ boolean currentIsSim = "com.android.phone".equals(currentPackageName);
+ // Do not override user selected outgoing calling account
+ // if the user has selected a third-party app as default
+ boolean shouldKeepOutgoingAccount = currentHandle != null && !currentIsSim;
+
+ if (!shouldKeepOutgoingAccount) {
+ telecomManager.setUserSelectedOutgoingPhoneAccount(newHandle);
+ log("[setDefaultVoiceSubId] change to phoneAccountHandle=" + newHandle);
+ } else {
+ log("[setDefaultVoiceSubId] default phoneAccountHandle not changed.");
+ }
}
updateDefaultSubId();
--
2.43.1

View file

@ -1,7 +1,7 @@
From 8cd54396bbf29cc977497b53c1464a80aea69825 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/4] Expose themed icon setting in ThemePicker
Subject: [PATCH 1/3] Expose themed icon setting in ThemePicker
Change-Id: I44e9288c3de13a3604b7a03857ec400753317d9a
---
@ -24,10 +24,10 @@ index 4f580e0bd6..d5b14e5bb9 100644
</application>
diff --git a/quickstep/AndroidManifest-launcher.xml b/quickstep/AndroidManifest-launcher.xml
index 7d7054f5a5..d2955c4327 100644
index c6e2d8cb74..1d7405e345 100644
--- a/quickstep/AndroidManifest-launcher.xml
+++ b/quickstep/AndroidManifest-launcher.xml
@@ -66,6 +66,9 @@
@@ -65,6 +65,9 @@
<meta-data
android:name="com.android.launcher3.grid.control"
android:value="${packageName}.grid_control" />
@ -38,5 +38,5 @@ index 7d7054f5a5..d2955c4327 100644
</application>
--
2.40.1
2.43.1

View file

@ -1,7 +1,7 @@
From 0d97b73a079dd81b0dd8c0bb512a926d37f76cf9 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/4] Properly expose GridCustomizationsProvider
Subject: [PATCH 2/3] Properly expose GridCustomizationsProvider
Change-Id: I8268a215257ae0e399c56ac8b44cdfdff8cc92a0
---
@ -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 0c7b48fe66..1fe86ad022 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 0c7b48fe66..1fe86ad022 100644
<!--
The settings activity. To extend point settings_fragment_name to appropriate fragment class
--
2.40.1
2.43.1

View file

@ -1,7 +1,7 @@
From 8f1880d3576c0c6521e38558d56e55df92922c8a 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 4/4] Disable QSB in BuildConfig
Subject: [PATCH 3/3] Disable QSB in BuildConfig
Change-Id: I3150ef1d9b8c161ed2a6569d1ae75bba0060b36f
---
@ -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.40.1
2.43.1

View file

@ -1,25 +0,0 @@
From 4fd73068a8fa6246676d52b6ae63f04341319520 Mon Sep 17 00:00:00 2001
From: Danny Lin <danny@kdrag0n.dev>
Date: Wed, 6 Oct 2021 22:45:33 -0700
Subject: [PATCH 3/4] Fix all apps header color in dark mode
Change-Id: Ib2ce7f6e3c9b87a4626699cb54673d88392a5f41
---
res/values/styles.xml | 1 +
1 file changed, 1 insertion(+)
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 5dc4f0afa1..f5d64729c8 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -94,6 +94,7 @@
<item name="android:colorControlHighlight">#19FFFFFF</item>
<item name="android:colorPrimary">#FF212121</item>
<item name="allAppsScrimColor">?android:attr/colorBackgroundFloating</item>
+ <item name="allappsHeaderProtectionColor">@color/popup_color_tertiary_dark</item>
<item name="allAppsNavBarScrimColor">#80000000</item>
<item name="popupColorPrimary">@color/popup_color_primary_dark</item>
<item name="popupColorSecondary">@color/popup_color_secondary_dark</item>
--
2.40.1

View file

@ -1,4 +1,4 @@
From 16c9311e41992ddd8d0bfb5a340cedbf001e3413 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]
@ -9,19 +9,20 @@ Subject: [PATCH] Global VPN feature [2/2]
Change-Id: Ic3b79beb635afe03642fce9473bc481239166566
Signed-off-by: Mohammad Hasan Keramat J <ikeramat@protonmail.com>
---
res/values/strings.xml | 5 ++
res/values/strings.xml | 6 +++
res/xml/vpn_app_management.xml | 6 +++
.../settings/vpn2/AppManagementFragment.java | 48 ++++++++++++++++++-
3 files changed, 58 insertions(+), 1 deletion(-)
3 files changed, 59 insertions(+), 1 deletion(-)
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 28b35b3fcf..29ca3882e9 100644
index 630aeed0049..20902850060 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -14457,4 +14457,9 @@
<!-- [CHAR LIMIT=NONE] Hint for QR code process failure -->
<string name="bt_le_audio_qr_code_is_not_valid_format">QR code isn\u0027t a valid format</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>
+ <string name="global_vpn_summary">Force all traffic on the device through this VPN, including work profile and other users.</string>
@ -29,12 +30,12 @@ index 28b35b3fcf..29ca3882e9 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 adc441d846..e00f23ccfa 100644
index dffbbbe3116..93df378fd76 100644
--- a/res/xml/vpn_app_management.xml
+++ b/res/xml/vpn_app_management.xml
@@ -31,6 +31,12 @@
@@ -23,6 +23,12 @@
android:key="version"
android:selectable="false"/>
-->
+ <SwitchPreference
+ android:key="global_vpn"
@ -43,10 +44,10 @@ index adc441d846..e00f23ccfa 100644
+ android:summary="@string/global_vpn_summary" />
+
<com.android.settingslib.RestrictedSwitchPreference
android:order="10"
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 d4ee5b9c47..7a52e0c42c 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;
@ -61,16 +62,16 @@ index d4ee5b9c47..7a52e0c42c 100644
+import android.provider.Settings;
import android.text.TextUtils;
import android.util.Log;
import android.widget.TextView;
@@ -41,6 +43,7 @@ import androidx.appcompat.app.AlertDialog;
@@ -39,6 +41,7 @@ import androidx.annotation.VisibleForTesting;
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.DialogFragment;
import androidx.preference.Preference;
import androidx.preference.PreferenceViewHolder;
+import androidx.preference.SwitchPreference;
import com.android.internal.net.VpnConfig;
import com.android.internal.util.ArrayUtils;
@@ -64,6 +67,7 @@ public class AppManagementFragment extends SettingsPreferenceFragment
@@ -63,6 +66,7 @@ public class AppManagementFragment extends SettingsPreferenceFragment
private static final String ARG_PACKAGE_NAME = "package";
private static final String KEY_VERSION = "version";
@ -78,18 +79,18 @@ index d4ee5b9c47..7a52e0c42c 100644
private static final String KEY_ALWAYS_ON_VPN = "always_on_vpn";
private static final String KEY_LOCKDOWN_VPN = "lockdown_vpn";
private static final String KEY_FORGET_VPN = "forget_vpn";
@@ -79,6 +83,7 @@ public class AppManagementFragment extends SettingsPreferenceFragment
private String mVpnLabel;
@@ -80,6 +84,7 @@ public class AppManagementFragment extends SettingsPreferenceFragment
// UI preference
private Preference mPreferenceVersion;
+ private SwitchPreference mPreferenceGlobal;
private RestrictedSwitchPreference mPreferenceAlwaysOn;
private RestrictedSwitchPreference mPreferenceLockdown;
private RestrictedPreference mPreferenceForget;
@@ -123,10 +128,16 @@ public class AppManagementFragment extends SettingsPreferenceFragment
mDevicePolicyManager = getContext().getSystemService(DevicePolicyManager.class);
mVpnManager = getContext().getSystemService(VpnManager.class);
@@ -126,10 +131,16 @@ public class AppManagementFragment extends SettingsPreferenceFragment
mFeatureProvider = FeatureFactory.getFeatureFactory().getAdvancedVpnFeatureProvider();
mPreferenceVersion = findPreference(KEY_VERSION);
+ mPreferenceGlobal = (SwitchPreference) findPreference(KEY_GLOBAL_VPN);
mPreferenceAlwaysOn = (RestrictedSwitchPreference) findPreference(KEY_ALWAYS_ON_VPN);
mPreferenceLockdown = (RestrictedSwitchPreference) findPreference(KEY_LOCKDOWN_VPN);
@ -103,7 +104,7 @@ index d4ee5b9c47..7a52e0c42c 100644
mPreferenceAlwaysOn.setOnPreferenceChangeListener(this);
mPreferenceLockdown.setOnPreferenceChangeListener(this);
mPreferenceForget.setOnPreferenceClickListener(this);
@@ -204,6 +215,8 @@ public class AppManagementFragment extends SettingsPreferenceFragment
@@ -163,6 +174,8 @@ public class AppManagementFragment extends SettingsPreferenceFragment
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
switch (preference.getKey()) {
@ -112,7 +113,7 @@ index d4ee5b9c47..7a52e0c42c 100644
case KEY_ALWAYS_ON_VPN:
return onAlwaysOnVpnClick((Boolean) newValue, mPreferenceLockdown.isChecked());
case KEY_LOCKDOWN_VPN:
@@ -243,6 +256,11 @@ public class AppManagementFragment extends SettingsPreferenceFragment
@@ -202,6 +215,11 @@ public class AppManagementFragment extends SettingsPreferenceFragment
return setAlwaysOnVpnByUI(alwaysOnSetting, lockdown);
}
@ -124,7 +125,7 @@ index d4ee5b9c47..7a52e0c42c 100644
@Override
public void onConfirmLockdown(Bundle options, boolean isEnabled, boolean isLockdown) {
setAlwaysOnVpnByUI(isEnabled, isLockdown);
@@ -276,7 +294,18 @@ public class AppManagementFragment extends SettingsPreferenceFragment
@@ -235,7 +253,18 @@ public class AppManagementFragment extends SettingsPreferenceFragment
final boolean alwaysOn = isVpnAlwaysOn();
final boolean lockdown = alwaysOn
&& VpnUtils.isAnyLockdownActive(getActivity());
@ -144,7 +145,7 @@ index d4ee5b9c47..7a52e0c42c 100644
mPreferenceAlwaysOn.setChecked(alwaysOn);
mPreferenceLockdown.setChecked(lockdown);
updateRestrictedViews();
@@ -322,6 +351,11 @@ public class AppManagementFragment extends SettingsPreferenceFragment
@@ -298,6 +327,11 @@ public class AppManagementFragment extends SettingsPreferenceFragment
return mPackageName.equals(getAlwaysOnVpnPackage());
}
@ -156,7 +157,7 @@ index d4ee5b9c47..7a52e0c42c 100644
/**
* @return false if the intent doesn't contain an existing package or can't retrieve activated
* vpn info.
@@ -376,6 +410,18 @@ public class AppManagementFragment extends SettingsPreferenceFragment
@@ -352,6 +386,18 @@ public class AppManagementFragment extends SettingsPreferenceFragment
return config != null && !TextUtils.equals(config.user, mPackageName);
}
@ -176,5 +177,5 @@ index d4ee5b9c47..7a52e0c42c 100644
private static final String TAG = "CannotConnect";
private static final String ARG_VPN_LABEL = "label";
--
2.40.0
2.43.1

View file

@ -1,26 +1,25 @@
From 12224023faccc52724a443670bd77c6aa229ce58 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 6d9ff8f6..ff9413ac 100644
index d3a7c514..e23d0c84 100644
--- a/Android.bp
+++ b/Android.bp
@@ -117,5 +117,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.40.0
2.43.1

View file

@ -1,33 +1,32 @@
From 0068121d698911e9bc86a224b3f9a2fb7bdc6cbc 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 dee08f45..74479801 100644
index e23d0c84..44319052 100644
--- a/Android.bp
+++ b/Android.bp
@@ -118,7 +118,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"],
}
@@ -129,3 +133,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.40.0
2.43.1

View file

@ -1,26 +0,0 @@
From 4b626d87eafd37bf950550f5c14b42f5eaab19eb 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 ff9413ac..dee08f45 100644
--- a/Android.bp
+++ b/Android.bp
@@ -119,7 +119,7 @@ android_app {
additional_manifests: [":WallpaperPicker2_Manifest"],
required: ["privapp_whitelist_com.android.wallpaper.xml"],
- overrides: ["WallpaperPicker2"],
+ overrides: ["WallpaperPicker2", "WallpaperPicker"],
}
prebuilt_etc_xml {
--
2.40.0

View file

@ -1,7 +1,7 @@
From e51787a4ad9f2a70d9d68cad29a8974244c2c0b6 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.40.0
2.43.1

View file

@ -1,7 +1,7 @@
From 3156edaae20291237f095d2d5bb66e8ba0a4cea5 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.40.0
2.43.1

View file

@ -1,57 +0,0 @@
From 08cae5289428f6a99f2a6d28145fa542d1288916 Mon Sep 17 00:00:00 2001
From: "tzu-hsien.huang" <tzu-hsien.huang@mediatek.com>
Date: Wed, 20 Jul 2022 15:12:01 +0800
Subject: [PATCH 1/3] Additionally check le_set_event_mask command resturn
status with UNSUPPORTED_LMP_OR_LL_PARAMETER
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
In GD BT stack, stack will check each return status of HCI Commands. E.g. reset , le_set_event_mask, set_event_mask …etc.
In BT spec 5.2, SIG add some parameters for le_set_event_mask for le audio, like LE Terminate BIG Complete event: Supported.
However, some legacy chips do not support LE Audio feature, and controller will return Status: Unsupported LMP Parameter Value when it receives this HCI Command
When it checks the return value and find the status is not SUCCESS, it will cause FAIL and cannot be compatible with old legacy chip.
After brushing GSI, Bluetooth will turn off automatically when it is turned on.
So all CTS test will always fail.
Check le_set_event_mask command return status with SUCCESS or UNSUPPORTED_LMP_OR_LL_PARAMETER
Bug: 239662211
Test: CtsBluetoothTestCases
Change-Id: I2b0cede7f47eecd2124a386e958773289eb6f11c
---
system/gd/hci/controller.cc | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/system/gd/hci/controller.cc b/system/gd/hci/controller.cc
index 9dac2b6a84..50342d639e 100644
--- a/system/gd/hci/controller.cc
+++ b/system/gd/hci/controller.cc
@@ -548,7 +548,7 @@ struct Controller::impl {
void le_set_event_mask(uint64_t le_event_mask) {
std::unique_ptr<LeSetEventMaskBuilder> packet = LeSetEventMaskBuilder::Create(le_event_mask);
hci_->EnqueueCommand(std::move(packet), module_.GetHandler()->BindOnceOn(
- this, &Controller::impl::check_status<LeSetEventMaskCompleteView>));
+ this, &Controller::impl::check_event_mask_status<LeSetEventMaskCompleteView>));
}
template <class T>
@@ -559,6 +559,15 @@ struct Controller::impl {
ASSERT(status_view.GetStatus() == ErrorCode::SUCCESS);
}
+ template <class T>
+ void check_event_mask_status(CommandCompleteView view) {
+ ASSERT(view.IsValid());
+ auto status_view = T::Create(view);
+ ASSERT(status_view.IsValid());
+ ASSERT(status_view.GetStatus() == ErrorCode::SUCCESS ||
+ status_view.GetStatus() == ErrorCode::UNSUPPORTED_LMP_OR_LL_PARAMETER);
+ }
+
#define OP_CODE_MAPPING(name) \
case OpCode::name: { \
uint16_t index = (uint16_t)OpCodeIndex::name; \
--
2.40.1

View file

@ -1,7 +1,7 @@
From 55a4e7e7158f50f3e8840b526e15d7c9f10423de 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 2/3] gd: hci: Ignore unexpected status events
Subject: [PATCH 1/3] gd: hci: Ignore unexpected status events
For some reason, on some old devices, the controller will report a
remote to support SNIFF_SUBRATING even when it does not. Just ignore the
@ -13,12 +13,12 @@ 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 5def729ac8..9c235294bb 100644
index 0889aa69e9..0b61fd4a4a 100644
--- a/system/gd/hci/hci_layer.cc
+++ b/system/gd/hci/hci_layer.cc
@@ -195,14 +195,13 @@ struct HciLayer::impl {
EventView::Create(PacketView<kLittleEndian>(std::make_shared<std::vector<uint8_t>>(std::vector<uint8_t>()))));
command_queue_.front().GetCallback<CommandCompleteView>()->Invoke(move(command_complete_view));
@@ -213,14 +213,13 @@ struct HciLayer::impl {
command_queue_.front().GetCallback<CommandCompleteView>()->Invoke(
std::move(command_complete_view));
} else {
- ASSERT_LOG(
- command_queue_.front().waiting_for_status_ == is_status,
@ -27,17 +27,17 @@ index 5def729ac8..9c235294bb 100644
- OpCodeText(op_code).c_str(),
- logging_id.c_str());
-
- command_queue_.front().GetCallback<TResponse>()->Invoke(move(response_view));
- command_queue_.front().GetCallback<TResponse>()->Invoke(std::move(response_view));
+ if (command_queue_.front().waiting_for_status_ == is_status) {
+ command_queue_.front().GetCallback<TResponse>()->Invoke(move(response_view));
+ command_queue_.front().GetCallback<TResponse>()->Invoke(std::move(response_view));
+ } else {
+ CommandCompleteView command_complete_view = CommandCompleteView::Create(
+ EventView::Create(PacketView<kLittleEndian>(std::make_shared<std::vector<uint8_t>>(std::vector<uint8_t>()))));
+ command_queue_.front().GetCallback<CommandCompleteView>()->Invoke(move(command_complete_view));
+ command_queue_.front().GetCallback<CommandCompleteView>()->Invoke(std::move(command_complete_view));
+ }
}
command_queue_.pop_front();
--
2.40.1
2.43.1

View file

@ -1,22 +1,22 @@
From f2d820597f4dcbb08e4e0c9026dc1d56fe7b3bfd 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 3/3] audio_hal_interface: Optionally use sysbta HAL
Subject: [PATCH 2/3] audio_hal_interface: Optionally use sysbta HAL
Required to support sysbta, our system-side bt audio implementation.
Change-Id: I59973e6ec84c5923be8a7c67b36b2e237f000860
---
system/audio_hal_interface/aidl/client_interface_aidl.cc | 6 +++---
system/audio_hal_interface/aidl/client_interface_aidl.h | 7 +++++++
system/audio_hal_interface/hal_version_manager.cc | 9 ++++++++-
3 files changed, 18 insertions(+), 4 deletions(-)
.../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 9af28031f7..5a9dbbccad 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 9af28031f7..5a9dbbccad 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 9af28031f7..5a9dbbccad 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(
@ -44,7 +44,7 @@ index 9af28031f7..5a9dbbccad 100644
if (provider_factory == nullptr) {
LOG(ERROR) << __func__ << ", can't get capability 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 17abefe8fe..07dd11266f 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 @@
@ -55,7 +55,7 @@ index 17abefe8fe..07dd11266f 100644
#define BLUETOOTH_AUDIO_HAL_PROP_DISABLED \
"persist.bluetooth.bluetooth_audio_hal.disabled"
@@ -117,6 +118,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";
@ -69,18 +69,18 @@ index 17abefe8fe..07dd11266f 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";
@ -93,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.40.1
2.43.1

View file

@ -0,0 +1,91 @@
From b2dff222788e6fe7e28e27f277980025f9548fa3 Mon Sep 17 00:00:00 2001
From: Peter Cai <peter@typeblog.net>
Date: Tue, 12 Mar 2024 22:33:37 -0400
Subject: [PATCH 3/3] Revert "BT: Add Low latency flow for Mediatek BT Chip"
This reverts commit 78b3684eb205e1b4bc0aa3e12138687e73f78ebe.
---
system/stack/include/hcidefs.h | 9 ---------
system/stack/l2cap/l2c_utils.cc | 32 --------------------------------
2 files changed, 41 deletions(-)
diff --git a/system/stack/include/hcidefs.h b/system/stack/include/hcidefs.h
index a8ad4499bf..344507f76d 100644
--- a/system/stack/include/hcidefs.h
+++ b/system/stack/include/hcidefs.h
@@ -916,9 +916,6 @@ typedef struct {
// TODO Remove this once all UNISOC specific hacks are removed.
#define LMP_COMPID_UNISOC 0x073F
-// TODO Remove this once all Mediatek specific hacks are removed.
-#define LMP_COMPID_MEDIATEK 0x0046
-
/* Parameter information for HCI_SYNA_SET_ACL_PRIORITY */
#define HCI_SYNA_ACL_PRIORITY_PARAM_SIZE 3
#define HCI_SYNA_ACL_NORMAL_PRIORITY 0xF0
@@ -932,12 +929,6 @@ typedef struct {
#define HCI_UNISOC_ACL_NORMAL_PRIORITY 0x00
#define HCI_UNISOC_ACL_HIGH_PRIORITY 0xFF
-/* Parameter information for HCI_MTK_SET_ACL_PRIORITY */
-#define HCI_MTK_ACL_PRIORITY_PARAM_SIZE 1
-#define HCI_MTK_SET_ACL_PRIORITY (0xFD95 | HCI_GRP_VENDOR_SPECIFIC)
-#define HCI_MTK_ACL_NORMAL_PRIORITY 0x00
-#define HCI_MTK_ACL_HIGH_PRIORITY 0x01
-
/*
* Define packet size
*/
diff --git a/system/stack/l2cap/l2c_utils.cc b/system/stack/l2cap/l2c_utils.cc
index 7b722f426a..ef213c4de6 100644
--- a/system/stack/l2cap/l2c_utils.cc
+++ b/system/stack/l2cap/l2c_utils.cc
@@ -2338,34 +2338,6 @@ static void l2cu_set_acl_priority_unisoc(tL2C_LCB* p_lcb,
HCI_UNISOC_ACL_PRIORITY_PARAM_SIZE, command, NULL);
}
-/*******************************************************************************
- *
- * Function l2cu_set_acl_priority_latency_mtk
- *
- * Description Sends a VSC to set the ACL priority and recorded latency on
- * Mediatek chip.
- *
- * Returns void
- *
- ******************************************************************************/
-
-static void l2cu_set_acl_priority_latency_mtk(tL2C_LCB* p_lcb,
- tL2CAP_PRIORITY priority) {
- uint8_t vs_param;
- if (priority == L2CAP_PRIORITY_HIGH) {
- // priority to high, if using latency mode check preset latency
- LOG_INFO("Set ACL priority: High Priority Mode");
- vs_param = HCI_MTK_ACL_HIGH_PRIORITY;
- } else {
- // priority to normal
- LOG_INFO("Set ACL priority: Normal Mode");
- vs_param = HCI_MTK_ACL_NORMAL_PRIORITY;
- }
-
- BTM_VendorSpecificCommand(HCI_MTK_SET_ACL_PRIORITY,
- HCI_MTK_ACL_PRIORITY_PARAM_SIZE, &vs_param, NULL);
-}
-
/*******************************************************************************
*
* Function l2cu_set_acl_priority
@@ -2410,10 +2382,6 @@ bool l2cu_set_acl_priority(const RawAddress& bd_addr, tL2CAP_PRIORITY priority,
l2cu_set_acl_priority_unisoc(p_lcb, priority);
break;
- case LMP_COMPID_MEDIATEK:
- l2cu_set_acl_priority_latency_mtk(p_lcb, priority);
- break;
-
default:
/* Not supported/required for other vendors */
break;
--
2.43.1

View file

@ -0,0 +1,44 @@
From 7c61a53d73e8ac2903653d92fdd2aad8e38ffad3 Mon Sep 17 00:00:00 2001
From: Peter Cai <peter@typeblog.net>
Date: Sat, 16 Mar 2024 15:27:27 -0400
Subject: [PATCH] Revert "drop support for V gsi on pixel 5 R base kernel"
This reverts commit bbbd18a71368a80f689b924dcf82062c2ee351b2.
---
..._android_server_connectivity_ClatCoordinator.cpp | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/service/jni/com_android_server_connectivity_ClatCoordinator.cpp b/service/jni/com_android_server_connectivity_ClatCoordinator.cpp
index c125bd6479..787ef8fd69 100644
--- a/service/jni/com_android_server_connectivity_ClatCoordinator.cpp
+++ b/service/jni/com_android_server_connectivity_ClatCoordinator.cpp
@@ -90,6 +90,11 @@ static void verifyPerms(const char * const path,
#undef ALOGF
+bool isGsiImage() {
+ // this implementation matches 2 other places in the codebase (same function name too)
+ return !access("/system/system_ext/etc/init/init.gsi.rc", F_OK);
+}
+
static const char* kClatdDir = "/apex/com.android.tethering/bin/for-system";
static const char* kClatdBin = "/apex/com.android.tethering/bin/for-system/clatd";
@@ -130,6 +135,14 @@ static void verifyClatPerms() {
#undef V2
+ // HACK: Some old vendor kernels lack ~5.10 backport of 'bpffs selinux genfscon' support.
+ // This is *NOT* supported, but let's allow, at least for now, U+ GSI to boot on them.
+ // (without this hack pixel5 R vendor + U gsi breaks)
+ if (isGsiImage() && !bpf::isAtLeastKernelVersion(5, 10, 0)) {
+ ALOGE("GSI with *BAD* pre-5.10 kernel lacking bpffs selinux genfscon support.");
+ return;
+ }
+
if (fatal) abort();
}
--
2.43.1

View file

@ -1,34 +0,0 @@
From cf04b02d96fef364996067ca4ecc51b65f521dca 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 5cd80b7..bc72811 100644
--- a/bpfloader/BpfLoader.cpp
+++ b/bpfloader/BpfLoader.cpp
@@ -199,15 +199,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.38.1

View file

@ -1,4 +1,4 @@
From f53da166596fc34df3255b1c5120fd7cdcf21e5f Mon Sep 17 00:00:00 2001
From ce23dec99926b3e688ae5cd85f5da71c8765f89c 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/2] init: Do not start console service when debuggable
@ -13,10 +13,10 @@ Change-Id: I34cfd6b42d3b9aee4b3e63181480cfb8b1255f29
1 file changed, 3 deletions(-)
diff --git a/rootdir/init.rc b/rootdir/init.rc
index 02e51d2c4..ab45bb032 100644
index 317f80908..9dc09ea4a 100644
--- a/rootdir/init.rc
+++ b/rootdir/init.rc
@@ -1277,9 +1277,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 02e51d2c4..ab45bb032 100644
# TODO(b/135984674): reset all necessary properties here.
setprop sys.boot_completed ""
--
2.40.0
2.44.0

View file

@ -1,32 +0,0 @@
From b50dd85e88568bddedbab1e18984a5b5578c8612 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/2] 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 26341b196..19fc09d63 100644
--- a/init/property_service.cpp
+++ b/init/property_service.cpp
@@ -726,7 +726,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.40.0

View file

@ -0,0 +1,52 @@
From b5256522214257f1a5f8ee5ecac84609993f8129 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
* adb secure props and logd can be overridden from system.
Change-Id: I94efa3f108ae97711026f099f367b6bea325629f
---
init/property_service.cpp | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/init/property_service.cpp b/init/property_service.cpp
index 013924778..ce164372a 100644
--- a/init/property_service.cpp
+++ b/init/property_service.cpp
@@ -64,6 +64,7 @@
#include <selinux/android.h>
#include <selinux/label.h>
#include <selinux/selinux.h>
+
#include "debug_ramdisk.h"
#include "epoll.h"
#include "init.h"
@@ -796,13 +797,20 @@ 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 (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 (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.44.0