Initial unified commit for Android 13, with "light" GSI target
This commit is contained in:
@@ -0,0 +1,75 @@
|
||||
From faff60c8814e2d31519d86e92faf08761a1d1de1 Mon Sep 17 00:00:00 2001
|
||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||
Date: Wed, 8 Dec 2021 07:04:53 +0000
|
||||
Subject: [PATCH] Remove init.vndk-nodef.rc
|
||||
|
||||
This partially reverts "Deprecate VNDK-lite support from Legacy GSI".
|
||||
|
||||
Paired with https://github.com/LineageOS/android_system_core/commit/0b265e35ddf42638fa807f5349a10c40e3d46446, it kicks permissive devices into bootloader.
|
||||
Given that GSI+permissive won't ever be a Lineage official scenario, revert this only on our side.
|
||||
Thanks @Kethen for the insight!
|
||||
|
||||
Change-Id: I7c14fe5229e953f620bb225fa5c981752d0ac5f9
|
||||
---
|
||||
target/product/gsi/Android.mk | 13 -------------
|
||||
target/product/gsi/init.gsi.rc | 2 --
|
||||
target/product/gsi/init.vndk-nodef.rc | 3 ---
|
||||
target/product/gsi_release.mk | 1 -
|
||||
4 files changed, 19 deletions(-)
|
||||
delete mode 100644 target/product/gsi/init.vndk-nodef.rc
|
||||
|
||||
diff --git a/target/product/gsi/Android.mk b/target/product/gsi/Android.mk
|
||||
index 85e551d3f..c1f37e07f 100644
|
||||
--- a/target/product/gsi/Android.mk
|
||||
+++ b/target/product/gsi/Android.mk
|
||||
@@ -247,16 +247,3 @@ LOCAL_SYSTEM_EXT_MODULE := true
|
||||
LOCAL_MODULE_RELATIVE_PATH := init
|
||||
|
||||
include $(BUILD_PREBUILT)
|
||||
-
|
||||
-
|
||||
-include $(CLEAR_VARS)
|
||||
-LOCAL_MODULE := init.vndk-nodef.rc
|
||||
-LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
|
||||
-LOCAL_LICENSE_CONDITIONS := notice
|
||||
-LOCAL_NOTICE_FILE := build/soong/licenses/LICENSE
|
||||
-LOCAL_SRC_FILES := $(LOCAL_MODULE)
|
||||
-LOCAL_MODULE_CLASS := ETC
|
||||
-LOCAL_SYSTEM_EXT_MODULE := true
|
||||
-LOCAL_MODULE_RELATIVE_PATH := gsi
|
||||
-
|
||||
-include $(BUILD_PREBUILT)
|
||||
diff --git a/target/product/gsi/init.gsi.rc b/target/product/gsi/init.gsi.rc
|
||||
index 69c8e467b..c6faba78d 100644
|
||||
--- a/target/product/gsi/init.gsi.rc
|
||||
+++ b/target/product/gsi/init.gsi.rc
|
||||
@@ -1,5 +1,3 @@
|
||||
#
|
||||
# Android init script for GSI required initialization
|
||||
#
|
||||
-
|
||||
-import /system/system_ext/etc/gsi/init.vndk-${ro.vndk.version:-nodef}.rc
|
||||
diff --git a/target/product/gsi/init.vndk-nodef.rc b/target/product/gsi/init.vndk-nodef.rc
|
||||
deleted file mode 100644
|
||||
index 1b141a05e..000000000
|
||||
--- a/target/product/gsi/init.vndk-nodef.rc
|
||||
+++ /dev/null
|
||||
@@ -1,3 +0,0 @@
|
||||
-on early-init
|
||||
- # Reboot if BOARD_VNDK_VERSION is not defined
|
||||
- exec - root -- /system/bin/reboot bootloader
|
||||
diff --git a/target/product/gsi_release.mk b/target/product/gsi_release.mk
|
||||
index 74501cd1f..575e90b14 100644
|
||||
--- a/target/product/gsi_release.mk
|
||||
+++ b/target/product/gsi_release.mk
|
||||
@@ -60,7 +60,6 @@ PRODUCT_PACKAGES += com.android.apex.cts.shim.v1_with_prebuilts.flattened
|
||||
PRODUCT_PACKAGES += \
|
||||
gsi_skip_mount.cfg \
|
||||
init.gsi.rc \
|
||||
- init.vndk-nodef.rc \
|
||||
|
||||
# Support additional VNDK snapshots
|
||||
PRODUCT_EXTRA_VNDK_VERSIONS := \
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -0,0 +1,313 @@
|
||||
From 51deb8e31ca57f19420277cc92b26375233e9050 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/5] APM: Restore S, R and Q behavior respectively for
|
||||
telephony audio
|
||||
|
||||
This conditionally reverts part of b2e5cb (T), 51c9cc (S) and afd4ce (R)
|
||||
when the VNDK version is equal to or before S, R and Q respectively.
|
||||
|
||||
On R, commit afd4ce made it so that both HW and SW bridging go through
|
||||
`createAudioPatch()`, which is broken on some devices such as on MTK Q
|
||||
vendor, because their HAL do not support HW patching via the newer
|
||||
`createAudioPatch()` method. Instead, the patching on Q was done through
|
||||
`setOutputDevices()`.
|
||||
|
||||
On S, commit 51c9cc refactored the related code again such that HW
|
||||
bridging for the Rx direction is essentially removed, replaced with SW
|
||||
bridging through `startAudioSource()`. This is, again, broken on MTK R
|
||||
vendor devices.
|
||||
|
||||
On T, commit b2e5cb applied the same SW bridging to the Tx direction.
|
||||
|
||||
All of these commits rely on assumptions that are not tested through
|
||||
VTS and just presumed to be true. Although we can blame MTK for not
|
||||
supporting all the possible cases in their HAL, it will not fix
|
||||
anything, and really frameworks code should not depend on such untested
|
||||
assumptions.
|
||||
|
||||
To work around said issues, we restore old behavior from S, R and Q
|
||||
relying on the value of `ro.vndk.version`.
|
||||
|
||||
Change-Id: I56d36d2aef4319935cb88a3e4771b23c6d5b2145
|
||||
---
|
||||
.../managerdefault/AudioPolicyManager.cpp | 193 +++++++++++++-----
|
||||
.../managerdefault/AudioPolicyManager.h | 3 +
|
||||
2 files changed, 141 insertions(+), 55 deletions(-)
|
||||
|
||||
diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
|
||||
index 744609f27b..224dae3820 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);
|
||||
|
||||
+ // release existing RX patch if any
|
||||
+ if (mCallRxPatch != 0) {
|
||||
+ releaseAudioPatchInternal(mCallRxPatch->getHandle());
|
||||
+ mCallRxPatch.clear();
|
||||
+ }
|
||||
+ // release TX patch if any
|
||||
+ if (mCallTxPatch != 0) {
|
||||
+ releaseAudioPatchInternal(mCallTxPatch->getHandle());
|
||||
+ mCallTxPatch.clear();
|
||||
+ }
|
||||
+
|
||||
auto telephonyRxModule =
|
||||
mHwModules.getModuleForDeviceType(AUDIO_DEVICE_IN_TELEPHONY_RX, AUDIO_FORMAT_DEFAULT);
|
||||
auto telephonyTxModule =
|
||||
@@ -697,9 +708,20 @@ status_t AudioPolicyManager::updateCallRoutingInternal(
|
||||
ALOGE("%s() no telephony Tx and/or RX device", __func__);
|
||||
return INVALID_OPERATION;
|
||||
}
|
||||
- // createAudioPatchInternal now supports both HW / SW bridging
|
||||
- createRxPatch = true;
|
||||
- createTxPatch = true;
|
||||
+ if (property_get_int32("ro.vndk.version", 31) >= 30) {
|
||||
+ // createAudioPatchInternal now supports both HW / SW bridging
|
||||
+ createRxPatch = true;
|
||||
+ createTxPatch = true;
|
||||
+ } else {
|
||||
+ // pre-R behavior: some devices before VNDK 30 do not support createAudioPatch correctly
|
||||
+ // for HW bridging even though they declare support for it
|
||||
+ // do not create a patch (aka Sw Bridging) if Primary HW module has declared supporting a
|
||||
+ // route between telephony RX to Sink device and Source device to telephony TX
|
||||
+ ALOGI("%s() Using pre-R behavior for createRxPatch and createTxPatch", __func__);
|
||||
+ const auto &primaryModule = telephonyRxModule;
|
||||
+ createRxPatch = !primaryModule->supportsPatch(rxSourceDevice, rxDevices.itemAt(0));
|
||||
+ createTxPatch = !primaryModule->supportsPatch(txSourceDevice, txSinkDevice);
|
||||
+ }
|
||||
} 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);
|
||||
} else { // create RX path audio patch
|
||||
- connectTelephonyRxAudioSource();
|
||||
+ if (property_get_int32("ro.vndk.version", 31) >= 31) {
|
||||
+ connectTelephonyRxAudioSource();
|
||||
+ } else {
|
||||
+ // pre-S behavior: some devices do not support SW bridging correctly when HW bridge is
|
||||
+ // available through createAudioPatch(); startAudioSource() forces SW bridging.
|
||||
+ ALOGI("%s() Using pre-S behavior to create HW Rx patch", __func__);
|
||||
+ mCallRxPatch = createTelephonyPatch(true /*isRx*/, rxDevices.itemAt(0), delayMs);
|
||||
+ }
|
||||
// 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(
|
||||
closeActiveClients(activeDesc);
|
||||
}
|
||||
}
|
||||
- connectTelephonyTxAudioSource(txSourceDevice, txSinkDevice, delayMs);
|
||||
+ if (property_get_int32("ro.vndk.version", 33) >= 33) {
|
||||
+ connectTelephonyTxAudioSource(txSourceDevice, txSinkDevice, delayMs);
|
||||
+ } else {
|
||||
+ // pre-T behavior: hw bridging for tx too; skip the SwOutput
|
||||
+ mCallTxPatch = createTelephonyPatch(false /*isRx*/, txSourceDevice, delayMs);
|
||||
+ }
|
||||
}
|
||||
if (waitMs != nullptr) {
|
||||
*waitMs = muteWaitMs;
|
||||
@@ -739,6 +773,36 @@ status_t AudioPolicyManager::updateCallRoutingInternal(
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
+sp<AudioPatch> AudioPolicyManager::createTelephonyPatch(
|
||||
+ bool isRx, const sp<DeviceDescriptor> &device, uint32_t delayMs) {
|
||||
+ PatchBuilder patchBuilder;
|
||||
+
|
||||
+ if (device == nullptr) {
|
||||
+ return nullptr;
|
||||
+ }
|
||||
+
|
||||
+ // @TODO: still ignoring the address, or not dealing platform with multiple telephony devices
|
||||
+ if (isRx) {
|
||||
+ patchBuilder.addSink(device).
|
||||
+ addSource(mAvailableInputDevices.getDevice(
|
||||
+ AUDIO_DEVICE_IN_TELEPHONY_RX, String8(), AUDIO_FORMAT_DEFAULT));
|
||||
+ } else {
|
||||
+ patchBuilder.addSource(device).
|
||||
+ addSink(mAvailableOutputDevices.getDevice(
|
||||
+ AUDIO_DEVICE_OUT_TELEPHONY_TX, String8(), AUDIO_FORMAT_DEFAULT));
|
||||
+ }
|
||||
+
|
||||
+ audio_patch_handle_t patchHandle = AUDIO_PATCH_HANDLE_NONE;
|
||||
+ status_t status =
|
||||
+ createAudioPatchInternal(patchBuilder.patch(), &patchHandle, mUidCached, delayMs, nullptr);
|
||||
+ ssize_t index = mAudioPatches.indexOfKey(patchHandle);
|
||||
+ if (status != NO_ERROR || index < 0) {
|
||||
+ ALOGW("%s() error %d creating %s audio patch", __func__, status, isRx ? "RX" : "TX");
|
||||
+ return nullptr;
|
||||
+ }
|
||||
+ return mAudioPatches.valueAt(index);
|
||||
+}
|
||||
+
|
||||
bool AudioPolicyManager::isDeviceOfModule(
|
||||
const sp<DeviceDescriptor>& devDesc, const char *moduleId) const {
|
||||
sp<HwModule> module = mHwModules.getModuleFromName(moduleId);
|
||||
@@ -4520,76 +4584,95 @@ 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 = 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;
|
||||
- config.channel_mask = sourceDesc->config().channel_mask;
|
||||
- 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;
|
||||
- getOutputForAttrInt(&resultAttr, &output, AUDIO_SESSION_NONE, &attributes,
|
||||
- &stream, sourceDesc->uid(), &config, &flags,
|
||||
- &selectedDeviceId, &isRequestedDeviceForExclusiveUse,
|
||||
- nullptr, &outputType, &isSpatialized);
|
||||
- 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;
|
||||
- }
|
||||
- sourceDesc->setSwOutput(outputDesc);
|
||||
- } else {
|
||||
- // Same for "raw patches" aka created from createAudioPatch API
|
||||
- SortedVector<audio_io_handle_t> outputs =
|
||||
+ 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;
|
||||
+ config.channel_mask = sourceDesc->config().channel_mask;
|
||||
+ 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;
|
||||
+ getOutputForAttrInt(&resultAttr, &output, AUDIO_SESSION_NONE, &attributes,
|
||||
+ &stream, sourceDesc->uid(), &config, &flags,
|
||||
+ &selectedDeviceId, &isRequestedDeviceForExclusiveUse,
|
||||
+ nullptr, &outputType, &isSpatialized);
|
||||
+ 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;
|
||||
+ }
|
||||
+ sourceDesc->setSwOutput(outputDesc);
|
||||
+ } 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;
|
||||
+ // 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);
|
||||
}
|
||||
- sourceDesc->setSwOutput(outputDesc);
|
||||
}
|
||||
// create a software bridge in PatchPanel if:
|
||||
// - source and sink devices are on different HW modules OR
|
||||
// - audio HAL version is < 3.0
|
||||
// - audio HAL version is >= 3.0 but no route has been declared between devices
|
||||
- // - called from startAudioSource (aka sourceDesc is not internal) and source device
|
||||
+ // - called from startAudioSource (aka sourceDesc is neither null nor internal) and source device
|
||||
// does not have a gain controller
|
||||
if (!srcDevice->hasSameHwModuleAs(sinkDevice) ||
|
||||
(srcDevice->getModuleVersionMajor() < 3) ||
|
||||
!srcDevice->getModule()->supportsPatch(srcDevice, sinkDevice) ||
|
||||
- (!sourceDesc->isInternal() &&
|
||||
+ ((sourceDesc != nullptr && !sourceDesc->isInternal()) &&
|
||||
srcDevice->getAudioPort()->getGains().size() == 0)) {
|
||||
// support only one sink device for now to simplify output selection logic
|
||||
if (patch->num_sinks > 1) {
|
||||
return INVALID_OPERATION;
|
||||
}
|
||||
- sourceDesc->setUseSwBridge();
|
||||
+ if (sourceDesc == nullptr) {
|
||||
+ 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) {
|
||||
+ outputDesc = mOutputs.valueFor(output);
|
||||
+ if (outputDesc->isDuplicated()) {
|
||||
+ ALOGV("%s output for device %s is duplicated",
|
||||
+ __FUNCTION__, sinkDevice->toString().c_str());
|
||||
+ return INVALID_OPERATION;
|
||||
+ }
|
||||
+ }
|
||||
+ } else {
|
||||
+ sourceDesc->setUseSwBridge();
|
||||
+ }
|
||||
if (outputDesc != nullptr) {
|
||||
audio_port_config srcMixPortConfig = {};
|
||||
outputDesc->toAudioPortConfig(&srcMixPortConfig, nullptr);
|
||||
// for volume control, we may need a valid stream
|
||||
- srcMixPortConfig.ext.mix.usecase.stream = !sourceDesc->isInternal() ?
|
||||
+ srcMixPortConfig.ext.mix.usecase.stream = (sourceDesc != nullptr && !sourceDesc->isInternal()) ?
|
||||
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 db0ee15de8..97fa6f6f81 100644
|
||||
--- a/services/audiopolicy/managerdefault/AudioPolicyManager.h
|
||||
+++ b/services/audiopolicy/managerdefault/AudioPolicyManager.h
|
||||
@@ -938,6 +938,9 @@ protected:
|
||||
|
||||
SoundTriggerSessionCollection mSoundTriggerSessions;
|
||||
|
||||
+ sp<AudioPatch> mCallTxPatch;
|
||||
+ sp<AudioPatch> mCallRxPatch;
|
||||
+
|
||||
HwAudioOutputCollection mHwOutputs;
|
||||
SourceClientCollection mAudioSources;
|
||||
|
||||
--
|
||||
2.37.2
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
From 5def9ad1a26e28d517666e34301dc725c1660e36 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/5] APM: Optionally force-load audio policy for system-side
|
||||
bt audio HAL
|
||||
|
||||
Required to support our system-side bt audio implementation, i.e.
|
||||
`sysbta`.
|
||||
|
||||
Co-authored-by: Pierre-Hugues Husson <phh@phh.me>
|
||||
Change-Id: I279fff541a531f922f3fa55b8f14d00237db59ff
|
||||
---
|
||||
.../managerdefinitions/src/Serializer.cpp | 25 +++++++++++++++++++
|
||||
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
|
||||
--- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||
+++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <libxml/parser.h>
|
||||
#include <libxml/xinclude.h>
|
||||
#include <media/convert.h>
|
||||
+#include <cutils/properties.h>
|
||||
#include <utils/Log.h>
|
||||
#include <utils/StrongPointer.h>
|
||||
#include <utils/Errors.h>
|
||||
@@ -890,6 +891,30 @@ status_t PolicySerializer::deserialize(const char *configFile, AudioPolicyConfig
|
||||
if (status != NO_ERROR) {
|
||||
return status;
|
||||
}
|
||||
+
|
||||
+ // Remove modules called bluetooth, bluetooth_qti or a2dp, and inject our own
|
||||
+ if (property_get_bool("persist.bluetooth.system_audio_hal.enabled", false)) {
|
||||
+ for (auto it = modules.begin(); it != modules.end(); it++) {
|
||||
+ const char *name = (*it)->getName();
|
||||
+ if (strcmp(name, "a2dp") == 0 ||
|
||||
+ strcmp(name, "a2dpsink") == 0 ||
|
||||
+ strcmp(name, "bluetooth") == 0 ||
|
||||
+ strcmp(name, "bluetooth_qti") == 0) {
|
||||
+
|
||||
+ ALOGE("Removed module %s\n", name);
|
||||
+ it = modules.erase(it);
|
||||
+ }
|
||||
+ if (it == modules.end()) break;
|
||||
+ }
|
||||
+ const char* a2dpFileName = "/system/etc/sysbta_audio_policy_configuration.xml";
|
||||
+ if (version == "7.0")
|
||||
+ a2dpFileName = "/system/etc/sysbta_audio_policy_configuration_7_0.xml";
|
||||
+ auto doc = make_xmlUnique(xmlParseFile(a2dpFileName));
|
||||
+ xmlNodePtr root = xmlDocGetRootElement(doc.get());
|
||||
+ auto maybeA2dpModule = deserialize<ModuleTraits>(root, config);
|
||||
+ modules.add(std::get<1>(maybeA2dpModule));
|
||||
+ }
|
||||
+
|
||||
config->setHwModules(modules);
|
||||
|
||||
// Global Configuration
|
||||
--
|
||||
2.37.2
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
From e31fc6f3f79848e6f7e7b1b4abe82aa26571cf7b 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/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
|
||||
sysbta, the system-side generic bluetooth audio implementation.
|
||||
|
||||
Remove them as we parse the policy XML.
|
||||
|
||||
Co-authored-by: Pierre-Hugues Husson <phh@phh.me>
|
||||
Change-Id: I3305594a17285da113167b419543543f0ef71122
|
||||
---
|
||||
.../managerdefinitions/src/Serializer.cpp | 26 ++++++++++++++++---
|
||||
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
|
||||
--- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||
+++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||
@@ -26,6 +26,7 @@
|
||||
#include <libxml/xinclude.h>
|
||||
#include <media/convert.h>
|
||||
#include <cutils/properties.h>
|
||||
+#include <system/audio.h>
|
||||
#include <utils/Log.h>
|
||||
#include <utils/StrongPointer.h>
|
||||
#include <utils/Errors.h>
|
||||
@@ -334,11 +335,8 @@ status_t PolicySerializer::deserializeCollection(const xmlNode *cur,
|
||||
Trait::collectionTag);
|
||||
return status;
|
||||
}
|
||||
- } else if (mIgnoreVendorExtensions && std::get<status_t>(maybeElement) == NO_INIT) {
|
||||
- // Skip a vendor extension element.
|
||||
- } else {
|
||||
- return BAD_VALUE;
|
||||
}
|
||||
+ // Ignore elements that failed to parse, e.g. routes with invalid sinks
|
||||
}
|
||||
}
|
||||
if (!xmlStrcmp(cur->name, reinterpret_cast<const xmlChar*>(Trait::tag))) {
|
||||
@@ -679,6 +677,7 @@ std::variant<status_t, ModuleTraits::Element> PolicySerializer::deserialize<Modu
|
||||
ALOGE("%s: No %s found", __func__, Attributes::name);
|
||||
return BAD_VALUE;
|
||||
}
|
||||
+
|
||||
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
|
||||
if (status != NO_ERROR) {
|
||||
return status;
|
||||
}
|
||||
+ bool shouldEraseA2DP = name == "primary" && property_get_bool("persist.bluetooth.system_audio_hal.enabled", false);
|
||||
+ if (shouldEraseA2DP) {
|
||||
+ // Having A2DP ports in the primary audio HAL module will interfere with sysbta
|
||||
+ // so remove them here. Note that we do not need to explicitly remove the
|
||||
+ // corresponding routes below, because routes with invalid sinks will be ignored
|
||||
+ auto iter = devicePorts.begin();
|
||||
+ while (iter != devicePorts.end()) {
|
||||
+ auto port = *iter;
|
||||
+ auto type = port->type();
|
||||
+ if (type == AUDIO_DEVICE_OUT_BLUETOOTH_A2DP
|
||||
+ || type == AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES
|
||||
+ || type == AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER) {
|
||||
+ ALOGE("Erasing A2DP device port %s", port->getTagName().c_str());
|
||||
+ iter = devicePorts.erase(iter);
|
||||
+ } else {
|
||||
+ iter++;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
module->setDeclaredDevices(devicePorts);
|
||||
|
||||
RouteTraits::Collection routes;
|
||||
--
|
||||
2.37.2
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
From 1891dacd48c4d502666fb4468582c088e4c0c097 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Sun, 25 Oct 2020 23:57:26 +0100
|
||||
Subject: [PATCH 1/3] Re-implement fnmatch-like behaviour for RRO java-side
|
||||
|
||||
T: Also apply to FrameworkParsingPackageUtils (@PeterCxy)
|
||||
|
||||
Change-Id: Id38292a9a1453aa87b8401c1fdb390fa4e63c7d1
|
||||
---
|
||||
core/java/android/content/pm/PackageParser.java | 13 +++++++++++--
|
||||
.../pm/parsing/FrameworkParsingPackageUtils.java | 13 +++++++++++--
|
||||
2 files changed, 22 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java
|
||||
index 995092117f4d..28efda00393d 100644
|
||||
--- a/core/java/android/content/pm/PackageParser.java
|
||||
+++ b/core/java/android/content/pm/PackageParser.java
|
||||
@@ -2544,8 +2544,17 @@ public class PackageParser {
|
||||
for (int i = 0; i < propNames.length; i++) {
|
||||
// Check property value: make sure it is both set and equal to expected value
|
||||
final String currValue = SystemProperties.get(propNames[i]);
|
||||
- if (!TextUtils.equals(currValue, propValues[i])) {
|
||||
- return false;
|
||||
+ final String value = propValues[i];
|
||||
+ if(value.startsWith("+")) {
|
||||
+ final java.util.regex.Pattern regex = java.util.regex.Pattern.compile(value.substring(1, value.length()).replace("*", ".*"));
|
||||
+ java.util.regex.Matcher matcher = regex.matcher(currValue);
|
||||
+ if (!matcher.find()) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ } else {
|
||||
+ if(!value.equals(currValue)) {
|
||||
+ return false;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
return true;
|
||||
diff --git a/core/java/android/content/pm/parsing/FrameworkParsingPackageUtils.java b/core/java/android/content/pm/parsing/FrameworkParsingPackageUtils.java
|
||||
index 3e1c5bb3d7ec..8182e9e0c771 100644
|
||||
--- a/core/java/android/content/pm/parsing/FrameworkParsingPackageUtils.java
|
||||
+++ b/core/java/android/content/pm/parsing/FrameworkParsingPackageUtils.java
|
||||
@@ -215,8 +215,17 @@ public class FrameworkParsingPackageUtils {
|
||||
for (int i = 0; i < propNames.length; i++) {
|
||||
// Check property value: make sure it is both set and equal to expected value
|
||||
final String currValue = SystemProperties.get(propNames[i]);
|
||||
- if (!TextUtils.equals(currValue, propValues[i])) {
|
||||
- return false;
|
||||
+ final String value = propValues[i];
|
||||
+ if(value.startsWith("+")) {
|
||||
+ final java.util.regex.Pattern regex = java.util.regex.Pattern.compile(value.substring(1, value.length()).replace("*", ".*"));
|
||||
+ java.util.regex.Matcher matcher = regex.matcher(currValue);
|
||||
+ if (!matcher.find()) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ } else {
|
||||
+ if(!value.equals(currValue)) {
|
||||
+ return false;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
return true;
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
From b0333760d4370e63470fc61bece55e29f16a9eaf Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Sat, 24 Mar 2018 08:01:48 +0100
|
||||
Subject: [PATCH 2/3] LightsService: Alternative backlight scale
|
||||
|
||||
Reserved a manual override just in case
|
||||
|
||||
Change-Id: I46ae69c758d1a4609d89cf1c293488ea5fc76787
|
||||
---
|
||||
.../com/android/server/lights/LightsService.java | 13 +++++++++++++
|
||||
1 file changed, 13 insertions(+)
|
||||
|
||||
diff --git a/services/core/java/com/android/server/lights/LightsService.java b/services/core/java/com/android/server/lights/LightsService.java
|
||||
index fea6b29d9260..2a9a3b63ea2e 100644
|
||||
--- a/services/core/java/com/android/server/lights/LightsService.java
|
||||
+++ b/services/core/java/com/android/server/lights/LightsService.java
|
||||
@@ -32,6 +32,7 @@ import android.os.IBinder;
|
||||
import android.os.Looper;
|
||||
import android.os.RemoteException;
|
||||
import android.os.ServiceManager;
|
||||
+import android.os.SystemProperties;
|
||||
import android.os.Trace;
|
||||
import android.provider.Settings;
|
||||
import android.util.Slog;
|
||||
@@ -295,6 +296,18 @@ public class LightsService extends SystemService {
|
||||
return;
|
||||
}
|
||||
int brightnessInt = BrightnessSynchronizer.brightnessFloatToInt(brightness);
|
||||
+ if (mHwLight.id == 0) {
|
||||
+ int scaleOverrideValue = SystemProperties.getInt("persist.sys.treble.backlight_scale.override_value", -1);
|
||||
+ if (scaleOverrideValue != -1) {
|
||||
+ setLightLocked(brightnessInt * scaleOverrideValue / 255, LIGHT_FLASH_NONE, 0, 0, brightnessMode);
|
||||
+ return;
|
||||
+ }
|
||||
+ int scaleValue = SystemProperties.getInt("persist.sys.treble.backlight_scale.value", -1);
|
||||
+ if (scaleValue != -1) {
|
||||
+ setLightLocked(brightnessInt * scaleValue / 255, LIGHT_FLASH_NONE, 0, 0, brightnessMode);
|
||||
+ return;
|
||||
+ }
|
||||
+ }
|
||||
int color = brightnessInt & 0x000000ff;
|
||||
color = 0xff000000 | (color << 16) | (color << 8) | color;
|
||||
setLightLocked(color, LIGHT_FLASH_NONE, 0, 0, brightnessMode);
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -0,0 +1,127 @@
|
||||
From f962ed979393abb8297e790b452739a8eec9c76c 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 3/3] 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 497bfa6380bc..646a7095c1b3 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 98d81c9598b8..8b659f927633 100644
|
||||
--- a/core/java/com/android/internal/os/RoSystemProperties.java
|
||||
+++ b/core/java/com/android/internal/os/RoSystemProperties.java
|
||||
@@ -60,10 +60,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.25.1
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
From 2bb0d801335970b8f0e9b8b7ffdf86128ae19468 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
|
||||
ImsManager.updateImsServiceConfig(Context,int,boolean). Bring it back
|
||||
|
||||
Change-Id: I3dd66d436629d37c8ec795df6569736195ae570e
|
||||
---
|
||||
src/java/com/android/ims/ImsManager.java | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
diff --git a/src/java/com/android/ims/ImsManager.java b/src/java/com/android/ims/ImsManager.java
|
||||
index c41426d..2c6d656 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 {
|
||||
}
|
||||
}
|
||||
|
||||
+ public static void updateImsServiceConfig(Context context, int phoneId, boolean force) {
|
||||
+ ImsManager mgr = ImsManager.getInstance(context, phoneId);
|
||||
+ if (mgr != null) {
|
||||
+ mgr.updateImsServiceConfig();
|
||||
+ }
|
||||
+ Rlog.e(TAG, "updateImsServiceConfig: ImsManager null, returning without update.");
|
||||
+ }
|
||||
+
|
||||
/**
|
||||
* Push configuration updates to the ImsService implementation.
|
||||
*/
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
From fc4ecc73093f88934a65a9371ae7af274c2b143d 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] 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)
|
||||
invoke this method in their `sendSms` method; Google, in their infinite wisdom,
|
||||
decided that this method needed a message ID passed in as well, changing the signature
|
||||
to 'public void TelephonyMetrics.writeRilSendSms(int, int, int, int, long)' and resulting
|
||||
in a MethodNotFoundException being raised in com.mediatek.ims, crashing it.
|
||||
|
||||
Fixes https://github.com/phhusson/treble_experimentations/issues/2125.
|
||||
|
||||
Co-authored-by: Sarah Vandomelen <sarah@sightworks.com>
|
||||
Change-Id: I789f470fb38d86dd37e8408536e208a7a49e7e26
|
||||
---
|
||||
.../telephony/metrics/TelephonyMetrics.java | 13 +++++++++++++
|
||||
1 file changed, 13 insertions(+)
|
||||
|
||||
diff --git a/src/java/com/android/internal/telephony/metrics/TelephonyMetrics.java b/src/java/com/android/internal/telephony/metrics/TelephonyMetrics.java
|
||||
index 5b47ae5b7a..f3e7717aca 100644
|
||||
--- a/src/java/com/android/internal/telephony/metrics/TelephonyMetrics.java
|
||||
+++ b/src/java/com/android/internal/telephony/metrics/TelephonyMetrics.java
|
||||
@@ -2324,6 +2324,19 @@ public class TelephonyMetrics {
|
||||
smsSession.increaseExpectedResponse();
|
||||
}
|
||||
|
||||
+ /**
|
||||
+ * Write Send SMS event (backwards-compatible method for R and earlier IMS implementations)
|
||||
+ *
|
||||
+ * @param phoneId Phone id
|
||||
+ * @param rilSerial RIL request serial number
|
||||
+ * @param tech SMS RAT
|
||||
+ * @param format SMS format. Either {@link SmsMessage#FORMAT_3GPP} or
|
||||
+ * {@link SmsMessage#FORMAT_3GPP2}.
|
||||
+ */
|
||||
+ public void writeRilSendSms(int phoneId, int rilSerial, int tech, int format) {
|
||||
+ writeRilSendSms(phoneId, rilSerial, tech, format, 0);
|
||||
+ }
|
||||
+
|
||||
/**
|
||||
* Write Send SMS event using ImsService. Expecting response from
|
||||
* {@link #writeOnSmsSolicitedResponse}.
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
From 25edd8e7b0afd85ea1bc6f39878b557c47366518 Mon Sep 17 00:00:00 2001
|
||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||
Date: Fri, 30 Sep 2022 11:32:24 +0000
|
||||
Subject: [PATCH] Add an enum for Treble settings
|
||||
|
||||
Change-Id: I8dc25afa27e938ee82594a8343e73c7c494003e2
|
||||
---
|
||||
stats/enums/app/settings_enums.proto | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/stats/enums/app/settings_enums.proto b/stats/enums/app/settings_enums.proto
|
||||
index ed241b6c..41b5efe0 100644
|
||||
--- a/stats/enums/app/settings_enums.proto
|
||||
+++ b/stats/enums/app/settings_enums.proto
|
||||
@@ -2006,6 +2006,9 @@ enum PageId {
|
||||
// OPEN: Settings > System > Input & Gesture > Double twist gesture
|
||||
SETTINGS_GESTURE_DOUBLE_TWIST = 755;
|
||||
|
||||
+ // OPEN: Settings > Treble Settings
|
||||
+ SETTINGS_TREBLE_CATEGORY = 777;
|
||||
+
|
||||
// OPEN: Settings > Apps > Default Apps > Default browser
|
||||
DEFAULT_BROWSER_PICKER = 785;
|
||||
// OPEN: Settings > Apps > Default Apps > Default emergency app
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -0,0 +1,356 @@
|
||||
From 4ecdcc515e80750e3423a5c203048b76aae0809c Mon Sep 17 00:00:00 2001
|
||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||
Date: Thu, 22 Sep 2022 12:37:50 +0000
|
||||
Subject: [PATCH 1/3] TrebleSettings: Screen resolution & refresh rate
|
||||
|
||||
Change-Id: I4a4679cdb6d4ede55479e9ab2f014342025b0fec
|
||||
---
|
||||
AndroidManifest.xml | 8 +
|
||||
res/drawable/ic_settings_treble.xml | 10 ++
|
||||
res/values/menu_keys.xml | 1 +
|
||||
res/values/strings.xml | 10 ++
|
||||
res/xml/top_level_settings.xml | 9 +
|
||||
res/xml/treble_settings.xml | 18 ++
|
||||
...lutionRefreshRatePreferenceController.java | 169 ++++++++++++++++++
|
||||
.../settings/treble/TrebleSettings.java | 39 ++++
|
||||
8 files changed, 264 insertions(+)
|
||||
create mode 100644 res/drawable/ic_settings_treble.xml
|
||||
create mode 100644 res/xml/treble_settings.xml
|
||||
create mode 100644 src/com/android/settings/treble/ScreenResolutionRefreshRatePreferenceController.java
|
||||
create mode 100644 src/com/android/settings/treble/TrebleSettings.java
|
||||
|
||||
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
|
||||
index d800bb472e..1495e851a7 100644
|
||||
--- a/AndroidManifest.xml
|
||||
+++ b/AndroidManifest.xml
|
||||
@@ -220,6 +220,14 @@
|
||||
android:value="com.android.settings.shortcut.CreateShortcut" />
|
||||
</activity>
|
||||
|
||||
+ <receiver
|
||||
+ android:name=".treble.ScreenResolutionRefreshRatePreferenceController$BootReceiver"
|
||||
+ android:exported="true">
|
||||
+ <intent-filter>
|
||||
+ <action android:name="android.intent.action.BOOT_COMPLETED"/>
|
||||
+ </intent-filter>
|
||||
+ </receiver>
|
||||
+
|
||||
<!-- Wireless Controls -->
|
||||
<activity
|
||||
android:name=".Settings$NetworkDashboardActivity"
|
||||
diff --git a/res/drawable/ic_settings_treble.xml b/res/drawable/ic_settings_treble.xml
|
||||
new file mode 100644
|
||||
index 0000000000..3c56ed7032
|
||||
--- /dev/null
|
||||
+++ b/res/drawable/ic_settings_treble.xml
|
||||
@@ -0,0 +1,10 @@
|
||||
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
+ android:width="24dp"
|
||||
+ android:height="24dp"
|
||||
+ android:viewportWidth="24.0"
|
||||
+ android:viewportHeight="24.0"
|
||||
+ android:tint="?attr/colorControlNormal">
|
||||
+ <path
|
||||
+ android:fillColor="@android:color/white"
|
||||
+ android:pathData="M10.82 12.49c.02-.16.04-.32.04-.49 0-.17-.02-.33-.04-.49l1.08-.82c.1-.07.12-.21.06-.32l-1.03-1.73c-.06-.11-.2-.15-.31-.11l-1.28.5c-.27-.2-.56-.36-.87-.49l-.2-1.33c0-.12-.11-.21-.24-.21H5.98c-.13 0-.24.09-.26.21l-.2 1.32c-.31.12-.6.3-.87.49l-1.28-.5c-.12-.05-.25 0-.31.11l-1.03 1.73c-.06.12-.03.25.07.33l1.08.82c-.02.16-.03.33-.03.49 0 .17.02.33.04.49l-1.09.83c-.1.07-.12.21-.06.32l1.03 1.73c.06.11.2.15.31.11l1.28-.5c.27.2.56.36.87.49l.2 1.32c.01.12.12.21.25.21h2.06c.13 0 .24-.09.25-.21l.2-1.32c.31-.12.6-.3.87-.49l1.28.5c.12.05.25 0 .31-.11l1.03-1.73c.06-.11.04-.24-.06-.32l-1.1-.83zM7 13.75c-.99 0-1.8-.78-1.8-1.75s.81-1.75 1.8-1.75 1.8.78 1.8 1.75S8 13.75 7 13.75zM18 1.01L8 1c-1.1 0-2 .9-2 2v3h2V5h10v14H8v-1H6v3c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V3c0-1.1-.9-1.99-2-1.99z"/>
|
||||
+</vector>
|
||||
diff --git a/res/values/menu_keys.xml b/res/values/menu_keys.xml
|
||||
index 2841b699c9..c30d6392e9 100755
|
||||
--- a/res/values/menu_keys.xml
|
||||
+++ b/res/values/menu_keys.xml
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
||||
|
||||
+ <string name="menu_key_treble" translatable="false">top_level_treble</string>
|
||||
<string name="menu_key_network" translatable="false">top_level_network</string>
|
||||
<string name="menu_key_connected_devices" translatable="false">top_level_connected_devices</string>
|
||||
<string name="menu_key_apps" translatable="false">top_level_apps</string>
|
||||
diff --git a/res/values/strings.xml b/res/values/strings.xml
|
||||
index 04b2de208b..8cebfe3964 100644
|
||||
--- a/res/values/strings.xml
|
||||
+++ b/res/values/strings.xml
|
||||
@@ -8274,6 +8274,16 @@
|
||||
<item quantity="other">Show %d hidden items</item>
|
||||
</plurals>
|
||||
|
||||
+ <!-- Title for setting tile leading to Treble settings [CHAR LIMIT=40]-->
|
||||
+ <string name="treble_settings">Treble settings</string>
|
||||
+ <!-- Summary for Treble settings [CHAR LIMIT=NONE]-->
|
||||
+ <string name="treble_settings_summary">Fixes & tweaks for GSIs</string>
|
||||
+ <!-- Display category name [CHAR LIMIT=none] -->
|
||||
+ <string name="treble_settings_category_name_display">Display</string>
|
||||
+
|
||||
+ <!-- Treble settings screen, screen resolution and refresh rate settings title -->
|
||||
+ <string name="screen_resolution_refresh_rate_title">Screen resolution & refresh rate</string>
|
||||
+
|
||||
<!-- Title for setting tile leading to network and Internet settings [CHAR LIMIT=40]-->
|
||||
<string name="network_dashboard_title">Network & internet</string>
|
||||
<!-- Summary for Network and Internet settings, explaining it contains mobile, wifi setting and data usage settings [CHAR LIMIT=NONE]-->
|
||||
diff --git a/res/xml/top_level_settings.xml b/res/xml/top_level_settings.xml
|
||||
index c9e60170eb..1127056675 100644
|
||||
--- a/res/xml/top_level_settings.xml
|
||||
+++ b/res/xml/top_level_settings.xml
|
||||
@@ -20,6 +20,15 @@
|
||||
xmlns:settings="http://schemas.android.com/apk/res-auto"
|
||||
android:key="top_level_settings">
|
||||
|
||||
+ <com.android.settings.widget.HomepagePreference
|
||||
+ android:fragment="com.android.settings.treble.TrebleSettings"
|
||||
+ android:icon="@drawable/ic_settings_treble"
|
||||
+ android:key="top_level_treble"
|
||||
+ android:order="-160"
|
||||
+ android:title="@string/treble_settings"
|
||||
+ android:summary="@string/treble_settings_summary"
|
||||
+ settings:highlightableMenuKey="@string/menu_key_treble"/>
|
||||
+
|
||||
<com.android.settings.widget.HomepagePreference
|
||||
android:fragment="com.android.settings.network.NetworkDashboardFragment"
|
||||
android:icon="@drawable/ic_settings_wireless"
|
||||
diff --git a/res/xml/treble_settings.xml b/res/xml/treble_settings.xml
|
||||
new file mode 100644
|
||||
index 0000000000..1a82c468a2
|
||||
--- /dev/null
|
||||
+++ b/res/xml/treble_settings.xml
|
||||
@@ -0,0 +1,18 @@
|
||||
+<?xml version="1.0" encoding="utf-8"?>
|
||||
+
|
||||
+<PreferenceScreen
|
||||
+ xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
+ xmlns:settings="http://schemas.android.com/apk/res-auto"
|
||||
+ android:key="treble_settings_screen"
|
||||
+ android:title="@string/treble_settings">
|
||||
+
|
||||
+ <PreferenceCategory
|
||||
+ android:title="@string/treble_settings_category_name_display">
|
||||
+
|
||||
+ <ListPreference
|
||||
+ android:key="screen_resolution_refresh_rate"
|
||||
+ android:title="@string/screen_resolution_refresh_rate_title" />
|
||||
+
|
||||
+ </PreferenceCategory>
|
||||
+
|
||||
+</PreferenceScreen>
|
||||
diff --git a/src/com/android/settings/treble/ScreenResolutionRefreshRatePreferenceController.java b/src/com/android/settings/treble/ScreenResolutionRefreshRatePreferenceController.java
|
||||
new file mode 100644
|
||||
index 0000000000..5d14f13209
|
||||
--- /dev/null
|
||||
+++ b/src/com/android/settings/treble/ScreenResolutionRefreshRatePreferenceController.java
|
||||
@@ -0,0 +1,169 @@
|
||||
+package com.android.settings.treble;
|
||||
+
|
||||
+import static android.content.Intent.ACTION_BOOT_COMPLETED;
|
||||
+
|
||||
+import android.app.ActivityManager;
|
||||
+import android.content.BroadcastReceiver;
|
||||
+import android.content.Context;
|
||||
+import android.content.Intent;
|
||||
+import android.os.IBinder;
|
||||
+import android.os.Parcel;
|
||||
+import android.os.RemoteException;
|
||||
+import android.os.ServiceManager;
|
||||
+import android.os.SystemProperties;
|
||||
+import android.view.SurfaceControl;
|
||||
+import android.view.SurfaceControl.DisplayMode;
|
||||
+
|
||||
+import androidx.preference.ListPreference;
|
||||
+import androidx.preference.Preference;
|
||||
+import androidx.preference.PreferenceScreen;
|
||||
+
|
||||
+import com.android.settings.core.BasePreferenceController;
|
||||
+
|
||||
+import java.util.ArrayList;
|
||||
+import java.util.Collections;
|
||||
+import java.util.Comparator;
|
||||
+import java.util.HashSet;
|
||||
+import java.util.List;
|
||||
+import java.util.Set;
|
||||
+
|
||||
+public class ScreenResolutionRefreshRatePreferenceController extends BasePreferenceController
|
||||
+ implements Preference.OnPreferenceChangeListener {
|
||||
+
|
||||
+ private static final String SCREEN_RESOLUTION_REFRESH_RATE_KEY = "screen_resolution_refresh_rate";
|
||||
+ private static final String SURFACE_FLINGER_SERVICE_KEY = "SurfaceFlinger";
|
||||
+ private static final String SURFACE_COMPOSER_INTERFACE_KEY = "android.ui.ISurfaceComposer";
|
||||
+ private static final int SURFACE_FLINGER_CODE = 1035;
|
||||
+ private static final String TREBLE_DISPLAY_MODE_PROPERTY = "persist.sys.treble.display_mode";
|
||||
+ private static final String SYSTEMUI_PACKAGE_NAME = "com.android.systemui";
|
||||
+
|
||||
+ private ActivityManager mAm;
|
||||
+ private ListPreference mListPreference;
|
||||
+ private List<DisplayMode> mModes = new ArrayList<>();
|
||||
+ private List<String> mEntries = new ArrayList<>();
|
||||
+ private List<String> mValues = new ArrayList<>();
|
||||
+
|
||||
+ public ScreenResolutionRefreshRatePreferenceController(Context context) {
|
||||
+ super(context, SCREEN_RESOLUTION_REFRESH_RATE_KEY);
|
||||
+
|
||||
+ mAm = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
|
||||
+
|
||||
+ DisplayMode[] supportedDisplayModes =
|
||||
+ SurfaceControl.getDynamicDisplayInfo(SurfaceControl.getInternalDisplayToken()).supportedDisplayModes;
|
||||
+ Set<String> summarySet = new HashSet<>();
|
||||
+ for (DisplayMode m : supportedDisplayModes) {
|
||||
+ String summary = String.format("%dx%d @ %dHz", m.width, m.height, Math.round(m.refreshRate));
|
||||
+ if (!summarySet.contains(summary)) {
|
||||
+ summarySet.add(summary);
|
||||
+ mModes.add(m);
|
||||
+ }
|
||||
+ }
|
||||
+ Collections.sort(mModes, Comparator.comparing((DisplayMode m)->m.width)
|
||||
+ .thenComparing(m->m.height)
|
||||
+ .thenComparing(m->m.refreshRate)
|
||||
+ .thenComparing(m->m.id));
|
||||
+ for (DisplayMode m : mModes) {
|
||||
+ String summary = String.format("%dx%d @ %dHz", m.width, m.height, Math.round(m.refreshRate));
|
||||
+ mEntries.add(summary);
|
||||
+ mValues.add(String.valueOf(m.id));
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int getAvailabilityStatus() {
|
||||
+ return AVAILABLE;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public String getPreferenceKey() {
|
||||
+ return SCREEN_RESOLUTION_REFRESH_RATE_KEY;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void displayPreference(PreferenceScreen screen) {
|
||||
+ mListPreference = screen.findPreference(getPreferenceKey());
|
||||
+ mListPreference.setEntries(mEntries.toArray(new String[mEntries.size()]));
|
||||
+ mListPreference.setEntryValues(mValues.toArray(new String[mValues.size()]));
|
||||
+
|
||||
+ if (mEntries.size() <= 1) {
|
||||
+ mListPreference.setEnabled(false);
|
||||
+ }
|
||||
+
|
||||
+ super.displayPreference(screen);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void updateState(Preference preference) {
|
||||
+ int id = SurfaceControl.getDynamicDisplayInfo(SurfaceControl.getInternalDisplayToken()).activeDisplayModeId;
|
||||
+ int index = mListPreference.findIndexOfValue(String.valueOf(id));
|
||||
+ mListPreference.setValueIndex(index);
|
||||
+ mListPreference.setSummary(mListPreference.getEntries()[index]);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||
+ DisplayMode currentMode = getCurrentMode();
|
||||
+ int id = Integer.valueOf((String) newValue);
|
||||
+ DisplayMode newMode = getModeById(id);
|
||||
+ setModeFromBackdoor(id);
|
||||
+ SystemProperties.set(TREBLE_DISPLAY_MODE_PROPERTY, (String) newValue);
|
||||
+ int index = mListPreference.findIndexOfValue((String) newValue);
|
||||
+ mListPreference.setValueIndex(index);
|
||||
+ mListPreference.setSummary(mListPreference.getEntries()[index]);
|
||||
+ if ((newMode.width != currentMode.width) || (newMode.height != currentMode.height)) {
|
||||
+ try {
|
||||
+ for (ActivityManager.RunningAppProcessInfo app: mAm.getRunningAppProcesses()) {
|
||||
+ if (app.processName.equals(SYSTEMUI_PACKAGE_NAME)) {
|
||||
+ ActivityManager.getService().killApplicationProcess(app.processName, app.uid);
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ } catch (Exception e) {
|
||||
+ e.printStackTrace();
|
||||
+ }
|
||||
+ }
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ private DisplayMode getCurrentMode() {
|
||||
+ int id = SurfaceControl.getDynamicDisplayInfo(SurfaceControl.getInternalDisplayToken()).activeDisplayModeId;
|
||||
+ return getModeById(id);
|
||||
+ }
|
||||
+
|
||||
+ private DisplayMode getModeById(int id) {
|
||||
+ for (DisplayMode m : mModes) {
|
||||
+ if (m.id == id) {
|
||||
+ return m;
|
||||
+ }
|
||||
+ }
|
||||
+ return null;
|
||||
+ }
|
||||
+
|
||||
+ public static void setModeFromBackdoor(int id) {
|
||||
+ IBinder surfaceFlinger = ServiceManager.getService(SURFACE_FLINGER_SERVICE_KEY);
|
||||
+ try {
|
||||
+ if (surfaceFlinger != null) {
|
||||
+ Parcel data = Parcel.obtain();
|
||||
+ data.writeInterfaceToken(SURFACE_COMPOSER_INTERFACE_KEY);
|
||||
+ data.writeInt(id);
|
||||
+ surfaceFlinger.transact(SURFACE_FLINGER_CODE, data, null, 0);
|
||||
+ data.recycle();
|
||||
+ }
|
||||
+ } catch (RemoteException ex) {}
|
||||
+ }
|
||||
+
|
||||
+ public static class BootReceiver extends BroadcastReceiver {
|
||||
+
|
||||
+ @Override
|
||||
+ public void onReceive(Context context, Intent intent) {
|
||||
+ if (ACTION_BOOT_COMPLETED.equals(intent.getAction())) {
|
||||
+ int id = SystemProperties.getInt(TREBLE_DISPLAY_MODE_PROPERTY, -1);
|
||||
+ if (id != -1) {
|
||||
+ setModeFromBackdoor(id);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+}
|
||||
diff --git a/src/com/android/settings/treble/TrebleSettings.java b/src/com/android/settings/treble/TrebleSettings.java
|
||||
new file mode 100644
|
||||
index 0000000000..e581539229
|
||||
--- /dev/null
|
||||
+++ b/src/com/android/settings/treble/TrebleSettings.java
|
||||
@@ -0,0 +1,39 @@
|
||||
+package com.android.settings.treble;
|
||||
+
|
||||
+import android.app.settings.SettingsEnums;
|
||||
+import android.content.Context;
|
||||
+
|
||||
+import com.android.settings.R;
|
||||
+import com.android.settings.dashboard.DashboardFragment;
|
||||
+import com.android.settingslib.core.AbstractPreferenceController;
|
||||
+
|
||||
+import java.util.ArrayList;
|
||||
+import java.util.List;
|
||||
+
|
||||
+public class TrebleSettings extends DashboardFragment {
|
||||
+
|
||||
+ private static final String TAG = "TrebleSettings";
|
||||
+
|
||||
+ @Override
|
||||
+ protected int getPreferenceScreenResId() {
|
||||
+ return R.xml.treble_settings;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ protected String getLogTag() {
|
||||
+ return TAG;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int getMetricsCategory() {
|
||||
+ return SettingsEnums.SETTINGS_TREBLE_CATEGORY;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
|
||||
+ final List<AbstractPreferenceController> controllers = new ArrayList<>();
|
||||
+ controllers.add(new ScreenResolutionRefreshRatePreferenceController(context));
|
||||
+ return controllers;
|
||||
+ }
|
||||
+
|
||||
+}
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -0,0 +1,288 @@
|
||||
From 937c56865ea02e00886920f40cabd85ab293a5fb Mon Sep 17 00:00:00 2001
|
||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||
Date: Sat, 24 Sep 2022 03:38:41 +0000
|
||||
Subject: [PATCH 2/3] TrebleSettings: Basic audio and display fixes
|
||||
|
||||
- Alternative audio policy
|
||||
- Disable soundvolume effect
|
||||
- Alternative backlight scale
|
||||
|
||||
Change-Id: I4f22dcd9c59c40b3fd70ba642db35b9466467b7d
|
||||
---
|
||||
res/values/strings.xml | 8 +++
|
||||
res/xml/treble_settings.xml | 17 ++++++
|
||||
...SoundvolumeEffectPreferenceController.java | 59 +++++++++++++++++++
|
||||
.../settings/treble/TrebleSettings.java | 3 +
|
||||
...nativeAudioPolicyPreferenceController.java | 59 +++++++++++++++++++
|
||||
...iveBacklightScalePreferenceController.java | 53 +++++++++++++++++
|
||||
6 files changed, 199 insertions(+)
|
||||
create mode 100644 src/com/android/settings/treble/DisableSoundvolumeEffectPreferenceController.java
|
||||
create mode 100644 src/com/android/settings/treble/UseAlternativeAudioPolicyPreferenceController.java
|
||||
create mode 100644 src/com/android/settings/treble/UseAlternativeBacklightScalePreferenceController.java
|
||||
|
||||
diff --git a/res/values/strings.xml b/res/values/strings.xml
|
||||
index 8cebfe3964..4014c53eaa 100644
|
||||
--- a/res/values/strings.xml
|
||||
+++ b/res/values/strings.xml
|
||||
@@ -8278,11 +8278,19 @@
|
||||
<string name="treble_settings">Treble settings</string>
|
||||
<!-- Summary for Treble settings [CHAR LIMIT=NONE]-->
|
||||
<string name="treble_settings_summary">Fixes & tweaks for GSIs</string>
|
||||
+ <!-- Audio category name [CHAR LIMIT=none] -->
|
||||
+ <string name="treble_settings_category_name_audio">Audio</string>
|
||||
<!-- Display category name [CHAR LIMIT=none] -->
|
||||
<string name="treble_settings_category_name_display">Display</string>
|
||||
|
||||
+ <!-- Treble settings screen, use alternative audio policy title -->
|
||||
+ <string name="use_alternative_audio_policy_title">Use alternative audio policy</string>
|
||||
+ <!-- Treble settings screen, disable soundvolume effect title -->
|
||||
+ <string name="disable_soundvolume_effect_title">Disable soundvolume effect</string>
|
||||
<!-- Treble settings screen, screen resolution and refresh rate settings title -->
|
||||
<string name="screen_resolution_refresh_rate_title">Screen resolution & refresh rate</string>
|
||||
+ <!-- Treble settings screen, use alternative backlight scale title -->
|
||||
+ <string name="use_alternative_backlight_scale_title">Use alternative backlight scale</string>
|
||||
|
||||
<!-- Title for setting tile leading to network and Internet settings [CHAR LIMIT=40]-->
|
||||
<string name="network_dashboard_title">Network & internet</string>
|
||||
diff --git a/res/xml/treble_settings.xml b/res/xml/treble_settings.xml
|
||||
index 1a82c468a2..336137c95f 100644
|
||||
--- a/res/xml/treble_settings.xml
|
||||
+++ b/res/xml/treble_settings.xml
|
||||
@@ -6,6 +6,19 @@
|
||||
android:key="treble_settings_screen"
|
||||
android:title="@string/treble_settings">
|
||||
|
||||
+ <PreferenceCategory
|
||||
+ android:title="@string/treble_settings_category_name_audio">
|
||||
+
|
||||
+ <SwitchPreference
|
||||
+ android:key="use_alternative_audio_policy"
|
||||
+ android:title="@string/use_alternative_audio_policy_title" />
|
||||
+
|
||||
+ <SwitchPreference
|
||||
+ android:key="disable_soundvolume_effect"
|
||||
+ android:title="@string/disable_soundvolume_effect_title" />
|
||||
+
|
||||
+ </PreferenceCategory>
|
||||
+
|
||||
<PreferenceCategory
|
||||
android:title="@string/treble_settings_category_name_display">
|
||||
|
||||
@@ -13,6 +26,10 @@
|
||||
android:key="screen_resolution_refresh_rate"
|
||||
android:title="@string/screen_resolution_refresh_rate_title" />
|
||||
|
||||
+ <SwitchPreference
|
||||
+ android:key="use_alternative_backlight_scale"
|
||||
+ android:title="@string/use_alternative_backlight_scale_title" />
|
||||
+
|
||||
</PreferenceCategory>
|
||||
|
||||
</PreferenceScreen>
|
||||
diff --git a/src/com/android/settings/treble/DisableSoundvolumeEffectPreferenceController.java b/src/com/android/settings/treble/DisableSoundvolumeEffectPreferenceController.java
|
||||
new file mode 100644
|
||||
index 0000000000..8feb318f55
|
||||
--- /dev/null
|
||||
+++ b/src/com/android/settings/treble/DisableSoundvolumeEffectPreferenceController.java
|
||||
@@ -0,0 +1,59 @@
|
||||
+package com.android.settings.treble;
|
||||
+
|
||||
+import android.content.Context;
|
||||
+import android.os.SystemProperties;
|
||||
+
|
||||
+import androidx.preference.Preference;
|
||||
+import androidx.preference.PreferenceScreen;
|
||||
+import androidx.preference.SwitchPreference;
|
||||
+
|
||||
+import com.android.settings.core.BasePreferenceController;
|
||||
+
|
||||
+public class DisableSoundvolumeEffectPreferenceController extends BasePreferenceController
|
||||
+ implements Preference.OnPreferenceChangeListener {
|
||||
+
|
||||
+ private static final String DISABLE_SOUNDVOLUME_EFFECT_KEY = "disable_soundvolume_effect";
|
||||
+ private static final String RO_HARDWARE_PROPERTY = "ro.hardware";
|
||||
+ private static final String TREBLE_CAF_DISABLE_SOUNDVOLUME_EFFECT_PROPERTY = "persist.sys.treble.caf.disable_soundvolume_effect";
|
||||
+
|
||||
+ private SwitchPreference mSwitchPreference;
|
||||
+
|
||||
+ public DisableSoundvolumeEffectPreferenceController(Context context) {
|
||||
+ super(context, DISABLE_SOUNDVOLUME_EFFECT_KEY);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int getAvailabilityStatus() {
|
||||
+ return AVAILABLE;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public String getPreferenceKey() {
|
||||
+ return DISABLE_SOUNDVOLUME_EFFECT_KEY;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void displayPreference(PreferenceScreen screen) {
|
||||
+ mSwitchPreference = screen.findPreference(getPreferenceKey());
|
||||
+
|
||||
+ if (!SystemProperties.get(RO_HARDWARE_PROPERTY, "N/A").equals("qcom")) {
|
||||
+ mSwitchPreference.setEnabled(false);
|
||||
+ }
|
||||
+
|
||||
+ super.displayPreference(screen);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void updateState(Preference preference) {
|
||||
+ boolean checked = SystemProperties.getBoolean(TREBLE_CAF_DISABLE_SOUNDVOLUME_EFFECT_PROPERTY, false);
|
||||
+ mSwitchPreference.setChecked(checked);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||
+ SystemProperties.set(TREBLE_CAF_DISABLE_SOUNDVOLUME_EFFECT_PROPERTY, String.valueOf((boolean) newValue));
|
||||
+ mSwitchPreference.setChecked((boolean) newValue);
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+}
|
||||
diff --git a/src/com/android/settings/treble/TrebleSettings.java b/src/com/android/settings/treble/TrebleSettings.java
|
||||
index e581539229..5c1611c053 100644
|
||||
--- a/src/com/android/settings/treble/TrebleSettings.java
|
||||
+++ b/src/com/android/settings/treble/TrebleSettings.java
|
||||
@@ -32,7 +32,10 @@ public class TrebleSettings extends DashboardFragment {
|
||||
@Override
|
||||
protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
|
||||
final List<AbstractPreferenceController> controllers = new ArrayList<>();
|
||||
+ controllers.add(new UseAlternativeAudioPolicyPreferenceController(context));
|
||||
+ controllers.add(new DisableSoundvolumeEffectPreferenceController(context));
|
||||
controllers.add(new ScreenResolutionRefreshRatePreferenceController(context));
|
||||
+ controllers.add(new UseAlternativeBacklightScalePreferenceController(context));
|
||||
return controllers;
|
||||
}
|
||||
|
||||
diff --git a/src/com/android/settings/treble/UseAlternativeAudioPolicyPreferenceController.java b/src/com/android/settings/treble/UseAlternativeAudioPolicyPreferenceController.java
|
||||
new file mode 100644
|
||||
index 0000000000..fbc327cba0
|
||||
--- /dev/null
|
||||
+++ b/src/com/android/settings/treble/UseAlternativeAudioPolicyPreferenceController.java
|
||||
@@ -0,0 +1,59 @@
|
||||
+package com.android.settings.treble;
|
||||
+
|
||||
+import android.content.Context;
|
||||
+import android.os.SystemProperties;
|
||||
+
|
||||
+import androidx.preference.Preference;
|
||||
+import androidx.preference.PreferenceScreen;
|
||||
+import androidx.preference.SwitchPreference;
|
||||
+
|
||||
+import com.android.settings.core.BasePreferenceController;
|
||||
+
|
||||
+public class UseAlternativeAudioPolicyPreferenceController extends BasePreferenceController
|
||||
+ implements Preference.OnPreferenceChangeListener {
|
||||
+
|
||||
+ private static final String USE_ALTERNATIVE_AUDIO_POLICY_KEY = "use_alternative_audio_policy";
|
||||
+ private static final String RO_HARDWARE_PROPERTY = "ro.hardware";
|
||||
+ private static final String TREBLE_CAF_AUDIO_POLICY_PROPERTY = "persist.sys.treble.caf.audio_policy";
|
||||
+
|
||||
+ private SwitchPreference mSwitchPreference;
|
||||
+
|
||||
+ public UseAlternativeAudioPolicyPreferenceController(Context context) {
|
||||
+ super(context, USE_ALTERNATIVE_AUDIO_POLICY_KEY);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int getAvailabilityStatus() {
|
||||
+ return AVAILABLE;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public String getPreferenceKey() {
|
||||
+ return USE_ALTERNATIVE_AUDIO_POLICY_KEY;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void displayPreference(PreferenceScreen screen) {
|
||||
+ mSwitchPreference = screen.findPreference(getPreferenceKey());
|
||||
+
|
||||
+ if (!SystemProperties.get(RO_HARDWARE_PROPERTY, "N/A").equals("qcom")) {
|
||||
+ mSwitchPreference.setEnabled(false);
|
||||
+ }
|
||||
+
|
||||
+ super.displayPreference(screen);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void updateState(Preference preference) {
|
||||
+ boolean checked = SystemProperties.getBoolean(TREBLE_CAF_AUDIO_POLICY_PROPERTY, false);
|
||||
+ mSwitchPreference.setChecked(checked);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||
+ SystemProperties.set(TREBLE_CAF_AUDIO_POLICY_PROPERTY, String.valueOf((boolean) newValue));
|
||||
+ mSwitchPreference.setChecked((boolean) newValue);
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+}
|
||||
diff --git a/src/com/android/settings/treble/UseAlternativeBacklightScalePreferenceController.java b/src/com/android/settings/treble/UseAlternativeBacklightScalePreferenceController.java
|
||||
new file mode 100644
|
||||
index 0000000000..bd9de82d90
|
||||
--- /dev/null
|
||||
+++ b/src/com/android/settings/treble/UseAlternativeBacklightScalePreferenceController.java
|
||||
@@ -0,0 +1,53 @@
|
||||
+package com.android.settings.treble;
|
||||
+
|
||||
+import android.content.Context;
|
||||
+import android.os.SystemProperties;
|
||||
+
|
||||
+import androidx.preference.Preference;
|
||||
+import androidx.preference.PreferenceScreen;
|
||||
+import androidx.preference.SwitchPreference;
|
||||
+
|
||||
+import com.android.settings.core.BasePreferenceController;
|
||||
+
|
||||
+public class UseAlternativeBacklightScalePreferenceController extends BasePreferenceController
|
||||
+ implements Preference.OnPreferenceChangeListener {
|
||||
+
|
||||
+ private static final String USE_ALTERNATIVE_BACKLIGHT_SCALE_KEY = "use_alternative_backlight_scale";
|
||||
+ private static final String TREBLE_BACKLIGHT_SCALE_PROPERTY = "persist.sys.treble.backlight_scale";
|
||||
+
|
||||
+ private SwitchPreference mSwitchPreference;
|
||||
+
|
||||
+ public UseAlternativeBacklightScalePreferenceController(Context context) {
|
||||
+ super(context, USE_ALTERNATIVE_BACKLIGHT_SCALE_KEY);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int getAvailabilityStatus() {
|
||||
+ return AVAILABLE;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public String getPreferenceKey() {
|
||||
+ return USE_ALTERNATIVE_BACKLIGHT_SCALE_KEY;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void displayPreference(PreferenceScreen screen) {
|
||||
+ mSwitchPreference = screen.findPreference(getPreferenceKey());
|
||||
+ super.displayPreference(screen);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void updateState(Preference preference) {
|
||||
+ boolean checked = SystemProperties.getBoolean(TREBLE_BACKLIGHT_SCALE_PROPERTY, false);
|
||||
+ mSwitchPreference.setChecked(checked);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||
+ SystemProperties.set(TREBLE_BACKLIGHT_SCALE_PROPERTY, String.valueOf((boolean) newValue));
|
||||
+ mSwitchPreference.setChecked((boolean) newValue);
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+}
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -0,0 +1,363 @@
|
||||
From 106235d2d4f2e0540a0a73332cfecf465942e9cc Mon Sep 17 00:00:00 2001
|
||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||
Date: Tue, 11 Oct 2022 10:29:36 +0000
|
||||
Subject: [PATCH 3/3] TrebleSettings: IMS
|
||||
|
||||
Change-Id: Id7a12e150d4a3dc988f8ce1a888ad88443fa0ea4
|
||||
---
|
||||
Android.bp | 1 +
|
||||
res/values/strings.xml | 9 +
|
||||
res/xml/treble_settings.xml | 13 ++
|
||||
.../InstallImsApkPreferenceController.java | 198 ++++++++++++++++++
|
||||
...VolteAvailabilityPreferenceController.java | 59 ++++++
|
||||
.../settings/treble/TrebleSettings.java | 2 +
|
||||
6 files changed, 282 insertions(+)
|
||||
create mode 100644 src/com/android/settings/treble/InstallImsApkPreferenceController.java
|
||||
create mode 100644 src/com/android/settings/treble/OverrideVolteAvailabilityPreferenceController.java
|
||||
|
||||
diff --git a/Android.bp b/Android.bp
|
||||
index 140d4480c8..c73a774a28 100644
|
||||
--- a/Android.bp
|
||||
+++ b/Android.bp
|
||||
@@ -81,6 +81,7 @@ android_library {
|
||||
"LineagePreferenceLib",
|
||||
"vendor.lineage.fastcharge-V1.0-java",
|
||||
"SystemUISharedLib",
|
||||
+ "android.hidl.manager-V1.0-java",
|
||||
],
|
||||
|
||||
libs: [
|
||||
diff --git a/res/values/strings.xml b/res/values/strings.xml
|
||||
index 4014c53eaa..ef8ffbbf46 100644
|
||||
--- a/res/values/strings.xml
|
||||
+++ b/res/values/strings.xml
|
||||
@@ -8282,6 +8282,8 @@
|
||||
<string name="treble_settings_category_name_audio">Audio</string>
|
||||
<!-- Display category name [CHAR LIMIT=none] -->
|
||||
<string name="treble_settings_category_name_display">Display</string>
|
||||
+ <!-- IMS category name [CHAR LIMIT=none] -->
|
||||
+ <string name="treble_settings_category_name_ims">IMS</string>
|
||||
|
||||
<!-- Treble settings screen, use alternative audio policy title -->
|
||||
<string name="use_alternative_audio_policy_title">Use alternative audio policy</string>
|
||||
@@ -8291,6 +8293,13 @@
|
||||
<string name="screen_resolution_refresh_rate_title">Screen resolution & refresh rate</string>
|
||||
<!-- Treble settings screen, use alternative backlight scale title -->
|
||||
<string name="use_alternative_backlight_scale_title">Use alternative backlight scale</string>
|
||||
+ <!-- Treble settings screen, install IMS APK title -->
|
||||
+ <string name="install_ims_apk_title">Install IMS APK</string>
|
||||
+ <!-- Treble settings screen, install IMS APK toasts -->
|
||||
+ <string name="install_ims_apk_toast_downloading">Downloading IMS APK...</string>
|
||||
+ <string name="install_ims_apk_toast_completed">IMS APK installed. Reboot required.</string>
|
||||
+ <!-- Treble settings screen, override VoLTE availability title -->
|
||||
+ <string name="override_volte_availability_title">Override VoLTE availability</string>
|
||||
|
||||
<!-- Title for setting tile leading to network and Internet settings [CHAR LIMIT=40]-->
|
||||
<string name="network_dashboard_title">Network & internet</string>
|
||||
diff --git a/res/xml/treble_settings.xml b/res/xml/treble_settings.xml
|
||||
index 336137c95f..09e6bc5d00 100644
|
||||
--- a/res/xml/treble_settings.xml
|
||||
+++ b/res/xml/treble_settings.xml
|
||||
@@ -32,4 +32,17 @@
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
+ <PreferenceCategory
|
||||
+ android:title="@string/treble_settings_category_name_ims">
|
||||
+
|
||||
+ <Preference
|
||||
+ android:key="install_ims_apk"
|
||||
+ android:title="@string/install_ims_apk_title" />
|
||||
+
|
||||
+ <SwitchPreference
|
||||
+ android:key="override_volte_availability"
|
||||
+ android:title="@string/override_volte_availability_title" />
|
||||
+
|
||||
+ </PreferenceCategory>
|
||||
+
|
||||
</PreferenceScreen>
|
||||
diff --git a/src/com/android/settings/treble/InstallImsApkPreferenceController.java b/src/com/android/settings/treble/InstallImsApkPreferenceController.java
|
||||
new file mode 100644
|
||||
index 0000000000..f59e5d7d9a
|
||||
--- /dev/null
|
||||
+++ b/src/com/android/settings/treble/InstallImsApkPreferenceController.java
|
||||
@@ -0,0 +1,198 @@
|
||||
+package com.android.settings.treble;
|
||||
+
|
||||
+import android.app.DownloadManager;
|
||||
+import android.app.PendingIntent;
|
||||
+import android.content.BroadcastReceiver;
|
||||
+import android.content.Context;
|
||||
+import android.content.Intent;
|
||||
+import android.content.IntentFilter;
|
||||
+import android.content.pm.PackageInstaller;
|
||||
+import android.database.Cursor;
|
||||
+import android.hidl.manager.V1_0.IServiceManager;
|
||||
+import android.net.Uri;
|
||||
+import android.os.Environment;
|
||||
+import android.os.RemoteException;
|
||||
+import android.os.ServiceManager;
|
||||
+import android.os.SystemProperties;
|
||||
+import android.util.Log;
|
||||
+import android.widget.Toast;
|
||||
+
|
||||
+import androidx.preference.Preference;
|
||||
+import androidx.preference.PreferenceScreen;
|
||||
+
|
||||
+import com.android.settings.R;
|
||||
+import com.android.settings.core.BasePreferenceController;
|
||||
+
|
||||
+import java.io.File;
|
||||
+import java.io.FileInputStream;
|
||||
+import java.io.IOException;
|
||||
+import java.io.InputStream;
|
||||
+import java.io.OutputStream;
|
||||
+
|
||||
+public class InstallImsApkPreferenceController extends BasePreferenceController
|
||||
+ implements Preference.OnPreferenceClickListener {
|
||||
+
|
||||
+ private static final String TAG = "TrebleSettings";
|
||||
+ private static final String INSTALL_IMS_APK_KEY = "install_ims_apk";
|
||||
+ private static final String[] IMS_SLOTS = {
|
||||
+ "imsrild1", "imsrild2", "imsrild3",
|
||||
+ "slot1", "slot2", "slot3",
|
||||
+ "imsSlot1", "imsSlot2",
|
||||
+ "mtkSlot1", "mtkSlot2",
|
||||
+ "imsradio0", "imsradio1"
|
||||
+ };
|
||||
+ private static final String RO_PRODUCT_VENDOR_BRAND_PROPERTY = "ro.product.vendor.brand";
|
||||
+
|
||||
+ private Preference mPreference;
|
||||
+ private String mImsType = "none";
|
||||
+ private String mImsApkUrl = "";
|
||||
+
|
||||
+ public InstallImsApkPreferenceController(Context context) {
|
||||
+ super(context, INSTALL_IMS_APK_KEY);
|
||||
+
|
||||
+ mImsType = getImsType();
|
||||
+ Log.d(TAG, "IMS type = " + mImsType);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int getAvailabilityStatus() {
|
||||
+ return AVAILABLE;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public String getPreferenceKey() {
|
||||
+ return INSTALL_IMS_APK_KEY;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void displayPreference(PreferenceScreen screen) {
|
||||
+ mPreference = screen.findPreference(getPreferenceKey());
|
||||
+
|
||||
+ if (mImsType.equals("none")) {
|
||||
+ mPreference.setEnabled(false);
|
||||
+ } else {
|
||||
+ mPreference.setOnPreferenceClickListener(this);
|
||||
+ }
|
||||
+
|
||||
+ super.displayPreference(screen);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean onPreferenceClick(Preference preference) {
|
||||
+ switch (mImsType) {
|
||||
+ case "qcom_hidl_moto":
|
||||
+ mImsApkUrl = "https://treble.phh.me/stable/ims-caf-moto.apk";
|
||||
+ break;
|
||||
+ case "qcom_hidl":
|
||||
+ mImsApkUrl = "https://treble.phh.me/stable/ims-q.64.apk";
|
||||
+ break;
|
||||
+ case "qcom_aidl":
|
||||
+ mImsApkUrl = "https://treble.phh.me/stable/ims-caf-s.apk";
|
||||
+ break;
|
||||
+ case "mtk_p":
|
||||
+ mImsApkUrl = "https://treble.phh.me/stable/ims-mtk-p.apk";
|
||||
+ break;
|
||||
+ case "mtk_q":
|
||||
+ mImsApkUrl = "https://treble.phh.me/stable/ims-mtk-q.apk";
|
||||
+ break;
|
||||
+ case "mtk_r":
|
||||
+ mImsApkUrl = "https://treble.phh.me/stable/ims-mtk-r.apk";
|
||||
+ break;
|
||||
+ case "mtk_s":
|
||||
+ mImsApkUrl = "https://treble.phh.me/stable/ims-mtk-s.apk";
|
||||
+ break;
|
||||
+ default:
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ Context context = preference.getContext();
|
||||
+ DownloadManager dm = (DownloadManager) context.getSystemService(Context.DOWNLOAD_SERVICE);
|
||||
+ DownloadManager.Request request = new DownloadManager.Request(Uri.parse(mImsApkUrl));
|
||||
+ request.setTitle("IMS APK");
|
||||
+ request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
|
||||
+ request.setDestinationInExternalFilesDir(context, Environment.DIRECTORY_DOWNLOADS, "ims.apk");
|
||||
+ long id = dm.enqueue(request);
|
||||
+ Toast.makeText(context, context.getString(R.string.install_ims_apk_toast_downloading), Toast.LENGTH_LONG).show();
|
||||
+
|
||||
+ context.registerReceiver(new BroadcastReceiver() {
|
||||
+ @Override
|
||||
+ public void onReceive(Context context, Intent intent) {
|
||||
+ if (intent.getLongExtra(DownloadManager.EXTRA_DOWNLOAD_ID, -1L) != id) {
|
||||
+ return;
|
||||
+ }
|
||||
+ Cursor cursor = dm.query(new DownloadManager.Query().setFilterById(id));
|
||||
+ if (!cursor.moveToFirst()) {
|
||||
+ return;
|
||||
+ }
|
||||
+ Uri localUri = Uri.parse(cursor.getString(cursor.getColumnIndex(DownloadManager.COLUMN_LOCAL_URI)));
|
||||
+ String path = localUri.getPath();
|
||||
+ if (path == null) {
|
||||
+ return;
|
||||
+ }
|
||||
+ long fileSize = 0;
|
||||
+ File file = new File(path);
|
||||
+ if (file.isFile()) {
|
||||
+ fileSize = file.length();
|
||||
+ } else {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ try (InputStream in = new FileInputStream(path)) {
|
||||
+ PackageInstaller pi = context.getPackageManager().getPackageInstaller();
|
||||
+ int sessionId = pi.createSession(new PackageInstaller.SessionParams(PackageInstaller.SessionParams.MODE_FULL_INSTALL));
|
||||
+ PackageInstaller.Session session = pi.openSession(sessionId);
|
||||
+ try (OutputStream out = session.openWrite(TAG, 0, fileSize)) {
|
||||
+ byte[] buffer = new byte[512 * 1024];
|
||||
+ while (in.available() > 0) {
|
||||
+ int l = in.read(buffer);
|
||||
+ out.write(buffer, 0, l);
|
||||
+ }
|
||||
+ session.fsync(out);
|
||||
+ }
|
||||
+ String action = TAG + "_" + sessionId;
|
||||
+ PendingIntent pendingIntent = PendingIntent.getBroadcast(context, sessionId,
|
||||
+ new Intent(action), PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE);
|
||||
+ context.registerReceiver(new BroadcastReceiver() {
|
||||
+ @Override
|
||||
+ public void onReceive(Context context, Intent intent) {
|
||||
+ Toast.makeText(context, context.getString(R.string.install_ims_apk_toast_completed), Toast.LENGTH_LONG).show();
|
||||
+ }
|
||||
+ }, new IntentFilter(action));
|
||||
+ session.commit(pendingIntent.getIntentSender());
|
||||
+ context.unregisterReceiver(this);
|
||||
+ } catch (IOException ex) {
|
||||
+ Log.d(TAG, "IOException while installing IMS APK");
|
||||
+ }
|
||||
+ }
|
||||
+ }, new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE));
|
||||
+
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ protected static String getImsType() {
|
||||
+ try {
|
||||
+ IServiceManager hidlManager = IServiceManager.getService();
|
||||
+ for (String slot: IMS_SLOTS) {
|
||||
+ if (hidlManager.get("vendor.qti.hardware.radio.ims@1.0::IImsRadio", slot) != null) {
|
||||
+ if (SystemProperties.get(RO_PRODUCT_VENDOR_BRAND_PROPERTY, "N/A").equals("motorola")) {
|
||||
+ return "qcom_hidl_moto";
|
||||
+ }
|
||||
+ return "qcom_hidl";
|
||||
+ } else if (ServiceManager.getService("vendor.qti.hardware.radio.ims.IImsRadio/" + slot) != null) {
|
||||
+ return "qcom_aidl";
|
||||
+ } else if (hidlManager.get("vendor.mediatek.hardware.radio@3.0::IRadio", slot) != null) {
|
||||
+ return "mtk_p";
|
||||
+ } else if (hidlManager.get("vendor.mediatek.hardware.mtkradioex@1.0::IMtkRadioEx", slot) != null) {
|
||||
+ return "mtk_q";
|
||||
+ } else if (hidlManager.get("vendor.mediatek.hardware.mtkradioex@2.0::IMtkRadioEx", slot) != null) {
|
||||
+ return "mtk_r";
|
||||
+ } else if (hidlManager.get("vendor.mediatek.hardware.mtkradioex@3.0::IMtkRadioEx", slot) != null) {
|
||||
+ return "mtk_s";
|
||||
+ }
|
||||
+ }
|
||||
+ } catch (RemoteException ex) {}
|
||||
+
|
||||
+ return "none";
|
||||
+ }
|
||||
+
|
||||
+}
|
||||
diff --git a/src/com/android/settings/treble/OverrideVolteAvailabilityPreferenceController.java b/src/com/android/settings/treble/OverrideVolteAvailabilityPreferenceController.java
|
||||
new file mode 100644
|
||||
index 0000000000..1ab12d3ca0
|
||||
--- /dev/null
|
||||
+++ b/src/com/android/settings/treble/OverrideVolteAvailabilityPreferenceController.java
|
||||
@@ -0,0 +1,59 @@
|
||||
+package com.android.settings.treble;
|
||||
+
|
||||
+import android.content.Context;
|
||||
+import android.os.SystemProperties;
|
||||
+
|
||||
+import androidx.preference.Preference;
|
||||
+import androidx.preference.PreferenceScreen;
|
||||
+import androidx.preference.SwitchPreference;
|
||||
+
|
||||
+import com.android.settings.core.BasePreferenceController;
|
||||
+
|
||||
+public class OverrideVolteAvailabilityPreferenceController extends BasePreferenceController
|
||||
+ implements Preference.OnPreferenceChangeListener {
|
||||
+
|
||||
+ private static final String OVERRIDE_VOLTE_AVAILABILITY_KEY = "override_volte_availability";
|
||||
+ private static final String[] IMSMANAGER_DEBUG_OVERRIDE_PROPERTIES = {
|
||||
+ "persist.dbg.volte_avail_ovr",
|
||||
+ "persist.dbg.wfc_avail_ovr",
|
||||
+ "persist.dbg.allow_ims_off"
|
||||
+ };
|
||||
+
|
||||
+ private SwitchPreference mSwitchPreference;
|
||||
+
|
||||
+ public OverrideVolteAvailabilityPreferenceController(Context context) {
|
||||
+ super(context, OVERRIDE_VOLTE_AVAILABILITY_KEY);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int getAvailabilityStatus() {
|
||||
+ return AVAILABLE;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public String getPreferenceKey() {
|
||||
+ return OVERRIDE_VOLTE_AVAILABILITY_KEY;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void displayPreference(PreferenceScreen screen) {
|
||||
+ mSwitchPreference = screen.findPreference(getPreferenceKey());
|
||||
+ super.displayPreference(screen);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void updateState(Preference preference) {
|
||||
+ boolean checked = SystemProperties.getBoolean(IMSMANAGER_DEBUG_OVERRIDE_PROPERTIES[0], false);
|
||||
+ mSwitchPreference.setChecked(checked);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||
+ for (String prop: IMSMANAGER_DEBUG_OVERRIDE_PROPERTIES) {
|
||||
+ SystemProperties.set(prop, ((boolean) newValue) ? "1" : "0");
|
||||
+ }
|
||||
+ mSwitchPreference.setChecked((boolean) newValue);
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+}
|
||||
diff --git a/src/com/android/settings/treble/TrebleSettings.java b/src/com/android/settings/treble/TrebleSettings.java
|
||||
index 5c1611c053..50e3eda8c6 100644
|
||||
--- a/src/com/android/settings/treble/TrebleSettings.java
|
||||
+++ b/src/com/android/settings/treble/TrebleSettings.java
|
||||
@@ -36,6 +36,8 @@ public class TrebleSettings extends DashboardFragment {
|
||||
controllers.add(new DisableSoundvolumeEffectPreferenceController(context));
|
||||
controllers.add(new ScreenResolutionRefreshRatePreferenceController(context));
|
||||
controllers.add(new UseAlternativeBacklightScalePreferenceController(context));
|
||||
+ controllers.add(new InstallImsApkPreferenceController(context));
|
||||
+ controllers.add(new OverrideVolteAvailabilityPreferenceController(context));
|
||||
return controllers;
|
||||
}
|
||||
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
From a1d10cb31ae386c01a66c8bf0a028b8f33e5bd32 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 da5986fcb7..8be21a20a3 100644
|
||||
--- a/system/gd/hci/controller.cc
|
||||
+++ b/system/gd/hci/controller.cc
|
||||
@@ -540,7 +540,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>
|
||||
@@ -551,6 +551,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.37.2
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
From 0e2bf3f3d46efaa7d01d3554b7e5ceeac9664c69 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
|
||||
|
||||
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
|
||||
error here (the status event comes from the failure response).
|
||||
|
||||
Change-Id: Ifb9a65fd77f21d15a8dc1ced9240194d38218ef6
|
||||
---
|
||||
system/gd/hci/hci_layer.cc | 15 +++++++--------
|
||||
1 file changed, 7 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/system/gd/hci/hci_layer.cc b/system/gd/hci/hci_layer.cc
|
||||
index 57d7e55fff..b5a9d065be 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));
|
||||
} else {
|
||||
- ASSERT_LOG(
|
||||
- command_queue_.front().waiting_for_status_ == is_status,
|
||||
- "0x%02hx (%s) was not expecting %s event",
|
||||
- op_code,
|
||||
- OpCodeText(op_code).c_str(),
|
||||
- logging_id.c_str());
|
||||
-
|
||||
- command_queue_.front().GetCallback<TResponse>()->Invoke(move(response_view));
|
||||
+ if (command_queue_.front().waiting_for_status_ == is_status) {
|
||||
+ command_queue_.front().GetCallback<TResponse>()->Invoke(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_.pop_front();
|
||||
--
|
||||
2.37.2
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
From cad9f7f7aeaf57e5fead759bcc68b75262ba3708 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
|
||||
|
||||
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(-)
|
||||
|
||||
diff --git a/system/audio_hal_interface/aidl/client_interface_aidl.cc b/system/audio_hal_interface/aidl/client_interface_aidl.cc
|
||||
index 814c6c7796..a38b6da495 100644
|
||||
--- a/system/audio_hal_interface/aidl/client_interface_aidl.cc
|
||||
+++ b/system/audio_hal_interface/aidl/client_interface_aidl.cc
|
||||
@@ -55,7 +55,7 @@ BluetoothAudioClientInterface::BluetoothAudioClientInterface(
|
||||
|
||||
bool BluetoothAudioClientInterface::is_aidl_available() {
|
||||
auto service = AServiceManager_checkService(
|
||||
- kDefaultAudioProviderFactoryInterface.c_str());
|
||||
+ audioProviderFactoryInterface().c_str());
|
||||
return (service != nullptr);
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ BluetoothAudioClientInterface::GetAudioCapabilities(SessionType session_type) {
|
||||
}
|
||||
auto provider_factory = IBluetoothAudioProviderFactory::fromBinder(
|
||||
::ndk::SpAIBinder(AServiceManager_getService(
|
||||
- kDefaultAudioProviderFactoryInterface.c_str())));
|
||||
+ audioProviderFactoryInterface().c_str())));
|
||||
|
||||
if (provider_factory == nullptr) {
|
||||
LOG(ERROR) << __func__ << ", can't get capability from unknown factory";
|
||||
@@ -100,7 +100,7 @@ void BluetoothAudioClientInterface::FetchAudioProvider() {
|
||||
}
|
||||
auto provider_factory = IBluetoothAudioProviderFactory::fromBinder(
|
||||
::ndk::SpAIBinder(AServiceManager_getService(
|
||||
- kDefaultAudioProviderFactoryInterface.c_str())));
|
||||
+ audioProviderFactoryInterface().c_str())));
|
||||
|
||||
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 87dd450997..36d5fa5e86 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 @@
|
||||
#include "bluetooth_audio_port_impl.h"
|
||||
#include "common/message_loop_thread.h"
|
||||
#include "transport_instance.h"
|
||||
+#include "osi/include/properties.h"
|
||||
|
||||
#define BLUETOOTH_AUDIO_HAL_PROP_DISABLED \
|
||||
"persist.bluetooth.bluetooth_audio_hal.disabled"
|
||||
@@ -115,6 +116,12 @@ class BluetoothAudioClientInterface {
|
||||
// "android.hardware.bluetooth.audio.IBluetoothAudioProviderFactory/default";
|
||||
static inline const std::string kDefaultAudioProviderFactoryInterface =
|
||||
std::string() + IBluetoothAudioProviderFactory::descriptor + "/default";
|
||||
+ static inline const std::string kSystemAudioProviderFactoryInterface =
|
||||
+ std::string() + IBluetoothAudioProviderFactory::descriptor + "/sysbta";
|
||||
+ static inline const std::string audioProviderFactoryInterface() {
|
||||
+ return osi_property_get_bool("persist.bluetooth.system_audio_hal.enabled", false)
|
||||
+ ? kSystemAudioProviderFactoryInterface : kDefaultAudioProviderFactoryInterface;
|
||||
+ }
|
||||
|
||||
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
|
||||
--- a/system/audio_hal_interface/hal_version_manager.cc
|
||||
+++ b/system/audio_hal_interface/hal_version_manager.cc
|
||||
@@ -24,6 +24,7 @@
|
||||
#include <memory>
|
||||
|
||||
#include "aidl/audio_aidl_interfaces.h"
|
||||
+#include "osi/include/properties.h"
|
||||
|
||||
namespace bluetooth {
|
||||
namespace audio {
|
||||
@@ -33,6 +34,12 @@ using ::aidl::android::hardware::bluetooth::audio::
|
||||
|
||||
static const std::string kDefaultAudioProviderFactoryInterface =
|
||||
std::string() + IBluetoothAudioProviderFactory::descriptor + "/default";
|
||||
+static const std::string kSystemAudioProviderFactoryInterface =
|
||||
+ std::string() + IBluetoothAudioProviderFactory::descriptor + "/sysbta";
|
||||
+static inline const std::string audioProviderFactoryInterface() {
|
||||
+ return osi_property_get_bool("persist.bluetooth.system_audio_hal.enabled", false)
|
||||
+ ? kSystemAudioProviderFactoryInterface : kDefaultAudioProviderFactoryInterface;
|
||||
+}
|
||||
|
||||
std::unique_ptr<HalVersionManager> HalVersionManager::instance_ptr =
|
||||
std::make_unique<HalVersionManager>();
|
||||
@@ -92,7 +99,7 @@ HalVersionManager::GetProvidersFactory_2_0() {
|
||||
|
||||
HalVersionManager::HalVersionManager() {
|
||||
if (AServiceManager_checkService(
|
||||
- kDefaultAudioProviderFactoryInterface.c_str()) != nullptr) {
|
||||
+ audioProviderFactoryInterface().c_str()) != nullptr) {
|
||||
hal_version_ = BluetoothAudioHalVersion::VERSION_AIDL_V1;
|
||||
return;
|
||||
}
|
||||
--
|
||||
2.37.2
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
From 04eb0f02934f58c1c842da1ea365275ba03c5b58 Mon Sep 17 00:00:00 2001
|
||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||
Date: Wed, 19 Oct 2022 02:20:05 +0000
|
||||
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.25.1
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
From 29ccba624ae893659126b2f6562c16909c2691c5 Mon Sep 17 00:00:00 2001
|
||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||
Date: Mon, 26 Sep 2022 14:41:41 +0000
|
||||
Subject: [PATCH 1/4] Make xbin and su executable by other
|
||||
|
||||
Needed by PHH-SU
|
||||
|
||||
Change-Id: I5304b787ce4602036904a373a409bb08f8f969de
|
||||
---
|
||||
libcutils/fs_config.cpp | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/libcutils/fs_config.cpp b/libcutils/fs_config.cpp
|
||||
index a6835fc70..a703993f6 100644
|
||||
--- a/libcutils/fs_config.cpp
|
||||
+++ b/libcutils/fs_config.cpp
|
||||
@@ -86,7 +86,7 @@ static const struct fs_path_config android_dirs[] = {
|
||||
{ 00751, AID_ROOT, AID_SHELL, 0, "system/bin" },
|
||||
{ 00755, AID_ROOT, AID_ROOT, 0, "system/etc/ppp" },
|
||||
{ 00755, AID_ROOT, AID_SHELL, 0, "system/vendor" },
|
||||
- { 00750, AID_ROOT, AID_SHELL, 0, "system/xbin" },
|
||||
+ { 00755, AID_ROOT, AID_SHELL, 0, "system/xbin" },
|
||||
{ 00751, AID_ROOT, AID_SHELL, 0, "system/apex/*/bin" },
|
||||
{ 00751, AID_ROOT, AID_SHELL, 0, "system_ext/bin" },
|
||||
{ 00751, AID_ROOT, AID_SHELL, 0, "system_ext/apex/*/bin" },
|
||||
@@ -190,7 +190,7 @@ static const struct fs_path_config android_files[] = {
|
||||
// the following two files are INTENTIONALLY set-uid, but they
|
||||
// are NOT included on user builds.
|
||||
{ 06755, AID_ROOT, AID_ROOT, 0, "system/xbin/procmem" },
|
||||
- { 04750, AID_ROOT, AID_SHELL, 0, "system/xbin/su" },
|
||||
+ { 04755, AID_ROOT, AID_SHELL, 0, "system/xbin/su" },
|
||||
|
||||
// the following files have enhanced capabilities and ARE included
|
||||
// in user builds.
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
From c4d992edc94f3db949b6146428c978bf8036f345 Mon Sep 17 00:00:00 2001
|
||||
From: Victor Bo <bvoid@yandex.ru>
|
||||
Date: Wed, 3 Mar 2021 06:31:17 -0500
|
||||
Subject: [PATCH 2/4] Restore /sbin for Magisk compatibility
|
||||
|
||||
Squash of:
|
||||
- Revert "Do not create /sbin"
|
||||
- Revert "Remove sbin from fs_config.cpp"
|
||||
- add /sbin to the PATH
|
||||
|
||||
Change-Id: I1224c9b64ce8eb14f7d15c8441c0633a7e6a20de
|
||||
---
|
||||
CleanSpec.mk | 2 --
|
||||
libcutils/fs_config.cpp | 3 +++
|
||||
rootdir/Android.mk | 2 +-
|
||||
rootdir/init.environ.rc.in | 1 +
|
||||
4 files changed, 5 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/CleanSpec.mk b/CleanSpec.mk
|
||||
index 0a534a2bd..81150a0fa 100644
|
||||
--- a/CleanSpec.mk
|
||||
+++ b/CleanSpec.mk
|
||||
@@ -80,8 +80,6 @@ $(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/vndksp.libraries.txt)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/recovery/root/)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/root/sbin/charger)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/recovery/root/sbin/charger)
|
||||
-$(call add-clean-step, rm -rf $(PRODUCT_OUT)/root/sbin)
|
||||
-$(call add-clean-step, rm -rf $(PRODUCT_OUT)/recovery/root/sbin)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/product_services)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/product_services.img)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/product_services)
|
||||
diff --git a/libcutils/fs_config.cpp b/libcutils/fs_config.cpp
|
||||
index a703993f6..184c7da0f 100644
|
||||
--- a/libcutils/fs_config.cpp
|
||||
+++ b/libcutils/fs_config.cpp
|
||||
@@ -80,6 +80,7 @@ static const struct fs_path_config android_dirs[] = {
|
||||
{ 00771, AID_SYSTEM, AID_SYSTEM, 0, "data" },
|
||||
{ 00755, AID_ROOT, AID_SYSTEM, 0, "mnt" },
|
||||
{ 00751, AID_ROOT, AID_SHELL, 0, "product/bin" },
|
||||
+ { 00750, AID_ROOT, AID_SHELL, 0, "sbin" },
|
||||
{ 00751, AID_ROOT, AID_SHELL, 0, "product/apex/*/bin" },
|
||||
{ 00777, AID_ROOT, AID_ROOT, 0, "sdcard" },
|
||||
{ 00751, AID_ROOT, AID_SDCARD_R, 0, "storage" },
|
||||
@@ -166,6 +167,7 @@ static const struct fs_path_config android_files[] = {
|
||||
{ 00600, AID_ROOT, AID_ROOT, 0, "system_ext/build.prop" },
|
||||
{ 00444, AID_ROOT, AID_ROOT, 0, system_ext_conf_dir + 1 },
|
||||
{ 00444, AID_ROOT, AID_ROOT, 0, system_ext_conf_file + 1 },
|
||||
+ { 00750, AID_ROOT, AID_SHELL, 0, "sbin/fs_mgr" },
|
||||
{ 00755, AID_ROOT, AID_SHELL, 0, "system/bin/crash_dump32" },
|
||||
{ 00755, AID_ROOT, AID_SHELL, 0, "system/bin/crash_dump64" },
|
||||
{ 00755, AID_ROOT, AID_SHELL, 0, "system/bin/debuggerd" },
|
||||
@@ -218,6 +220,7 @@ static const struct fs_path_config android_files[] = {
|
||||
{ 00750, AID_ROOT, AID_SHELL, 0, "init*" },
|
||||
{ 00755, AID_ROOT, AID_SHELL, 0, "odm/bin/*" },
|
||||
{ 00755, AID_ROOT, AID_SHELL, 0, "product/bin/*" },
|
||||
+ { 00750, AID_ROOT, AID_SHELL, 0, "sbin/*" },
|
||||
{ 00755, AID_ROOT, AID_SHELL, 0, "product/apex/*bin/*" },
|
||||
{ 00755, AID_ROOT, AID_SHELL, 0, "system/bin/*" },
|
||||
{ 00755, AID_ROOT, AID_SHELL, 0, "system/xbin/*" },
|
||||
diff --git a/rootdir/Android.mk b/rootdir/Android.mk
|
||||
index fe23b6206..81bd46342 100644
|
||||
--- a/rootdir/Android.mk
|
||||
+++ b/rootdir/Android.mk
|
||||
@@ -91,7 +91,7 @@ endif
|
||||
#
|
||||
# create some directories (some are mount points) and symlinks
|
||||
LOCAL_POST_INSTALL_CMD := mkdir -p $(addprefix $(TARGET_ROOT_OUT)/, \
|
||||
- dev proc sys system data data_mirror odm oem acct config storage mnt apex debug_ramdisk \
|
||||
+ sbin dev proc sys system data data_mirror odm oem acct config storage mnt apex debug_ramdisk \
|
||||
linkerconfig second_stage_resources postinstall $(BOARD_ROOT_EXTRA_FOLDERS)); \
|
||||
ln -sf /system/bin $(TARGET_ROOT_OUT)/bin; \
|
||||
ln -sf /system/etc $(TARGET_ROOT_OUT)/etc; \
|
||||
diff --git a/rootdir/init.environ.rc.in b/rootdir/init.environ.rc.in
|
||||
index bf6e986c4..090fa5a78 100644
|
||||
--- a/rootdir/init.environ.rc.in
|
||||
+++ b/rootdir/init.environ.rc.in
|
||||
@@ -10,6 +10,7 @@ on early-init
|
||||
export ANDROID_TZDATA_ROOT /apex/com.android.tzdata
|
||||
export EXTERNAL_STORAGE /sdcard
|
||||
export ASEC_MOUNTPOINT /mnt/asec
|
||||
+ export PATH /sbin:/product/bin:/apex/com.android.runtime/bin:/apex/com.android.art/bin:/system_ext/bin:/system/bin:/system/xbin:/odm/bin:/vendor/bin:/vendor/xbin
|
||||
%EXPORT_GLOBAL_ASAN_OPTIONS%
|
||||
%EXPORT_GLOBAL_GCOV_OPTIONS%
|
||||
%EXPORT_GLOBAL_CLANG_COVERAGE_OPTIONS%
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
From b58f1976ed11252c29c1ecb711dd073856998d7d Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Thu, 7 Oct 2021 15:48:11 -0400
|
||||
Subject: [PATCH 3/4] Stop overriding system properties from vendor
|
||||
|
||||
This is annoying to disable apexes, or force adb
|
||||
|
||||
Change-Id: Ifd0072c631349b23945df4ab401ba26eca07131f
|
||||
---
|
||||
init/property_service.cpp | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/init/property_service.cpp b/init/property_service.cpp
|
||||
index 8db414a97..ff79ce8a0 100644
|
||||
--- a/init/property_service.cpp
|
||||
+++ b/init/property_service.cpp
|
||||
@@ -727,7 +727,6 @@ 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;
|
||||
}
|
||||
} else {
|
||||
LOG(ERROR) << "Do not have permissions to set '" << key << "' to '" << value
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
From 60937ffa51434cde846397f81b2771cfe9f4ec5d Mon Sep 17 00:00:00 2001
|
||||
From: Isaac Chen <tingyi364@gmail.com>
|
||||
Date: Wed, 23 Jun 2021 13:07:30 +0800
|
||||
Subject: [PATCH 4/4] init: Do not start console service when debuggable
|
||||
|
||||
Google added a check for this in R, when it's running it will show a
|
||||
notification about that performance is impacted.
|
||||
|
||||
Signed-off-by: Isaac Chen <tingyi364@gmail.com>
|
||||
Change-Id: I34cfd6b42d3b9aee4b3e63181480cfb8b1255f29
|
||||
---
|
||||
rootdir/init.rc | 3 ---
|
||||
1 file changed, 3 deletions(-)
|
||||
|
||||
diff --git a/rootdir/init.rc b/rootdir/init.rc
|
||||
index cd71aa8aa..417de0d4a 100644
|
||||
--- a/rootdir/init.rc
|
||||
+++ b/rootdir/init.rc
|
||||
@@ -1268,9 +1268,6 @@ on property:ro.debuggable=1
|
||||
# Give reads to anyone for the accessibility trace folder on debug builds.
|
||||
chmod 0775 /data/misc/a11ytrace
|
||||
|
||||
-on init && property:ro.debuggable=1
|
||||
- start console
|
||||
-
|
||||
on userspace-reboot-requested
|
||||
# TODO(b/135984674): reset all necessary properties here.
|
||||
setprop sys.boot_completed ""
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
From 1614817aa551569818e7d3f09e0ddbc8ac4cf796 Mon Sep 17 00:00:00 2001
|
||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||
Date: Wed, 21 Sep 2022 13:36:07 +0000
|
||||
Subject: [PATCH 1/2] Exclude TrebleApp & co.
|
||||
|
||||
Change-Id: Ieb62801a79c6e015634fd58b654c63c1de5aef7e
|
||||
---
|
||||
overlay.mk | 3 ---
|
||||
1 file changed, 3 deletions(-)
|
||||
|
||||
diff --git a/overlay.mk b/overlay.mk
|
||||
index 80b1ff4..10c8855 100644
|
||||
--- a/overlay.mk
|
||||
+++ b/overlay.mk
|
||||
@@ -1,7 +1,4 @@
|
||||
PRODUCT_PACKAGES += \
|
||||
- HardwareOverlayPicker \
|
||||
- QtiAudio \
|
||||
- TrebleApp \
|
||||
treble-overlay-NavBar \
|
||||
treble-overlay-NightMode \
|
||||
treble-overlay-SystemUI-FalseLocks \
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -0,0 +1,161 @@
|
||||
From 93192b8e62ac4a9ac9dd8241793830ceb063a4b8 Mon Sep 17 00:00:00 2001
|
||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||
Date: Tue, 11 Oct 2022 10:53:34 +0000
|
||||
Subject: [PATCH 2/2] Enable IMS overlays statically on QCOM/MTK devices
|
||||
|
||||
Change-Id: I851cf859328cc431e8bb163297c33837d4270f58
|
||||
---
|
||||
CAF-IMS/AndroidManifest.xml | 8 ++++----
|
||||
CAF-IMS/res/values/config.xml | 4 ++--
|
||||
MTK-IMS/AndroidManifest.xml | 8 ++++----
|
||||
MTK-IMS/res/values/config.xml | 8 +++++---
|
||||
Telephony/CAF-IMS/Android.mk | 2 ++
|
||||
Telephony/CAF-IMS/AndroidManifest.xml | 6 ++++--
|
||||
Telephony/CAF-IMS/res/values/config.xml | 2 +-
|
||||
Telephony/MTK-IMS/Android.mk | 2 ++
|
||||
Telephony/MTK-IMS/AndroidManifest.xml | 6 ++++--
|
||||
Telephony/MTK-IMS/res/values/config.xml | 3 +--
|
||||
10 files changed, 29 insertions(+), 20 deletions(-)
|
||||
|
||||
diff --git a/CAF-IMS/AndroidManifest.xml b/CAF-IMS/AndroidManifest.xml
|
||||
index 47236c6..5376fb8 100644
|
||||
--- a/CAF-IMS/AndroidManifest.xml
|
||||
+++ b/CAF-IMS/AndroidManifest.xml
|
||||
@@ -3,8 +3,8 @@
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0">
|
||||
<overlay android:targetPackage="android"
|
||||
- android:requiredSystemPropertyName="persist.sys.phh.ims.caf"
|
||||
- android:requiredSystemPropertyValue="true"
|
||||
- android:priority="39"
|
||||
- android:isStatic="true" />
|
||||
+ android:requiredSystemPropertyName="ro.hardware"
|
||||
+ android:requiredSystemPropertyValue="qcom"
|
||||
+ android:priority="39"
|
||||
+ android:isStatic="true" />
|
||||
</manifest>
|
||||
diff --git a/CAF-IMS/res/values/config.xml b/CAF-IMS/res/values/config.xml
|
||||
index 1af87c7..5b85ebd 100644
|
||||
--- a/CAF-IMS/res/values/config.xml
|
||||
+++ b/CAF-IMS/res/values/config.xml
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
- <string name="config_ims_package">org.codeaurora.ims</string>
|
||||
- <bool name="config_dynamic_bind_ims">true</bool>
|
||||
+ <string name="config_ims_package">org.codeaurora.ims</string>
|
||||
+ <bool name="config_dynamic_bind_ims">true</bool>
|
||||
<bool name="config_carrier_volte_available">true</bool>
|
||||
<bool name="config_device_volte_available">true</bool>
|
||||
<bool name="config_device_wfc_ims_available">true</bool>
|
||||
diff --git a/MTK-IMS/AndroidManifest.xml b/MTK-IMS/AndroidManifest.xml
|
||||
index 96ba83e..33132cc 100644
|
||||
--- a/MTK-IMS/AndroidManifest.xml
|
||||
+++ b/MTK-IMS/AndroidManifest.xml
|
||||
@@ -3,8 +3,8 @@
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0">
|
||||
<overlay android:targetPackage="android"
|
||||
- android:requiredSystemPropertyName="persist.sys.phh.ims.mtk"
|
||||
- android:requiredSystemPropertyValue="true"
|
||||
- android:priority="79"
|
||||
- android:isStatic="true" />
|
||||
+ android:requiredSystemPropertyName="ro.hardware"
|
||||
+ android:requiredSystemPropertyValue="+mt6*"
|
||||
+ android:priority="79"
|
||||
+ android:isStatic="true" />
|
||||
</manifest>
|
||||
diff --git a/MTK-IMS/res/values/config.xml b/MTK-IMS/res/values/config.xml
|
||||
index f5e0486..2d49a11 100644
|
||||
--- a/MTK-IMS/res/values/config.xml
|
||||
+++ b/MTK-IMS/res/values/config.xml
|
||||
@@ -1,6 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
- <string name="config_ims_package">com.mediatek.ims</string>
|
||||
- <bool name="config_carrier_volte_available">true</bool>
|
||||
- <bool name="config_dynamic_bind_ims">true</bool>
|
||||
+ <string name="config_ims_package">com.mediatek.ims</string>
|
||||
+ <bool name="config_dynamic_bind_ims">true</bool>
|
||||
+ <bool name="config_carrier_volte_available">true</bool>
|
||||
+ <bool name="config_device_volte_available">true</bool>
|
||||
+ <bool name="config_device_wfc_ims_available">true</bool>
|
||||
</resources>
|
||||
diff --git a/Telephony/CAF-IMS/Android.mk b/Telephony/CAF-IMS/Android.mk
|
||||
index 7785cc3..416f501 100644
|
||||
--- a/Telephony/CAF-IMS/Android.mk
|
||||
+++ b/Telephony/CAF-IMS/Android.mk
|
||||
@@ -2,5 +2,7 @@ LOCAL_PATH := $(call my-dir)
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE_TAGS := optional
|
||||
LOCAL_PACKAGE_NAME := treble-overlay-telephony-caf-ims
|
||||
+LOCAL_MODULE_PATH := $(TARGET_OUT_PRODUCT)/overlay
|
||||
+LOCAL_IS_RUNTIME_RESOURCE_OVERLAY := true
|
||||
LOCAL_PRIVATE_PLATFORM_APIS := true
|
||||
include $(BUILD_PACKAGE)
|
||||
diff --git a/Telephony/CAF-IMS/AndroidManifest.xml b/Telephony/CAF-IMS/AndroidManifest.xml
|
||||
index 2267406..365525c 100644
|
||||
--- a/Telephony/CAF-IMS/AndroidManifest.xml
|
||||
+++ b/Telephony/CAF-IMS/AndroidManifest.xml
|
||||
@@ -3,6 +3,8 @@
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0">
|
||||
<overlay android:targetPackage="com.android.phone"
|
||||
- android:priority="79"
|
||||
- />
|
||||
+ android:requiredSystemPropertyName="ro.hardware"
|
||||
+ android:requiredSystemPropertyValue="qcom"
|
||||
+ android:priority="79"
|
||||
+ android:isStatic="true" />
|
||||
</manifest>
|
||||
diff --git a/Telephony/CAF-IMS/res/values/config.xml b/Telephony/CAF-IMS/res/values/config.xml
|
||||
index 565ee42..ddf685d 100644
|
||||
--- a/Telephony/CAF-IMS/res/values/config.xml
|
||||
+++ b/Telephony/CAF-IMS/res/values/config.xml
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
- <string name="config_ims_mmtel_package">org.codeaurora.ims</string>
|
||||
+ <string name="config_ims_mmtel_package">org.codeaurora.ims</string>
|
||||
</resources>
|
||||
diff --git a/Telephony/MTK-IMS/Android.mk b/Telephony/MTK-IMS/Android.mk
|
||||
index 314b1a9..d08cb5a 100644
|
||||
--- a/Telephony/MTK-IMS/Android.mk
|
||||
+++ b/Telephony/MTK-IMS/Android.mk
|
||||
@@ -2,5 +2,7 @@ LOCAL_PATH := $(call my-dir)
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE_TAGS := optional
|
||||
LOCAL_PACKAGE_NAME := treble-overlay-telephony-mtk-ims
|
||||
+LOCAL_MODULE_PATH := $(TARGET_OUT_PRODUCT)/overlay
|
||||
+LOCAL_IS_RUNTIME_RESOURCE_OVERLAY := true
|
||||
LOCAL_PRIVATE_PLATFORM_APIS := true
|
||||
include $(BUILD_PACKAGE)
|
||||
diff --git a/Telephony/MTK-IMS/AndroidManifest.xml b/Telephony/MTK-IMS/AndroidManifest.xml
|
||||
index 5afe885..644d06b 100644
|
||||
--- a/Telephony/MTK-IMS/AndroidManifest.xml
|
||||
+++ b/Telephony/MTK-IMS/AndroidManifest.xml
|
||||
@@ -3,6 +3,8 @@
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0">
|
||||
<overlay android:targetPackage="com.android.phone"
|
||||
- android:priority="79"
|
||||
- />
|
||||
+ android:requiredSystemPropertyName="ro.hardware"
|
||||
+ android:requiredSystemPropertyValue="+mt6*"
|
||||
+ android:priority="79"
|
||||
+ android:isStatic="true" />
|
||||
</manifest>
|
||||
diff --git a/Telephony/MTK-IMS/res/values/config.xml b/Telephony/MTK-IMS/res/values/config.xml
|
||||
index ead0cc2..01eca95 100644
|
||||
--- a/Telephony/MTK-IMS/res/values/config.xml
|
||||
+++ b/Telephony/MTK-IMS/res/values/config.xml
|
||||
@@ -1,5 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
- <string name="config_ims_mmtel_package">com.mediatek.ims</string>
|
||||
-
|
||||
+ <string name="config_ims_mmtel_package">com.mediatek.ims</string>
|
||||
</resources>
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
From 1193bdf321a07cbffbad383cf3a9968d293099c1 Mon Sep 17 00:00:00 2001
|
||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||
Date: Sat, 24 Sep 2022 11:40:52 +0000
|
||||
Subject: [PATCH 1/2] vendor_lineage: Commonly build some packages
|
||||
|
||||
These were in handheld_product.mk and thus weren't included in GSI targets:
|
||||
Contacts, DeskClock, Gallery2, fwb overlays
|
||||
|
||||
Change-Id: I00cc5918164ed70c612c5caa31eb8d2d0cd05b62
|
||||
---
|
||||
config/common_mobile.mk | 6 +++++-
|
||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/config/common_mobile.mk b/config/common_mobile.mk
|
||||
index 547804ce..3c58d9ff 100644
|
||||
--- a/config/common_mobile.mk
|
||||
+++ b/config/common_mobile.mk
|
||||
@@ -10,12 +10,16 @@ PRODUCT_PRODUCT_PROPERTIES += \
|
||||
PRODUCT_PACKAGES += \
|
||||
Aperture \
|
||||
Backgrounds \
|
||||
+ Contacts \
|
||||
+ DeskClock \
|
||||
Eleven \
|
||||
Etar \
|
||||
ExactCalculator \
|
||||
+ Gallery2 \
|
||||
Jelly \
|
||||
Profiles \
|
||||
- Seedvault
|
||||
+ Seedvault \
|
||||
+ frameworks-base-overlays
|
||||
|
||||
ifneq ($(TARGET_EXCLUDES_AUDIOFX),true)
|
||||
PRODUCT_PACKAGES += \
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
From 60803f4939a1df05b7c29925a987efe7e899ba7c Mon Sep 17 00:00:00 2001
|
||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||
Date: Tue, 19 Oct 2021 15:48:43 +0000
|
||||
Subject: [PATCH 2/2] vendor_lineage: Disable ADB authentication
|
||||
|
||||
Change-Id: I4370583ecab1c88ef6f42e29d3eaa52c24d13f09
|
||||
---
|
||||
config/common.mk | 5 -----
|
||||
1 file changed, 5 deletions(-)
|
||||
|
||||
diff --git a/config/common.mk b/config/common.mk
|
||||
index 52a4bfd4..a57536c3 100644
|
||||
--- a/config/common.mk
|
||||
+++ b/config/common.mk
|
||||
@@ -13,16 +13,11 @@ PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
|
||||
ro.com.google.clientidbase=$(PRODUCT_GMS_CLIENTID_BASE)
|
||||
endif
|
||||
|
||||
-ifeq ($(TARGET_BUILD_VARIANT),eng)
|
||||
# Disable ADB authentication
|
||||
PRODUCT_SYSTEM_DEFAULT_PROPERTIES += ro.adb.secure=0
|
||||
-else
|
||||
-# Enable ADB authentication
|
||||
-PRODUCT_SYSTEM_DEFAULT_PROPERTIES += ro.adb.secure=1
|
||||
|
||||
# Disable extra StrictMode features on all non-engineering builds
|
||||
PRODUCT_SYSTEM_DEFAULT_PROPERTIES += persist.sys.strictmode.disable=true
|
||||
-endif
|
||||
|
||||
# Backup Tool
|
||||
PRODUCT_COPY_FILES += \
|
||||
--
|
||||
2.25.1
|
||||
|
||||
Reference in New Issue
Block a user