Compare commits
No commits in common. "lineage-21-td" and "lineage-21-light" have entirely different histories.
lineage-21
...
lineage-21
@ -1,8 +1,7 @@
|
|||||||
From 0cbe25143ccc28bd13d85cd2c01cbb9ac6cf9be4 Mon Sep 17 00:00:00 2001
|
From ac39cb00a04c571699df695ce0d144d8cb386f35 Mon Sep 17 00:00:00 2001
|
||||||
From: Pierre-Hugues Husson <phh@phh.me>
|
From: Pierre-Hugues Husson <phh@phh.me>
|
||||||
Date: Sat, 19 Feb 2022 08:20:25 -0500
|
Date: Sat, 19 Feb 2022 08:20:25 -0500
|
||||||
Subject: [PATCH 2/2] Add new mechanism to fake vendor props on a per-process
|
Subject: [PATCH] Add new mechanism to fake vendor props on a per-process basis
|
||||||
basis
|
|
||||||
|
|
||||||
This reads debug.phh.props.<process name>. If its value is "vendor",
|
This reads debug.phh.props.<process name>. If its value is "vendor",
|
||||||
then ro.product.device/ro.product.manufacturer is read from vendor
|
then ro.product.device/ro.product.manufacturer is read from vendor
|
||||||
@ -132,5 +131,5 @@ index 9dd5e35ce..886bef127 100644
|
|||||||
|
|
||||||
static bool is_appcompat_override(const char* name) {
|
static bool is_appcompat_override(const char* name) {
|
||||||
--
|
--
|
||||||
2.25.1
|
2.34.1
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
From 8c656a5c6d12c62d767ba210823db70cec5224b0 Mon Sep 17 00:00:00 2001
|
From 32c4d23814d4b387226dd4b4abae04663f89afbe Mon Sep 17 00:00:00 2001
|
||||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||||
Date: Wed, 8 Dec 2021 07:04:53 +0000
|
Date: Wed, 8 Dec 2021 07:04:53 +0000
|
||||||
Subject: [PATCH] Remove init.vndk-nodef.rc
|
Subject: [PATCH] Remove init.vndk-nodef.rc
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,23 +0,0 @@
|
|||||||
From ca0a29e2a10704398ef98db53ea472c70e6d2df5 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
|
||||||
Date: Sun, 8 Aug 2021 09:29:32 +0000
|
|
||||||
Subject: [PATCH 2/7] treble: Set BOARD_EXT4_SHARE_DUP_BLOCKS explicitly
|
|
||||||
|
|
||||||
Change-Id: I725443154fabde548d2e6c1b072d34c27596c421
|
|
||||||
---
|
|
||||||
board-base.mk | 2 ++
|
|
||||||
1 file changed, 2 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/board-base.mk b/board-base.mk
|
|
||||||
index 2cb5dbc..e493d1c 100644
|
|
||||||
--- a/board-base.mk
|
|
||||||
+++ b/board-base.mk
|
|
||||||
@@ -10,3 +10,5 @@ BOARD_ROOT_EXTRA_FOLDERS += bt_firmware sec_storage efs persist
|
|
||||||
BUILD_BROKEN_ELF_PREBUILT_PRODUCT_COPY_FILES := true
|
|
||||||
|
|
||||||
BOARD_ROOT_EXTRA_SYMLINKS := $(filter-out $(BOARD_ROOT_EXTRA_SYMLINKS),/mnt/vendor/persist:/persist)
|
|
||||||
+
|
|
||||||
+BOARD_EXT4_SHARE_DUP_BLOCKS := true
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
@ -1,25 +0,0 @@
|
|||||||
From 8bfd515e29aa6998c95326afcd7b9212bc50e855 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
|
||||||
Date: Wed, 20 Oct 2021 11:30:25 +0000
|
|
||||||
Subject: [PATCH 3/7] treble: Set TARGET_NO_KERNEL_OVERRIDE
|
|
||||||
|
|
||||||
Taken from Lineage generic targets - skips building kernel cleanly
|
|
||||||
|
|
||||||
Change-Id: Id71d3a3aed56fd4e815a64ef4191b125fc5026ce
|
|
||||||
---
|
|
||||||
board-base.mk | 2 ++
|
|
||||||
1 file changed, 2 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/board-base.mk b/board-base.mk
|
|
||||||
index e493d1c..9d1d45e 100644
|
|
||||||
--- a/board-base.mk
|
|
||||||
+++ b/board-base.mk
|
|
||||||
@@ -12,3 +12,5 @@ BUILD_BROKEN_ELF_PREBUILT_PRODUCT_COPY_FILES := true
|
|
||||||
BOARD_ROOT_EXTRA_SYMLINKS := $(filter-out $(BOARD_ROOT_EXTRA_SYMLINKS),/mnt/vendor/persist:/persist)
|
|
||||||
|
|
||||||
BOARD_EXT4_SHARE_DUP_BLOCKS := true
|
|
||||||
+
|
|
||||||
+TARGET_NO_KERNEL_OVERRIDE := true
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
@ -1,40 +0,0 @@
|
|||||||
From 2171319d09fd6681683c2fbb8841ff00589e826c Mon Sep 17 00:00:00 2001
|
|
||||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
|
||||||
Date: Tue, 11 Oct 2022 11:29:02 +0000
|
|
||||||
Subject: [PATCH 4/7] treble: Enable call recording
|
|
||||||
|
|
||||||
Change-Id: I57ca3604363547419a566b37b5151b6b30c46d28
|
|
||||||
---
|
|
||||||
.../dialer/callrecord/res/values/config.xml | 20 +++++++++++++++++++
|
|
||||||
1 file changed, 20 insertions(+)
|
|
||||||
create mode 100644 overlay-lineage/packages/apps/Dialer/java/com/android/dialer/callrecord/res/values/config.xml
|
|
||||||
|
|
||||||
diff --git a/overlay-lineage/packages/apps/Dialer/java/com/android/dialer/callrecord/res/values/config.xml b/overlay-lineage/packages/apps/Dialer/java/com/android/dialer/callrecord/res/values/config.xml
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000..4cacde5
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/overlay-lineage/packages/apps/Dialer/java/com/android/dialer/callrecord/res/values/config.xml
|
|
||||||
@@ -0,0 +1,20 @@
|
|
||||||
+<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
+<!--
|
|
||||||
+ Copyright (C) 2021 The LineageOS Project
|
|
||||||
+
|
|
||||||
+ Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
+ you may not use this file except in compliance with the License.
|
|
||||||
+ You may obtain a copy of the License at
|
|
||||||
+
|
|
||||||
+ http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
+
|
|
||||||
+ Unless required by applicable law or agreed to in writing, software
|
|
||||||
+ distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
+ See the License for the specific language governing permissions and
|
|
||||||
+ limitations under the License.
|
|
||||||
+-->
|
|
||||||
+<resources>
|
|
||||||
+ <bool name="call_recording_enabled">true</bool>
|
|
||||||
+ <integer name="call_recording_audio_source">4</integer>
|
|
||||||
+</resources>
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
@ -1,46 +0,0 @@
|
|||||||
From 2f8779cb2631ddff20e81d56b4a1a7c0ec46fb19 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
|
||||||
Date: Sat, 5 Nov 2022 23:49:11 +0000
|
|
||||||
Subject: [PATCH 5/7] treble: Switch to MindTheGapps
|
|
||||||
|
|
||||||
Change-Id: I1b80d4c5176cbf4af21d147c71b0abce6027c7c7
|
|
||||||
---
|
|
||||||
generate.sh | 13 +++++++------
|
|
||||||
1 file changed, 7 insertions(+), 6 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/generate.sh b/generate.sh
|
|
||||||
index 3527159..0bd6556 100644
|
|
||||||
--- a/generate.sh
|
|
||||||
+++ b/generate.sh
|
|
||||||
@@ -24,9 +24,15 @@ for part in a ab;do
|
|
||||||
extra_packages=""
|
|
||||||
vndk="vndk.mk"
|
|
||||||
optional_base=""
|
|
||||||
+
|
|
||||||
+ baseArch="$arch"
|
|
||||||
+ if [ "$arch" = "a64" ];then
|
|
||||||
+ baseArch="arm"
|
|
||||||
+ fi
|
|
||||||
+
|
|
||||||
if [ "$apps" == "gapps" ];then
|
|
||||||
apps_suffix="g"
|
|
||||||
- apps_script='$(call inherit-product, device/phh/treble/gapps.mk)'
|
|
||||||
+ apps_script='$(call inherit-product, vendor/gapps/'$baseArch'/'$baseArch'-vendor.mk)'
|
|
||||||
apps_name="with GApps"
|
|
||||||
fi
|
|
||||||
if [ "$apps" == "gapps-go" ];then
|
|
||||||
@@ -66,11 +72,6 @@ for part in a ab;do
|
|
||||||
|
|
||||||
target="lineage_${arch}_${part_suffix}${apps_suffix}${su_suffix}"
|
|
||||||
|
|
||||||
- baseArch="$arch"
|
|
||||||
- if [ "$arch" = "a64" ];then
|
|
||||||
- baseArch="arm"
|
|
||||||
- fi
|
|
||||||
-
|
|
||||||
zygote=32
|
|
||||||
if [ "$arch" = "arm64" ];then
|
|
||||||
zygote=64_32
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
@ -1,166 +0,0 @@
|
|||||||
From 6049d780bfdddc2d11a0b3f1bca6b6de6a761ed5 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
|
||||||
Date: Mon, 15 Jul 2024 22:30:54 +0800
|
|
||||||
Subject: [PATCH 7/7] treble: Remove Securize (1/2)
|
|
||||||
|
|
||||||
Leave this Play Integrity mess to the professionals
|
|
||||||
|
|
||||||
Change-Id: Ic4ef0512d8b555b85e7497464a07913101fcc819
|
|
||||||
---
|
|
||||||
base.mk | 1 -
|
|
||||||
files/ota.sh | 3 ---
|
|
||||||
phh-securize.sh | 38 -----------------------------
|
|
||||||
rw-system.sh | 63 ++++++-------------------------------------------
|
|
||||||
4 files changed, 7 insertions(+), 98 deletions(-)
|
|
||||||
delete mode 100644 phh-securize.sh
|
|
||||||
|
|
||||||
diff --git a/base.mk b/base.mk
|
|
||||||
index 1c2fe3d..dea8d2d 100644
|
|
||||||
--- a/base.mk
|
|
||||||
+++ b/base.mk
|
|
||||||
@@ -178,7 +178,6 @@ PRODUCT_PACKAGES += \
|
|
||||||
resetprop_phh
|
|
||||||
|
|
||||||
PRODUCT_COPY_FILES += \
|
|
||||||
- device/phh/treble/phh-securize.sh:system/bin/phh-securize.sh \
|
|
||||||
device/phh/treble/files/ota.sh:system/bin/ota.sh \
|
|
||||||
|
|
||||||
PRODUCT_COPY_FILES += \
|
|
||||||
diff --git a/files/ota.sh b/files/ota.sh
|
|
||||||
index a43ce81..78fea95 100644
|
|
||||||
--- a/files/ota.sh
|
|
||||||
+++ b/files/ota.sh
|
|
||||||
@@ -8,9 +8,6 @@ if ! [ "$(getprop ro.boot.dynamic_partitions)" = true ];then
|
|
||||||
fi
|
|
||||||
|
|
||||||
flavor=$(getprop ro.product.product.name)
|
|
||||||
-if [ -f /system/phh/secure ];then
|
|
||||||
- flavor=${flavor}-secure
|
|
||||||
-fi
|
|
||||||
nextVersion=$(curl --silent -L https://raw.githubusercontent.com/phhusson/treble_experimentations/master/ota/squeak/$flavor/date)
|
|
||||||
if [ -z "$nextVersion" ];then
|
|
||||||
echo "Couldn't find any OTA for $flavor"
|
|
||||||
diff --git a/phh-securize.sh b/phh-securize.sh
|
|
||||||
deleted file mode 100644
|
|
||||||
index 80b46d7..0000000
|
|
||||||
--- a/phh-securize.sh
|
|
||||||
+++ /dev/null
|
|
||||||
@@ -1,38 +0,0 @@
|
|
||||||
-#!/system/bin/sh
|
|
||||||
-
|
|
||||||
-if [ -e /system/bin/magisk ]
|
|
||||||
-then
|
|
||||||
- # remove bind-mount of phh-su overriding /system/bin/su -> ./magisk
|
|
||||||
- umount -l /system/bin/magisk
|
|
||||||
- # we need to modify the real system partition
|
|
||||||
- MAGISK_MIRROR="$(magisk --path)/.magisk/mirror"
|
|
||||||
- SYSTEM=$MAGISK_MIRROR/system
|
|
||||||
- MOUNTPOINT_LIST="$MAGISK_MIRROR/system_root $MAGISK_MIRROR/system"
|
|
||||||
-else
|
|
||||||
- SYSTEM=/system
|
|
||||||
- MOUNTPOINT_LIST="/system /"
|
|
||||||
-fi
|
|
||||||
-
|
|
||||||
-# remove bind-mount of phh-su (preventing $SYSTEM/xbin/su to be removed)
|
|
||||||
-umount -l /system/xbin/su
|
|
||||||
-
|
|
||||||
-for MOUNTPOINT in $MOUNTPOINT_LIST
|
|
||||||
-do
|
|
||||||
- [ -d $MOUNTPOINT ] && mountpoint -q $MOUNTPOINT && break
|
|
||||||
-done
|
|
||||||
-
|
|
||||||
-mount -o remount,rw $MOUNTPOINT
|
|
||||||
-remount
|
|
||||||
-
|
|
||||||
-touch $SYSTEM/phh/secure
|
|
||||||
-rm $SYSTEM/xbin/su
|
|
||||||
-rm $SYSTEM/bin/phh-su
|
|
||||||
-rm $SYSTEM/etc/init/su.rc
|
|
||||||
-rm $SYSTEM/bin/phh-securize.sh
|
|
||||||
-rm -Rf $SYSTEM/{app,priv-app}/me.phh.superuser/
|
|
||||||
-rm -Rf /data/su || true
|
|
||||||
-mount -o remount,ro $MOUNTPOINT
|
|
||||||
-sync
|
|
||||||
-mkdir /metadata/phh
|
|
||||||
-touch /metadata/phh/secure
|
|
||||||
-reboot
|
|
||||||
diff --git a/rw-system.sh b/rw-system.sh
|
|
||||||
index 3ddfdda..7546fae 100644
|
|
||||||
--- a/rw-system.sh
|
|
||||||
+++ b/rw-system.sh
|
|
||||||
@@ -779,65 +779,16 @@ copyprop() {
|
|
||||||
resetprop_phh "$1" "$(getprop "$2")"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
-if [ -f /system/phh/secure ] || [ -f /metadata/phh/secure ];then
|
|
||||||
- copyprop ro.build.device ro.vendor.build.device
|
|
||||||
- copyprop ro.system.build.fingerprint ro.vendor.build.fingerprint
|
|
||||||
- copyprop ro.bootimage.build.fingerprint ro.vendor.build.fingerprint
|
|
||||||
- copyprop ro.build.fingerprint ro.vendor.build.fingerprint
|
|
||||||
- copyprop ro.build.device ro.vendor.product.device
|
|
||||||
- copyprop ro.product.system.device ro.vendor.product.device
|
|
||||||
- copyprop ro.product.device ro.vendor.product.device
|
|
||||||
- copyprop ro.product.system.device ro.product.vendor.device
|
|
||||||
- copyprop ro.product.device ro.product.vendor.device
|
|
||||||
- copyprop ro.product.system.name ro.vendor.product.name
|
|
||||||
- copyprop ro.product.name ro.vendor.product.name
|
|
||||||
- copyprop ro.product.system.name ro.product.vendor.device
|
|
||||||
- copyprop ro.product.name ro.product.vendor.device
|
|
||||||
- copyprop ro.system.product.brand ro.vendor.product.brand
|
|
||||||
- copyprop ro.product.brand ro.vendor.product.brand
|
|
||||||
- copyprop ro.product.system.model ro.vendor.product.model
|
|
||||||
- copyprop ro.product.model ro.vendor.product.model
|
|
||||||
- copyprop ro.product.system.model ro.product.vendor.model
|
|
||||||
- copyprop ro.product.model ro.product.vendor.model
|
|
||||||
- copyprop ro.build.product ro.vendor.product.model
|
|
||||||
- copyprop ro.build.product ro.product.vendor.model
|
|
||||||
- copyprop ro.system.product.manufacturer ro.vendor.product.manufacturer
|
|
||||||
- copyprop ro.product.manufacturer ro.vendor.product.manufacturer
|
|
||||||
- copyprop ro.system.product.manufacturer ro.product.vendor.manufacturer
|
|
||||||
- copyprop ro.product.manufacturer ro.product.vendor.manufacturer
|
|
||||||
- (getprop ro.vendor.build.security_patch; getprop ro.keymaster.xxx.security_patch) |sort |tail -n 1 |while read v;do
|
|
||||||
- [ -n "$v" ] && resetprop_phh ro.build.version.security_patch "$v"
|
|
||||||
- done
|
|
||||||
|
|
||||||
- resetprop_phh ro.build.tags release-keys
|
|
||||||
- resetprop_phh ro.boot.vbmeta.device_state locked
|
|
||||||
- resetprop_phh ro.boot.verifiedbootstate green
|
|
||||||
- resetprop_phh ro.boot.flash.locked 1
|
|
||||||
- resetprop_phh ro.boot.veritymode enforcing
|
|
||||||
- resetprop_phh ro.boot.warranty_bit 0
|
|
||||||
- resetprop_phh ro.warranty_bit 0
|
|
||||||
- resetprop_phh ro.debuggable 0
|
|
||||||
- resetprop_phh ro.secure 1
|
|
||||||
- resetprop_phh ro.build.type user
|
|
||||||
- resetprop_phh --delete ro.build.selinux
|
|
||||||
-
|
|
||||||
- resetprop_phh ro.adb.secure 1
|
|
||||||
-
|
|
||||||
- # Hide system/xbin/su
|
|
||||||
- mount /mnt/phh/empty_dir /system/xbin
|
|
||||||
- mount /mnt/phh/empty_dir /system/app/me.phh.superuser
|
|
||||||
- mount /system/phh/empty /system/xbin/phh-su
|
|
||||||
-else
|
|
||||||
- mkdir /mnt/phh/xbin
|
|
||||||
- chmod 0755 /mnt/phh/xbin
|
|
||||||
- chcon u:object_r:system_file:s0 /mnt/phh/xbin
|
|
||||||
+mkdir /mnt/phh/xbin
|
|
||||||
+chmod 0755 /mnt/phh/xbin
|
|
||||||
+chcon u:object_r:system_file:s0 /mnt/phh/xbin
|
|
||||||
|
|
||||||
- #phh-su will bind over this empty file to make a real su
|
|
||||||
- touch /mnt/phh/xbin/su
|
|
||||||
- chcon u:object_r:system_file:s0 /mnt/phh/xbin/su
|
|
||||||
+#phh-su will bind over this empty file to make a real su
|
|
||||||
+touch /mnt/phh/xbin/su
|
|
||||||
+chcon u:object_r:system_file:s0 /mnt/phh/xbin/su
|
|
||||||
|
|
||||||
- mount -o bind /mnt/phh/xbin /system/xbin
|
|
||||||
-fi
|
|
||||||
+mount -o bind /mnt/phh/xbin /system/xbin
|
|
||||||
|
|
||||||
for abi in "" 64;do
|
|
||||||
f=/vendor/lib$abi/libstagefright_foundation.so
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
|||||||
From 0c66c0bf51f8edb8b880e9d15594befe9ead217c Mon Sep 17 00:00:00 2001
|
From c92b1e40a795bf844c6347b454403cc26ff3fbce Mon Sep 17 00:00:00 2001
|
||||||
From: Peter Cai <peter@typeblog.net>
|
From: Peter Cai <peter@typeblog.net>
|
||||||
Date: Thu, 18 Aug 2022 15:44:46 -0400
|
Date: Thu, 18 Aug 2022 15:44:46 -0400
|
||||||
Subject: [PATCH 01/24] APM: Restore S, R and Q behavior respectively for
|
Subject: [PATCH 1/3] APM: Restore S, R and Q behavior respectively for
|
||||||
telephony audio
|
telephony audio
|
||||||
|
|
||||||
This conditionally reverts part of b2e5cb (T), 51c9cc (S) and afd4ce (R)
|
This conditionally reverts part of b2e5cb (T), 51c9cc (S) and afd4ce (R)
|
||||||
@ -36,10 +36,10 @@ Change-Id: I56d36d2aef4319935cb88a3e4771b23c6d5b2145
|
|||||||
2 files changed, 147 insertions(+), 62 deletions(-)
|
2 files changed, 147 insertions(+), 62 deletions(-)
|
||||||
|
|
||||||
diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
|
diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
|
||||||
index 3bebb1134a..1823522fe2 100644
|
index 135548fb9c..fc99bdbd78 100644
|
||||||
--- a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
|
--- a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
|
||||||
+++ b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
|
+++ b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
|
||||||
@@ -699,6 +699,17 @@ status_t AudioPolicyManager::updateCallRoutingInternal(
|
@@ -692,6 +692,17 @@ status_t AudioPolicyManager::updateCallRoutingInternal(
|
||||||
ALOGV("%s device rxDevice %s txDevice %s", __func__,
|
ALOGV("%s device rxDevice %s txDevice %s", __func__,
|
||||||
rxDevices.itemAt(0)->toString().c_str(), txSourceDevice->toString().c_str());
|
rxDevices.itemAt(0)->toString().c_str(), txSourceDevice->toString().c_str());
|
||||||
|
|
||||||
@ -57,7 +57,7 @@ index 3bebb1134a..1823522fe2 100644
|
|||||||
auto telephonyRxModule =
|
auto telephonyRxModule =
|
||||||
mHwModules.getModuleForDeviceType(AUDIO_DEVICE_IN_TELEPHONY_RX, AUDIO_FORMAT_DEFAULT);
|
mHwModules.getModuleForDeviceType(AUDIO_DEVICE_IN_TELEPHONY_RX, AUDIO_FORMAT_DEFAULT);
|
||||||
auto telephonyTxModule =
|
auto telephonyTxModule =
|
||||||
@@ -721,9 +732,20 @@ status_t AudioPolicyManager::updateCallRoutingInternal(
|
@@ -714,9 +725,20 @@ status_t AudioPolicyManager::updateCallRoutingInternal(
|
||||||
ALOGE("%s() no telephony Tx and/or RX device", __func__);
|
ALOGE("%s() no telephony Tx and/or RX device", __func__);
|
||||||
return INVALID_OPERATION;
|
return INVALID_OPERATION;
|
||||||
}
|
}
|
||||||
@ -81,7 +81,7 @@ index 3bebb1134a..1823522fe2 100644
|
|||||||
} else {
|
} else {
|
||||||
// If the RX device is on the primary HW module, then use legacy routing method for
|
// If the RX device is on the primary HW module, then use legacy routing method for
|
||||||
// voice calls via setOutputDevice() on primary output.
|
// voice calls via setOutputDevice() on primary output.
|
||||||
@@ -744,7 +766,14 @@ status_t AudioPolicyManager::updateCallRoutingInternal(
|
@@ -737,7 +759,14 @@ status_t AudioPolicyManager::updateCallRoutingInternal(
|
||||||
}
|
}
|
||||||
muteWaitMs = setOutputDevices(__func__, mPrimaryOutput, rxDevices, true, delayMs);
|
muteWaitMs = setOutputDevices(__func__, mPrimaryOutput, rxDevices, true, delayMs);
|
||||||
} else { // create RX path audio patch
|
} else { // create RX path audio patch
|
||||||
@ -97,7 +97,7 @@ index 3bebb1134a..1823522fe2 100644
|
|||||||
// If the TX device is on the primary HW module but RX device is
|
// 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
|
// on other HW module, SinkMetaData of telephony input should handle it
|
||||||
// assuming the device uses audio HAL V5.0 and above
|
// assuming the device uses audio HAL V5.0 and above
|
||||||
@@ -759,7 +788,12 @@ status_t AudioPolicyManager::updateCallRoutingInternal(
|
@@ -752,7 +781,12 @@ status_t AudioPolicyManager::updateCallRoutingInternal(
|
||||||
closeActiveClients(activeDesc);
|
closeActiveClients(activeDesc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -111,7 +111,7 @@ index 3bebb1134a..1823522fe2 100644
|
|||||||
}
|
}
|
||||||
if (waitMs != nullptr) {
|
if (waitMs != nullptr) {
|
||||||
*waitMs = muteWaitMs;
|
*waitMs = muteWaitMs;
|
||||||
@@ -767,6 +801,36 @@ status_t AudioPolicyManager::updateCallRoutingInternal(
|
@@ -760,6 +794,36 @@ status_t AudioPolicyManager::updateCallRoutingInternal(
|
||||||
return NO_ERROR;
|
return NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -148,7 +148,7 @@ index 3bebb1134a..1823522fe2 100644
|
|||||||
bool AudioPolicyManager::isDeviceOfModule(
|
bool AudioPolicyManager::isDeviceOfModule(
|
||||||
const sp<DeviceDescriptor>& devDesc, const char *moduleId) const {
|
const sp<DeviceDescriptor>& devDesc, const char *moduleId) const {
|
||||||
sp<HwModule> module = mHwModules.getModuleFromName(moduleId);
|
sp<HwModule> module = mHwModules.getModuleFromName(moduleId);
|
||||||
@@ -5192,83 +5256,101 @@ status_t AudioPolicyManager::createAudioPatchInternal(const struct audio_patch *
|
@@ -5087,83 +5151,101 @@ status_t AudioPolicyManager::createAudioPatchInternal(const struct audio_patch *
|
||||||
// in config XML to reach the sink so that is can be declared as available.
|
// in config XML to reach the sink so that is can be declared as available.
|
||||||
audio_io_handle_t output = AUDIO_IO_HANDLE_NONE;
|
audio_io_handle_t output = AUDIO_IO_HANDLE_NONE;
|
||||||
sp<SwAudioOutputDescriptor> outputDesc;
|
sp<SwAudioOutputDescriptor> outputDesc;
|
||||||
@ -308,10 +308,10 @@ index 3bebb1134a..1823522fe2 100644
|
|||||||
AUDIO_STREAM_PATCH;
|
AUDIO_STREAM_PATCH;
|
||||||
patchBuilder.addSource(srcMixPortConfig);
|
patchBuilder.addSource(srcMixPortConfig);
|
||||||
diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.h b/services/audiopolicy/managerdefault/AudioPolicyManager.h
|
diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.h b/services/audiopolicy/managerdefault/AudioPolicyManager.h
|
||||||
index a3232a2d40..cc2cf50688 100644
|
index a1c8f6202c..ee1b595e30 100644
|
||||||
--- a/services/audiopolicy/managerdefault/AudioPolicyManager.h
|
--- a/services/audiopolicy/managerdefault/AudioPolicyManager.h
|
||||||
+++ b/services/audiopolicy/managerdefault/AudioPolicyManager.h
|
+++ b/services/audiopolicy/managerdefault/AudioPolicyManager.h
|
||||||
@@ -980,6 +980,9 @@ protected:
|
@@ -964,6 +964,9 @@ protected:
|
||||||
|
|
||||||
SoundTriggerSessionCollection mSoundTriggerSessions;
|
SoundTriggerSessionCollection mSoundTriggerSessions;
|
||||||
|
|
@ -1,7 +1,7 @@
|
|||||||
From 3708bb8a7cba3be95a53d3afad8f4a502b366ae6 Mon Sep 17 00:00:00 2001
|
From ae67c8f78aee3c99ee2c9a8da964ad7b5a0cf30d Mon Sep 17 00:00:00 2001
|
||||||
From: Peter Cai <peter@typeblog.net>
|
From: Peter Cai <peter@typeblog.net>
|
||||||
Date: Wed, 24 Aug 2022 15:42:39 -0400
|
Date: Wed, 24 Aug 2022 15:42:39 -0400
|
||||||
Subject: [PATCH 04/24] APM: Optionally force-load audio policy for system-side
|
Subject: [PATCH 2/3] APM: Optionally force-load audio policy for system-side
|
||||||
bt audio HAL
|
bt audio HAL
|
||||||
|
|
||||||
Required to support our system-side bt audio implementation, i.e.
|
Required to support our system-side bt audio implementation, i.e.
|
||||||
@ -14,7 +14,7 @@ Change-Id: I279fff541a531f922f3fa55b8f14d00237db59ff
|
|||||||
1 file changed, 25 insertions(+)
|
1 file changed, 25 insertions(+)
|
||||||
|
|
||||||
diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||||
index 1ab472f396..29d36ca00b 100644
|
index 6f19a7a145..08836377b7 100644
|
||||||
--- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
--- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||||
+++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
+++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||||
@@ -25,6 +25,7 @@
|
@@ -25,6 +25,7 @@
|
||||||
@ -25,7 +25,7 @@ index 1ab472f396..29d36ca00b 100644
|
|||||||
#include <utils/Log.h>
|
#include <utils/Log.h>
|
||||||
#include <utils/StrongPointer.h>
|
#include <utils/StrongPointer.h>
|
||||||
#include <utils/Errors.h>
|
#include <utils/Errors.h>
|
||||||
@@ -988,6 +989,30 @@ status_t PolicySerializer::deserialize(const char *configFile, AudioPolicyConfig
|
@@ -895,6 +896,30 @@ status_t PolicySerializer::deserialize(const char *configFile, AudioPolicyConfig
|
||||||
if (status != NO_ERROR) {
|
if (status != NO_ERROR) {
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
@ -1,7 +1,7 @@
|
|||||||
From 70ede12fd7215948067cf687613d3eedeb57e073 Mon Sep 17 00:00:00 2001
|
From 33f3d337016bfbc4a7836b504c5baf8ad9130a45 Mon Sep 17 00:00:00 2001
|
||||||
From: Peter Cai <peter@typeblog.net>
|
From: Peter Cai <peter@typeblog.net>
|
||||||
Date: Thu, 25 Aug 2022 13:30:29 -0400
|
Date: Thu, 25 Aug 2022 13:30:29 -0400
|
||||||
Subject: [PATCH 05/24] APM: Remove A2DP audio ports from the primary HAL
|
Subject: [PATCH 3/3] APM: Remove A2DP audio ports from the primary HAL
|
||||||
|
|
||||||
These ports defined in the primary HAL are intended for A2DP offloading,
|
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
|
however they do not work in general on GSIs, and will interfere with
|
||||||
@ -16,7 +16,7 @@ Change-Id: I3305594a17285da113167b419543543f0ef71122
|
|||||||
1 file changed, 22 insertions(+), 4 deletions(-)
|
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
|
diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||||
index 29d36ca00b..839974b9d3 100644
|
index 08836377b7..0f7c903909 100644
|
||||||
--- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
--- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||||
+++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
+++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||||
@@ -26,6 +26,7 @@
|
@@ -26,6 +26,7 @@
|
||||||
@ -40,7 +40,7 @@ index 29d36ca00b..839974b9d3 100644
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!xmlStrcmp(cur->name, reinterpret_cast<const xmlChar*>(Trait::tag))) {
|
if (!xmlStrcmp(cur->name, reinterpret_cast<const xmlChar*>(Trait::tag))) {
|
||||||
@@ -775,6 +773,7 @@ std::variant<status_t, ModuleTraits::Element> PolicySerializer::deserialize<Modu
|
@@ -683,6 +681,7 @@ std::variant<status_t, ModuleTraits::Element> PolicySerializer::deserialize<Modu
|
||||||
ALOGE("%s: No %s found", __func__, Attributes::name);
|
ALOGE("%s: No %s found", __func__, Attributes::name);
|
||||||
return BAD_VALUE;
|
return BAD_VALUE;
|
||||||
}
|
}
|
||||||
@ -48,7 +48,7 @@ index 29d36ca00b..839974b9d3 100644
|
|||||||
uint32_t versionMajor = 0, versionMinor = 0;
|
uint32_t versionMajor = 0, versionMinor = 0;
|
||||||
std::string versionLiteral = getXmlAttribute(cur, Attributes::version);
|
std::string versionLiteral = getXmlAttribute(cur, Attributes::version);
|
||||||
if (!versionLiteral.empty()) {
|
if (!versionLiteral.empty()) {
|
||||||
@@ -800,6 +799,25 @@ std::variant<status_t, ModuleTraits::Element> PolicySerializer::deserialize<Modu
|
@@ -708,6 +707,25 @@ std::variant<status_t, ModuleTraits::Element> PolicySerializer::deserialize<Modu
|
||||||
if (status != NO_ERROR) {
|
if (status != NO_ERROR) {
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
@ -1,7 +1,7 @@
|
|||||||
From 4765587bd7258f49fd56bd3c41c79bd402290ef5 Mon Sep 17 00:00:00 2001
|
From 019df05a5d610f34f167195a2b69228e99160d6c Mon Sep 17 00:00:00 2001
|
||||||
From: Pierre-Hugues Husson <phh@phh.me>
|
From: Pierre-Hugues Husson <phh@phh.me>
|
||||||
Date: Sun, 25 Oct 2020 23:57:26 +0100
|
Date: Sun, 25 Oct 2020 23:57:26 +0100
|
||||||
Subject: [PATCH 14/51] Re-implement fnmatch-like behaviour for RRO java-side
|
Subject: [PATCH 1/6] Re-implement fnmatch-like behaviour for RRO java-side
|
||||||
|
|
||||||
T: Also apply to FrameworkParsingPackageUtils (@PeterCxy)
|
T: Also apply to FrameworkParsingPackageUtils (@PeterCxy)
|
||||||
|
|
@ -0,0 +1,46 @@
|
|||||||
|
From f2b671435968f7693c6950d58ee06b42c1f38aef 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/6] 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 76cf1348d313..91c3c32fe835 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.Looper;
|
||||||
|
import android.os.PermissionEnforcer;
|
||||||
|
import android.os.RemoteException;
|
||||||
|
import android.os.ServiceManager;
|
||||||
|
+import android.os.SystemProperties;
|
||||||
|
import android.os.Trace;
|
||||||
|
import android.provider.Settings;
|
||||||
|
import android.util.Slog;
|
||||||
|
@@ -298,6 +299,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.34.1
|
||||||
|
|
@ -1,7 +1,7 @@
|
|||||||
From d5427d078f946fc8b98cf2b6cfc882b44fbd2b85 Mon Sep 17 00:00:00 2001
|
From 5c06aad5517951b1b4f7dcdfb3089d4e147d5d53 Mon Sep 17 00:00:00 2001
|
||||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||||
Date: Sat, 15 Oct 2022 09:33:56 +0000
|
Date: Sat, 15 Oct 2022 09:33:56 +0000
|
||||||
Subject: [PATCH 26/51] Revert "Remove more FDE methods from StorageManager"
|
Subject: [PATCH 3/6] Revert "Remove more FDE methods from StorageManager"
|
||||||
|
|
||||||
This reverts commit bd13f84152449a3ead6fa8604fd31f48c0224676.
|
This reverts commit bd13f84152449a3ead6fa8604fd31f48c0224676.
|
||||||
|
|
@ -1,7 +1,7 @@
|
|||||||
From 307ac5b06deb7a70f05c8a2bd738ef11876f221a Mon Sep 17 00:00:00 2001
|
From b1f7c0a4d99d3b14d143980af414d2adca441a4f Mon Sep 17 00:00:00 2001
|
||||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||||
Date: Wed, 2 Aug 2023 20:59:53 +0800
|
Date: Wed, 2 Aug 2023 20:59:53 +0800
|
||||||
Subject: [PATCH 32/51] Restore getSimStateForSlotIndex in SubscriptionManager
|
Subject: [PATCH 4/6] Restore getSimStateForSlotIndex in SubscriptionManager
|
||||||
|
|
||||||
MTK IMS still needs it here
|
MTK IMS still needs it here
|
||||||
|
|
@ -0,0 +1,88 @@
|
|||||||
|
From 4b4182708a6c183a52f5459d357f341ea6c99e1b Mon Sep 17 00:00:00 2001
|
||||||
|
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||||
|
Date: Sun, 19 Nov 2023 23:07:03 +0800
|
||||||
|
Subject: [PATCH 5/6] Restore getPhysicalDisplayIds in SurfaceControl
|
||||||
|
|
||||||
|
For convenience of accessing DynamicDisplayInfo from Settings
|
||||||
|
Copy over the updated implementation from DisplayControl while we're at it
|
||||||
|
|
||||||
|
This partially reverts commit e2f333728788ad88a65208a6119aed90e13e7040.
|
||||||
|
|
||||||
|
Change-Id: Ie056ecaf76acbc70d73e1c26cc4542088fcda18d
|
||||||
|
---
|
||||||
|
core/java/android/view/SurfaceControl.java | 8 ++++++++
|
||||||
|
core/jni/android_view_SurfaceControl.cpp | 18 ++++++++++++++++++
|
||||||
|
2 files changed, 26 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/core/java/android/view/SurfaceControl.java b/core/java/android/view/SurfaceControl.java
|
||||||
|
index eff35c0c0f03..5cc1d0817688 100644
|
||||||
|
--- a/core/java/android/view/SurfaceControl.java
|
||||||
|
+++ b/core/java/android/view/SurfaceControl.java
|
||||||
|
@@ -176,6 +176,7 @@ public final class SurfaceControl implements Parcelable {
|
||||||
|
private static native boolean nativeClearAnimationFrameStats();
|
||||||
|
private static native boolean nativeGetAnimationFrameStats(WindowAnimationFrameStats outStats);
|
||||||
|
|
||||||
|
+ private static native long[] nativeGetPhysicalDisplayIds();
|
||||||
|
private static native void nativeSetDisplaySurface(long transactionObj,
|
||||||
|
IBinder displayToken, long nativeSurfaceObject);
|
||||||
|
private static native void nativeSetDisplayLayerStack(long transactionObj,
|
||||||
|
@@ -2379,6 +2380,13 @@ public final class SurfaceControl implements Parcelable {
|
||||||
|
nativeSetGameContentType(displayToken, on);
|
||||||
|
}
|
||||||
|
|
||||||
|
+ /**
|
||||||
|
+ * @hide
|
||||||
|
+ */
|
||||||
|
+ public static long[] getPhysicalDisplayIds() {
|
||||||
|
+ return nativeGetPhysicalDisplayIds();
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
/**
|
||||||
|
* Returns whether protected content is supported in GPU composition.
|
||||||
|
* @hide
|
||||||
|
diff --git a/core/jni/android_view_SurfaceControl.cpp b/core/jni/android_view_SurfaceControl.cpp
|
||||||
|
index 6fec527aaa16..8c908aa3d451 100644
|
||||||
|
--- a/core/jni/android_view_SurfaceControl.cpp
|
||||||
|
+++ b/core/jni/android_view_SurfaceControl.cpp
|
||||||
|
@@ -36,6 +36,7 @@
|
||||||
|
#include <gui/SurfaceComposerClient.h>
|
||||||
|
#include <jni.h>
|
||||||
|
#include <nativehelper/JNIHelp.h>
|
||||||
|
+#include <nativehelper/ScopedPrimitiveArray.h>
|
||||||
|
#include <nativehelper/ScopedUtfChars.h>
|
||||||
|
#include <private/gui/ComposerService.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
@@ -1075,6 +1076,21 @@ static void nativeSetDestinationFrame(JNIEnv* env, jclass clazz, jlong transacti
|
||||||
|
transaction->setDestinationFrame(ctrl, crop);
|
||||||
|
}
|
||||||
|
|
||||||
|
+static jlongArray nativeGetPhysicalDisplayIds(JNIEnv* env, jclass clazz) {
|
||||||
|
+ const auto displayIds = SurfaceComposerClient::getPhysicalDisplayIds();
|
||||||
|
+ ScopedLongArrayRW values(env, env->NewLongArray(displayIds.size()));
|
||||||
|
+ if (values.get() == nullptr) {
|
||||||
|
+ jniThrowException(env, "java/lang/OutOfMemoryError", nullptr);
|
||||||
|
+ return nullptr;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ for (size_t i = 0; i < displayIds.size(); ++i) {
|
||||||
|
+ values[i] = static_cast<jlong>(displayIds[i].value);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ return values.getJavaArray();
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
static jobject nativeGetDisplayedContentSamplingAttributes(JNIEnv* env, jclass clazz,
|
||||||
|
jobject tokenObj) {
|
||||||
|
sp<IBinder> token(ibinderForJavaObject(env, tokenObj));
|
||||||
|
@@ -2269,6 +2285,8 @@ static const JNINativeMethod sSurfaceControlMethods[] = {
|
||||||
|
(void*)nativeSetFrameRateCategory},
|
||||||
|
{"nativeSetFrameRateSelectionStrategy", "(JJI)V",
|
||||||
|
(void*)nativeSetFrameRateSelectionStrategy},
|
||||||
|
+ {"nativeGetPhysicalDisplayIds", "()[J",
|
||||||
|
+ (void*)nativeGetPhysicalDisplayIds },
|
||||||
|
{"nativeSetDisplaySurface", "(JLandroid/os/IBinder;J)V",
|
||||||
|
(void*)nativeSetDisplaySurface },
|
||||||
|
{"nativeSetDisplayLayerStack", "(JLandroid/os/IBinder;I)V",
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
@ -1,7 +1,7 @@
|
|||||||
From 92baead82c113777ad33ff0069ad54094b1595ca Mon Sep 17 00:00:00 2001
|
From 262cf4f5ed67cd8343ccb912bc8d265ea331af3e Mon Sep 17 00:00:00 2001
|
||||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||||
Date: Sun, 7 Jul 2024 21:55:42 +0800
|
Date: Sun, 7 Jul 2024 21:55:42 +0800
|
||||||
Subject: [PATCH 51/51] Allow APKs of a certain signature to install/work like
|
Subject: [PATCH 6/6] Allow APKs of a certain signature to install/work like
|
||||||
platform-signed
|
platform-signed
|
||||||
|
|
||||||
Intended usecase - one authoritative set of signed IMS APKs for any GSI, regardless of their signature
|
Intended usecase - one authoritative set of signed IMS APKs for any GSI, regardless of their signature
|
@ -1,8 +1,8 @@
|
|||||||
From 0d55f5113d95dcbc02676ec1e6e642f2a8241f3d Mon Sep 17 00:00:00 2001
|
From a62c64145c25f62e0a6f6c264b5da12e7a253c72 Mon Sep 17 00:00:00 2001
|
||||||
From: Pierre-Hugues Husson <phh@phh.me>
|
From: Pierre-Hugues Husson <phh@phh.me>
|
||||||
Date: Fri, 25 Mar 2022 05:37:56 -0400
|
Date: Fri, 25 Mar 2022 05:37:56 -0400
|
||||||
Subject: [PATCH 06/13] MIUI13 devices hide their vibrator HAL behind
|
Subject: [PATCH 1/2] MIUI13 devices hide their vibrator HAL behind non-default
|
||||||
non-default name: "vibratorfeature"
|
name: "vibratorfeature"
|
||||||
|
|
||||||
---
|
---
|
||||||
services/vibratorservice/VibratorHalController.cpp | 6 ++++++
|
services/vibratorservice/VibratorHalController.cpp | 6 ++++++
|
@ -1,22 +1,23 @@
|
|||||||
From f46d54958764bc0ddef9f441de062c7680cdbc81 Mon Sep 17 00:00:00 2001
|
From 939201042b7a18dd00eb865f78209ba9f8eaeed8 Mon Sep 17 00:00:00 2001
|
||||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||||
Date: Sun, 26 May 2024 21:34:17 +0800
|
Date: Sun, 26 May 2024 21:34:17 +0800
|
||||||
Subject: [PATCH 13/13] SurfaceFlinger: Disable SF HWC backpressure
|
Subject: [PATCH 2/2] SurfaceFlinger: Disable SF HWC backpressure
|
||||||
|
|
||||||
|
Change-Id: I5b99a2b860b1387ef5b589cb5b7b1d3ff0cfeee8
|
||||||
---
|
---
|
||||||
services/surfaceflinger/SurfaceFlinger.cpp | 3 ++-
|
services/surfaceflinger/SurfaceFlinger.cpp | 3 ++-
|
||||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
|
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
|
||||||
index 95829c7bd6..ae149b3ab7 100644
|
index 305e08c714..3b508cd043 100644
|
||||||
--- a/services/surfaceflinger/SurfaceFlinger.cpp
|
--- a/services/surfaceflinger/SurfaceFlinger.cpp
|
||||||
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
|
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
|
||||||
@@ -2557,7 +2557,8 @@ bool SurfaceFlinger::commit(PhysicalDisplayId pacesetterId,
|
@@ -2556,7 +2556,8 @@ bool SurfaceFlinger::commit(PhysicalDisplayId pacesetterId,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- if (pacesetterFrameTarget.isFramePending()) {
|
- if (pacesetterFrameTarget.isFramePending()) {
|
||||||
+ if (base::GetBoolProperty("persist.sys.phh.enable_sf_hwc_backpressure"s, true)
|
+ if (base::GetBoolProperty("persist.sys.treble.enable_sf_hwc_backpressure"s, true)
|
||||||
+ && pacesetterFrameTarget.isFramePending()) {
|
+ && pacesetterFrameTarget.isFramePending()) {
|
||||||
if (mBackpressureGpuComposition || pacesetterFrameTarget.didMissHwcFrame()) {
|
if (mBackpressureGpuComposition || pacesetterFrameTarget.didMissHwcFrame()) {
|
||||||
if (FlagManager::getInstance().vrr_config()) {
|
if (FlagManager::getInstance().vrr_config()) {
|
@ -1,4 +1,4 @@
|
|||||||
From e1832b745a9d991d919235788777e82bc3e7c1f6 Mon Sep 17 00:00:00 2001
|
From 2bb0d801335970b8f0e9b8b7ffdf86128ae19468 Mon Sep 17 00:00:00 2001
|
||||||
From: Pierre-Hugues Husson <phh@phh.me>
|
From: Pierre-Hugues Husson <phh@phh.me>
|
||||||
Date: Sun, 14 Nov 2021 13:47:29 -0500
|
Date: Sun, 14 Nov 2021 13:47:29 -0500
|
||||||
Subject: [PATCH] Pie MTK IMS calls static
|
Subject: [PATCH] Pie MTK IMS calls static
|
||||||
@ -10,7 +10,7 @@ Change-Id: I3dd66d436629d37c8ec795df6569736195ae570e
|
|||||||
1 file changed, 8 insertions(+)
|
1 file changed, 8 insertions(+)
|
||||||
|
|
||||||
diff --git a/src/java/com/android/ims/ImsManager.java b/src/java/com/android/ims/ImsManager.java
|
diff --git a/src/java/com/android/ims/ImsManager.java b/src/java/com/android/ims/ImsManager.java
|
||||||
index c9252f24..9d6a3122 100644
|
index c41426d..2c6d656 100644
|
||||||
--- a/src/java/com/android/ims/ImsManager.java
|
--- a/src/java/com/android/ims/ImsManager.java
|
||||||
+++ b/src/java/com/android/ims/ImsManager.java
|
+++ b/src/java/com/android/ims/ImsManager.java
|
||||||
@@ -1667,6 +1667,14 @@ public class ImsManager implements FeatureUpdates {
|
@@ -1667,6 +1667,14 @@ public class ImsManager implements FeatureUpdates {
|
@ -1,7 +1,7 @@
|
|||||||
From 20afc68fee873214a63b46521c921024ae968258 Mon Sep 17 00:00:00 2001
|
From fc4ecc73093f88934a65a9371ae7af274c2b143d Mon Sep 17 00:00:00 2001
|
||||||
From: ironydelerium <42721860+ironydelerium@users.noreply.github.com>
|
From: ironydelerium <42721860+ironydelerium@users.noreply.github.com>
|
||||||
Date: Fri, 31 Dec 2021 02:20:28 -0800
|
Date: Fri, 31 Dec 2021 02:20:28 -0800
|
||||||
Subject: [PATCH 04/14] Reintroduce 'public void
|
Subject: [PATCH] Reintroduce 'public void
|
||||||
TelephonyMetrics.writeRilSendSms(int, int, int, int)'. (#8)
|
TelephonyMetrics.writeRilSendSms(int, int, int, int)'. (#8)
|
||||||
|
|
||||||
The MediaTek IMS package for Android Q, at the very least (likely for the rest, too)
|
The MediaTek IMS package for Android Q, at the very least (likely for the rest, too)
|
||||||
@ -13,15 +13,16 @@ in a MethodNotFoundException being raised in com.mediatek.ims, crashing it.
|
|||||||
Fixes https://github.com/phhusson/treble_experimentations/issues/2125.
|
Fixes https://github.com/phhusson/treble_experimentations/issues/2125.
|
||||||
|
|
||||||
Co-authored-by: Sarah Vandomelen <sarah@sightworks.com>
|
Co-authored-by: Sarah Vandomelen <sarah@sightworks.com>
|
||||||
|
Change-Id: I789f470fb38d86dd37e8408536e208a7a49e7e26
|
||||||
---
|
---
|
||||||
.../telephony/metrics/TelephonyMetrics.java | 13 +++++++++++++
|
.../telephony/metrics/TelephonyMetrics.java | 13 +++++++++++++
|
||||||
1 file changed, 13 insertions(+)
|
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
|
diff --git a/src/java/com/android/internal/telephony/metrics/TelephonyMetrics.java b/src/java/com/android/internal/telephony/metrics/TelephonyMetrics.java
|
||||||
index 3fdbfe0ed7..fb8011c3df 100644
|
index 5b47ae5b7a..f3e7717aca 100644
|
||||||
--- a/src/java/com/android/internal/telephony/metrics/TelephonyMetrics.java
|
--- a/src/java/com/android/internal/telephony/metrics/TelephonyMetrics.java
|
||||||
+++ b/src/java/com/android/internal/telephony/metrics/TelephonyMetrics.java
|
+++ b/src/java/com/android/internal/telephony/metrics/TelephonyMetrics.java
|
||||||
@@ -2320,6 +2320,19 @@ public class TelephonyMetrics {
|
@@ -2324,6 +2324,19 @@ public class TelephonyMetrics {
|
||||||
smsSession.increaseExpectedResponse();
|
smsSession.increaseExpectedResponse();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -42,5 +43,5 @@ index 3fdbfe0ed7..fb8011c3df 100644
|
|||||||
* Write Send SMS event using ImsService. Expecting response from
|
* Write Send SMS event using ImsService. Expecting response from
|
||||||
* {@link #writeOnSmsSolicitedResponse}.
|
* {@link #writeOnSmsSolicitedResponse}.
|
||||||
--
|
--
|
||||||
2.34.1
|
2.25.1
|
||||||
|
|
@ -0,0 +1,27 @@
|
|||||||
|
From 31b4f85f4d8d4e3aad6cab62d88ec7c065b62607 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 50a68098..7392b1ce 100644
|
||||||
|
--- a/stats/enums/app/settings_enums.proto
|
||||||
|
+++ b/stats/enums/app/settings_enums.proto
|
||||||
|
@@ -2217,6 +2217,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;
|
||||||
|
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
@ -1,7 +1,7 @@
|
|||||||
From 483f4f3771ad6fda6906eb56c5564207f8c4048e Mon Sep 17 00:00:00 2001
|
From 89f823e7f42d3fb3677a9dc0384363f7ba540e64 Mon Sep 17 00:00:00 2001
|
||||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||||
Date: Tue, 18 Apr 2023 23:48:15 +0000
|
Date: Tue, 18 Apr 2023 23:48:15 +0000
|
||||||
Subject: [PATCH 2/3] Fix light sensor crash on Xiaomi 13
|
Subject: [PATCH] Fix light sensor crash on Xiaomi 13
|
||||||
|
|
||||||
SensorService expects a scalar, but Xiaomi HAL returns a pose6DOF vector encapsulation
|
SensorService expects a scalar, but Xiaomi HAL returns a pose6DOF vector encapsulation
|
||||||
Thanks @phhusson for the analysis
|
Thanks @phhusson for the analysis
|
||||||
@ -12,7 +12,7 @@ Change-Id: Ie358321d5328d01541f455d6af86944ff413c9c9
|
|||||||
1 file changed, 8 insertions(+), 1 deletion(-)
|
1 file changed, 8 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
diff --git a/sensors/aidl/convert/convert.cpp b/sensors/aidl/convert/convert.cpp
|
diff --git a/sensors/aidl/convert/convert.cpp b/sensors/aidl/convert/convert.cpp
|
||||||
index 2dc7a177a0..be3833dfa7 100644
|
index 2dc7a177a..be3833dfa 100644
|
||||||
--- a/sensors/aidl/convert/convert.cpp
|
--- a/sensors/aidl/convert/convert.cpp
|
||||||
+++ b/sensors/aidl/convert/convert.cpp
|
+++ b/sensors/aidl/convert/convert.cpp
|
||||||
@@ -162,7 +162,14 @@ void convertToSensorEvent(const Event& src, sensors_event_t* dst) {
|
@@ -162,7 +162,14 @@ void convertToSensorEvent(const Event& src, sensors_event_t* dst) {
|
||||||
@ -32,5 +32,5 @@ index 2dc7a177a0..be3833dfa7 100644
|
|||||||
}
|
}
|
||||||
|
|
||||||
--
|
--
|
||||||
2.25.1
|
2.34.1
|
||||||
|
|
@ -0,0 +1,363 @@
|
|||||||
|
From 8162af1310582494ce99ee502abacb1f937d5596 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/9] 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 | 176 ++++++++++++++++++
|
||||||
|
.../settings/treble/TrebleSettings.java | 39 ++++
|
||||||
|
8 files changed, 271 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 a6bb19fe58c..6fafd10f702 100644
|
||||||
|
--- a/AndroidManifest.xml
|
||||||
|
+++ b/AndroidManifest.xml
|
||||||
|
@@ -252,6 +252,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 00000000000..3c56ed7032c
|
||||||
|
--- /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 27e9639122a..ef25f9971c4 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_communal" translatable="false">top_level_communal</string>
|
||||||
|
<string name="menu_key_connected_devices" translatable="false">top_level_connected_devices</string>
|
||||||
|
diff --git a/res/values/strings.xml b/res/values/strings.xml
|
||||||
|
index 61aa1b265e6..5a5edf00ebf 100644
|
||||||
|
--- a/res/values/strings.xml
|
||||||
|
+++ b/res/values/strings.xml
|
||||||
|
@@ -7345,6 +7345,16 @@
|
||||||
|
<!-- Text to describe the dashboard fragment title [CHAR LIMIT=16] -->
|
||||||
|
<string name="dashboard_title">Settings</string>
|
||||||
|
|
||||||
|
+ <!-- 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 31c6af3c40b..7fb404789ad 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 00000000000..1a82c468a26
|
||||||
|
--- /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 00000000000..9c609b606de
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/src/com/android/settings/treble/ScreenResolutionRefreshRatePreferenceController.java
|
||||||
|
@@ -0,0 +1,176 @@
|
||||||
|
+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);
|
||||||
|
+
|
||||||
|
+ long[] physicalDisplayIds = SurfaceControl.getPhysicalDisplayIds();
|
||||||
|
+ DisplayMode[] supportedDisplayModes =
|
||||||
|
+ SurfaceControl.getDynamicDisplayInfo(physicalDisplayIds[0]).supportedDisplayModes;
|
||||||
|
+ Set<String> summarySet = new HashSet<>();
|
||||||
|
+ for (DisplayMode m : supportedDisplayModes) {
|
||||||
|
+ String summary = String.format("%dx%d @ %dHz", m.width, m.height, Math.round(m.peakRefreshRate));
|
||||||
|
+ 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.peakRefreshRate)
|
||||||
|
+ .thenComparing(m->m.id));
|
||||||
|
+ for (DisplayMode m : mModes) {
|
||||||
|
+ String summary = String.format("%dx%d @ %dHz", m.width, m.height, Math.round(m.peakRefreshRate));
|
||||||
|
+ 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) {
|
||||||
|
+ long[] physicalDisplayIds = SurfaceControl.getPhysicalDisplayIds();
|
||||||
|
+ int id = SurfaceControl.getDynamicDisplayInfo(physicalDisplayIds[0]).activeDisplayModeId;
|
||||||
|
+ int index = mListPreference.findIndexOfValue(String.valueOf(id));
|
||||||
|
+ try {
|
||||||
|
+ mListPreference.setValueIndex(index);
|
||||||
|
+ mListPreference.setSummary(mListPreference.getEntries()[index]);
|
||||||
|
+ } catch (ArrayIndexOutOfBoundsException e) {
|
||||||
|
+ e.printStackTrace();
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @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() {
|
||||||
|
+ long[] physicalDisplayIds = SurfaceControl.getPhysicalDisplayIds();
|
||||||
|
+ int id = SurfaceControl.getDynamicDisplayInfo(physicalDisplayIds[0]).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 00000000000..e581539229b
|
||||||
|
--- /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.34.1
|
||||||
|
|
@ -0,0 +1,288 @@
|
|||||||
|
From 2ddbe3a19b8775a02dfb933033d71e9e0b138260 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/9] 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 5a5edf00ebf..366194bf500 100644
|
||||||
|
--- a/res/values/strings.xml
|
||||||
|
+++ b/res/values/strings.xml
|
||||||
|
@@ -7349,11 +7349,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 1a82c468a26..336137c95f1 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 00000000000..8feb318f55a
|
||||||
|
--- /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 e581539229b..5c1611c0534 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 00000000000..fbc327cba0b
|
||||||
|
--- /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 00000000000..bd9de82d906
|
||||||
|
--- /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.34.1
|
||||||
|
|
@ -0,0 +1,368 @@
|
|||||||
|
From e588ad066e470f910d44877bf506b2ecae1cbc59 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/9] TrebleSettings: IMS
|
||||||
|
|
||||||
|
Change-Id: Id7a12e150d4a3dc988f8ce1a888ad88443fa0ea4
|
||||||
|
---
|
||||||
|
Android.bp | 1 +
|
||||||
|
res/values/strings.xml | 9 +
|
||||||
|
res/xml/treble_settings.xml | 13 ++
|
||||||
|
.../InstallImsApkPreferenceController.java | 203 ++++++++++++++++++
|
||||||
|
...VolteAvailabilityPreferenceController.java | 59 +++++
|
||||||
|
.../settings/treble/TrebleSettings.java | 2 +
|
||||||
|
6 files changed, 287 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 b5018960056..d545aecda9e 100644
|
||||||
|
--- a/Android.bp
|
||||||
|
+++ b/Android.bp
|
||||||
|
@@ -117,6 +117,7 @@ android_library {
|
||||||
|
"org.lineageos.platform.internal",
|
||||||
|
"LineagePreferenceLib",
|
||||||
|
"vendor.lineage.fastcharge-V1.0-java",
|
||||||
|
+ "android.hidl.manager-V1.0-java",
|
||||||
|
],
|
||||||
|
|
||||||
|
plugins: ["androidx.room_room-compiler-plugin"],
|
||||||
|
diff --git a/res/values/strings.xml b/res/values/strings.xml
|
||||||
|
index 366194bf500..ff534fe0152 100644
|
||||||
|
--- a/res/values/strings.xml
|
||||||
|
+++ b/res/values/strings.xml
|
||||||
|
@@ -7353,6 +7353,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>
|
||||||
|
@@ -7362,6 +7364,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 336137c95f1..09e6bc5d006 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 00000000000..e86884e86cd
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/src/com/android/settings/treble/InstallImsApkPreferenceController.java
|
||||||
|
@@ -0,0 +1,203 @@
|
||||||
|
+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);
|
||||||
|
+ String summary = "IMS type: ";
|
||||||
|
+ switch (mImsType) {
|
||||||
|
+ case "qcom":
|
||||||
|
+ summary += "Qualcomm";
|
||||||
|
+ break;
|
||||||
|
+ case "mtk_p":
|
||||||
|
+ summary += "MediaTek P";
|
||||||
|
+ break;
|
||||||
|
+ case "mtk_q":
|
||||||
|
+ summary += "MediaTek Q";
|
||||||
|
+ break;
|
||||||
|
+ case "mtk_r+":
|
||||||
|
+ summary += "MediaTek R+";
|
||||||
|
+ break;
|
||||||
|
+ default:
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+ mPreference.setSummary(summary);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ super.displayPreference(screen);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public boolean onPreferenceClick(Preference preference) {
|
||||||
|
+ switch (mImsType) {
|
||||||
|
+ case "qcom":
|
||||||
|
+ mImsApkUrl = "https://treble.phh.me/ims-caf-u-resigned.apk";
|
||||||
|
+ break;
|
||||||
|
+ case "mtk_p":
|
||||||
|
+ mImsApkUrl = "https://treble.phh.me/stable/ims-mtk-p-resigned.apk";
|
||||||
|
+ break;
|
||||||
|
+ case "mtk_q":
|
||||||
|
+ mImsApkUrl = "https://treble.phh.me/stable/ims-mtk-q-resigned.apk";
|
||||||
|
+ break;
|
||||||
|
+ case "mtk_r+":
|
||||||
|
+ mImsApkUrl = "https://treble.phh.me/ims-mtk-u-resigned.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
|
||||||
|
+ || ServiceManager.getService("vendor.qti.hardware.radio.ims.IImsRadio/" + slot) != null) {
|
||||||
|
+ return "qcom";
|
||||||
|
+ } 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
|
||||||
|
+ || hidlManager.get("vendor.mediatek.hardware.mtkradioex@3.0::IMtkRadioEx", slot) != null
|
||||||
|
+ || ServiceManager.getService("vendor.mediatek.hardware.mtkradioex.ims.IMtkRadioExIms/" + slot) != null) {
|
||||||
|
+ return "mtk_r+";
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ } 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 00000000000..1ab12d3ca0e
|
||||||
|
--- /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 5c1611c0534..50e3eda8c68 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.34.1
|
||||||
|
|
@ -0,0 +1,116 @@
|
|||||||
|
From a15199ab73e7f205ef16a287afd973b062ae9ac6 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||||
|
Date: Sat, 10 Dec 2022 12:04:37 +0000
|
||||||
|
Subject: [PATCH 4/9] TrebleSettings: Disable A2DP offload
|
||||||
|
|
||||||
|
Change-Id: I737f49d146f83d96793f4436850529e3c528acbe
|
||||||
|
---
|
||||||
|
res/values/strings.xml | 2 +
|
||||||
|
res/xml/treble_settings.xml | 4 ++
|
||||||
|
...isableA2DPOffloadPreferenceController.java | 53 +++++++++++++++++++
|
||||||
|
.../settings/treble/TrebleSettings.java | 1 +
|
||||||
|
4 files changed, 60 insertions(+)
|
||||||
|
create mode 100644 src/com/android/settings/treble/DisableA2DPOffloadPreferenceController.java
|
||||||
|
|
||||||
|
diff --git a/res/values/strings.xml b/res/values/strings.xml
|
||||||
|
index ff534fe0152..26980abbd58 100644
|
||||||
|
--- a/res/values/strings.xml
|
||||||
|
+++ b/res/values/strings.xml
|
||||||
|
@@ -7360,6 +7360,8 @@
|
||||||
|
<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, disable A2DP offload title -->
|
||||||
|
+ <string name="disable_a2dp_offload_title">Disable A2DP offload</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 -->
|
||||||
|
diff --git a/res/xml/treble_settings.xml b/res/xml/treble_settings.xml
|
||||||
|
index 09e6bc5d006..b58e7a1282c 100644
|
||||||
|
--- a/res/xml/treble_settings.xml
|
||||||
|
+++ b/res/xml/treble_settings.xml
|
||||||
|
@@ -17,6 +17,10 @@
|
||||||
|
android:key="disable_soundvolume_effect"
|
||||||
|
android:title="@string/disable_soundvolume_effect_title" />
|
||||||
|
|
||||||
|
+ <SwitchPreference
|
||||||
|
+ android:key="disable_a2dp_offload"
|
||||||
|
+ android:title="@string/disable_a2dp_offload_title" />
|
||||||
|
+
|
||||||
|
</PreferenceCategory>
|
||||||
|
|
||||||
|
<PreferenceCategory
|
||||||
|
diff --git a/src/com/android/settings/treble/DisableA2DPOffloadPreferenceController.java b/src/com/android/settings/treble/DisableA2DPOffloadPreferenceController.java
|
||||||
|
new file mode 100644
|
||||||
|
index 00000000000..f53103160df
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/src/com/android/settings/treble/DisableA2DPOffloadPreferenceController.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 DisableA2DPOffloadPreferenceController extends BasePreferenceController
|
||||||
|
+ implements Preference.OnPreferenceChangeListener {
|
||||||
|
+
|
||||||
|
+ private static final String DISABLE_A2DP_OFFLOAD_KEY = "disable_a2dp_offload";
|
||||||
|
+ private static final String A2DP_OFFLOAD_DISABLED_PROPERTY = "persist.bluetooth.a2dp_offload.disabled";
|
||||||
|
+
|
||||||
|
+ private SwitchPreference mSwitchPreference;
|
||||||
|
+
|
||||||
|
+ public DisableA2DPOffloadPreferenceController(Context context) {
|
||||||
|
+ super(context, DISABLE_A2DP_OFFLOAD_KEY);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public int getAvailabilityStatus() {
|
||||||
|
+ return AVAILABLE;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public String getPreferenceKey() {
|
||||||
|
+ return DISABLE_A2DP_OFFLOAD_KEY;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public void displayPreference(PreferenceScreen screen) {
|
||||||
|
+ mSwitchPreference = screen.findPreference(getPreferenceKey());
|
||||||
|
+ super.displayPreference(screen);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public void updateState(Preference preference) {
|
||||||
|
+ boolean checked = SystemProperties.getBoolean(A2DP_OFFLOAD_DISABLED_PROPERTY, false);
|
||||||
|
+ mSwitchPreference.setChecked(checked);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||||
|
+ SystemProperties.set(A2DP_OFFLOAD_DISABLED_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 50e3eda8c68..5e9b7f88e25 100644
|
||||||
|
--- a/src/com/android/settings/treble/TrebleSettings.java
|
||||||
|
+++ b/src/com/android/settings/treble/TrebleSettings.java
|
||||||
|
@@ -34,6 +34,7 @@ public class TrebleSettings extends DashboardFragment {
|
||||||
|
final List<AbstractPreferenceController> controllers = new ArrayList<>();
|
||||||
|
controllers.add(new UseAlternativeAudioPolicyPreferenceController(context));
|
||||||
|
controllers.add(new DisableSoundvolumeEffectPreferenceController(context));
|
||||||
|
+ controllers.add(new DisableA2DPOffloadPreferenceController(context));
|
||||||
|
controllers.add(new ScreenResolutionRefreshRatePreferenceController(context));
|
||||||
|
controllers.add(new UseAlternativeBacklightScalePreferenceController(context));
|
||||||
|
controllers.add(new InstallImsApkPreferenceController(context));
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
@ -0,0 +1,116 @@
|
|||||||
|
From 1d11999625604110b51d31127a6b8e4a43ad6a5f Mon Sep 17 00:00:00 2001
|
||||||
|
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||||
|
Date: Sat, 10 Dec 2022 14:16:50 +0000
|
||||||
|
Subject: [PATCH 5/9] TrebleSettings: Alternative audio jack detection
|
||||||
|
|
||||||
|
Change-Id: I5d6d48f26a4a2134fd6edf996eca89a1fc42e6de
|
||||||
|
---
|
||||||
|
res/values/strings.xml | 2 +
|
||||||
|
res/xml/treble_settings.xml | 4 ++
|
||||||
|
.../settings/treble/TrebleSettings.java | 1 +
|
||||||
|
...udioJackDetectionPreferenceController.java | 53 +++++++++++++++++++
|
||||||
|
4 files changed, 60 insertions(+)
|
||||||
|
create mode 100644 src/com/android/settings/treble/UseAlternativeAudioJackDetectionPreferenceController.java
|
||||||
|
|
||||||
|
diff --git a/res/values/strings.xml b/res/values/strings.xml
|
||||||
|
index 26980abbd58..08b953b9ccf 100644
|
||||||
|
--- a/res/values/strings.xml
|
||||||
|
+++ b/res/values/strings.xml
|
||||||
|
@@ -7362,6 +7362,8 @@
|
||||||
|
<string name="disable_soundvolume_effect_title">Disable soundvolume effect</string>
|
||||||
|
<!-- Treble settings screen, disable A2DP offload title -->
|
||||||
|
<string name="disable_a2dp_offload_title">Disable A2DP offload</string>
|
||||||
|
+ <!-- Treble settings screen, use alternative audio jack detection title -->
|
||||||
|
+ <string name="use_alternative_audio_jack_detection_title">Use alternative audio jack detection</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 -->
|
||||||
|
diff --git a/res/xml/treble_settings.xml b/res/xml/treble_settings.xml
|
||||||
|
index b58e7a1282c..47097a14c70 100644
|
||||||
|
--- a/res/xml/treble_settings.xml
|
||||||
|
+++ b/res/xml/treble_settings.xml
|
||||||
|
@@ -21,6 +21,10 @@
|
||||||
|
android:key="disable_a2dp_offload"
|
||||||
|
android:title="@string/disable_a2dp_offload_title" />
|
||||||
|
|
||||||
|
+ <SwitchPreference
|
||||||
|
+ android:key="use_alternative_audio_jack_detection"
|
||||||
|
+ android:title="@string/use_alternative_audio_jack_detection_title" />
|
||||||
|
+
|
||||||
|
</PreferenceCategory>
|
||||||
|
|
||||||
|
<PreferenceCategory
|
||||||
|
diff --git a/src/com/android/settings/treble/TrebleSettings.java b/src/com/android/settings/treble/TrebleSettings.java
|
||||||
|
index 5e9b7f88e25..09aa001e82c 100644
|
||||||
|
--- a/src/com/android/settings/treble/TrebleSettings.java
|
||||||
|
+++ b/src/com/android/settings/treble/TrebleSettings.java
|
||||||
|
@@ -35,6 +35,7 @@ public class TrebleSettings extends DashboardFragment {
|
||||||
|
controllers.add(new UseAlternativeAudioPolicyPreferenceController(context));
|
||||||
|
controllers.add(new DisableSoundvolumeEffectPreferenceController(context));
|
||||||
|
controllers.add(new DisableA2DPOffloadPreferenceController(context));
|
||||||
|
+ controllers.add(new UseAlternativeAudioJackDetectionPreferenceController(context));
|
||||||
|
controllers.add(new ScreenResolutionRefreshRatePreferenceController(context));
|
||||||
|
controllers.add(new UseAlternativeBacklightScalePreferenceController(context));
|
||||||
|
controllers.add(new InstallImsApkPreferenceController(context));
|
||||||
|
diff --git a/src/com/android/settings/treble/UseAlternativeAudioJackDetectionPreferenceController.java b/src/com/android/settings/treble/UseAlternativeAudioJackDetectionPreferenceController.java
|
||||||
|
new file mode 100644
|
||||||
|
index 00000000000..0d60b72db1b
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/src/com/android/settings/treble/UseAlternativeAudioJackDetectionPreferenceController.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 UseAlternativeAudioJackDetectionPreferenceController extends BasePreferenceController
|
||||||
|
+ implements Preference.OnPreferenceChangeListener {
|
||||||
|
+
|
||||||
|
+ private static final String USE_ALTERNATIVE_AUDIO_JACK_DETECTION_KEY = "use_alternative_audio_jack_detection";
|
||||||
|
+ private static final String DEVINPUT_JACK_PROPERTY = "persist.sys.overlay.devinputjack";
|
||||||
|
+
|
||||||
|
+ private SwitchPreference mSwitchPreference;
|
||||||
|
+
|
||||||
|
+ public UseAlternativeAudioJackDetectionPreferenceController(Context context) {
|
||||||
|
+ super(context, USE_ALTERNATIVE_AUDIO_JACK_DETECTION_KEY);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public int getAvailabilityStatus() {
|
||||||
|
+ return AVAILABLE;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public String getPreferenceKey() {
|
||||||
|
+ return USE_ALTERNATIVE_AUDIO_JACK_DETECTION_KEY;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public void displayPreference(PreferenceScreen screen) {
|
||||||
|
+ mSwitchPreference = screen.findPreference(getPreferenceKey());
|
||||||
|
+ super.displayPreference(screen);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public void updateState(Preference preference) {
|
||||||
|
+ boolean checked = SystemProperties.getBoolean(DEVINPUT_JACK_PROPERTY, false);
|
||||||
|
+ mSwitchPreference.setChecked(checked);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||||
|
+ SystemProperties.set(DEVINPUT_JACK_PROPERTY, String.valueOf((boolean) newValue));
|
||||||
|
+ mSwitchPreference.setChecked((boolean) newValue);
|
||||||
|
+ return true;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+}
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
@ -0,0 +1,116 @@
|
|||||||
|
From 0640b1aa050f80bc8b095e2d78a134402fb0c0de Mon Sep 17 00:00:00 2001
|
||||||
|
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||||
|
Date: Sat, 17 Dec 2022 10:29:05 +0000
|
||||||
|
Subject: [PATCH 6/9] TrebleSettings: Override minimum brightness
|
||||||
|
|
||||||
|
Change-Id: I6d621f7dd04b675b6e2e851a5e474dc9a9841eb0
|
||||||
|
---
|
||||||
|
res/values/strings.xml | 2 +
|
||||||
|
res/xml/treble_settings.xml | 4 ++
|
||||||
|
...MinimumBrightnessPreferenceController.java | 53 +++++++++++++++++++
|
||||||
|
.../settings/treble/TrebleSettings.java | 1 +
|
||||||
|
4 files changed, 60 insertions(+)
|
||||||
|
create mode 100644 src/com/android/settings/treble/OverrideMinimumBrightnessPreferenceController.java
|
||||||
|
|
||||||
|
diff --git a/res/values/strings.xml b/res/values/strings.xml
|
||||||
|
index 08b953b9ccf..2dd1ddeb5a8 100644
|
||||||
|
--- a/res/values/strings.xml
|
||||||
|
+++ b/res/values/strings.xml
|
||||||
|
@@ -7368,6 +7368,8 @@
|
||||||
|
<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, override minimum brightness title -->
|
||||||
|
+ <string name="override_minimum_brightness_title">Override minimum brightness</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 -->
|
||||||
|
diff --git a/res/xml/treble_settings.xml b/res/xml/treble_settings.xml
|
||||||
|
index 47097a14c70..5c18461b69f 100644
|
||||||
|
--- a/res/xml/treble_settings.xml
|
||||||
|
+++ b/res/xml/treble_settings.xml
|
||||||
|
@@ -38,6 +38,10 @@
|
||||||
|
android:key="use_alternative_backlight_scale"
|
||||||
|
android:title="@string/use_alternative_backlight_scale_title" />
|
||||||
|
|
||||||
|
+ <SwitchPreference
|
||||||
|
+ android:key="override_minimum_brightness"
|
||||||
|
+ android:title="@string/override_minimum_brightness_title" />
|
||||||
|
+
|
||||||
|
</PreferenceCategory>
|
||||||
|
|
||||||
|
<PreferenceCategory
|
||||||
|
diff --git a/src/com/android/settings/treble/OverrideMinimumBrightnessPreferenceController.java b/src/com/android/settings/treble/OverrideMinimumBrightnessPreferenceController.java
|
||||||
|
new file mode 100644
|
||||||
|
index 00000000000..95200fbeaac
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/src/com/android/settings/treble/OverrideMinimumBrightnessPreferenceController.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 OverrideMinimumBrightnessPreferenceController extends BasePreferenceController
|
||||||
|
+ implements Preference.OnPreferenceChangeListener {
|
||||||
|
+
|
||||||
|
+ private static final String OVERRIDE_MINIMUM_BRIGHTNESS_KEY = "override_minimum_brightness";
|
||||||
|
+ private static final String MINIMAL_BRIGHTNESS_PROPERTY = "persist.sys.overlay.minimal_brightness";
|
||||||
|
+
|
||||||
|
+ private SwitchPreference mSwitchPreference;
|
||||||
|
+
|
||||||
|
+ public OverrideMinimumBrightnessPreferenceController(Context context) {
|
||||||
|
+ super(context, OVERRIDE_MINIMUM_BRIGHTNESS_KEY);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public int getAvailabilityStatus() {
|
||||||
|
+ return AVAILABLE;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public String getPreferenceKey() {
|
||||||
|
+ return OVERRIDE_MINIMUM_BRIGHTNESS_KEY;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public void displayPreference(PreferenceScreen screen) {
|
||||||
|
+ mSwitchPreference = screen.findPreference(getPreferenceKey());
|
||||||
|
+ super.displayPreference(screen);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public void updateState(Preference preference) {
|
||||||
|
+ boolean checked = SystemProperties.getBoolean(MINIMAL_BRIGHTNESS_PROPERTY, false);
|
||||||
|
+ mSwitchPreference.setChecked(checked);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||||
|
+ SystemProperties.set(MINIMAL_BRIGHTNESS_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 09aa001e82c..39a0e199726 100644
|
||||||
|
--- a/src/com/android/settings/treble/TrebleSettings.java
|
||||||
|
+++ b/src/com/android/settings/treble/TrebleSettings.java
|
||||||
|
@@ -38,6 +38,7 @@ public class TrebleSettings extends DashboardFragment {
|
||||||
|
controllers.add(new UseAlternativeAudioJackDetectionPreferenceController(context));
|
||||||
|
controllers.add(new ScreenResolutionRefreshRatePreferenceController(context));
|
||||||
|
controllers.add(new UseAlternativeBacklightScalePreferenceController(context));
|
||||||
|
+ controllers.add(new OverrideMinimumBrightnessPreferenceController(context));
|
||||||
|
controllers.add(new InstallImsApkPreferenceController(context));
|
||||||
|
controllers.add(new OverrideVolteAvailabilityPreferenceController(context));
|
||||||
|
return controllers;
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
@ -0,0 +1,128 @@
|
|||||||
|
From 36aebacf72f4366a1e6bc2c3e5f60c6596527752 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||||
|
Date: Sat, 17 Dec 2022 11:00:38 +0000
|
||||||
|
Subject: [PATCH 7/9] TrebleSettings: Override navbar availability
|
||||||
|
|
||||||
|
Change-Id: I7c771caf6274543fed23a8cc47411bf8c369ac2c
|
||||||
|
---
|
||||||
|
res/values/strings.xml | 4 ++
|
||||||
|
res/xml/treble_settings.xml | 9 ++++
|
||||||
|
...avbarAvailabilityPreferenceController.java | 53 +++++++++++++++++++
|
||||||
|
.../settings/treble/TrebleSettings.java | 1 +
|
||||||
|
4 files changed, 67 insertions(+)
|
||||||
|
create mode 100644 src/com/android/settings/treble/OverrideNavbarAvailabilityPreferenceController.java
|
||||||
|
|
||||||
|
diff --git a/res/values/strings.xml b/res/values/strings.xml
|
||||||
|
index 2dd1ddeb5a8..cd79f4d3ed3 100644
|
||||||
|
--- a/res/values/strings.xml
|
||||||
|
+++ b/res/values/strings.xml
|
||||||
|
@@ -7355,6 +7355,8 @@
|
||||||
|
<string name="treble_settings_category_name_display">Display</string>
|
||||||
|
<!-- IMS category name [CHAR LIMIT=none] -->
|
||||||
|
<string name="treble_settings_category_name_ims">IMS</string>
|
||||||
|
+ <!-- UI category name [CHAR LIMIT=none] -->
|
||||||
|
+ <string name="treble_settings_category_name_ui">UI</string>
|
||||||
|
|
||||||
|
<!-- Treble settings screen, use alternative audio policy title -->
|
||||||
|
<string name="use_alternative_audio_policy_title">Use alternative audio policy</string>
|
||||||
|
@@ -7377,6 +7379,8 @@
|
||||||
|
<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>
|
||||||
|
+ <!-- Treble settings screen, override navbar availability title -->
|
||||||
|
+ <string name="override_navbar_availability_title">Override navigation bar 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 5c18461b69f..250a8ee75ae 100644
|
||||||
|
--- a/res/xml/treble_settings.xml
|
||||||
|
+++ b/res/xml/treble_settings.xml
|
||||||
|
@@ -57,4 +57,13 @@
|
||||||
|
|
||||||
|
</PreferenceCategory>
|
||||||
|
|
||||||
|
+ <PreferenceCategory
|
||||||
|
+ android:title="@string/treble_settings_category_name_ui">
|
||||||
|
+
|
||||||
|
+ <SwitchPreference
|
||||||
|
+ android:key="override_navbar_availability"
|
||||||
|
+ android:title="@string/override_navbar_availability_title" />
|
||||||
|
+
|
||||||
|
+ </PreferenceCategory>
|
||||||
|
+
|
||||||
|
</PreferenceScreen>
|
||||||
|
diff --git a/src/com/android/settings/treble/OverrideNavbarAvailabilityPreferenceController.java b/src/com/android/settings/treble/OverrideNavbarAvailabilityPreferenceController.java
|
||||||
|
new file mode 100644
|
||||||
|
index 00000000000..d6baa337397
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/src/com/android/settings/treble/OverrideNavbarAvailabilityPreferenceController.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 OverrideNavbarAvailabilityPreferenceController extends BasePreferenceController
|
||||||
|
+ implements Preference.OnPreferenceChangeListener {
|
||||||
|
+
|
||||||
|
+ private static final String OVERRIDE_NAVBAR_AVAILABILITY_KEY = "override_navbar_availability";
|
||||||
|
+ private static final String TREBLE_MAINKEYS_PROPERTY = "persist.sys.treble.mainkeys";
|
||||||
|
+
|
||||||
|
+ private SwitchPreference mSwitchPreference;
|
||||||
|
+
|
||||||
|
+ public OverrideNavbarAvailabilityPreferenceController(Context context) {
|
||||||
|
+ super(context, OVERRIDE_NAVBAR_AVAILABILITY_KEY);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public int getAvailabilityStatus() {
|
||||||
|
+ return AVAILABLE;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public String getPreferenceKey() {
|
||||||
|
+ return OVERRIDE_NAVBAR_AVAILABILITY_KEY;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public void displayPreference(PreferenceScreen screen) {
|
||||||
|
+ mSwitchPreference = screen.findPreference(getPreferenceKey());
|
||||||
|
+ super.displayPreference(screen);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public void updateState(Preference preference) {
|
||||||
|
+ boolean checked = (SystemProperties.getInt(TREBLE_MAINKEYS_PROPERTY, 0) == 0);
|
||||||
|
+ mSwitchPreference.setChecked(checked);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||||
|
+ SystemProperties.set(TREBLE_MAINKEYS_PROPERTY, ((boolean) newValue) ? "0" : "1");
|
||||||
|
+ 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 39a0e199726..634b7ce3ce1 100644
|
||||||
|
--- a/src/com/android/settings/treble/TrebleSettings.java
|
||||||
|
+++ b/src/com/android/settings/treble/TrebleSettings.java
|
||||||
|
@@ -41,6 +41,7 @@ public class TrebleSettings extends DashboardFragment {
|
||||||
|
controllers.add(new OverrideMinimumBrightnessPreferenceController(context));
|
||||||
|
controllers.add(new InstallImsApkPreferenceController(context));
|
||||||
|
controllers.add(new OverrideVolteAvailabilityPreferenceController(context));
|
||||||
|
+ controllers.add(new OverrideNavbarAvailabilityPreferenceController(context));
|
||||||
|
return controllers;
|
||||||
|
}
|
||||||
|
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
@ -0,0 +1,119 @@
|
|||||||
|
From 94c32f8dc4f427938340a1b5c704153561e44e06 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||||
|
Date: Sun, 26 May 2024 21:32:44 +0800
|
||||||
|
Subject: [PATCH 8/9] TrebleSettings: Disable SF HWC backpressure
|
||||||
|
|
||||||
|
Change-Id: I4d6a1d43222a8e4dec202056a14b1b1ce41e33d3
|
||||||
|
---
|
||||||
|
res/values/strings.xml | 4 ++
|
||||||
|
res/xml/treble_settings.xml | 5 ++
|
||||||
|
...SfHwcBackpressurePreferenceController.java | 53 +++++++++++++++++++
|
||||||
|
.../settings/treble/TrebleSettings.java | 1 +
|
||||||
|
4 files changed, 63 insertions(+)
|
||||||
|
create mode 100644 src/com/android/settings/treble/DisableSfHwcBackpressurePreferenceController.java
|
||||||
|
|
||||||
|
diff --git a/res/values/strings.xml b/res/values/strings.xml
|
||||||
|
index cd79f4d3ed3..b9bed8d56b5 100644
|
||||||
|
--- a/res/values/strings.xml
|
||||||
|
+++ b/res/values/strings.xml
|
||||||
|
@@ -7372,6 +7372,10 @@
|
||||||
|
<string name="use_alternative_backlight_scale_title">Use alternative backlight scale</string>
|
||||||
|
<!-- Treble settings screen, override minimum brightness title -->
|
||||||
|
<string name="override_minimum_brightness_title">Override minimum brightness</string>
|
||||||
|
+ <!-- Treble settings screen, disable SF HWC backpressure title -->
|
||||||
|
+ <string name="disable_sf_hwc_backpressure_title">Disable SF HWC backpressure</string>
|
||||||
|
+ <!-- Treble settings screen, disable SF HWC backpressure summary -->
|
||||||
|
+ <string name="disable_sf_hwc_backpressure_summary">Might improve rendering performance</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 -->
|
||||||
|
diff --git a/res/xml/treble_settings.xml b/res/xml/treble_settings.xml
|
||||||
|
index 250a8ee75ae..4e3bef9b644 100644
|
||||||
|
--- a/res/xml/treble_settings.xml
|
||||||
|
+++ b/res/xml/treble_settings.xml
|
||||||
|
@@ -42,6 +42,11 @@
|
||||||
|
android:key="override_minimum_brightness"
|
||||||
|
android:title="@string/override_minimum_brightness_title" />
|
||||||
|
|
||||||
|
+ <SwitchPreference
|
||||||
|
+ android:key="disable_sf_hwc_backpressure"
|
||||||
|
+ android:title="@string/disable_sf_hwc_backpressure_title"
|
||||||
|
+ android:summary="@string/disable_sf_hwc_backpressure_summary" />
|
||||||
|
+
|
||||||
|
</PreferenceCategory>
|
||||||
|
|
||||||
|
<PreferenceCategory
|
||||||
|
diff --git a/src/com/android/settings/treble/DisableSfHwcBackpressurePreferenceController.java b/src/com/android/settings/treble/DisableSfHwcBackpressurePreferenceController.java
|
||||||
|
new file mode 100644
|
||||||
|
index 00000000000..8ba77738b58
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/src/com/android/settings/treble/DisableSfHwcBackpressurePreferenceController.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 DisableSfHwcBackpressurePreferenceController extends BasePreferenceController
|
||||||
|
+ implements Preference.OnPreferenceChangeListener {
|
||||||
|
+
|
||||||
|
+ private static final String DISABLE_SF_HWC_BACKPRESSURE_KEY = "disable_sf_hwc_backpressure";
|
||||||
|
+ private static final String TREBLE_ENABLE_SF_HWC_BACKPRESSURE_PROPERTY = "persist.sys.treble.enable_sf_hwc_backpressure";
|
||||||
|
+
|
||||||
|
+ private SwitchPreference mSwitchPreference;
|
||||||
|
+
|
||||||
|
+ public DisableSfHwcBackpressurePreferenceController(Context context) {
|
||||||
|
+ super(context, DISABLE_SF_HWC_BACKPRESSURE_KEY);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public int getAvailabilityStatus() {
|
||||||
|
+ return AVAILABLE;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public String getPreferenceKey() {
|
||||||
|
+ return DISABLE_SF_HWC_BACKPRESSURE_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_ENABLE_SF_HWC_BACKPRESSURE_PROPERTY, true);
|
||||||
|
+ mSwitchPreference.setChecked(checked);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||||
|
+ SystemProperties.set(TREBLE_ENABLE_SF_HWC_BACKPRESSURE_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 634b7ce3ce1..f72a3cb9ed7 100644
|
||||||
|
--- a/src/com/android/settings/treble/TrebleSettings.java
|
||||||
|
+++ b/src/com/android/settings/treble/TrebleSettings.java
|
||||||
|
@@ -39,6 +39,7 @@ public class TrebleSettings extends DashboardFragment {
|
||||||
|
controllers.add(new ScreenResolutionRefreshRatePreferenceController(context));
|
||||||
|
controllers.add(new UseAlternativeBacklightScalePreferenceController(context));
|
||||||
|
controllers.add(new OverrideMinimumBrightnessPreferenceController(context));
|
||||||
|
+ controllers.add(new DisableSfHwcBackpressurePreferenceController(context));
|
||||||
|
controllers.add(new InstallImsApkPreferenceController(context));
|
||||||
|
controllers.add(new OverrideVolteAvailabilityPreferenceController(context));
|
||||||
|
controllers.add(new OverrideNavbarAvailabilityPreferenceController(context));
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
@ -0,0 +1,61 @@
|
|||||||
|
From e6f53c10e76522ec31519264c40d95d872542f47 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||||
|
Date: Wed, 17 Jul 2024 22:35:50 +0800
|
||||||
|
Subject: [PATCH 9/9] TrebleSettings: Securize placeholder
|
||||||
|
|
||||||
|
Leave this Play Integrity mess to the professionals
|
||||||
|
|
||||||
|
Change-Id: Ic30a78f5417925e1c8899ce91c37fa41b2ff15c2
|
||||||
|
---
|
||||||
|
res/values/strings.xml | 6 ++++++
|
||||||
|
res/xml/treble_settings.xml | 10 ++++++++++
|
||||||
|
2 files changed, 16 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/res/values/strings.xml b/res/values/strings.xml
|
||||||
|
index b9bed8d56b5..f55ee2a048d 100644
|
||||||
|
--- a/res/values/strings.xml
|
||||||
|
+++ b/res/values/strings.xml
|
||||||
|
@@ -7355,6 +7355,8 @@
|
||||||
|
<string name="treble_settings_category_name_display">Display</string>
|
||||||
|
<!-- IMS category name [CHAR LIMIT=none] -->
|
||||||
|
<string name="treble_settings_category_name_ims">IMS</string>
|
||||||
|
+ <!-- System category name [CHAR LIMIT=none] -->
|
||||||
|
+ <string name="treble_settings_category_name_system">System</string>
|
||||||
|
<!-- UI category name [CHAR LIMIT=none] -->
|
||||||
|
<string name="treble_settings_category_name_ui">UI</string>
|
||||||
|
|
||||||
|
@@ -7383,6 +7385,10 @@
|
||||||
|
<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>
|
||||||
|
+ <!-- Treble settings screen, securize title -->
|
||||||
|
+ <string name="securize_title">Securize</string>
|
||||||
|
+ <!-- Treble settings screen, securize summary -->
|
||||||
|
+ <string name="securize_summary">Unsupported - please try other methods\n(e.g. PlayIntegrityFix module)</string>
|
||||||
|
<!-- Treble settings screen, override navbar availability title -->
|
||||||
|
<string name="override_navbar_availability_title">Override navigation bar availability</string>
|
||||||
|
|
||||||
|
diff --git a/res/xml/treble_settings.xml b/res/xml/treble_settings.xml
|
||||||
|
index 4e3bef9b644..13e74ee4f6c 100644
|
||||||
|
--- a/res/xml/treble_settings.xml
|
||||||
|
+++ b/res/xml/treble_settings.xml
|
||||||
|
@@ -62,6 +62,16 @@
|
||||||
|
|
||||||
|
</PreferenceCategory>
|
||||||
|
|
||||||
|
+ <PreferenceCategory
|
||||||
|
+ android:title="@string/treble_settings_category_name_system">
|
||||||
|
+
|
||||||
|
+ <Preference
|
||||||
|
+ android:enabled="false"
|
||||||
|
+ android:title="@string/securize_title"
|
||||||
|
+ android:summary="@string/securize_summary" />
|
||||||
|
+
|
||||||
|
+ </PreferenceCategory>
|
||||||
|
+
|
||||||
|
<PreferenceCategory
|
||||||
|
android:title="@string/treble_settings_category_name_ui">
|
||||||
|
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
@ -1,7 +1,7 @@
|
|||||||
From 0b172e212e68b219395ec28373d2f0e4423139a5 Mon Sep 17 00:00:00 2001
|
From 5a66cafc4821d898b3366445c07987ade57bab89 Mon Sep 17 00:00:00 2001
|
||||||
From: Peter Cai <peter@typeblog.net>
|
From: Peter Cai <peter@typeblog.net>
|
||||||
Date: Wed, 24 Aug 2022 15:45:18 -0400
|
Date: Wed, 24 Aug 2022 15:45:18 -0400
|
||||||
Subject: [PATCH 1/7] audio_hal_interface: Optionally use sysbta HAL
|
Subject: [PATCH] audio_hal_interface: Optionally use sysbta HAL
|
||||||
|
|
||||||
Required to support sysbta, our system-side bt audio implementation.
|
Required to support sysbta, our system-side bt audio implementation.
|
||||||
|
|
@ -1,7 +1,7 @@
|
|||||||
From b8b55f75bf016b5215081b7ba9347085d91089fe Mon Sep 17 00:00:00 2001
|
From 9eed8d4e6f8858cd5214e8e2d57475b11ef29493 Mon Sep 17 00:00:00 2001
|
||||||
From: Peter Cai <peter@typeblog.net>
|
From: Peter Cai <peter@typeblog.net>
|
||||||
Date: Sat, 16 Mar 2024 15:27:27 -0400
|
Date: Sat, 16 Mar 2024 15:27:27 -0400
|
||||||
Subject: [PATCH 4/6] Revert "drop support for V gsi on pixel 5 R base kernel"
|
Subject: [PATCH] Revert "drop support for V gsi on pixel 5 R base kernel"
|
||||||
|
|
||||||
This reverts commit bbbd18a71368a80f689b924dcf82062c2ee351b2.
|
This reverts commit bbbd18a71368a80f689b924dcf82062c2ee351b2.
|
||||||
---
|
---
|
@ -0,0 +1,37 @@
|
|||||||
|
From 1f5cafaf96da7e9f9049a7c41b9d2ce5998b8ea5 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 919be2ff2..809237bc9 100644
|
||||||
|
--- a/libcutils/fs_config.cpp
|
||||||
|
+++ b/libcutils/fs_config.cpp
|
||||||
|
@@ -83,7 +83,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" },
|
||||||
|
{ 00750, AID_ROOT, AID_SYSTEM, 0, "system_ext/apex/com.android.tethering/bin/for-system" },
|
||||||
|
{ 00751, AID_ROOT, AID_SHELL, 0, "system_ext/bin" },
|
||||||
|
@@ -188,7 +188,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.34.1
|
||||||
|
|
@ -1,7 +1,7 @@
|
|||||||
From 82927d1019eddeb325ea689cdf493717eab7bb49 Mon Sep 17 00:00:00 2001
|
From 9eb5fbb2fec3d1734d7f28f71e37655eaac067ce Mon Sep 17 00:00:00 2001
|
||||||
From: Victor Bo <bvoid@yandex.ru>
|
From: Victor Bo <bvoid@yandex.ru>
|
||||||
Date: Wed, 3 Mar 2021 06:31:17 -0500
|
Date: Wed, 3 Mar 2021 06:31:17 -0500
|
||||||
Subject: [PATCH] Restore /sbin for Magisk compatibility
|
Subject: [PATCH 2/4] Restore /sbin for Magisk compatibility
|
||||||
|
|
||||||
Squash of:
|
Squash of:
|
||||||
- Revert "Do not create /sbin"
|
- Revert "Do not create /sbin"
|
||||||
@ -30,7 +30,7 @@ index 0a534a2bd..81150a0fa 100644
|
|||||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/product_services.img)
|
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/product_services.img)
|
||||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/product_services)
|
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/product_services)
|
||||||
diff --git a/libcutils/fs_config.cpp b/libcutils/fs_config.cpp
|
diff --git a/libcutils/fs_config.cpp b/libcutils/fs_config.cpp
|
||||||
index 9ab7f4305..c45317d0f 100644
|
index 809237bc9..584e513f8 100644
|
||||||
--- a/libcutils/fs_config.cpp
|
--- a/libcutils/fs_config.cpp
|
||||||
+++ b/libcutils/fs_config.cpp
|
+++ b/libcutils/fs_config.cpp
|
||||||
@@ -76,6 +76,7 @@ static const struct fs_path_config android_dirs[] = {
|
@@ -76,6 +76,7 @@ static const struct fs_path_config android_dirs[] = {
|
@ -1,7 +1,7 @@
|
|||||||
From 99dd3f91dfbf98927a0e792ed8f92ddfe779acea Mon Sep 17 00:00:00 2001
|
From 767bbc383c83a8c9d04b7450d28a34d33e53392d Mon Sep 17 00:00:00 2001
|
||||||
From: Isaac Chen <tingyi364@gmail.com>
|
From: Isaac Chen <tingyi364@gmail.com>
|
||||||
Date: Wed, 23 Jun 2021 13:07:30 +0800
|
Date: Wed, 23 Jun 2021 13:07:30 +0800
|
||||||
Subject: [PATCH 03/26] init: Do not start console service when debuggable
|
Subject: [PATCH 3/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
|
Google added a check for this in R, when it's running it will show a
|
||||||
notification about that performance is impacted.
|
notification about that performance is impacted.
|
@ -1,7 +1,7 @@
|
|||||||
From 65fea9d642f39c087b7f6168dbcc30667f9c181d Mon Sep 17 00:00:00 2001
|
From 469c6ef39faeba84caf704564a3bc21c4261b665 Mon Sep 17 00:00:00 2001
|
||||||
From: Pierre-Hugues Husson <phh@phh.me>
|
From: Pierre-Hugues Husson <phh@phh.me>
|
||||||
Date: Sun, 18 Oct 2020 18:14:47 +0200
|
Date: Sun, 18 Oct 2020 18:14:47 +0200
|
||||||
Subject: [PATCH 02/26] Don't abandon creating property tree if there is a
|
Subject: [PATCH 4/4] Don't abandon creating property tree if there is a
|
||||||
conflict, and hope for the best
|
conflict, and hope for the best
|
||||||
|
|
||||||
Change-Id: I194c815fdd58bfb84aaf7db02b8f0d00b4db21e8
|
Change-Id: I194c815fdd58bfb84aaf7db02b8f0d00b4db21e8
|
@ -1,8 +1,8 @@
|
|||||||
From b5ae14d08e62bda486db4c9c3f54fd08d9e11158 Mon Sep 17 00:00:00 2001
|
From a56636e9543054107dfcfc9f77533fc05df053c6 Mon Sep 17 00:00:00 2001
|
||||||
From: danielzhang130 <37479705+danielzhang130@users.noreply.github.com>
|
From: danielzhang130 <37479705+danielzhang130@users.noreply.github.com>
|
||||||
Date: Fri, 12 Apr 2024 13:01:08 -0400
|
Date: Fri, 12 Apr 2024 13:01:08 -0400
|
||||||
Subject: [PATCH 2/2] Fix sepolicy for kernel < 5.10 that doesn't support bpf
|
Subject: [PATCH] Fix sepolicy for kernel < 5.10 that doesn't support bpf file
|
||||||
file context (#1)
|
context (#1)
|
||||||
|
|
||||||
Change-Id: I877bd90b1dc74c9d2f7713c70fd9aebd92331085
|
Change-Id: I877bd90b1dc74c9d2f7713c70fd9aebd92331085
|
||||||
|
|
@ -1,7 +1,7 @@
|
|||||||
From c2d239096a04484797137017eb717393cc21d212 Mon Sep 17 00:00:00 2001
|
From 1c1e3e209c687d9ef0e86c80a113208251a375b9 Mon Sep 17 00:00:00 2001
|
||||||
From: Pierre-Hugues Husson <phh@phh.me>
|
From: Pierre-Hugues Husson <phh@phh.me>
|
||||||
Date: Tue, 18 Oct 2022 16:08:09 -0400
|
Date: Tue, 18 Oct 2022 16:08:09 -0400
|
||||||
Subject: [PATCH 4/5] Exfat can be mounted with "exfat" kernel fs driver, or
|
Subject: [PATCH] Exfat can be mounted with "exfat" kernel fs driver, or
|
||||||
"sdfat" or "texfat" (Samsung and Sony variants)
|
"sdfat" or "texfat" (Samsung and Sony variants)
|
||||||
|
|
||||||
@AndyCGYan: Adapt to LineageOS vold
|
@AndyCGYan: Adapt to LineageOS vold
|
||||||
@ -13,7 +13,7 @@ Change-Id: I331e66d8cb37664adbd493b9190123e29f01fd9d
|
|||||||
2 files changed, 14 insertions(+), 2 deletions(-)
|
2 files changed, 14 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
diff --git a/Utils.cpp b/Utils.cpp
|
diff --git a/Utils.cpp b/Utils.cpp
|
||||||
index 5e719b6..e20f170 100644
|
index a7e85f2..fb67067 100644
|
||||||
--- a/Utils.cpp
|
--- a/Utils.cpp
|
||||||
+++ b/Utils.cpp
|
+++ b/Utils.cpp
|
||||||
@@ -1059,6 +1059,11 @@ bool IsFilesystemSupported(const std::string& fsType) {
|
@@ -1059,6 +1059,11 @@ bool IsFilesystemSupported(const std::string& fsType) {
|
||||||
@ -29,10 +29,10 @@ index 5e719b6..e20f170 100644
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/fs/Exfat.cpp b/fs/Exfat.cpp
|
diff --git a/fs/Exfat.cpp b/fs/Exfat.cpp
|
||||||
index ed53921..bbc739b 100644
|
index c8b19e0..46a0e2d 100644
|
||||||
--- a/fs/Exfat.cpp
|
--- a/fs/Exfat.cpp
|
||||||
+++ b/fs/Exfat.cpp
|
+++ b/fs/Exfat.cpp
|
||||||
@@ -64,13 +64,20 @@ status_t Mount(const std::string& source, const std::string& target, int ownerUi
|
@@ -61,13 +61,20 @@ status_t Mount(const std::string& source, const std::string& target, int ownerUi
|
||||||
auto mountData = android::base::StringPrintf("uid=%d,gid=%d,fmask=%o,dmask=%o", ownerUid,
|
auto mountData = android::base::StringPrintf("uid=%d,gid=%d,fmask=%o,dmask=%o", ownerUid,
|
||||||
ownerGid, permMask, permMask);
|
ownerGid, permMask, permMask);
|
||||||
|
|
||||||
@ -56,5 +56,5 @@ index ed53921..bbc739b 100644
|
|||||||
}
|
}
|
||||||
|
|
||||||
--
|
--
|
||||||
2.34.1
|
2.25.1
|
||||||
|
|
@ -1,85 +0,0 @@
|
|||||||
From 5de486b70139a2dc66c38b0be6df5396b74391fc Mon Sep 17 00:00:00 2001
|
|
||||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
|
||||||
Date: Mon, 15 Jul 2024 22:14:09 +0800
|
|
||||||
Subject: [PATCH] Remove Securize (2/2)
|
|
||||||
|
|
||||||
Leave this Play Integrity mess to the professionals
|
|
||||||
|
|
||||||
Change-Id: I36abaea9714ccdd5680be88e771143eee2a170cd
|
|
||||||
---
|
|
||||||
.../java/me/phh/treble/app/MiscSettings.kt | 34 -------------------
|
|
||||||
app/src/main/res/xml/pref_misc.xml | 6 ++--
|
|
||||||
2 files changed, 4 insertions(+), 36 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/app/src/main/java/me/phh/treble/app/MiscSettings.kt b/app/src/main/java/me/phh/treble/app/MiscSettings.kt
|
|
||||||
index 78556be..661abb2 100644
|
|
||||||
--- a/app/src/main/java/me/phh/treble/app/MiscSettings.kt
|
|
||||||
+++ b/app/src/main/java/me/phh/treble/app/MiscSettings.kt
|
|
||||||
@@ -21,7 +21,6 @@ object MiscSettings : Settings {
|
|
||||||
val disableButtonsBacklight = "key_misc_disable_buttons_backlight"
|
|
||||||
val forceNavbarOff = "key_misc_force_navbar_off"
|
|
||||||
val bluetooth = "key_misc_bluetooth"
|
|
||||||
- val securize = "key_misc_securize"
|
|
||||||
val removeTelephony = "key_misc_removetelephony"
|
|
||||||
val remotectl = "key_misc_remotectl"
|
|
||||||
val disableAudioEffects = "key_misc_disable_audio_effects"
|
|
||||||
@@ -58,39 +57,6 @@ class MiscSettingsFragment : SettingsFragment() {
|
|
||||||
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
|
|
||||||
super.onCreatePreferences(savedInstanceState, rootKey)
|
|
||||||
|
|
||||||
- val securizePref = findPreference<Preference>(MiscSettings.securize)
|
|
||||||
- securizePref!!.setOnPreferenceClickListener {
|
|
||||||
- val builder = AlertDialog.Builder( this.getActivity() )
|
|
||||||
- builder.setTitle(getString(R.string.remove_root))
|
|
||||||
- builder.setMessage(getString(R.string.continue_question))
|
|
||||||
-
|
|
||||||
- builder.setPositiveButton(android.R.string.yes) { dialog, which ->
|
|
||||||
-
|
|
||||||
- var cmds = listOf(
|
|
||||||
- arrayOf("/sbin/su", "-c", "/system/bin/phh-securize.sh"),
|
|
||||||
- arrayOf("/system/xbin/su", "-c", "/system/bin/phh-securize.sh"),
|
|
||||||
- arrayOf("/system/xbin/phh-su", "-c", "/system/bin/phh-securize.sh"),
|
|
||||||
- arrayOf("/sbin/su", "0", "/system/bin/phh-securize.sh"),
|
|
||||||
- arrayOf("/system/xbin/su", "0", "/system/bin/phh-securize.sh"),
|
|
||||||
- arrayOf("/system/xbin/phh-su", "0", "/system/bin/phh-securize.sh")
|
|
||||||
- )
|
|
||||||
- for (cmd in cmds) {
|
|
||||||
- try {
|
|
||||||
- Runtime.getRuntime().exec(cmd).waitFor()
|
|
||||||
- break
|
|
||||||
- } catch (t: Throwable) {
|
|
||||||
- Log.d("PHH", "Failed to exec \"" + cmd.joinToString(separator = " ") + "\", skipping")
|
|
||||||
- }
|
|
||||||
- }
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- builder.setNegativeButton(android.R.string.no) { dialog, which ->
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- builder.show()
|
|
||||||
- return@setOnPreferenceClickListener true
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
val removeTelephonyPref = findPreference<Preference>(MiscSettings.removeTelephony)
|
|
||||||
removeTelephonyPref!!.setOnPreferenceClickListener {
|
|
||||||
|
|
||||||
diff --git a/app/src/main/res/xml/pref_misc.xml b/app/src/main/res/xml/pref_misc.xml
|
|
||||||
index dbd8b88..0e8706d 100644
|
|
||||||
--- a/app/src/main/res/xml/pref_misc.xml
|
|
||||||
+++ b/app/src/main/res/xml/pref_misc.xml
|
|
||||||
@@ -203,8 +203,10 @@
|
|
||||||
android:entryValues="@array/pref_misc_fod_color_values"
|
|
||||||
android:key="key_misc_fod_color"
|
|
||||||
android:title="Under-display fp color" />
|
|
||||||
- <Preference android:title="Securize"
|
|
||||||
- android:key="key_misc_securize" />
|
|
||||||
+ <Preference
|
|
||||||
+ android:enabled="false"
|
|
||||||
+ android:title="Securize"
|
|
||||||
+ android:summary="Unsupported - please try other methods\n(e.g. PlayIntegrityFix module)" />
|
|
||||||
</PreferenceCategory>
|
|
||||||
<PreferenceCategory android:title="Debugging">
|
|
||||||
<Preference android:title="Debug Sensors">
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
@ -0,0 +1,25 @@
|
|||||||
|
From f2a436e690f020d1bf730283283b25fb99882b01 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 37a9923..2d2021e 100644
|
||||||
|
--- a/overlay.mk
|
||||||
|
+++ b/overlay.mk
|
||||||
|
@@ -1,7 +1,4 @@
|
||||||
|
PRODUCT_PACKAGES += \
|
||||||
|
- HardwareOverlayPicker \
|
||||||
|
- QtiAudio \
|
||||||
|
- TrebleApp \
|
||||||
|
treble-overlay-Hisense-HLTE556N \
|
||||||
|
treble-overlay-NavBar \
|
||||||
|
treble-overlay-NightMode \
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
@ -0,0 +1,135 @@
|
|||||||
|
From b37a53bfddd844a62673be768c3a6352886e617f 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/AndroidManifest.xml | 6 ++++--
|
||||||
|
Telephony/CAF-IMS/res/values/config.xml | 2 +-
|
||||||
|
Telephony/MTK-IMS/AndroidManifest.xml | 6 ++++--
|
||||||
|
Telephony/MTK-IMS/res/values/config.xml | 3 +--
|
||||||
|
8 files changed, 25 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/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/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.34.1
|
||||||
|
|
@ -1,45 +0,0 @@
|
|||||||
From 329e8930c11cd2a90dae2f127645ec2e830d3aa2 Mon Sep 17 00:00:00 2001
|
|
||||||
From: AndyCGYan <GeForce8800Ultra@gmail.com>
|
|
||||||
Date: Sun, 3 Mar 2019 14:07:33 +0800
|
|
||||||
Subject: [PATCH 1/2] build_soong: Disable generated_kernel_headers
|
|
||||||
|
|
||||||
...but done in a way so that there's no need to remove generated_kernel_headers from individual projects - thanks @ExpressLuke
|
|
||||||
|
|
||||||
Change-Id: I630857cec208f1830e776bf5031d7bb9bc4435d0
|
|
||||||
---
|
|
||||||
build/soong/Android.bp | 12 ------------
|
|
||||||
1 file changed, 12 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/build/soong/Android.bp b/build/soong/Android.bp
|
|
||||||
index 5899c987..3846fa01 100644
|
|
||||||
--- a/build/soong/Android.bp
|
|
||||||
+++ b/build/soong/Android.bp
|
|
||||||
@@ -20,9 +20,6 @@ bootstrap_go_package {
|
|
||||||
lineage_generator {
|
|
||||||
name: "generated_kernel_includes",
|
|
||||||
|
|
||||||
- // The headers make command
|
|
||||||
- cmd: "$(PATH_OVERRIDE_SOONG) $(KERNEL_MAKE_CMD) $(KERNEL_MAKE_FLAGS) -C $(TARGET_KERNEL_SOURCE) O=$(KERNEL_BUILD_OUT_PREFIX)$(genDir) ARCH=$(KERNEL_ARCH) $(KERNEL_CROSS_COMPILE) headers_install && vendor/lineage/tools/clean_headers.sh $(KERNEL_BUILD_OUT_PREFIX)$(genDir)",
|
|
||||||
-
|
|
||||||
// Directories that can be imported by a cc_* module generated_headers property
|
|
||||||
export_include_dirs: [
|
|
||||||
"usr/audio/include/uapi",
|
|
||||||
@@ -31,15 +28,6 @@ lineage_generator {
|
|
||||||
"usr/include/audio/include/uapi",
|
|
||||||
"usr/techpack/audio/include",
|
|
||||||
],
|
|
||||||
-
|
|
||||||
- // Sources for dependency tracking
|
|
||||||
- dep_root: "$(TARGET_KERNEL_SOURCE)",
|
|
||||||
- dep_files: [
|
|
||||||
- "Makefile",
|
|
||||||
- "include/**/*",
|
|
||||||
- "arch/$(KERNEL_ARCH)/include/**/*",
|
|
||||||
- "techpack/audio/include/**/*",
|
|
||||||
- ],
|
|
||||||
}
|
|
||||||
|
|
||||||
cc_defaults {
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
@ -0,0 +1,48 @@
|
|||||||
|
From a931f5059d0f87508de975d855e38f0cef03ed46 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, SettingsIntelligence, fwb overlays
|
||||||
|
|
||||||
|
Change-Id: I00cc5918164ed70c612c5caa31eb8d2d0cd05b62
|
||||||
|
---
|
||||||
|
config/common_full.mk | 3 +++
|
||||||
|
config/common_mobile.mk | 4 +++-
|
||||||
|
2 files changed, 6 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/config/common_full.mk b/config/common_full.mk
|
||||||
|
index f7eecd84..51e1e022 100644
|
||||||
|
--- a/config/common_full.mk
|
||||||
|
+++ b/config/common_full.mk
|
||||||
|
@@ -9,8 +9,11 @@ $(call inherit-product-if-exists, external/google-fonts/rubik/fonts.mk)
|
||||||
|
|
||||||
|
# Apps
|
||||||
|
PRODUCT_PACKAGES += \
|
||||||
|
+ Contacts \
|
||||||
|
+ DeskClock \
|
||||||
|
Eleven \
|
||||||
|
Etar \
|
||||||
|
+ Gallery2 \
|
||||||
|
Profiles \
|
||||||
|
Recorder \
|
||||||
|
Seedvault
|
||||||
|
diff --git a/config/common_mobile.mk b/config/common_mobile.mk
|
||||||
|
index 4e898b4b..8dc5bf5a 100644
|
||||||
|
--- a/config/common_mobile.mk
|
||||||
|
+++ b/config/common_mobile.mk
|
||||||
|
@@ -16,7 +16,9 @@ PRODUCT_PRODUCT_PROPERTIES += \
|
||||||
|
# Apps
|
||||||
|
PRODUCT_PACKAGES += \
|
||||||
|
Backgrounds \
|
||||||
|
- Glimpse
|
||||||
|
+ Glimpse \
|
||||||
|
+ SettingsIntelligence \
|
||||||
|
+ frameworks-base-overlays
|
||||||
|
|
||||||
|
ifeq ($(PRODUCT_TYPE), go)
|
||||||
|
PRODUCT_PACKAGES += \
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
From 12793ea2bcf49d7ffa7231aa8560d5a629e48c88 Mon Sep 17 00:00:00 2001
|
From a946e53c08d8296f2e648870c266df8d680f2427 Mon Sep 17 00:00:00 2001
|
||||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||||
Date: Tue, 19 Oct 2021 15:48:43 +0000
|
Date: Tue, 19 Oct 2021 15:48:43 +0000
|
||||||
Subject: [PATCH 2/2] vendor_lineage: Disable ADB authentication
|
Subject: [PATCH 2/2] vendor_lineage: Disable ADB authentication
|
||||||
|
@ -0,0 +1,27 @@
|
|||||||
|
From a1ae87fa01e6e31fb733045d05a956ba4dfd00d6 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||||
|
Date: Sat, 24 Sep 2022 07:44:20 +0000
|
||||||
|
Subject: [PATCH] Skip mounting /my_manifest on GSIs
|
||||||
|
|
||||||
|
On OPlus devices, /my_manifest/build.prop unnecessarily overrides a ton of props
|
||||||
|
All my_* partitions are supposedly useless on GSIs, but only skip this for now
|
||||||
|
|
||||||
|
Change-Id: I638fd8ed2cfd7ca835a8e46fd235ebf08c2460a4
|
||||||
|
---
|
||||||
|
target/product/gsi/gsi_skip_mount.cfg | 3 +++
|
||||||
|
1 file changed, 3 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/target/product/gsi/gsi_skip_mount.cfg b/target/product/gsi/gsi_skip_mount.cfg
|
||||||
|
index 28f434966..612c3bc81 100644
|
||||||
|
--- a/target/product/gsi/gsi_skip_mount.cfg
|
||||||
|
+++ b/target/product/gsi/gsi_skip_mount.cfg
|
||||||
|
@@ -7,3 +7,6 @@
|
||||||
|
/product/*
|
||||||
|
/system_ext/*
|
||||||
|
/system/*
|
||||||
|
+# Skip OPlus "my_manifest" mountpoints.
|
||||||
|
+/mnt/vendor/my_manifest
|
||||||
|
+/my_manifest
|
||||||
|
--
|
||||||
|
2.25.1
|
||||||
|
|
@ -1,432 +0,0 @@
|
|||||||
From c237d550fffad14a20990d9ee072dbe44cb31768 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
|
||||||
Date: Tue, 22 Jun 2021 13:38:31 +0000
|
|
||||||
Subject: [PATCH 1/3] Add Meizu 18 vibrator support
|
|
||||||
|
|
||||||
Thanks to:
|
|
||||||
- @phhusson for guidance
|
|
||||||
- Google for marlin HAL as reference in implementing 1.0
|
|
||||||
- @xingrz for Meizu 16th HAL as reference in implementing 1.3
|
|
||||||
|
|
||||||
Change-Id: Iecf12cd814e8773abfd78a19f98e31125a73761a
|
|
||||||
---
|
|
||||||
base.mk | 4 +
|
|
||||||
meizu-vibrator/Android.bp | 32 ++++
|
|
||||||
meizu-vibrator/Vibrator.cpp | 140 ++++++++++++++++++
|
|
||||||
meizu-vibrator/Vibrator.h | 60 ++++++++
|
|
||||||
...oid.hardware.vibrator@1.3-service.meizu.rc | 5 +
|
|
||||||
...id.hardware.vibrator@1.3-service.meizu.xml | 11 ++
|
|
||||||
meizu-vibrator/service.cpp | 72 +++++++++
|
|
||||||
sepolicy/file_contexts | 1 +
|
|
||||||
sepolicy/hal.te | 11 ++
|
|
||||||
9 files changed, 336 insertions(+)
|
|
||||||
create mode 100644 meizu-vibrator/Android.bp
|
|
||||||
create mode 100644 meizu-vibrator/Vibrator.cpp
|
|
||||||
create mode 100644 meizu-vibrator/Vibrator.h
|
|
||||||
create mode 100644 meizu-vibrator/android.hardware.vibrator@1.3-service.meizu.rc
|
|
||||||
create mode 100644 meizu-vibrator/android.hardware.vibrator@1.3-service.meizu.xml
|
|
||||||
create mode 100644 meizu-vibrator/service.cpp
|
|
||||||
|
|
||||||
diff --git a/base.mk b/base.mk
|
|
||||||
index 7dce0a0..bb48831 100644
|
|
||||||
--- a/base.mk
|
|
||||||
+++ b/base.mk
|
|
||||||
@@ -269,4 +269,8 @@ $(call inherit-product, $(SRC_TARGET_DIR)/product/window_extensions.mk)
|
|
||||||
PRODUCT_PRODUCT_PROPERTIES += \
|
|
||||||
persist.settings.large_screen_opt.enabled=true
|
|
||||||
|
|
||||||
+# Meizu vibrator
|
|
||||||
+PRODUCT_PACKAGES += \
|
|
||||||
+ android.hardware.vibrator@1.3-service.meizu
|
|
||||||
+
|
|
||||||
PRODUCT_EXTRA_VNDK_VERSIONS += 28 29
|
|
||||||
diff --git a/meizu-vibrator/Android.bp b/meizu-vibrator/Android.bp
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000..76ad034
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/meizu-vibrator/Android.bp
|
|
||||||
@@ -0,0 +1,32 @@
|
|
||||||
+//
|
|
||||||
+// Copyright (C) 2017 The Android Open Source Project
|
|
||||||
+//
|
|
||||||
+// Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
+// you may not use this file except in compliance with the License.
|
|
||||||
+// You may obtain a copy of the License at
|
|
||||||
+//
|
|
||||||
+// http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
+//
|
|
||||||
+// Unless required by applicable law or agreed to in writing, software
|
|
||||||
+// distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
+// See the License for the specific language governing permissions and
|
|
||||||
+// limitations under the License.
|
|
||||||
+cc_binary {
|
|
||||||
+ name: "android.hardware.vibrator@1.3-service.meizu",
|
|
||||||
+ relative_install_path: "hw",
|
|
||||||
+ vintf_fragments: ["android.hardware.vibrator@1.3-service.meizu.xml"],
|
|
||||||
+ init_rc: ["android.hardware.vibrator@1.3-service.meizu.rc"],
|
|
||||||
+ srcs: ["service.cpp", "Vibrator.cpp"],
|
|
||||||
+ cflags: ["-Wall", "-Werror"],
|
|
||||||
+ shared_libs: [
|
|
||||||
+ "libhidlbase",
|
|
||||||
+ "liblog",
|
|
||||||
+ "libutils",
|
|
||||||
+ "libhardware",
|
|
||||||
+ "android.hardware.vibrator@1.0",
|
|
||||||
+ "android.hardware.vibrator@1.1",
|
|
||||||
+ "android.hardware.vibrator@1.2",
|
|
||||||
+ "android.hardware.vibrator@1.3",
|
|
||||||
+ ],
|
|
||||||
+}
|
|
||||||
diff --git a/meizu-vibrator/Vibrator.cpp b/meizu-vibrator/Vibrator.cpp
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000..8f12987
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/meizu-vibrator/Vibrator.cpp
|
|
||||||
@@ -0,0 +1,140 @@
|
|
||||||
+/*
|
|
||||||
+ * Copyright (C) 2017 The Android Open Source Project
|
|
||||||
+ *
|
|
||||||
+ * Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
+ * you may not use this file except in compliance with the License.
|
|
||||||
+ * You may obtain a copy of the License at
|
|
||||||
+ *
|
|
||||||
+ * http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
+ *
|
|
||||||
+ * Unless required by applicable law or agreed to in writing, software
|
|
||||||
+ * distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
+ * See the License for the specific language governing permissions and
|
|
||||||
+ * limitations under the License.
|
|
||||||
+ */
|
|
||||||
+
|
|
||||||
+#define LOG_TAG "VibratorService"
|
|
||||||
+
|
|
||||||
+#include <log/log.h>
|
|
||||||
+
|
|
||||||
+#include <hardware/hardware.h>
|
|
||||||
+#include <hardware/vibrator.h>
|
|
||||||
+
|
|
||||||
+#include "Vibrator.h"
|
|
||||||
+
|
|
||||||
+#include <cinttypes>
|
|
||||||
+#include <cmath>
|
|
||||||
+#include <iostream>
|
|
||||||
+#include <fstream>
|
|
||||||
+#include <thread>
|
|
||||||
+#include <unistd.h>
|
|
||||||
+
|
|
||||||
+namespace android {
|
|
||||||
+namespace hardware {
|
|
||||||
+namespace vibrator {
|
|
||||||
+namespace V1_3 {
|
|
||||||
+namespace implementation {
|
|
||||||
+
|
|
||||||
+Vibrator::Vibrator(std::ofstream&& timeoutAndAmplitude, std::ofstream&& waveNumber, std::ofstream&& effectTrigger) :
|
|
||||||
+ mTimeoutAndAmplitude(std::move(timeoutAndAmplitude)),
|
|
||||||
+ mWaveNumber(std::move(waveNumber)),
|
|
||||||
+ mEffectTrigger(std::move(effectTrigger)) {}
|
|
||||||
+
|
|
||||||
+Return<Status> Vibrator::on(uint32_t timeout_ms) {
|
|
||||||
+ // Wave number 12 for vibrations slightly stronger than stock (13)
|
|
||||||
+ mWaveNumber << 12 << std::endl;
|
|
||||||
+ mTimeoutAndAmplitude << timeout_ms << std::endl;
|
|
||||||
+ if (!mTimeoutAndAmplitude) {
|
|
||||||
+ ALOGE("Failed to turn vibrator on (%d): %s", errno, strerror(errno));
|
|
||||||
+ return Status::UNKNOWN_ERROR;
|
|
||||||
+ }
|
|
||||||
+ return Status::OK;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+Return<Status> Vibrator::off() {
|
|
||||||
+ mTimeoutAndAmplitude << 0 << std::endl;
|
|
||||||
+ if (!mTimeoutAndAmplitude) {
|
|
||||||
+ ALOGE("Failed to turn vibrator off (%d): %s", errno, strerror(errno));
|
|
||||||
+ return Status::UNKNOWN_ERROR;
|
|
||||||
+ }
|
|
||||||
+ return Status::OK;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+Return<bool> Vibrator::supportsAmplitudeControl() {
|
|
||||||
+ return false;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+Return<Status> Vibrator::setAmplitude(uint8_t) {
|
|
||||||
+ return Status::UNSUPPORTED_OPERATION;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+Return<void> Vibrator::perform(V1_0::Effect effect, EffectStrength strength, perform_cb _hidl_cb) {
|
|
||||||
+ return perform<decltype(effect)>(effect, strength, _hidl_cb);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+Return<void> Vibrator::perform_1_1(V1_1::Effect_1_1 effect, EffectStrength strength, perform_cb _hidl_cb) {
|
|
||||||
+ return perform<decltype(effect)>(effect, strength, _hidl_cb);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+Return<void> Vibrator::perform_1_2(V1_2::Effect effect, EffectStrength strength, perform_cb _hidl_cb) {
|
|
||||||
+ return perform<decltype(effect)>(effect, strength, _hidl_cb);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+Return<void> Vibrator::perform_1_3(Effect effect, EffectStrength strength, perform_cb _hidl_cb) {
|
|
||||||
+ return perform<decltype(effect)>(effect, strength, _hidl_cb);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+Return<bool> Vibrator::supportsExternalControl() {
|
|
||||||
+ return false;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+Return<Status> Vibrator::setExternalControl(bool) {
|
|
||||||
+ return Status::UNSUPPORTED_OPERATION;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+Return<void> Vibrator::perform(Effect effect, EffectStrength, perform_cb _hidl_cb) {
|
|
||||||
+ uint32_t id;
|
|
||||||
+ switch (effect) {
|
|
||||||
+ case Effect::CLICK:
|
|
||||||
+ id = 31008;
|
|
||||||
+ break;
|
|
||||||
+ case Effect::DOUBLE_CLICK:
|
|
||||||
+ id = 31003;
|
|
||||||
+ break;
|
|
||||||
+ case Effect::TICK:
|
|
||||||
+ case Effect::TEXTURE_TICK:
|
|
||||||
+ id = 21000;
|
|
||||||
+ break;
|
|
||||||
+ case Effect::THUD:
|
|
||||||
+ id = 30900;
|
|
||||||
+ break;
|
|
||||||
+ case Effect::POP:
|
|
||||||
+ id = 22520;
|
|
||||||
+ break;
|
|
||||||
+ case Effect::HEAVY_CLICK:
|
|
||||||
+ id = 30900;
|
|
||||||
+ break;
|
|
||||||
+ default:
|
|
||||||
+ _hidl_cb(Status::UNSUPPORTED_OPERATION, 0);
|
|
||||||
+ return Void();
|
|
||||||
+ }
|
|
||||||
+ mEffectTrigger << id << std::endl;
|
|
||||||
+ _hidl_cb(Status::OK, 200);
|
|
||||||
+ return Void();
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+template <typename T> Return<void> Vibrator::perform(T effect, EffectStrength strength, perform_cb _hidl_cb) {
|
|
||||||
+ auto validRange = hidl_enum_range<T>();
|
|
||||||
+ if (effect < *validRange.begin() || effect > *std::prev(validRange.end())) {
|
|
||||||
+ _hidl_cb(Status::UNSUPPORTED_OPERATION, 0);
|
|
||||||
+ return Void();
|
|
||||||
+ }
|
|
||||||
+ return perform(static_cast<Effect>(effect), strength, _hidl_cb);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+} // namespace implementation
|
|
||||||
+} // namespace V1_3
|
|
||||||
+} // namespace vibrator
|
|
||||||
+} // namespace hardware
|
|
||||||
+} // namespace android
|
|
||||||
diff --git a/meizu-vibrator/Vibrator.h b/meizu-vibrator/Vibrator.h
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000..df901aa
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/meizu-vibrator/Vibrator.h
|
|
||||||
@@ -0,0 +1,60 @@
|
|
||||||
+/*
|
|
||||||
+ * Copyright (C) 2017 The Android Open Source Project
|
|
||||||
+ *
|
|
||||||
+ * Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
+ * you may not use this file except in compliance with the License.
|
|
||||||
+ * You may obtain a copy of the License at
|
|
||||||
+ *
|
|
||||||
+ * http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
+ *
|
|
||||||
+ * Unless required by applicable law or agreed to in writing, software
|
|
||||||
+ * distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
+ * See the License for the specific language governing permissions and
|
|
||||||
+ * limitations under the License.
|
|
||||||
+ */
|
|
||||||
+#ifndef ANDROID_HARDWARE_VIBRATOR_V1_3_VIBRATOR_H
|
|
||||||
+#define ANDROID_HARDWARE_VIBRATOR_V1_3_VIBRATOR_H
|
|
||||||
+
|
|
||||||
+#include <android/hardware/vibrator/1.3/IVibrator.h>
|
|
||||||
+#include <hidl/Status.h>
|
|
||||||
+
|
|
||||||
+#include <fstream>
|
|
||||||
+
|
|
||||||
+namespace android {
|
|
||||||
+namespace hardware {
|
|
||||||
+namespace vibrator {
|
|
||||||
+namespace V1_3 {
|
|
||||||
+namespace implementation {
|
|
||||||
+
|
|
||||||
+using android::hardware::vibrator::V1_0::EffectStrength;
|
|
||||||
+using android::hardware::vibrator::V1_0::Status;
|
|
||||||
+
|
|
||||||
+class Vibrator : public IVibrator {
|
|
||||||
+public:
|
|
||||||
+ Vibrator(std::ofstream&& timeoutAndAmplitude, std::ofstream&& waveNumber, std::ofstream&& effectTrigger);
|
|
||||||
+ Return<Status> on(uint32_t timeoutMs) override;
|
|
||||||
+ Return<Status> off() override;
|
|
||||||
+ Return<bool> supportsAmplitudeControl() override;
|
|
||||||
+ Return<Status> setAmplitude(uint8_t amplitude) override;
|
|
||||||
+ Return<void> perform(V1_0::Effect effect, EffectStrength strength, perform_cb _hidl_cb) override;
|
|
||||||
+ Return<void> perform_1_1(V1_1::Effect_1_1 effect, EffectStrength strength, perform_cb _hidl_cb) override;
|
|
||||||
+ Return<void> perform_1_2(V1_2::Effect effect, EffectStrength strength, perform_cb _hidl_cb) override;
|
|
||||||
+ Return<void> perform_1_3(Effect effect, EffectStrength strength, perform_cb _hidl_cb) override;
|
|
||||||
+ Return<bool> supportsExternalControl() override;
|
|
||||||
+ Return<Status> setExternalControl(bool enabled) override;
|
|
||||||
+
|
|
||||||
+private:
|
|
||||||
+ Return<void> perform(Effect effect, EffectStrength strength, perform_cb _hidl_cb);
|
|
||||||
+ template <typename T> Return<void> perform(T effect, EffectStrength strength, perform_cb _hidl_cb);
|
|
||||||
+ std::ofstream mTimeoutAndAmplitude;
|
|
||||||
+ std::ofstream mWaveNumber;
|
|
||||||
+ std::ofstream mEffectTrigger;
|
|
||||||
+};
|
|
||||||
+} // namespace implementation
|
|
||||||
+} // namespace V1_3
|
|
||||||
+} // namespace vibrator
|
|
||||||
+} // namespace hardware
|
|
||||||
+} // namespace android
|
|
||||||
+
|
|
||||||
+#endif // ANDROID_HARDWARE_VIBRATOR_V1_3_VIBRATOR_H
|
|
||||||
diff --git a/meizu-vibrator/android.hardware.vibrator@1.3-service.meizu.rc b/meizu-vibrator/android.hardware.vibrator@1.3-service.meizu.rc
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000..527ff66
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/meizu-vibrator/android.hardware.vibrator@1.3-service.meizu.rc
|
|
||||||
@@ -0,0 +1,5 @@
|
|
||||||
+service vibrator.meizu /system/bin/hw/android.hardware.vibrator@1.3-service.meizu
|
|
||||||
+ class late_start
|
|
||||||
+ user system
|
|
||||||
+ group system
|
|
||||||
+ oneshot
|
|
||||||
diff --git a/meizu-vibrator/android.hardware.vibrator@1.3-service.meizu.xml b/meizu-vibrator/android.hardware.vibrator@1.3-service.meizu.xml
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000..d1b836e
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/meizu-vibrator/android.hardware.vibrator@1.3-service.meizu.xml
|
|
||||||
@@ -0,0 +1,11 @@
|
|
||||||
+<manifest version="1.0" type="framework">
|
|
||||||
+ <hal format="hidl">
|
|
||||||
+ <name>android.hardware.vibrator</name>
|
|
||||||
+ <transport>hwbinder</transport>
|
|
||||||
+ <version>1.3</version>
|
|
||||||
+ <interface>
|
|
||||||
+ <name>IVibrator</name>
|
|
||||||
+ <instance>default</instance>
|
|
||||||
+ </interface>
|
|
||||||
+ </hal>
|
|
||||||
+</manifest>
|
|
||||||
diff --git a/meizu-vibrator/service.cpp b/meizu-vibrator/service.cpp
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000..1405dfb
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/meizu-vibrator/service.cpp
|
|
||||||
@@ -0,0 +1,72 @@
|
|
||||||
+/*
|
|
||||||
+ * Copyright (C) 2017 The Android Open Source Project
|
|
||||||
+ *
|
|
||||||
+ * Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
+ * you may not use this file except in compliance with the License.
|
|
||||||
+ * You may obtain a copy of the License at
|
|
||||||
+ *
|
|
||||||
+ * http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
+ *
|
|
||||||
+ * Unless required by applicable law or agreed to in writing, software
|
|
||||||
+ * distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
+ * See the License for the specific language governing permissions and
|
|
||||||
+ * limitations under the License.
|
|
||||||
+ */
|
|
||||||
+#define LOG_TAG "android.hardware.vibrator@1.3-service.meizu"
|
|
||||||
+
|
|
||||||
+#include <android/hardware/vibrator/1.3/IVibrator.h>
|
|
||||||
+#include <hidl/HidlSupport.h>
|
|
||||||
+#include <hidl/HidlTransportSupport.h>
|
|
||||||
+#include <utils/Errors.h>
|
|
||||||
+#include <utils/StrongPointer.h>
|
|
||||||
+
|
|
||||||
+#include "Vibrator.h"
|
|
||||||
+
|
|
||||||
+using android::hardware::configureRpcThreadpool;
|
|
||||||
+using android::hardware::joinRpcThreadpool;
|
|
||||||
+using android::hardware::vibrator::V1_3::IVibrator;
|
|
||||||
+using android::hardware::vibrator::V1_3::implementation::Vibrator;
|
|
||||||
+using namespace android;
|
|
||||||
+
|
|
||||||
+static const char *CONTROL_PATH_TIMEOUT = "/sys/class/timed_output/vibrator/enable";
|
|
||||||
+static const char *PATH_WAVE_NUMBER = "/sys/class/meizu/motor/waveform";
|
|
||||||
+static const char *CONTROL_PATH_EFFECT = "/sys/class/meizu/motor/on_off";
|
|
||||||
+
|
|
||||||
+status_t registerVibratorService() {
|
|
||||||
+ std::ofstream timeoutAndAmplitude{CONTROL_PATH_TIMEOUT};
|
|
||||||
+ if (!timeoutAndAmplitude) {
|
|
||||||
+ int error = errno;
|
|
||||||
+ ALOGE("Failed to open %s (%d): %s", CONTROL_PATH_TIMEOUT, error, strerror(error));
|
|
||||||
+ return -error;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ std::ofstream waveNumber{PATH_WAVE_NUMBER};
|
|
||||||
+ if (!waveNumber) {
|
|
||||||
+ int error = errno;
|
|
||||||
+ ALOGE("Failed to open %s (%d): %s", PATH_WAVE_NUMBER, error, strerror(error));
|
|
||||||
+ return -error;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ std::ofstream effectTrigger{CONTROL_PATH_EFFECT};
|
|
||||||
+ if (!effectTrigger) {
|
|
||||||
+ int error = errno;
|
|
||||||
+ ALOGE("Failed to open %s (%d): %s", CONTROL_PATH_EFFECT, error, strerror(error));
|
|
||||||
+ return -error;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ sp<IVibrator> vibrator = new Vibrator(std::move(timeoutAndAmplitude), std::move(waveNumber), std::move(effectTrigger));
|
|
||||||
+ (void) vibrator->registerAsService(); // suppress unused-result warning
|
|
||||||
+ return OK;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+int main() {
|
|
||||||
+ configureRpcThreadpool(1, true);
|
|
||||||
+ status_t status = registerVibratorService();
|
|
||||||
+
|
|
||||||
+ if (status != OK) {
|
|
||||||
+ return status;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ joinRpcThreadpool();
|
|
||||||
+}
|
|
||||||
diff --git a/sepolicy/file_contexts b/sepolicy/file_contexts
|
|
||||||
index beb639a..3bc437c 100644
|
|
||||||
--- a/sepolicy/file_contexts
|
|
||||||
+++ b/sepolicy/file_contexts
|
|
||||||
@@ -14,6 +14,7 @@
|
|
||||||
|
|
||||||
/system/bin/hw/android.hardware.biometrics.fingerprint@2.1-service.oppo.compat u:object_r:hal_fingerprint_oppo_compat_exec:s0
|
|
||||||
/system/bin/hw/android.hardware.biometrics.fingerprint@2.1-service.oplus.compat u:object_r:hal_fingerprint_oppo_compat_exec:s0
|
|
||||||
+/system/bin/hw/android.hardware.vibrator@1.3-service.meizu u:object_r:hal_vibrator_default_exec:s0
|
|
||||||
|
|
||||||
/efs u:object_r:efs_file:s0
|
|
||||||
|
|
||||||
diff --git a/sepolicy/hal.te b/sepolicy/hal.te
|
|
||||||
index cb44422..280ae2d 100644
|
|
||||||
--- a/sepolicy/hal.te
|
|
||||||
+++ b/sepolicy/hal.te
|
|
||||||
@@ -8,3 +8,14 @@ init_daemon_domain(hal_fingerprint_oppo_compat)
|
|
||||||
|
|
||||||
type hal_fingerprint_oppo, domain;
|
|
||||||
allow hal_fingerprint_oppo vendor_default_prop:property_service { set };
|
|
||||||
+
|
|
||||||
+type vib_strength_sysfs, fs_type, sysfs_type;
|
|
||||||
+
|
|
||||||
+type hal_vibrator_default, domain;
|
|
||||||
+hal_server_domain(hal_vibrator_default, hal_vibrator)
|
|
||||||
+
|
|
||||||
+type hal_vibrator_default_exec, exec_type, vendor_file_type, file_type;
|
|
||||||
+init_daemon_domain(hal_vibrator_default)
|
|
||||||
+
|
|
||||||
+allow hal_vibrator_default vib_strength_sysfs:dir rw_dir_perms;
|
|
||||||
+allow hal_vibrator_default vib_strength_sysfs:file rw_file_perms;
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
|||||||
From 5e0cf531dacb7a8c6d112917fd69d67c3d978909 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
|
||||||
Date: Thu, 28 Oct 2021 01:51:27 +0000
|
|
||||||
Subject: [PATCH 2/3] Revert "Include sim toolkit app"
|
|
||||||
|
|
||||||
This reverts commit 52d4d731465f37e3e8ccf9d315cfc8195303e51f.
|
|
||||||
|
|
||||||
Change-Id: I1eb7f4bb070eea649b4cea6280299e629d1edb3d
|
|
||||||
---
|
|
||||||
base.mk | 3 ---
|
|
||||||
1 file changed, 3 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/base.mk b/base.mk
|
|
||||||
index bb48831..27f74f3 100644
|
|
||||||
--- a/base.mk
|
|
||||||
+++ b/base.mk
|
|
||||||
@@ -172,9 +172,6 @@ PRODUCT_PACKAGES += \
|
|
||||||
xiaomi-motor \
|
|
||||||
oneplus-motor
|
|
||||||
|
|
||||||
-PRODUCT_PACKAGES += \
|
|
||||||
- Stk
|
|
||||||
-
|
|
||||||
PRODUCT_PACKAGES += \
|
|
||||||
resetprop_phh
|
|
||||||
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
@ -1,27 +0,0 @@
|
|||||||
From 1332d9d8058ce117d1a3cf8880c13aa24556985b Mon Sep 17 00:00:00 2001
|
|
||||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
|
||||||
Date: Sun, 8 Aug 2021 09:31:01 +0000
|
|
||||||
Subject: [PATCH 3/3] Revert "treble: Set BOARD_EXT4_SHARE_DUP_BLOCKS
|
|
||||||
explicitly"
|
|
||||||
|
|
||||||
This reverts commit d7b179f234d76c3acf7a723fc05f07efe9adc84c.
|
|
||||||
|
|
||||||
Change-Id: I2bf95d40d4a096181710765c7d152f63556d27d8
|
|
||||||
---
|
|
||||||
board-base.mk | 2 --
|
|
||||||
1 file changed, 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/board-base.mk b/board-base.mk
|
|
||||||
index 9d1d45e..8cde64f 100644
|
|
||||||
--- a/board-base.mk
|
|
||||||
+++ b/board-base.mk
|
|
||||||
@@ -11,6 +11,4 @@ BUILD_BROKEN_ELF_PREBUILT_PRODUCT_COPY_FILES := true
|
|
||||||
|
|
||||||
BOARD_ROOT_EXTRA_SYMLINKS := $(filter-out $(BOARD_ROOT_EXTRA_SYMLINKS),/mnt/vendor/persist:/persist)
|
|
||||||
|
|
||||||
-BOARD_EXT4_SHARE_DUP_BLOCKS := true
|
|
||||||
-
|
|
||||||
TARGET_NO_KERNEL_OVERRIDE := true
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
@ -1,509 +0,0 @@
|
|||||||
From 927ad33505d92b92867c6c0b0c0d412780be2e93 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
|
||||||
Date: Sun, 21 Apr 2024 18:02:54 +0800
|
|
||||||
Subject: [PATCH 1/2] Squashed revert of LOS UDFPS changes
|
|
||||||
|
|
||||||
Way less than FOD, but reverting them nonetheless to keep in line with PHH AOSP
|
|
||||||
|
|
||||||
- Revert "fixup! udfps: Restore illumination dot for global hbm"
|
|
||||||
- Revert "fixup! SystemUI: Add UDFPS framework dimming support"
|
|
||||||
- Revert "fixup! SystemUI: Add UDFPS framework dimming support"
|
|
||||||
- Revert "fixup! udfps: Make pressed udfp view configurable"
|
|
||||||
- Revert "SystemUI: Only set dim behind UDFPS if it is actually enabled"
|
|
||||||
- Revert "SystemUI: Add UDFPS framework dimming support"
|
|
||||||
- Revert "udfps: Make pressed udfp view configurable"
|
|
||||||
- Revert "udfps: Restore illumination dot for global hbm"
|
|
||||||
---
|
|
||||||
.../res/drawable-nodpi/udfps_icon_pressed.png | Bin 108 -> 0 bytes
|
|
||||||
packages/SystemUI/res/layout/udfps_view.xml | 6 -
|
|
||||||
.../SystemUI/res/values/lineage_config.xml | 39 -----
|
|
||||||
.../systemui/biometrics/UdfpsController.java | 82 ---------
|
|
||||||
.../biometrics/UdfpsControllerOverlay.kt | 13 --
|
|
||||||
.../systemui/biometrics/UdfpsSurfaceView.java | 159 ------------------
|
|
||||||
.../android/systemui/biometrics/UdfpsView.kt | 32 +---
|
|
||||||
7 files changed, 1 insertion(+), 330 deletions(-)
|
|
||||||
delete mode 100644 packages/SystemUI/res/drawable-nodpi/udfps_icon_pressed.png
|
|
||||||
delete mode 100644 packages/SystemUI/src/com/android/systemui/biometrics/UdfpsSurfaceView.java
|
|
||||||
|
|
||||||
diff --git a/packages/SystemUI/res/drawable-nodpi/udfps_icon_pressed.png b/packages/SystemUI/res/drawable-nodpi/udfps_icon_pressed.png
|
|
||||||
deleted file mode 100644
|
|
||||||
index 4102e28c1300b49323b50625d8cfaa73b006561f..0000000000000000000000000000000000000000
|
|
||||||
GIT binary patch
|
|
||||||
literal 0
|
|
||||||
HcmV?d00001
|
|
||||||
|
|
||||||
literal 108
|
|
||||||
zcmeAS@N?(olHy`uVBq!ia0vp^j3CUx1|;Q0k8}bl$r9IylHmNblJdl&R0hYC{G?O`
|
|
||||||
z&)mfH)S%SFl*+=BsWw1Ge4Z|jAr-fh5*U~o7?>FtSQ!{^cTT<plwt66^>bP0l+XkK
|
|
||||||
D@OB!I
|
|
||||||
|
|
||||||
diff --git a/packages/SystemUI/res/layout/udfps_view.xml b/packages/SystemUI/res/layout/udfps_view.xml
|
|
||||||
index 0fcbfa161ddf..257d238f5c54 100644
|
|
||||||
--- a/packages/SystemUI/res/layout/udfps_view.xml
|
|
||||||
+++ b/packages/SystemUI/res/layout/udfps_view.xml
|
|
||||||
@@ -28,10 +28,4 @@
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"/>
|
|
||||||
|
|
||||||
- <com.android.systemui.biometrics.UdfpsSurfaceView
|
|
||||||
- android:id="@+id/hbm_view"
|
|
||||||
- android:layout_width="match_parent"
|
|
||||||
- android:layout_height="match_parent"
|
|
||||||
- android:visibility="invisible"/>
|
|
||||||
-
|
|
||||||
</com.android.systemui.biometrics.UdfpsView>
|
|
||||||
diff --git a/packages/SystemUI/res/values/lineage_config.xml b/packages/SystemUI/res/values/lineage_config.xml
|
|
||||||
index 79c2865567a7..a708f909d4a9 100644
|
|
||||||
--- a/packages/SystemUI/res/values/lineage_config.xml
|
|
||||||
+++ b/packages/SystemUI/res/values/lineage_config.xml
|
|
||||||
@@ -15,45 +15,6 @@
|
|
||||||
limitations under the License.
|
|
||||||
-->
|
|
||||||
<resources>
|
|
||||||
- <!-- Color of the UDFPS pressed view -->
|
|
||||||
- <color name="config_udfpsColor">#ffffffff</color>
|
|
||||||
-
|
|
||||||
- <!-- Whether to enable framework dimming for UDFPS -->
|
|
||||||
- <bool name="config_udfpsFrameworkDimming">false</bool>
|
|
||||||
-
|
|
||||||
- <!-- Array of brightness-alpha LUT for framework dimming -->
|
|
||||||
- <string-array name="config_udfpsDimmingBrightnessAlphaArray" translatable="false">
|
|
||||||
- <!-- Example:
|
|
||||||
- <item>0,255</item>
|
|
||||||
- <item>1,234</item>
|
|
||||||
- <item>3,227</item>
|
|
||||||
- <item>8,208</item>
|
|
||||||
- <item>16,192</item>
|
|
||||||
- <item>27,176</item>
|
|
||||||
- <item>41,160</item>
|
|
||||||
- <item>61,144</item>
|
|
||||||
- <item>80,128</item>
|
|
||||||
- <item>104,112</item>
|
|
||||||
- <item>130,96</item>
|
|
||||||
- <item>158,80</item>
|
|
||||||
- <item>188,64</item>
|
|
||||||
- <item>221,48</item>
|
|
||||||
- <item>250,36</item>
|
|
||||||
- <item>255,33</item>
|
|
||||||
- -->
|
|
||||||
- </string-array>
|
|
||||||
-
|
|
||||||
- <!-- Brightness range min for UDFPS dimming -->
|
|
||||||
- <integer name="config_udfpsDimmingBrightnessMin">0</integer>
|
|
||||||
-
|
|
||||||
- <!-- Brightness range max for UDFPS dimming -->
|
|
||||||
- <integer name="config_udfpsDimmingBrightnessMax">0</integer>
|
|
||||||
-
|
|
||||||
- <!-- The amount of delay to add when disabling the dimming.
|
|
||||||
- This is used to prevent flickers due to the dimming being disabled
|
|
||||||
- before the screen has had chance to switch out of HBM mode -->
|
|
||||||
- <integer name="config_udfpsDimmingDisableDelay">0</integer>
|
|
||||||
-
|
|
||||||
<!-- Doze: does the double tap sensor need a proximity check? -->
|
|
||||||
<bool name="doze_double_tap_proximity_check">false</bool>
|
|
||||||
|
|
||||||
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java
|
|
||||||
index 0dc13ff29771..65668b56a9f3 100644
|
|
||||||
--- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java
|
|
||||||
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java
|
|
||||||
@@ -48,7 +48,6 @@ import android.os.PowerManager;
|
|
||||||
import android.os.Trace;
|
|
||||||
import android.os.VibrationAttributes;
|
|
||||||
import android.os.VibrationEffect;
|
|
||||||
-import android.provider.Settings;
|
|
||||||
import android.util.Log;
|
|
||||||
import android.view.HapticFeedbackConstants;
|
|
||||||
import android.view.LayoutInflater;
|
|
||||||
@@ -217,9 +216,6 @@ public class UdfpsController implements DozeReceiver, Dumpable {
|
|
||||||
private boolean mAttemptedToDismissKeyguard;
|
|
||||||
private final Set<Callback> mCallbacks = new HashSet<>();
|
|
||||||
|
|
||||||
- private boolean mUseFrameworkDimming;
|
|
||||||
- private int[][] mBrightnessAlphaArray;
|
|
||||||
-
|
|
||||||
@VisibleForTesting
|
|
||||||
public static final VibrationAttributes UDFPS_VIBRATION_ATTRIBUTES =
|
|
||||||
new VibrationAttributes.Builder()
|
|
||||||
@@ -746,8 +742,6 @@ public class UdfpsController implements DozeReceiver, Dumpable {
|
|
||||||
final UdfpsOverlayController mUdfpsOverlayController = new UdfpsOverlayController();
|
|
||||||
mFingerprintManager.setUdfpsOverlayController(mUdfpsOverlayController);
|
|
||||||
|
|
||||||
- initUdfpsFrameworkDimming();
|
|
||||||
-
|
|
||||||
final IntentFilter filter = new IntentFilter();
|
|
||||||
filter.addAction(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
|
|
||||||
context.registerReceiver(mBroadcastReceiver, filter,
|
|
||||||
@@ -970,64 +964,6 @@ public class UdfpsController implements DozeReceiver, Dumpable {
|
|
||||||
return mSensorProps.sensorType == FingerprintSensorProperties.TYPE_UDFPS_OPTICAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
- private void initUdfpsFrameworkDimming() {
|
|
||||||
- mUseFrameworkDimming = mContext.getResources().getBoolean(
|
|
||||||
- com.android.systemui.res.R.bool.config_udfpsFrameworkDimming);
|
|
||||||
-
|
|
||||||
- if (mUseFrameworkDimming) {
|
|
||||||
- String[] array = mContext.getResources().getStringArray(
|
|
||||||
- com.android.systemui.res.R.array.config_udfpsDimmingBrightnessAlphaArray);
|
|
||||||
- mBrightnessAlphaArray = new int[array.length][2];
|
|
||||||
- for (int i = 0; i < array.length; i++) {
|
|
||||||
- String[] s = array[i].split(",");
|
|
||||||
- mBrightnessAlphaArray[i][0] = Integer.parseInt(s[0]);
|
|
||||||
- mBrightnessAlphaArray[i][1] = Integer.parseInt(s[1]);
|
|
||||||
- }
|
|
||||||
- }
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- private static int interpolate(int x, int xa, int xb, int ya, int yb) {
|
|
||||||
- return ya - (ya - yb) * (x - xa) / (xb - xa);
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- private int getBrightness() {
|
|
||||||
- int brightness = Settings.System.getInt(mContext.getContentResolver(),
|
|
||||||
- Settings.System.SCREEN_BRIGHTNESS, 100);
|
|
||||||
- // Since the brightness is taken from the system settings, we need to interpolate it
|
|
||||||
- final int brightnessMin = mContext.getResources().getInteger(
|
|
||||||
- com.android.systemui.res.R.integer.config_udfpsDimmingBrightnessMin);
|
|
||||||
- final int brightnessMax = mContext.getResources().getInteger(
|
|
||||||
- com.android.systemui.res.R.integer.config_udfpsDimmingBrightnessMax);
|
|
||||||
- if (brightnessMax > 0) {
|
|
||||||
- brightness = interpolate(brightness, 0, 255, brightnessMin, brightnessMax);
|
|
||||||
- }
|
|
||||||
- return brightness;
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- private void updateViewDimAmount() {
|
|
||||||
- if (mOverlay == null || !mUseFrameworkDimming) {
|
|
||||||
- return;
|
|
||||||
- } else if (isFingerDown()) {
|
|
||||||
- int curBrightness = getBrightness();
|
|
||||||
- int i, dimAmount;
|
|
||||||
- for (i = 0; i < mBrightnessAlphaArray.length; i++) {
|
|
||||||
- if (mBrightnessAlphaArray[i][0] >= curBrightness) break;
|
|
||||||
- }
|
|
||||||
- if (i == 0) {
|
|
||||||
- dimAmount = mBrightnessAlphaArray[i][1];
|
|
||||||
- } else if (i == mBrightnessAlphaArray.length) {
|
|
||||||
- dimAmount = mBrightnessAlphaArray[i-1][1];
|
|
||||||
- } else {
|
|
||||||
- dimAmount = interpolate(curBrightness,
|
|
||||||
- mBrightnessAlphaArray[i][0], mBrightnessAlphaArray[i-1][0],
|
|
||||||
- mBrightnessAlphaArray[i][1], mBrightnessAlphaArray[i-1][1]);
|
|
||||||
- }
|
|
||||||
- mOverlay.setDimAmount(dimAmount / 255.0f);
|
|
||||||
- } else {
|
|
||||||
- mOverlay.setDimAmount(0.0f);
|
|
||||||
- }
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
public boolean isFingerDown() {
|
|
||||||
return mOnFingerDown;
|
|
||||||
}
|
|
||||||
@@ -1036,7 +972,6 @@ public class UdfpsController implements DozeReceiver, Dumpable {
|
|
||||||
mFingerprintManager.onUdfpsUiEvent(FingerprintManager.UDFPS_UI_READY, requestId,
|
|
||||||
mSensorProps.sensorId);
|
|
||||||
mLatencyTracker.onActionEnd(LatencyTracker.ACTION_UDFPS_ILLUMINATE);
|
|
||||||
- updateViewDimAmount();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void onFingerDown(
|
|
||||||
@@ -1158,23 +1093,6 @@ public class UdfpsController implements DozeReceiver, Dumpable {
|
|
||||||
mOnFingerDown = false;
|
|
||||||
unconfigureDisplay(view);
|
|
||||||
cancelAodSendFingerUpAction();
|
|
||||||
-
|
|
||||||
- // Add a delay to ensure that the dim amount is updated after the display has had chance
|
|
||||||
- // to switch out of HBM mode. The delay, in ms is stored in config_udfpsDimmingDisableDelay.
|
|
||||||
- // If the delay is 0, the dim amount will be updated immediately.
|
|
||||||
- final int delay = mContext.getResources().getInteger(
|
|
||||||
- com.android.systemui.res.R.integer.config_udfpsDimmingDisableDelay);
|
|
||||||
- if (delay > 0) {
|
|
||||||
- mFgExecutor.executeDelayed(() -> {
|
|
||||||
- // A race condition exists where the overlay is destroyed before the dim amount
|
|
||||||
- // is updated. This check ensures that the overlay is still valid.
|
|
||||||
- if (mOverlay != null && mOverlay.matchesRequestId(requestId)) {
|
|
||||||
- updateViewDimAmount();
|
|
||||||
- }
|
|
||||||
- }, delay);
|
|
||||||
- } else {
|
|
||||||
- updateViewDimAmount();
|
|
||||||
- }
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsControllerOverlay.kt b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsControllerOverlay.kt
|
|
||||||
index 4983610df57a..dae6d08f7331 100644
|
|
||||||
--- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsControllerOverlay.kt
|
|
||||||
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsControllerOverlay.kt
|
|
||||||
@@ -131,8 +131,6 @@ class UdfpsControllerOverlay @JvmOverloads constructor(
|
|
||||||
|
|
||||||
private var overlayTouchListener: TouchExplorationStateChangeListener? = null
|
|
||||||
|
|
||||||
- private val frameworkDimming = context.getResources().getBoolean(
|
|
||||||
- R.bool.config_udfpsFrameworkDimming)
|
|
||||||
private val coreLayoutParams = WindowManager.LayoutParams(
|
|
||||||
WindowManager.LayoutParams.TYPE_NAVIGATION_BAR_PANEL,
|
|
||||||
0 /* flags set in computeLayoutParams() */,
|
|
||||||
@@ -144,23 +142,12 @@ class UdfpsControllerOverlay @JvmOverloads constructor(
|
|
||||||
layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS
|
|
||||||
flags = (Utils.FINGERPRINT_OVERLAY_LAYOUT_PARAM_FLAGS or
|
|
||||||
WindowManager.LayoutParams.FLAG_SPLIT_TOUCH)
|
|
||||||
- if (frameworkDimming) {
|
|
||||||
- flags = flags or WindowManager.LayoutParams.FLAG_DIM_BEHIND
|
|
||||||
- }
|
|
||||||
privateFlags = WindowManager.LayoutParams.PRIVATE_FLAG_TRUSTED_OVERLAY
|
|
||||||
- dimAmount = 0.0f
|
|
||||||
// Avoid announcing window title.
|
|
||||||
accessibilityTitle = " "
|
|
||||||
inputFeatures = WindowManager.LayoutParams.INPUT_FEATURE_SPY
|
|
||||||
}
|
|
||||||
|
|
||||||
- var dimAmount
|
|
||||||
- get() = coreLayoutParams.dimAmount
|
|
||||||
- set(value) {
|
|
||||||
- coreLayoutParams.dimAmount = value
|
|
||||||
- windowManager.updateViewLayout(getTouchOverlay(), coreLayoutParams)
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
/** If the overlay is currently showing. */
|
|
||||||
val isShowing: Boolean
|
|
||||||
get() = getTouchOverlay() != null
|
|
||||||
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsSurfaceView.java b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsSurfaceView.java
|
|
||||||
deleted file mode 100644
|
|
||||||
index 2e0e9491dd5b..000000000000
|
|
||||||
--- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsSurfaceView.java
|
|
||||||
+++ /dev/null
|
|
||||||
@@ -1,159 +0,0 @@
|
|
||||||
-/*
|
|
||||||
- * Copyright (C) 2021 The Android Open Source Project
|
|
||||||
- *
|
|
||||||
- * Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
- * you may not use this file except in compliance with the License.
|
|
||||||
- * You may obtain a copy of the License at
|
|
||||||
- *
|
|
||||||
- * http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
- *
|
|
||||||
- * Unless required by applicable law or agreed to in writing, software
|
|
||||||
- * distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
- * See the License for the specific language governing permissions and
|
|
||||||
- * limitations under the License.
|
|
||||||
- */
|
|
||||||
-
|
|
||||||
-package com.android.systemui.biometrics;
|
|
||||||
-
|
|
||||||
-import android.annotation.NonNull;
|
|
||||||
-import android.annotation.Nullable;
|
|
||||||
-import android.content.Context;
|
|
||||||
-import android.graphics.drawable.Drawable;
|
|
||||||
-import android.graphics.Canvas;
|
|
||||||
-import android.graphics.Paint;
|
|
||||||
-import android.graphics.PixelFormat;
|
|
||||||
-import android.graphics.RectF;
|
|
||||||
-import android.util.AttributeSet;
|
|
||||||
-import android.util.Log;
|
|
||||||
-import android.view.Surface;
|
|
||||||
-import android.view.SurfaceHolder;
|
|
||||||
-import android.view.SurfaceView;
|
|
||||||
-
|
|
||||||
-import com.android.systemui.res.R;
|
|
||||||
-
|
|
||||||
-/**
|
|
||||||
- * Surface View for providing the Global High-Brightness Mode (GHBM) illumination for UDFPS.
|
|
||||||
- */
|
|
||||||
-public class UdfpsSurfaceView extends SurfaceView implements SurfaceHolder.Callback {
|
|
||||||
- private static final String TAG = "UdfpsSurfaceView";
|
|
||||||
-
|
|
||||||
- /**
|
|
||||||
- * Notifies {@link UdfpsView} when to enable GHBM illumination.
|
|
||||||
- */
|
|
||||||
- interface GhbmIlluminationListener {
|
|
||||||
- /**
|
|
||||||
- * @param surface the surface for which GHBM should be enabled.
|
|
||||||
- * @param onDisplayConfigured a runnable that should be run after GHBM is enabled.
|
|
||||||
- */
|
|
||||||
- void enableGhbm(@NonNull Surface surface, @Nullable Runnable onDisplayConfigured);
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- @NonNull private final SurfaceHolder mHolder;
|
|
||||||
- @NonNull private final Paint mSensorPaint;
|
|
||||||
-
|
|
||||||
- @Nullable private GhbmIlluminationListener mGhbmIlluminationListener;
|
|
||||||
- @Nullable private Runnable mOnDisplayConfigured;
|
|
||||||
- boolean mAwaitingSurfaceToStartIllumination;
|
|
||||||
- boolean mHasValidSurface;
|
|
||||||
-
|
|
||||||
- private Drawable mUdfpsIconPressed;
|
|
||||||
-
|
|
||||||
- public UdfpsSurfaceView(Context context, AttributeSet attrs) {
|
|
||||||
- super(context, attrs);
|
|
||||||
-
|
|
||||||
- // Make this SurfaceView draw on top of everything else in this window. This allows us to
|
|
||||||
- // 1) Always show the HBM circle on top of everything else, and
|
|
||||||
- // 2) Properly composite this view with any other animations in the same window no matter
|
|
||||||
- // what contents are added in which order to this view hierarchy.
|
|
||||||
- setZOrderOnTop(true);
|
|
||||||
-
|
|
||||||
- mHolder = getHolder();
|
|
||||||
- mHolder.addCallback(this);
|
|
||||||
- mHolder.setFormat(PixelFormat.RGBA_8888);
|
|
||||||
-
|
|
||||||
- mSensorPaint = new Paint(0 /* flags */);
|
|
||||||
- mSensorPaint.setAntiAlias(true);
|
|
||||||
- mSensorPaint.setColor(context.getColor(R.color.config_udfpsColor));
|
|
||||||
- mSensorPaint.setStyle(Paint.Style.FILL);
|
|
||||||
-
|
|
||||||
- mUdfpsIconPressed = context.getDrawable(R.drawable.udfps_icon_pressed);
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- @Override public void surfaceCreated(SurfaceHolder holder) {
|
|
||||||
- mHasValidSurface = true;
|
|
||||||
- if (mAwaitingSurfaceToStartIllumination) {
|
|
||||||
- doIlluminate(mOnDisplayConfigured);
|
|
||||||
- mOnDisplayConfigured = null;
|
|
||||||
- mAwaitingSurfaceToStartIllumination = false;
|
|
||||||
- }
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- @Override
|
|
||||||
- public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
|
|
||||||
- // Unused.
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- @Override public void surfaceDestroyed(SurfaceHolder holder) {
|
|
||||||
- mHasValidSurface = false;
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- void setGhbmIlluminationListener(@Nullable GhbmIlluminationListener listener) {
|
|
||||||
- mGhbmIlluminationListener = listener;
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- /**
|
|
||||||
- * Note: there is no corresponding method to stop GHBM illumination. It is expected that
|
|
||||||
- * {@link UdfpsView} will hide this view, which would destroy the surface and remove the
|
|
||||||
- * illumination dot.
|
|
||||||
- */
|
|
||||||
- void startGhbmIllumination(@Nullable Runnable onDisplayConfigured) {
|
|
||||||
- if (mGhbmIlluminationListener == null) {
|
|
||||||
- Log.e(TAG, "startIllumination | mGhbmIlluminationListener is null");
|
|
||||||
- return;
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- if (mHasValidSurface) {
|
|
||||||
- doIlluminate(onDisplayConfigured);
|
|
||||||
- } else {
|
|
||||||
- mAwaitingSurfaceToStartIllumination = true;
|
|
||||||
- mOnDisplayConfigured = onDisplayConfigured;
|
|
||||||
- }
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- private void doIlluminate(@Nullable Runnable onDisplayConfigured) {
|
|
||||||
- if (mGhbmIlluminationListener == null) {
|
|
||||||
- Log.e(TAG, "doIlluminate | mGhbmIlluminationListener is null");
|
|
||||||
- return;
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- mGhbmIlluminationListener.enableGhbm(mHolder.getSurface(), onDisplayConfigured);
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- /**
|
|
||||||
- * Immediately draws the illumination dot on this SurfaceView's surface.
|
|
||||||
- */
|
|
||||||
- void drawIlluminationDot(@NonNull RectF sensorRect) {
|
|
||||||
- if (!mHasValidSurface) {
|
|
||||||
- Log.e(TAG, "drawIlluminationDot | the surface is destroyed or was never created.");
|
|
||||||
- return;
|
|
||||||
- }
|
|
||||||
- Canvas canvas = null;
|
|
||||||
- try {
|
|
||||||
- canvas = mHolder.lockCanvas();
|
|
||||||
- mUdfpsIconPressed.setBounds(
|
|
||||||
- Math.round(sensorRect.left),
|
|
||||||
- Math.round(sensorRect.top),
|
|
||||||
- Math.round(sensorRect.right),
|
|
||||||
- Math.round(sensorRect.bottom)
|
|
||||||
- );
|
|
||||||
- mUdfpsIconPressed.draw(canvas);
|
|
||||||
- canvas.drawOval(sensorRect, mSensorPaint);
|
|
||||||
- } finally {
|
|
||||||
- // Make sure the surface is never left in a bad state.
|
|
||||||
- if (canvas != null) {
|
|
||||||
- mHolder.unlockCanvasAndPost(canvas);
|
|
||||||
- }
|
|
||||||
- }
|
|
||||||
- }
|
|
||||||
-}
|
|
||||||
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt
|
|
||||||
index a8e4e95114ca..76bcd6e2863b 100644
|
|
||||||
--- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt
|
|
||||||
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt
|
|
||||||
@@ -24,11 +24,9 @@ import android.graphics.RectF
|
|
||||||
import android.util.AttributeSet
|
|
||||||
import android.util.Log
|
|
||||||
import android.view.MotionEvent
|
|
||||||
-import android.view.Surface
|
|
||||||
import android.widget.FrameLayout
|
|
||||||
import com.android.systemui.biometrics.shared.model.UdfpsOverlayParams
|
|
||||||
import com.android.systemui.doze.DozeReceiver
|
|
||||||
-import com.android.systemui.res.R
|
|
||||||
|
|
||||||
private const val TAG = "UdfpsView"
|
|
||||||
|
|
||||||
@@ -49,8 +47,6 @@ class UdfpsView(
|
|
||||||
textSize = 32f
|
|
||||||
}
|
|
||||||
|
|
||||||
- private var ghbmView: UdfpsSurfaceView? = null
|
|
||||||
-
|
|
||||||
/** View controller (can be different for enrollment, BiometricPrompt, Keyguard, etc.). */
|
|
||||||
var animationViewController: UdfpsAnimationViewController<*>? = null
|
|
||||||
|
|
||||||
@@ -77,10 +73,6 @@ class UdfpsView(
|
|
||||||
return (animationViewController == null || !animationViewController!!.shouldPauseAuth())
|
|
||||||
}
|
|
||||||
|
|
||||||
- override fun onFinishInflate() {
|
|
||||||
- ghbmView = findViewById(R.id.hbm_view)
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
override fun dozeTimeTick() {
|
|
||||||
animationViewController?.dozeTimeTick()
|
|
||||||
}
|
|
||||||
@@ -114,34 +106,12 @@ class UdfpsView(
|
|
||||||
fun configureDisplay(onDisplayConfigured: Runnable) {
|
|
||||||
isDisplayConfigured = true
|
|
||||||
animationViewController?.onDisplayConfiguring()
|
|
||||||
- val gView = ghbmView
|
|
||||||
- if (gView != null) {
|
|
||||||
- gView.setGhbmIlluminationListener(this::doIlluminate)
|
|
||||||
- gView.visibility = VISIBLE
|
|
||||||
- gView.startGhbmIllumination(onDisplayConfigured)
|
|
||||||
- } else {
|
|
||||||
- doIlluminate(null /* surface */, onDisplayConfigured)
|
|
||||||
- }
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- private fun doIlluminate(surface: Surface?, onDisplayConfigured: Runnable?) {
|
|
||||||
- if (ghbmView != null && surface == null) {
|
|
||||||
- Log.e(TAG, "doIlluminate | surface must be non-null for GHBM")
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- mUdfpsDisplayMode?.enable {
|
|
||||||
- onDisplayConfigured?.run()
|
|
||||||
- ghbmView?.drawIlluminationDot(RectF(sensorRect))
|
|
||||||
- }
|
|
||||||
+ mUdfpsDisplayMode?.enable(onDisplayConfigured)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun unconfigureDisplay() {
|
|
||||||
isDisplayConfigured = false
|
|
||||||
animationViewController?.onDisplayUnconfigured()
|
|
||||||
- ghbmView?.let { view ->
|
|
||||||
- view.setGhbmIlluminationListener(null)
|
|
||||||
- view.visibility = INVISIBLE
|
|
||||||
- }
|
|
||||||
mUdfpsDisplayMode?.disable(null /* onDisabled */)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
@ -1,47 +0,0 @@
|
|||||||
From 58171eec5da2091f45c6c110ae4de2bd6717820b Mon Sep 17 00:00:00 2001
|
|
||||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
|
||||||
Date: Sun, 21 Jan 2024 23:21:02 +0800
|
|
||||||
Subject: [PATCH 2/2] Revert "Biometrics: Allow disabling of fingerprint
|
|
||||||
cleanups"
|
|
||||||
|
|
||||||
This reverts commit add9f4dc93bba9d414ad67a0770b82c06747d09f.
|
|
||||||
---
|
|
||||||
.../sensors/fingerprint/hidl/Fingerprint21.java | 8 --------
|
|
||||||
1 file changed, 8 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/Fingerprint21.java b/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/Fingerprint21.java
|
|
||||||
index 4ff18edc82b9..d3cecd0e34c7 100644
|
|
||||||
--- a/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/Fingerprint21.java
|
|
||||||
+++ b/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/Fingerprint21.java
|
|
||||||
@@ -143,8 +143,6 @@ public class Fingerprint21 implements IHwBinder.DeathRecipient, ServiceProvider
|
|
||||||
private final boolean mIsPowerbuttonFps;
|
|
||||||
private AidlSession mSession;
|
|
||||||
|
|
||||||
- private boolean mCleanup;
|
|
||||||
-
|
|
||||||
private final class BiometricTaskStackListener extends TaskStackListener {
|
|
||||||
@Override
|
|
||||||
public void onTaskStackChanged() {
|
|
||||||
@@ -377,9 +375,6 @@ public class Fingerprint21 implements IHwBinder.DeathRecipient, ServiceProvider
|
|
||||||
mAuthenticationStatsCollector = collector;
|
|
||||||
});
|
|
||||||
|
|
||||||
- mCleanup = context.getResources().getBoolean(
|
|
||||||
- org.lineageos.platform.internal.R.bool.config_cleanupUnusedFingerprints);
|
|
||||||
-
|
|
||||||
try {
|
|
||||||
ActivityManager.getService().registerUserSwitchObserver(mUserSwitchObserver, TAG);
|
|
||||||
} catch (RemoteException e) {
|
|
||||||
@@ -1009,9 +1004,6 @@ public class Fingerprint21 implements IHwBinder.DeathRecipient, ServiceProvider
|
|
||||||
|
|
||||||
private void scheduleInternalCleanup(int userId,
|
|
||||||
@Nullable ClientMonitorCallback callback) {
|
|
||||||
- if (!mCleanup) {
|
|
||||||
- return;
|
|
||||||
- }
|
|
||||||
mHandler.post(() -> {
|
|
||||||
scheduleUpdateActiveUserWithoutHandler(userId);
|
|
||||||
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
@ -1,55 +0,0 @@
|
|||||||
From d39466c50305a64ff3a683b1e13373379273ee57 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
|
||||||
Date: Mon, 20 Nov 2023 22:00:14 +0800
|
|
||||||
Subject: [PATCH 1/2] Revert "CompositionEngine: Request device composition for
|
|
||||||
the Udfps touched layer"
|
|
||||||
|
|
||||||
This reverts commit 69fad8aa4098b007fe17472902159705fdcd957f.
|
|
||||||
---
|
|
||||||
.../CompositionEngine/src/Output.cpp | 16 +---------------
|
|
||||||
1 file changed, 1 insertion(+), 15 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/services/surfaceflinger/CompositionEngine/src/Output.cpp b/services/surfaceflinger/CompositionEngine/src/Output.cpp
|
|
||||||
index f680fc5eac..09c7c9933a 100644
|
|
||||||
--- a/services/surfaceflinger/CompositionEngine/src/Output.cpp
|
|
||||||
+++ b/services/surfaceflinger/CompositionEngine/src/Output.cpp
|
|
||||||
@@ -22,7 +22,6 @@
|
|
||||||
#include <compositionengine/LayerFE.h>
|
|
||||||
#include <compositionengine/LayerFECompositionState.h>
|
|
||||||
#include <compositionengine/RenderSurface.h>
|
|
||||||
-#include <compositionengine/UdfpsExtension.h>
|
|
||||||
#include <compositionengine/impl/HwcAsyncWorker.h>
|
|
||||||
#include <compositionengine/impl/Output.h>
|
|
||||||
#include <compositionengine/impl/OutputCompositionState.h>
|
|
||||||
@@ -915,10 +914,7 @@ void Output::writeCompositionState(const compositionengine::CompositionRefreshAr
|
|
||||||
|
|
||||||
compositionengine::OutputLayer* Output::findLayerRequestingBackgroundComposition() const {
|
|
||||||
compositionengine::OutputLayer* layerRequestingBgComposition = nullptr;
|
|
||||||
- for (size_t i = 0; i < getOutputLayerCount(); i++) {
|
|
||||||
- compositionengine::OutputLayer* layer = getOutputLayerOrderedByZByIndex(i);
|
|
||||||
- compositionengine::OutputLayer* nextLayer = getOutputLayerOrderedByZByIndex(i + 1);
|
|
||||||
-
|
|
||||||
+ for (auto* layer : getOutputLayersOrderedByZ()) {
|
|
||||||
const auto* compState = layer->getLayerFE().getCompositionState();
|
|
||||||
|
|
||||||
// If any layer has a sideband stream, we will disable blurs. In that case, we don't
|
|
||||||
@@ -938,16 +934,6 @@ compositionengine::OutputLayer* Output::findLayerRequestingBackgroundComposition
|
|
||||||
if (compState->backgroundBlurRadius > 0 || compState->blurRegions.size() > 0) {
|
|
||||||
layerRequestingBgComposition = layer;
|
|
||||||
}
|
|
||||||
-
|
|
||||||
- // If the next layer is the Udfps touched layer, enable client composition for it
|
|
||||||
- // because that somehow leads to the Udfps touched layer getting device composition
|
|
||||||
- // consistently.
|
|
||||||
- if ((nextLayer != nullptr && layerRequestingBgComposition == nullptr) &&
|
|
||||||
- (strncmp(nextLayer->getLayerFE().getDebugName(), UDFPS_TOUCHED_LAYER_NAME,
|
|
||||||
- strlen(UDFPS_TOUCHED_LAYER_NAME)) == 0)) {
|
|
||||||
- layerRequestingBgComposition = layer;
|
|
||||||
- break;
|
|
||||||
- }
|
|
||||||
}
|
|
||||||
return layerRequestingBgComposition;
|
|
||||||
}
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
@ -1,155 +0,0 @@
|
|||||||
From 16d9d6827247991744b80aff6793582c42da9ba0 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
|
||||||
Date: Mon, 20 Nov 2023 22:00:23 +0800
|
|
||||||
Subject: [PATCH 2/2] Revert "surfaceflinger: Add support for Udfps extension
|
|
||||||
lib"
|
|
||||||
|
|
||||||
This reverts commit 8655d06e960235c0f9ad079be3541fee2a0359f7.
|
|
||||||
---
|
|
||||||
.../CompositionEngine/Android.bp | 14 +--------
|
|
||||||
.../compositionengine/UdfpsExtension.h | 29 -------------------
|
|
||||||
.../CompositionEngine/src/OutputLayer.cpp | 13 +--------
|
|
||||||
.../CompositionEngine/src/UdfpsExtension.cpp | 27 -----------------
|
|
||||||
4 files changed, 2 insertions(+), 81 deletions(-)
|
|
||||||
delete mode 100644 services/surfaceflinger/CompositionEngine/include/compositionengine/UdfpsExtension.h
|
|
||||||
delete mode 100644 services/surfaceflinger/CompositionEngine/src/UdfpsExtension.cpp
|
|
||||||
|
|
||||||
diff --git a/services/surfaceflinger/CompositionEngine/Android.bp b/services/surfaceflinger/CompositionEngine/Android.bp
|
|
||||||
index 52bc260720..ae2f2dbbf5 100644
|
|
||||||
--- a/services/surfaceflinger/CompositionEngine/Android.bp
|
|
||||||
+++ b/services/surfaceflinger/CompositionEngine/Android.bp
|
|
||||||
@@ -84,16 +84,12 @@ filegroup {
|
|
||||||
"src/OutputLayer.cpp",
|
|
||||||
"src/OutputLayerCompositionState.cpp",
|
|
||||||
"src/RenderSurface.cpp",
|
|
||||||
- "src/UdfpsExtension.cpp",
|
|
||||||
],
|
|
||||||
}
|
|
||||||
|
|
||||||
cc_library {
|
|
||||||
name: "libcompositionengine",
|
|
||||||
- defaults: [
|
|
||||||
- "libcompositionengine_defaults",
|
|
||||||
- "surfaceflinger_udfps_lib_defaults",
|
|
||||||
- ],
|
|
||||||
+ defaults: ["libcompositionengine_defaults"],
|
|
||||||
static_libs: [
|
|
||||||
"libsurfaceflinger_common",
|
|
||||||
"libsurfaceflingerflags",
|
|
||||||
@@ -136,14 +132,6 @@ cc_library {
|
|
||||||
export_include_dirs: ["include"],
|
|
||||||
}
|
|
||||||
|
|
||||||
-cc_library_static {
|
|
||||||
- name: "surfaceflinger_udfps_lib",
|
|
||||||
- srcs: [
|
|
||||||
- "src/UdfpsExtension.cpp",
|
|
||||||
- ],
|
|
||||||
- export_include_dirs: ["include"],
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
cc_test {
|
|
||||||
name: "libcompositionengine_test",
|
|
||||||
test_suites: ["device-tests"],
|
|
||||||
diff --git a/services/surfaceflinger/CompositionEngine/include/compositionengine/UdfpsExtension.h b/services/surfaceflinger/CompositionEngine/include/compositionengine/UdfpsExtension.h
|
|
||||||
deleted file mode 100644
|
|
||||||
index 4306cb4a02..0000000000
|
|
||||||
--- a/services/surfaceflinger/CompositionEngine/include/compositionengine/UdfpsExtension.h
|
|
||||||
+++ /dev/null
|
|
||||||
@@ -1,29 +0,0 @@
|
|
||||||
-/*
|
|
||||||
- * Copyright 2021-2022 The LineageOS Project
|
|
||||||
- *
|
|
||||||
- * Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
- * you may not use this file except in compliance with the License.
|
|
||||||
- * You may obtain a copy of the License at
|
|
||||||
- *
|
|
||||||
- * http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
- *
|
|
||||||
- * Unless required by applicable law or agreed to in writing, software
|
|
||||||
- * distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
- * See the License for the specific language governing permissions and
|
|
||||||
- * limitations under the License.
|
|
||||||
- */
|
|
||||||
-
|
|
||||||
-#include <stdint.h>
|
|
||||||
-
|
|
||||||
-#ifndef __UDFPS_EXTENSION__H__
|
|
||||||
-#define __UDFPS_EXTENSION__H__
|
|
||||||
-
|
|
||||||
-#define UDFPS_BIOMETRIC_PROMPT_LAYER_NAME "BiometricPrompt"
|
|
||||||
-#define UDFPS_LAYER_NAME "UdfpsControllerOverlay"
|
|
||||||
-#define UDFPS_TOUCHED_LAYER_NAME "SurfaceView[UdfpsControllerOverlay](BLAST)"
|
|
||||||
-
|
|
||||||
-extern uint32_t getUdfpsZOrder(uint32_t z, bool touched);
|
|
||||||
-extern uint64_t getUdfpsUsageBits(uint64_t usageBits, bool touched);
|
|
||||||
-
|
|
||||||
-#endif /* __UDFPS_EXTENSION__H__ */
|
|
||||||
diff --git a/services/surfaceflinger/CompositionEngine/src/OutputLayer.cpp b/services/surfaceflinger/CompositionEngine/src/OutputLayer.cpp
|
|
||||||
index 11b9024e99..7fe3369f88 100644
|
|
||||||
--- a/services/surfaceflinger/CompositionEngine/src/OutputLayer.cpp
|
|
||||||
+++ b/services/surfaceflinger/CompositionEngine/src/OutputLayer.cpp
|
|
||||||
@@ -18,7 +18,6 @@
|
|
||||||
#include <compositionengine/DisplayColorProfile.h>
|
|
||||||
#include <compositionengine/LayerFECompositionState.h>
|
|
||||||
#include <compositionengine/Output.h>
|
|
||||||
-#include <compositionengine/UdfpsExtension.h>
|
|
||||||
#include <compositionengine/impl/HwcBufferCache.h>
|
|
||||||
#include <compositionengine/impl/OutputCompositionState.h>
|
|
||||||
#include <compositionengine/impl/OutputLayer.h>
|
|
||||||
@@ -459,17 +458,7 @@ void OutputLayer::writeOutputDependentGeometryStateToHWC(HWC2::Layer* hwcLayer,
|
|
||||||
sourceCrop.bottom, to_string(error).c_str(), static_cast<int32_t>(error));
|
|
||||||
}
|
|
||||||
|
|
||||||
- uint32_t z_udfps = z;
|
|
||||||
- if ((strncmp(getLayerFE().getDebugName(), UDFPS_LAYER_NAME, strlen(UDFPS_LAYER_NAME)) == 0) ||
|
|
||||||
- (strncmp(getLayerFE().getDebugName(), UDFPS_BIOMETRIC_PROMPT_LAYER_NAME,
|
|
||||||
- strlen(UDFPS_BIOMETRIC_PROMPT_LAYER_NAME)) == 0)) {
|
|
||||||
- z_udfps = getUdfpsZOrder(z, false);
|
|
||||||
- } else if (strncmp(getLayerFE().getDebugName(), UDFPS_TOUCHED_LAYER_NAME,
|
|
||||||
- strlen(UDFPS_TOUCHED_LAYER_NAME)) == 0) {
|
|
||||||
- z_udfps = getUdfpsZOrder(z, true);
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- if (auto error = hwcLayer->setZOrder(z_udfps); error != hal::Error::NONE) {
|
|
||||||
+ if (auto error = hwcLayer->setZOrder(z); error != hal::Error::NONE) {
|
|
||||||
ALOGE("[%s] Failed to set Z %u: %s (%d)", getLayerFE().getDebugName(), z,
|
|
||||||
to_string(error).c_str(), static_cast<int32_t>(error));
|
|
||||||
}
|
|
||||||
diff --git a/services/surfaceflinger/CompositionEngine/src/UdfpsExtension.cpp b/services/surfaceflinger/CompositionEngine/src/UdfpsExtension.cpp
|
|
||||||
deleted file mode 100644
|
|
||||||
index 2d9d086dd2..0000000000
|
|
||||||
--- a/services/surfaceflinger/CompositionEngine/src/UdfpsExtension.cpp
|
|
||||||
+++ /dev/null
|
|
||||||
@@ -1,27 +0,0 @@
|
|
||||||
-/*
|
|
||||||
- * Copyright 2020 The LineageOS Project
|
|
||||||
- *
|
|
||||||
- * Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
- * you may not use this file except in compliance with the License.
|
|
||||||
- * You may obtain a copy of the License at
|
|
||||||
- *
|
|
||||||
- * http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
- *
|
|
||||||
- * Unless required by applicable law or agreed to in writing, software
|
|
||||||
- * distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
- * See the License for the specific language governing permissions and
|
|
||||||
- * limitations under the License.
|
|
||||||
- */
|
|
||||||
-
|
|
||||||
-#ifndef TARGET_PROVIDES_UDFPS_LIB
|
|
||||||
-#include <compositionengine/UdfpsExtension.h>
|
|
||||||
-
|
|
||||||
-uint32_t getUdfpsZOrder(uint32_t z, __unused bool touched) {
|
|
||||||
- return z;
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
-uint64_t getUdfpsUsageBits(uint64_t usageBits, __unused bool touched) {
|
|
||||||
- return usageBits;
|
|
||||||
-}
|
|
||||||
-#endif
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
@ -1,100 +0,0 @@
|
|||||||
From f9ca27932587c1c3f3ae9b26908eb35540e30f33 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
|
||||||
Date: Mon, 20 Nov 2023 22:48:28 +0800
|
|
||||||
Subject: [PATCH] Revert "compat: Provide libprotobuf-cpp vendorcompat
|
|
||||||
prebuilts from v29 VNDK"
|
|
||||||
|
|
||||||
This reverts commit 770258c025fcd689895cac9d172a18609bf96d09.
|
|
||||||
---
|
|
||||||
Android.bp | 38 --------------------------
|
|
||||||
vndk/v29/arm/libprotobuf-cpp-full.so | 1 -
|
|
||||||
vndk/v29/arm/libprotobuf-cpp-lite.so | 1 -
|
|
||||||
vndk/v29/arm64/libprotobuf-cpp-full.so | 1 -
|
|
||||||
vndk/v29/arm64/libprotobuf-cpp-lite.so | 1 -
|
|
||||||
5 files changed, 42 deletions(-)
|
|
||||||
delete mode 120000 vndk/v29/arm/libprotobuf-cpp-full.so
|
|
||||||
delete mode 120000 vndk/v29/arm/libprotobuf-cpp-lite.so
|
|
||||||
delete mode 120000 vndk/v29/arm64/libprotobuf-cpp-full.so
|
|
||||||
delete mode 120000 vndk/v29/arm64/libprotobuf-cpp-lite.so
|
|
||||||
|
|
||||||
diff --git a/Android.bp b/Android.bp
|
|
||||||
index f1fd0de..374fd33 100644
|
|
||||||
--- a/Android.bp
|
|
||||||
+++ b/Android.bp
|
|
||||||
@@ -429,41 +429,3 @@ cc_library_shared {
|
|
||||||
compile_multilib: "64",
|
|
||||||
vendor: true,
|
|
||||||
}
|
|
||||||
-
|
|
||||||
-cc_prebuilt_library_shared {
|
|
||||||
- name: "libprotobuf-cpp-full-vendorcompat",
|
|
||||||
- stem: "libprotobuf-cpp-full",
|
|
||||||
- vendor: true,
|
|
||||||
- strip: {
|
|
||||||
- none: true,
|
|
||||||
- },
|
|
||||||
- target: {
|
|
||||||
- android_arm: {
|
|
||||||
- srcs: ["vndk/v29/arm/libprotobuf-cpp-full.so"],
|
|
||||||
- },
|
|
||||||
- android_arm64: {
|
|
||||||
- srcs: ["vndk/v29/arm64/libprotobuf-cpp-full.so"],
|
|
||||||
- },
|
|
||||||
- },
|
|
||||||
- compile_multilib: "both",
|
|
||||||
- check_elf_files: false,
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
-cc_prebuilt_library_shared {
|
|
||||||
- name: "libprotobuf-cpp-lite-vendorcompat",
|
|
||||||
- stem: "libprotobuf-cpp-lite",
|
|
||||||
- vendor: true,
|
|
||||||
- strip: {
|
|
||||||
- none: true,
|
|
||||||
- },
|
|
||||||
- target: {
|
|
||||||
- android_arm: {
|
|
||||||
- srcs: ["vndk/v29/arm/libprotobuf-cpp-lite.so"],
|
|
||||||
- },
|
|
||||||
- android_arm64: {
|
|
||||||
- srcs: ["vndk/v29/arm64/libprotobuf-cpp-lite.so"],
|
|
||||||
- },
|
|
||||||
- },
|
|
||||||
- compile_multilib: "both",
|
|
||||||
- check_elf_files: false,
|
|
||||||
-}
|
|
||||||
diff --git a/vndk/v29/arm/libprotobuf-cpp-full.so b/vndk/v29/arm/libprotobuf-cpp-full.so
|
|
||||||
deleted file mode 120000
|
|
||||||
index 2c8c152..0000000
|
|
||||||
--- a/vndk/v29/arm/libprotobuf-cpp-full.so
|
|
||||||
+++ /dev/null
|
|
||||||
@@ -1 +0,0 @@
|
|
||||||
-../../../../../../prebuilts/vndk/v29/arm64/arch-arm-armv8-a/shared/vndk-core/libprotobuf-cpp-full.so
|
|
||||||
\ No newline at end of file
|
|
||||||
diff --git a/vndk/v29/arm/libprotobuf-cpp-lite.so b/vndk/v29/arm/libprotobuf-cpp-lite.so
|
|
||||||
deleted file mode 120000
|
|
||||||
index 4b3896e..0000000
|
|
||||||
--- a/vndk/v29/arm/libprotobuf-cpp-lite.so
|
|
||||||
+++ /dev/null
|
|
||||||
@@ -1 +0,0 @@
|
|
||||||
-../../../../../../prebuilts/vndk/v29/arm64/arch-arm-armv8-a/shared/vndk-core/libprotobuf-cpp-lite.so
|
|
||||||
\ No newline at end of file
|
|
||||||
diff --git a/vndk/v29/arm64/libprotobuf-cpp-full.so b/vndk/v29/arm64/libprotobuf-cpp-full.so
|
|
||||||
deleted file mode 120000
|
|
||||||
index caba7cb..0000000
|
|
||||||
--- a/vndk/v29/arm64/libprotobuf-cpp-full.so
|
|
||||||
+++ /dev/null
|
|
||||||
@@ -1 +0,0 @@
|
|
||||||
-../../../../../../prebuilts/vndk/v29/arm64/arch-arm64-armv8-a/shared/vndk-core/libprotobuf-cpp-full.so
|
|
||||||
\ No newline at end of file
|
|
||||||
diff --git a/vndk/v29/arm64/libprotobuf-cpp-lite.so b/vndk/v29/arm64/libprotobuf-cpp-lite.so
|
|
||||||
deleted file mode 120000
|
|
||||||
index a4bac2e..0000000
|
|
||||||
--- a/vndk/v29/arm64/libprotobuf-cpp-lite.so
|
|
||||||
+++ /dev/null
|
|
||||||
@@ -1 +0,0 @@
|
|
||||||
-../../../../../../prebuilts/vndk/v29/arm64/arch-arm64-armv8-a/shared/vndk-core/libprotobuf-cpp-lite.so
|
|
||||||
\ No newline at end of file
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
@ -1,50 +0,0 @@
|
|||||||
From 3ddebb45d3e48e581c0ac739b0b35b11f4737acc Mon Sep 17 00:00:00 2001
|
|
||||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
|
||||||
Date: Mon, 20 Nov 2023 21:59:29 +0800
|
|
||||||
Subject: [PATCH] Revert "gd: hci: Allow disabling selected local commands"
|
|
||||||
|
|
||||||
This reverts commit 543afb3dd2e2b5aa4f1931a973eb7c7df634aa69.
|
|
||||||
---
|
|
||||||
system/gd/hci/controller.cc | 12 ------------
|
|
||||||
1 file changed, 12 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/system/gd/hci/controller.cc b/system/gd/hci/controller.cc
|
|
||||||
index 6facfef4c3..a6c16a9061 100644
|
|
||||||
--- a/system/gd/hci/controller.cc
|
|
||||||
+++ b/system/gd/hci/controller.cc
|
|
||||||
@@ -16,7 +16,6 @@
|
|
||||||
|
|
||||||
#include "hci/controller.h"
|
|
||||||
|
|
||||||
-#include <android-base/strings.h>
|
|
||||||
#include <android_bluetooth_flags.h>
|
|
||||||
|
|
||||||
#include <future>
|
|
||||||
@@ -43,8 +42,6 @@ constexpr uint8_t kMinEncryptionKeySize = 7; // #define MIN_ENCRYPTION_KEY_SIZE
|
|
||||||
constexpr bool kDefaultVendorCapabilitiesEnabled = true;
|
|
||||||
static const std::string kPropertyVendorCapabilitiesEnabled =
|
|
||||||
"bluetooth.core.le.vendor_capabilities.enabled";
|
|
||||||
-static const char kPropertyDisabledCommands[] =
|
|
||||||
- "bluetooth.hci.disabled_commands";
|
|
||||||
|
|
||||||
using os::Handler;
|
|
||||||
|
|
||||||
@@ -317,15 +314,6 @@ struct Controller::impl {
|
|
||||||
ErrorCode status = complete_view.GetStatus();
|
|
||||||
ASSERT_LOG(status == ErrorCode::SUCCESS, "Status 0x%02hhx, %s", status, ErrorCodeText(status).c_str());
|
|
||||||
local_supported_commands_ = complete_view.GetSupportedCommands();
|
|
||||||
-
|
|
||||||
- if (auto disabledCommands = os::GetSystemProperty(kPropertyDisabledCommands)) {
|
|
||||||
- for (const auto& command : android::base::Split(*disabledCommands, ",")) {
|
|
||||||
- uint16_t index = std::stoi(command);
|
|
||||||
- uint16_t byte_index = index / 10;
|
|
||||||
- uint16_t bit_index = index % 10;
|
|
||||||
- local_supported_commands_[byte_index] &= ~(1 << bit_index);
|
|
||||||
- }
|
|
||||||
- }
|
|
||||||
}
|
|
||||||
|
|
||||||
void read_local_extended_features_complete_handler(std::promise<void> promise, CommandCompleteView view) {
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
@ -1,36 +0,0 @@
|
|||||||
From b354689bc72bb0ab0da52cc11ec5930444606d2c Mon Sep 17 00:00:00 2001
|
|
||||||
From: Pierre-Hugues Husson <phh@phh.me>
|
|
||||||
Date: Wed, 27 Oct 2021 14:39:29 -0400
|
|
||||||
Subject: [PATCH 1/2] Disable vndklite handling
|
|
||||||
|
|
||||||
Change-Id: Ic4474cf80fc4b45a9a2760dd51e2ca29c4d961e2
|
|
||||||
---
|
|
||||||
linker/linker.cpp | 5 -----
|
|
||||||
1 file changed, 5 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/linker/linker.cpp b/linker/linker.cpp
|
|
||||||
index 135eaa380..93523dcc0 100644
|
|
||||||
--- a/linker/linker.cpp
|
|
||||||
+++ b/linker/linker.cpp
|
|
||||||
@@ -97,7 +97,6 @@ static uint64_t g_module_unload_counter = 0;
|
|
||||||
static const char* const kLdConfigArchFilePath = "/system/etc/ld.config." ABI_STRING ".txt";
|
|
||||||
|
|
||||||
static const char* const kLdConfigFilePath = "/system/etc/ld.config.txt";
|
|
||||||
-static const char* const kLdConfigVndkLiteFilePath = "/system/etc/ld.config.vndk_lite.txt";
|
|
||||||
|
|
||||||
static const char* const kLdGeneratedConfigFilePath = "/linkerconfig/ld.config.txt";
|
|
||||||
|
|
||||||
@@ -3444,10 +3443,6 @@ static std::string get_ld_config_file_apex_path(const char* executable_path) {
|
|
||||||
}
|
|
||||||
|
|
||||||
static std::string get_ld_config_file_vndk_path() {
|
|
||||||
- if (android::base::GetBoolProperty("ro.vndk.lite", false)) {
|
|
||||||
- return kLdConfigVndkLiteFilePath;
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
std::string ld_config_file_vndk = kLdConfigFilePath;
|
|
||||||
size_t insert_pos = ld_config_file_vndk.find_last_of('.');
|
|
||||||
if (insert_pos == std::string::npos) {
|
|
||||||
--
|
|
||||||
2.25.1
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
|||||||
From fe82aa41e542f4da2709976cda0713dfa089cc1d Mon Sep 17 00:00:00 2001
|
|
||||||
From: Pierre-Hugues Husson <phh@phh.me>
|
|
||||||
Date: Thu, 12 Sep 2019 20:31:07 +0200
|
|
||||||
Subject: [PATCH] Don't reboot if we couldn't get bootctrl
|
|
||||||
|
|
||||||
Change-Id: Id1793660bd1c97ab369607f58a772ca3512ec1af
|
|
||||||
---
|
|
||||||
update_verifier/update_verifier.cpp | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/update_verifier/update_verifier.cpp b/update_verifier/update_verifier.cpp
|
|
||||||
index a0160e2f..24d6ccab 100644
|
|
||||||
--- a/update_verifier/update_verifier.cpp
|
|
||||||
+++ b/update_verifier/update_verifier.cpp
|
|
||||||
@@ -324,7 +324,7 @@ int update_verifier(int argc, char** argv) {
|
|
||||||
const auto module = android::hal::BootControlClient::WaitForService();
|
|
||||||
if (module == nullptr) {
|
|
||||||
LOG(ERROR) << "Error getting bootctrl module.";
|
|
||||||
- return reboot_device();
|
|
||||||
+ return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint32_t current_slot = module->GetCurrentSlot();
|
|
||||||
--
|
|
||||||
2.25.1
|
|
||||||
|
|
@ -1,24 +0,0 @@
|
|||||||
From 948c7a611e69510c38d593bb581cc1c21d080682 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Pierre-Hugues Husson <phh@phh.me>
|
|
||||||
Date: Fri, 6 Oct 2023 19:11:22 -0400
|
|
||||||
Subject: [PATCH 1/2] Include vndk v28 sepolicy support
|
|
||||||
|
|
||||||
---
|
|
||||||
core/config.mk | 1 +
|
|
||||||
1 file changed, 1 insertion(+)
|
|
||||||
|
|
||||||
diff --git a/core/config.mk b/core/config.mk
|
|
||||||
index 19308d7f22..369940845e 100644
|
|
||||||
--- a/core/config.mk
|
|
||||||
+++ b/core/config.mk
|
|
||||||
@@ -932,6 +932,7 @@ endif
|
|
||||||
|
|
||||||
# A list of SEPolicy versions, besides PLATFORM_SEPOLICY_VERSION, that the framework supports.
|
|
||||||
PLATFORM_SEPOLICY_COMPAT_VERSIONS := $(filter-out $(PLATFORM_SEPOLICY_VERSION), \
|
|
||||||
+ 28.0 \
|
|
||||||
29.0 \
|
|
||||||
30.0 \
|
|
||||||
31.0 \
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
|||||||
From 7675f6e75fbc4f5c9eb2d77602f8f3d72cd59706 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Adithya R <gh0strider.2k18.reborn@gmail.com>
|
|
||||||
Date: Thu, 18 Aug 2022 21:29:34 +0530
|
|
||||||
Subject: [PATCH 2/2] core: sysprop: Write build display id to product prop
|
|
||||||
|
|
||||||
Some vendors override build id in odm or vendor, such as oplus.
|
|
||||||
|
|
||||||
Change-Id: I1c2de43ba7c3544710897ad9127d320dd02293fe
|
|
||||||
---
|
|
||||||
core/sysprop.mk | 3 +++
|
|
||||||
1 file changed, 3 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/core/sysprop.mk b/core/sysprop.mk
|
|
||||||
index da8cdaff5e..678328d46d 100644
|
|
||||||
--- a/core/sysprop.mk
|
|
||||||
+++ b/core/sysprop.mk
|
|
||||||
@@ -77,6 +77,9 @@ define generate-common-build-props
|
|
||||||
echo "ro.$(1).product.cpu.abilist64=$(TARGET_CPU_ABI_LIST_64_BIT)" >> $(2);\
|
|
||||||
)\
|
|
||||||
)\
|
|
||||||
+ $(if $(filter product,$(1)),\
|
|
||||||
+ echo "ro.build.display.id=$(BUILD_DISPLAY_ID)" >> $(2);\
|
|
||||||
+ )\
|
|
||||||
echo "ro.$(1).build.date=`$(DATE_FROM_FILE)`" >> $(2);\
|
|
||||||
echo "ro.$(1).build.date.utc=`$(DATE_FROM_FILE) +%s`" >> $(2);\
|
|
||||||
echo "ro.$(1).build.fingerprint?=$(BUILD_FINGERPRINT_FROM_FILE)" >> $(2);\
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
|||||||
From 3d471c1fbb11c1d0b15eadf53b1f201fee44f35f Mon Sep 17 00:00:00 2001
|
|
||||||
From: Pierre-Hugues Husson <phh@phh.me>
|
|
||||||
Date: Mon, 9 Apr 2018 00:19:49 +0200
|
|
||||||
Subject: [PATCH 01/10] Increase default log_level to get actual selinux error
|
|
||||||
in kmsg
|
|
||||||
|
|
||||||
---
|
|
||||||
secilc/secilc.c | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/secilc/secilc.c b/secilc/secilc.c
|
|
||||||
index 80d3583d..a51630b2 100644
|
|
||||||
--- a/secilc/secilc.c
|
|
||||||
+++ b/secilc/secilc.c
|
|
||||||
@@ -107,7 +107,7 @@ int main(int argc, char *argv[])
|
|
||||||
int opt_index = 0;
|
|
||||||
char *fc_buf = NULL;
|
|
||||||
size_t fc_size;
|
|
||||||
- enum cil_log_level log_level = CIL_ERR;
|
|
||||||
+ enum cil_log_level log_level = CIL_WARN;
|
|
||||||
static struct option long_opts[] = {
|
|
||||||
{"help", no_argument, 0, 'h'},
|
|
||||||
{"verbose", no_argument, 0, 'v'},
|
|
||||||
--
|
|
||||||
2.25.1
|
|
||||||
|
|
@ -1,45 +0,0 @@
|
|||||||
From c401d3fca4a1783c9a84348e61a036c016b6e358 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Pierre-Hugues Husson <phh@phh.me>
|
|
||||||
Date: Wed, 9 Sep 2020 22:36:42 +0200
|
|
||||||
Subject: [PATCH 02/10] Revert "libsepol: Make an unknown permission an error
|
|
||||||
in CIL"
|
|
||||||
|
|
||||||
This reverts commit dc4e54126bf25dea4d51820922ccd1959be68fbc.
|
|
||||||
|
|
||||||
This is required because some targets calls undefined permissions:
|
|
||||||
- Realme X2 Pro calls sigcont
|
|
||||||
- Honor 7X calls perf_event
|
|
||||||
---
|
|
||||||
libsepol/cil/src/cil_resolve_ast.c | 12 ++++++++----
|
|
||||||
1 file changed, 8 insertions(+), 4 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/libsepol/cil/src/cil_resolve_ast.c b/libsepol/cil/src/cil_resolve_ast.c
|
|
||||||
index d2bfdc81..91fa1075 100644
|
|
||||||
--- a/libsepol/cil/src/cil_resolve_ast.c
|
|
||||||
+++ b/libsepol/cil/src/cil_resolve_ast.c
|
|
||||||
@@ -136,14 +136,18 @@ static int __cil_resolve_perms(symtab_t *class_symtab, symtab_t *common_symtab,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (rc != SEPOL_OK) {
|
|
||||||
+ struct cil_list *empty_list;
|
|
||||||
if (class_flavor == CIL_MAP_CLASS) {
|
|
||||||
cil_log(CIL_ERR, "Failed to resolve permission %s for map class\n", (char*)curr->data);
|
|
||||||
- } else {
|
|
||||||
- cil_log(CIL_ERR, "Failed to resolve permission %s\n", (char*)curr->data);
|
|
||||||
+ goto exit;
|
|
||||||
}
|
|
||||||
- goto exit;
|
|
||||||
+ cil_log(CIL_WARN, "Failed to resolve permission %s\n", (char*)curr->data);
|
|
||||||
+ /* Use an empty list to represent unknown perm */
|
|
||||||
+ cil_list_init(&empty_list, perm_strs->flavor);
|
|
||||||
+ cil_list_append(*perm_datums, CIL_LIST, empty_list);
|
|
||||||
+ } else {
|
|
||||||
+ cil_list_append(*perm_datums, CIL_DATUM, perm_datum);
|
|
||||||
}
|
|
||||||
- cil_list_append(*perm_datums, CIL_DATUM, perm_datum);
|
|
||||||
} else {
|
|
||||||
cil_list_append(*perm_datums, curr->flavor, curr->data);
|
|
||||||
}
|
|
||||||
--
|
|
||||||
2.25.1
|
|
||||||
|
|
@ -1,116 +0,0 @@
|
|||||||
From 561b2e69be86a1c40d402ba06e845546bade9b32 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Pierre-Hugues Husson <phh@phh.me>
|
|
||||||
Date: Wed, 31 Mar 2021 23:32:37 +0200
|
|
||||||
Subject: [PATCH 03/10] Workaround device/phh/treble conflict with SELinux
|
|
||||||
policy
|
|
||||||
|
|
||||||
device/phh/treble defines the following three types (hostapd,
|
|
||||||
sysfs_usb_supply, rpmb_device)
|
|
||||||
However, Qualcomm Samsung Android 11 devices export those symbols as
|
|
||||||
typealias.
|
|
||||||
Type and typealias are fundamentally not mergeable.
|
|
||||||
Luckily, Samsung doesn't do anything with those typealias, so we can
|
|
||||||
simply ignore them.
|
|
||||||
---
|
|
||||||
libsepol/cil/src/cil_binary.c | 8 ++++++--
|
|
||||||
libsepol/cil/src/cil_build_ast.c | 11 +++++++++--
|
|
||||||
libsepol/cil/src/cil_resolve_ast.c | 15 +++++++++++++--
|
|
||||||
3 files changed, 28 insertions(+), 6 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/libsepol/cil/src/cil_binary.c b/libsepol/cil/src/cil_binary.c
|
|
||||||
index 40615db2..74a52956 100644
|
|
||||||
--- a/libsepol/cil/src/cil_binary.c
|
|
||||||
+++ b/libsepol/cil/src/cil_binary.c
|
|
||||||
@@ -511,13 +511,17 @@ int cil_typealias_to_policydb(policydb_t *pdb, struct cil_alias *cil_alias)
|
|
||||||
type_datum_init(sepol_alias);
|
|
||||||
|
|
||||||
rc = __cil_get_sepol_type_datum(pdb, DATUM(cil_alias->actual), &sepol_type);
|
|
||||||
- if (rc != SEPOL_OK) goto exit;
|
|
||||||
+ if (rc != SEPOL_OK) {
|
|
||||||
+ cil_log(CIL_ERR, "Failed at %s:%s:%d\n", __FILE__, __FUNCTION__, __LINE__);
|
|
||||||
+ goto exit;
|
|
||||||
+ }
|
|
||||||
|
|
||||||
sepol_alias->flavor = TYPE_TYPE;
|
|
||||||
|
|
||||||
key = cil_strdup(cil_alias->datum.fqn);
|
|
||||||
rc = symtab_insert(pdb, SYM_TYPES, key, sepol_alias, SCOPE_DECL, 0, NULL);
|
|
||||||
if (rc != SEPOL_OK) {
|
|
||||||
+ cil_log(CIL_ERR, "Failed at %s:%s:%d:%d\n", __FILE__, __FUNCTION__, __LINE__, rc);
|
|
||||||
goto exit;
|
|
||||||
}
|
|
||||||
sepol_alias->s.value = sepol_type->s.value;
|
|
||||||
@@ -3995,7 +3999,7 @@ static int __cil_node_to_policydb(struct cil_tree_node *node, void *extra_args)
|
|
||||||
|
|
||||||
exit:
|
|
||||||
if (rc != SEPOL_OK) {
|
|
||||||
- cil_tree_log(node, CIL_ERR, "Binary policy creation failed");
|
|
||||||
+ cil_tree_log(node, CIL_ERR, "Binary policy creation failed, for pass = %d, flavor = %d", pass, node->flavor);
|
|
||||||
}
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
diff --git a/libsepol/cil/src/cil_build_ast.c b/libsepol/cil/src/cil_build_ast.c
|
|
||||||
index 4177c9f6..118de1f5 100644
|
|
||||||
--- a/libsepol/cil/src/cil_build_ast.c
|
|
||||||
+++ b/libsepol/cil/src/cil_build_ast.c
|
|
||||||
@@ -116,7 +116,7 @@ int cil_add_decl_to_symtab(struct cil_db *db, symtab_t *symtab, hashtab_key_t ke
|
|
||||||
|
|
||||||
rc = cil_symtab_insert(symtab, key, datum, node);
|
|
||||||
if (rc == SEPOL_EEXIST) {
|
|
||||||
- struct cil_symtab_datum *prev;
|
|
||||||
+ struct cil_symtab_datum *prev = NULL;
|
|
||||||
rc = cil_symtab_get_datum(symtab, key, &prev);
|
|
||||||
if (rc != SEPOL_OK) {
|
|
||||||
cil_log(CIL_ERR, "Re-declaration of %s %s, but previous declaration could not be found\n",cil_node_to_string(node), key);
|
|
||||||
@@ -129,7 +129,14 @@ int cil_add_decl_to_symtab(struct cil_db *db, symtab_t *symtab, hashtab_key_t ke
|
|
||||||
cil_node_to_string(node), key);
|
|
||||||
cil_tree_log(node, CIL_ERR, "Previous declaration of %s",
|
|
||||||
cil_node_to_string(n));
|
|
||||||
- return SEPOL_ERR;
|
|
||||||
+ if(
|
|
||||||
+ strcmp(key, "sysfs_usb_supply") == 0 ||
|
|
||||||
+ strcmp(key, "hostapd") == 0 ||
|
|
||||||
+ strcmp(key, "rpmb_device") == 0) {
|
|
||||||
+ cil_log(CIL_ERR, "Ignoring...");
|
|
||||||
+ } else {
|
|
||||||
+ return SEPOL_ERR;
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
/* multiple_decls is enabled and works for this datum type, add node */
|
|
||||||
cil_list_append(prev->nodes, CIL_NODE, node);
|
|
||||||
diff --git a/libsepol/cil/src/cil_resolve_ast.c b/libsepol/cil/src/cil_resolve_ast.c
|
|
||||||
index 91fa1075..d20fb7ee 100644
|
|
||||||
--- a/libsepol/cil/src/cil_resolve_ast.c
|
|
||||||
+++ b/libsepol/cil/src/cil_resolve_ast.c
|
|
||||||
@@ -522,7 +522,13 @@ static int cil_resolve_aliasactual(struct cil_tree_node *current, void *extra_ar
|
|
||||||
}
|
|
||||||
if (FLAVOR(alias_datum) != alias_flavor) {
|
|
||||||
cil_log(CIL_ERR, "%s is not an alias\n",alias_datum->name);
|
|
||||||
- rc = SEPOL_ERR;
|
|
||||||
+ if(
|
|
||||||
+ strcmp(alias_datum->name, "hostapd") == 0 ||
|
|
||||||
+ strcmp(alias_datum->name, "sysfs_usb_supply") == 0 ||
|
|
||||||
+ strcmp(alias_datum->name, "rpmb_device") == 0)
|
|
||||||
+ rc = 0;
|
|
||||||
+ else
|
|
||||||
+ rc = SEPOL_ERR;
|
|
||||||
goto exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -563,7 +569,12 @@ static int cil_resolve_alias_to_actual(struct cil_tree_node *current, enum cil_f
|
|
||||||
int limit = 2;
|
|
||||||
|
|
||||||
if (alias->actual == NULL) {
|
|
||||||
- cil_tree_log(current, CIL_ERR, "Alias declared but not used");
|
|
||||||
+ cil_tree_log(current, CIL_ERR, "Alias %s declared but not used", a1->datum.name);
|
|
||||||
+ if(
|
|
||||||
+ strcmp(a1->datum.name, "hostapd") == 0 ||
|
|
||||||
+ strcmp(a1->datum.name, "sysfs_usb_supply") == 0 ||
|
|
||||||
+ strcmp(a1->datum.name, "rpmb_device") == 0)
|
|
||||||
+ return SEPOL_OK;
|
|
||||||
return SEPOL_ERR;
|
|
||||||
}
|
|
||||||
|
|
||||||
--
|
|
||||||
2.25.1
|
|
||||||
|
|
@ -1,43 +0,0 @@
|
|||||||
From 674bf16f42a5c64c8c4acd0a9c458f78fdef785e Mon Sep 17 00:00:00 2001
|
|
||||||
From: Pierre-Hugues Husson <phh@phh.me>
|
|
||||||
Date: Fri, 6 Sep 2019 15:07:25 +0200
|
|
||||||
Subject: [PATCH 04/10] Allow /devices/virtual/block/ genfscon conflict (seen
|
|
||||||
on Xiaomi Mi 9)
|
|
||||||
|
|
||||||
Change-Id: I06e4e9d5b82d61a8aeab595b47e2589249675895
|
|
||||||
---
|
|
||||||
libsepol/cil/src/cil_post.c | 18 +++++++++++++++++-
|
|
||||||
1 file changed, 17 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/libsepol/cil/src/cil_post.c b/libsepol/cil/src/cil_post.c
|
|
||||||
index a7c66ead..99410da0 100644
|
|
||||||
--- a/libsepol/cil/src/cil_post.c
|
|
||||||
+++ b/libsepol/cil/src/cil_post.c
|
|
||||||
@@ -491,7 +491,23 @@ static int cil_post_genfscon_context_compare(const void *a, const void *b)
|
|
||||||
{
|
|
||||||
struct cil_genfscon *a_genfscon = *(struct cil_genfscon**)a;
|
|
||||||
struct cil_genfscon *b_genfscon = *(struct cil_genfscon**)b;
|
|
||||||
- return context_compare(a_genfscon->context, b_genfscon->context);
|
|
||||||
+ int rc = context_compare(a_genfscon->context, b_genfscon->context);
|
|
||||||
+ if(rc) {
|
|
||||||
+ fprintf(stderr, "hello %s\n", a_genfscon->fs_str);
|
|
||||||
+ int bypass = 0;
|
|
||||||
+ /*
|
|
||||||
+ * This conflict has been seen on Xiaomi Mi 9:
|
|
||||||
+ * - AOSP Q says (genfscon sysfs /devices/virtual/block/ (u object_r sysfs_devices_block ((s0) (s0))))
|
|
||||||
+ * - stock rom says (genfscon sysfs /devices/virtual/block/ (u object_r sysfs_ufs_target ((s0) (s0))))
|
|
||||||
+ */
|
|
||||||
+ if(strcmp(a_genfscon->path_str, "/devices/virtual/block/") == 0)
|
|
||||||
+ bypass = 1;
|
|
||||||
+ if(bypass == 1) {
|
|
||||||
+ fprintf(stderr, "Received conflicting %s vs %s but ignore\n", a_genfscon->path_str, b_genfscon->path_str);
|
|
||||||
+ return 0;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int cil_post_netifcon_context_compare(const void *a, const void *b)
|
|
||||||
--
|
|
||||||
2.25.1
|
|
||||||
|
|
@ -1,44 +0,0 @@
|
|||||||
From e4a26d31aab7bb541e1f510c2b231da2345d8dd8 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Pierre-Hugues Husson <phh@phh.me>
|
|
||||||
Date: Thu, 12 Sep 2019 20:37:04 +0200
|
|
||||||
Subject: [PATCH 05/10] if service is "rcs", accept conflict. Seen on Moto E5
|
|
||||||
|
|
||||||
Change-Id: I0cc2d0fad83f403f2b5d7458039b1564ce5ed9dd
|
|
||||||
---
|
|
||||||
libselinux/src/label_backends_android.c | 14 ++++++++++++--
|
|
||||||
1 file changed, 12 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/libselinux/src/label_backends_android.c b/libselinux/src/label_backends_android.c
|
|
||||||
index 77f7a1eb..55a30944 100644
|
|
||||||
--- a/libselinux/src/label_backends_android.c
|
|
||||||
+++ b/libselinux/src/label_backends_android.c
|
|
||||||
@@ -62,14 +62,24 @@ static int nodups_specs(struct saved_data *data)
|
|
||||||
curr_spec->property_key)) {
|
|
||||||
if (strcmp(spec_arr[jj].lr.ctx_raw,
|
|
||||||
curr_spec->lr.ctx_raw)) {
|
|
||||||
- rc = -1;
|
|
||||||
- errno = EINVAL;
|
|
||||||
selinux_log
|
|
||||||
(SELINUX_ERROR,
|
|
||||||
"Multiple different specifications for %s (%s and %s).\n",
|
|
||||||
curr_spec->property_key,
|
|
||||||
spec_arr[jj].lr.ctx_raw,
|
|
||||||
curr_spec->lr.ctx_raw);
|
|
||||||
+ int ignore = 0;
|
|
||||||
+ /*
|
|
||||||
+ * This issue has been found on Moto E5
|
|
||||||
+ * E SELinux : Multiple different specifications for rcs (u:object_r:radio_service:s0 and u:object_r:mot_rcs_service:s0).
|
|
||||||
+ */
|
|
||||||
+ if(!strcmp(curr_spec->property_key, "rcs"))
|
|
||||||
+ ignore = 1;
|
|
||||||
+
|
|
||||||
+ if(!ignore) {
|
|
||||||
+ rc = -1;
|
|
||||||
+ errno = EINVAL;
|
|
||||||
+ }
|
|
||||||
} else {
|
|
||||||
selinux_log
|
|
||||||
(SELINUX_WARNING,
|
|
||||||
--
|
|
||||||
2.25.1
|
|
||||||
|
|
@ -1,27 +0,0 @@
|
|||||||
From b62703b28a22e12c2f7044abc74689109a88eca1 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Pierre-Hugues Husson <phh@phh.me>
|
|
||||||
Date: Sun, 24 May 2020 17:22:22 +0200
|
|
||||||
Subject: [PATCH 06/10] Allow mismatches of exfat genfscon
|
|
||||||
|
|
||||||
---
|
|
||||||
libsepol/cil/src/cil_post.c | 4 ++++
|
|
||||||
1 file changed, 4 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/libsepol/cil/src/cil_post.c b/libsepol/cil/src/cil_post.c
|
|
||||||
index 99410da0..7f614c03 100644
|
|
||||||
--- a/libsepol/cil/src/cil_post.c
|
|
||||||
+++ b/libsepol/cil/src/cil_post.c
|
|
||||||
@@ -502,6 +502,10 @@ static int cil_post_genfscon_context_compare(const void *a, const void *b)
|
|
||||||
*/
|
|
||||||
if(strcmp(a_genfscon->path_str, "/devices/virtual/block/") == 0)
|
|
||||||
bypass = 1;
|
|
||||||
+ if(strcmp(a_genfscon->fs_str, "exfat") == 0 || strcmp(a_genfscon->fs_str, "esdfs") == 0) {
|
|
||||||
+ if(strcmp(a_genfscon->path_str, "/") == 0)
|
|
||||||
+ bypass = 1;
|
|
||||||
+ }
|
|
||||||
if(bypass == 1) {
|
|
||||||
fprintf(stderr, "Received conflicting %s vs %s but ignore\n", a_genfscon->path_str, b_genfscon->path_str);
|
|
||||||
return 0;
|
|
||||||
--
|
|
||||||
2.25.1
|
|
||||||
|
|
@ -1,84 +0,0 @@
|
|||||||
From 51de18a6b0c861925c7b4eb5c64f631c90d3c0e7 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Pierre-Hugues Husson <phh@phh.me>
|
|
||||||
Date: Fri, 25 Oct 2019 13:29:20 +0200
|
|
||||||
Subject: [PATCH 07/10] Fix boot on Moto devices using unknown class
|
|
||||||
|
|
||||||
vendor sepolicy never contains new class or classorder, and are not
|
|
||||||
allowed to.
|
|
||||||
Though this is not tested, and it turns out Moto did it anyway.
|
|
||||||
This raises an issue, because class need to be ordered, and thus the cil
|
|
||||||
contains the ordering. This ordering needs to be merged.
|
|
||||||
Android 10 added new classes, so the ordering can no longer be merged,
|
|
||||||
and secilc fails on those devices, preventing boot.
|
|
||||||
|
|
||||||
Considering vendor are not supposed to declare new class (and thus
|
|
||||||
declare classorder), this fix ignores class-es/classorder in vendor
|
|
||||||
SELinux policy.
|
|
||||||
|
|
||||||
Since the vendor selinux policy has allows rules based on this context,
|
|
||||||
those allows will fail since the class doesn't exist.
|
|
||||||
Workaround this by ignoring rules with the problematic class
|
|
||||||
( keystore_moto_key )
|
|
||||||
|
|
||||||
Lucky us, this new class `keystore_moto_key` is used by Moto for
|
|
||||||
framework to framework (more accurately priv app to keymaster), since
|
|
||||||
our own framework doesn't use this class, simply ignoring it fixes the
|
|
||||||
issue.
|
|
||||||
|
|
||||||
Change-Id: I66339857634ebfdba359f12a99dfd0bff709d80b
|
|
||||||
---
|
|
||||||
libsepol/cil/src/cil_build_ast.c | 24 ++++++++++++++++++++++++
|
|
||||||
1 file changed, 24 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/libsepol/cil/src/cil_build_ast.c b/libsepol/cil/src/cil_build_ast.c
|
|
||||||
index 118de1f5..77e130d1 100644
|
|
||||||
--- a/libsepol/cil/src/cil_build_ast.c
|
|
||||||
+++ b/libsepol/cil/src/cil_build_ast.c
|
|
||||||
@@ -462,6 +462,14 @@ int cil_gen_class(struct cil_db *db, struct cil_tree_node *parse_current, struct
|
|
||||||
struct cil_tree_node *perms = NULL;
|
|
||||||
int rc = SEPOL_ERR;
|
|
||||||
|
|
||||||
+ {
|
|
||||||
+ const char* path = cil_tree_get_cil_path(parse_current);
|
|
||||||
+ if(strstr(path, "vendor/")) {
|
|
||||||
+ cil_clear_node(ast_node);
|
|
||||||
+ return SEPOL_OK;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
rc = __cil_verify_syntax(parse_current, syntax, syntax_len);
|
|
||||||
if (rc != SEPOL_OK) {
|
|
||||||
goto exit;
|
|
||||||
@@ -530,6 +538,14 @@ int cil_gen_classorder(struct cil_db *db, struct cil_tree_node *parse_current, s
|
|
||||||
struct cil_list_item *head = NULL;
|
|
||||||
int rc = SEPOL_ERR;
|
|
||||||
|
|
||||||
+ {
|
|
||||||
+ const char* path = cil_tree_get_cil_path(parse_current);
|
|
||||||
+ if(strstr(path, "vendor/")) {
|
|
||||||
+ cil_clear_node(ast_node);
|
|
||||||
+ return SEPOL_OK;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
if (db == NULL || parse_current == NULL || ast_node == NULL) {
|
|
||||||
goto exit;
|
|
||||||
}
|
|
||||||
@@ -2115,6 +2131,14 @@ int cil_gen_avrule(struct cil_tree_node *parse_current, struct cil_tree_node *as
|
|
||||||
rule->src_str = parse_current->next->data;
|
|
||||||
rule->tgt_str = parse_current->next->next->data;
|
|
||||||
|
|
||||||
+ {
|
|
||||||
+ const char *classname = parse_current->next->next->next->cl_head->data;
|
|
||||||
+ if(strcmp(classname, "keystore_moto_key") == 0) {
|
|
||||||
+ cil_clear_node(ast_node);
|
|
||||||
+ return SEPOL_OK;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
rc = cil_fill_classperms_list(parse_current->next->next->next, &rule->perms.classperms);
|
|
||||||
if (rc != SEPOL_OK) {
|
|
||||||
goto exit;
|
|
||||||
--
|
|
||||||
2.25.1
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
|||||||
From 5ccb1dd0e78eeae1767febd733b9a0e9cd99e1a4 Mon Sep 17 00:00:00 2001
|
|
||||||
From: ponces <ponces26@gmail.com>
|
|
||||||
Date: Mon, 7 Nov 2022 16:14:20 +0000
|
|
||||||
Subject: [PATCH 08/10] Improve SELinux policy workaround on device/phh/treble
|
|
||||||
conflict to exit with SEPOL_OK instead of SEPOL_EEXIST
|
|
||||||
|
|
||||||
This fixes boot on many Samsung devices as exiting with SEPOL_EEXIST will prevent them to boot
|
|
||||||
---
|
|
||||||
libsepol/cil/src/cil_build_ast.c | 1 -
|
|
||||||
1 file changed, 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/libsepol/cil/src/cil_build_ast.c b/libsepol/cil/src/cil_build_ast.c
|
|
||||||
index 77e130d1..daf8b8b3 100644
|
|
||||||
--- a/libsepol/cil/src/cil_build_ast.c
|
|
||||||
+++ b/libsepol/cil/src/cil_build_ast.c
|
|
||||||
@@ -141,7 +141,6 @@ int cil_add_decl_to_symtab(struct cil_db *db, symtab_t *symtab, hashtab_key_t ke
|
|
||||||
/* multiple_decls is enabled and works for this datum type, add node */
|
|
||||||
cil_list_append(prev->nodes, CIL_NODE, node);
|
|
||||||
node->data = prev;
|
|
||||||
- return SEPOL_EEXIST;
|
|
||||||
}
|
|
||||||
|
|
||||||
return SEPOL_OK;
|
|
||||||
--
|
|
||||||
2.25.1
|
|
||||||
|
|
@ -1,33 +0,0 @@
|
|||||||
From a464342a983c1bbdfdc8fe50803a7e35659ecb22 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Pierre-Hugues Husson <phh@phh.me>
|
|
||||||
Date: Thu, 20 Jul 2023 14:21:21 -0400
|
|
||||||
Subject: [PATCH 09/10] Allow /sys/vm/watermark_scale_factor conflict -- seen
|
|
||||||
on Freebox Player Pop
|
|
||||||
|
|
||||||
---
|
|
||||||
libsepol/cil/src/cil_post.c | 9 +++++++++
|
|
||||||
1 file changed, 9 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/libsepol/cil/src/cil_post.c b/libsepol/cil/src/cil_post.c
|
|
||||||
index 7f614c03..1703b3b6 100644
|
|
||||||
--- a/libsepol/cil/src/cil_post.c
|
|
||||||
+++ b/libsepol/cil/src/cil_post.c
|
|
||||||
@@ -502,6 +502,15 @@ static int cil_post_genfscon_context_compare(const void *a, const void *b)
|
|
||||||
*/
|
|
||||||
if(strcmp(a_genfscon->path_str, "/devices/virtual/block/") == 0)
|
|
||||||
bypass = 1;
|
|
||||||
+ /*
|
|
||||||
+ * This conflict has been seen on Freebox Player Pop
|
|
||||||
+ * - AOSP T says (genfscon proc "/sys/vm/watermark_scale_factor" (u object_r proc_watermark_scale_factor ((s0) (s0))))
|
|
||||||
+ * - stock rom says proc_vm_writable
|
|
||||||
+ *
|
|
||||||
+ * Stock ROM uses it only in recovery so it's safe to ignore
|
|
||||||
+ */
|
|
||||||
+ if(strcmp(a_genfscon->path_str, "/sys/vm/watermark_scale_factor") == 0)
|
|
||||||
+ bypass = 1;
|
|
||||||
if(strcmp(a_genfscon->fs_str, "exfat") == 0 || strcmp(a_genfscon->fs_str, "esdfs") == 0) {
|
|
||||||
if(strcmp(a_genfscon->path_str, "/") == 0)
|
|
||||||
bypass = 1;
|
|
||||||
--
|
|
||||||
2.25.1
|
|
||||||
|
|
@ -1,25 +0,0 @@
|
|||||||
From fa8cc9f8c1fbdd902dbb6c9708e7e91f78defae9 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Pierre-Hugues Husson <phh@phh.me>
|
|
||||||
Date: Fri, 6 Oct 2023 08:49:59 -0400
|
|
||||||
Subject: [PATCH 10/10] Allow conflict on fuseblk
|
|
||||||
|
|
||||||
---
|
|
||||||
libsepol/cil/src/cil_post.c | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/libsepol/cil/src/cil_post.c b/libsepol/cil/src/cil_post.c
|
|
||||||
index 1703b3b6..5428005d 100644
|
|
||||||
--- a/libsepol/cil/src/cil_post.c
|
|
||||||
+++ b/libsepol/cil/src/cil_post.c
|
|
||||||
@@ -511,7 +511,7 @@ static int cil_post_genfscon_context_compare(const void *a, const void *b)
|
|
||||||
*/
|
|
||||||
if(strcmp(a_genfscon->path_str, "/sys/vm/watermark_scale_factor") == 0)
|
|
||||||
bypass = 1;
|
|
||||||
- if(strcmp(a_genfscon->fs_str, "exfat") == 0 || strcmp(a_genfscon->fs_str, "esdfs") == 0) {
|
|
||||||
+ if(strcmp(a_genfscon->fs_str, "exfat") == 0 || strcmp(a_genfscon->fs_str, "esdfs") == 0 || strcmp(a_genfscon->fs_str, "fuseblk") == 0) {
|
|
||||||
if(strcmp(a_genfscon->path_str, "/") == 0)
|
|
||||||
bypass = 1;
|
|
||||||
}
|
|
||||||
--
|
|
||||||
2.25.1
|
|
||||||
|
|
@ -1,131 +0,0 @@
|
|||||||
From 64131a132e24a38e12b9c4b2b9ba94b3d9091085 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Pierre-Hugues Husson <phh@phh.me>
|
|
||||||
Date: Mon, 5 Aug 2019 18:09:50 +0200
|
|
||||||
Subject: [PATCH 02/24] Fix BT in-call on CAF devices
|
|
||||||
|
|
||||||
See https://github.com/phhusson/treble_experimentations/issues/374
|
|
||||||
|
|
||||||
In Qualcomm's BSP audio_policy_configuration.xml, one route is missing,
|
|
||||||
from primary output and telephony to BT SCO.
|
|
||||||
|
|
||||||
Add it if we detect telephony and bt sco, but no such route.
|
|
||||||
|
|
||||||
Change-Id: Ifea0f88276ec9a0811f3cb1973c4b06f2c82077b
|
|
||||||
---
|
|
||||||
.../managerdefinitions/src/Serializer.cpp | 93 +++++++++++++++++++
|
|
||||||
1 file changed, 93 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
|
||||||
index 6f19a7a145..1ab472f396 100644
|
|
||||||
--- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
|
||||||
+++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
|
||||||
@@ -667,6 +667,98 @@ std::variant<status_t, RouteTraits::Element> PolicySerializer::deserialize<Route
|
|
||||||
return route;
|
|
||||||
}
|
|
||||||
|
|
||||||
+static void fixupQualcommBtScoRoute(RouteTraits::Collection& routes, DevicePortTraits::Collection& devicePorts, HwModule* ctx) {
|
|
||||||
+ // On many Qualcomm devices, there is a BT SCO Headset Mic => primary input mix
|
|
||||||
+ // But Telephony Rx => BT SCO Headset route is missing
|
|
||||||
+ // When we detect such case, add the missing route
|
|
||||||
+
|
|
||||||
+ // If we have:
|
|
||||||
+ // <route type="mix" sink="Telephony Tx" sources="voice_tx"/>
|
|
||||||
+ // <route type="mix" sink="primary input" sources="Built-In Mic,Built-In Back Mic,Wired Headset Mic,BT SCO Headset Mic"/>
|
|
||||||
+ // <devicePort tagName="BT SCO Headset" type="AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET" role="sink" />
|
|
||||||
+ // And no <route type="mix" sink="BT SCO Headset" />
|
|
||||||
+
|
|
||||||
+ // Add:
|
|
||||||
+ // <route type="mix" sink="BT SCO Headset" sources="primary output,deep_buffer,compressed_offload,Telephony Rx"/>
|
|
||||||
+ bool foundBtScoHeadsetDevice = false;
|
|
||||||
+ for(const auto& device: devicePorts) {
|
|
||||||
+ if(device->getTagName() == "BT SCO Headset") {
|
|
||||||
+ foundBtScoHeadsetDevice = true;
|
|
||||||
+ break;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ if(!foundBtScoHeadsetDevice) {
|
|
||||||
+ ALOGE("No BT SCO Headset device found, don't patch policy");
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ bool foundTelephony = false;
|
|
||||||
+ bool foundBtScoInput = false;
|
|
||||||
+ bool foundScoHeadsetRoute = false;
|
|
||||||
+ for(const auto& route: routes) {
|
|
||||||
+ ALOGE("Looking at route %d\n", route->getType());
|
|
||||||
+ if(route->getType() != AUDIO_ROUTE_MIX)
|
|
||||||
+ continue;
|
|
||||||
+ auto sink = route->getSink();
|
|
||||||
+ ALOGE("... With sink %s\n", sink->getTagName().c_str());
|
|
||||||
+ if(sink->getTagName() == "Telephony Tx") {
|
|
||||||
+ foundTelephony = true;
|
|
||||||
+ continue;
|
|
||||||
+ }
|
|
||||||
+ if(sink->getTagName() == "BT SCO Headset") {
|
|
||||||
+ foundScoHeadsetRoute = true;
|
|
||||||
+ break;
|
|
||||||
+ }
|
|
||||||
+ for(const auto& source: route->getSources()) {
|
|
||||||
+ ALOGE("... With source %s\n", source->getTagName().c_str());
|
|
||||||
+ if(source->getTagName() == "BT SCO Headset Mic") {
|
|
||||||
+ foundBtScoInput = true;
|
|
||||||
+ break;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ //The route we want to add is already there
|
|
||||||
+ ALOGE("Done looking for existing routes");
|
|
||||||
+ if(foundScoHeadsetRoute)
|
|
||||||
+ return;
|
|
||||||
+
|
|
||||||
+ ALOGE("No existing route found... %d %d", foundTelephony ? 1 : 0, foundBtScoInput ? 1 : 0);
|
|
||||||
+ //We couldn't find the routes we assume are required for the function we want to add
|
|
||||||
+ if(!foundTelephony || !foundBtScoInput)
|
|
||||||
+ return;
|
|
||||||
+ ALOGE("Adding our own.");
|
|
||||||
+
|
|
||||||
+ // Add:
|
|
||||||
+ // <route type="mix" sink="BT SCO Headset" sources="primary output,deep_buffer,compressed_offload,Telephony Rx"/>
|
|
||||||
+ AudioRoute *newRoute = new AudioRoute(AUDIO_ROUTE_MIX);
|
|
||||||
+
|
|
||||||
+ auto sink = ctx->findPortByTagName("BT SCO Headset");
|
|
||||||
+ ALOGE("Got sink %p\n", sink.get());
|
|
||||||
+ newRoute->setSink(sink);
|
|
||||||
+
|
|
||||||
+ Vector<sp<PolicyAudioPort>> sources;
|
|
||||||
+ for(const auto& sourceName: {
|
|
||||||
+ "primary output",
|
|
||||||
+ "deep_buffer",
|
|
||||||
+ "compressed_offload",
|
|
||||||
+ "Telephony Rx"
|
|
||||||
+ }) {
|
|
||||||
+ auto source = ctx->findPortByTagName(sourceName);
|
|
||||||
+ ALOGE("Got source %p\n", source.get());
|
|
||||||
+ if (source.get() != nullptr) {
|
|
||||||
+ sources.add(source);
|
|
||||||
+ source->addRoute(newRoute);
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ newRoute->setSources(sources);
|
|
||||||
+
|
|
||||||
+ sink->addRoute(newRoute);
|
|
||||||
+
|
|
||||||
+ auto ret = routes.add(newRoute);
|
|
||||||
+ ALOGE("route add returned %zd", ret);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
template<>
|
|
||||||
std::variant<status_t, ModuleTraits::Element> PolicySerializer::deserialize<ModuleTraits>(
|
|
||||||
const xmlNode *cur, ModuleTraits::PtrSerializingCtx ctx)
|
|
||||||
@@ -714,6 +806,7 @@ std::variant<status_t, ModuleTraits::Element> PolicySerializer::deserialize<Modu
|
|
||||||
if (status != NO_ERROR) {
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
+ fixupQualcommBtScoRoute(routes, devicePorts, module.get());
|
|
||||||
module->setRoutes(routes);
|
|
||||||
|
|
||||||
for (const xmlNode *children = cur->xmlChildrenNode; children != NULL;
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
@ -1,94 +0,0 @@
|
|||||||
From 66a6eb4ef75d566fd86877e303ff3a5688e37165 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Pierre-Hugues Husson <phh@phh.me>
|
|
||||||
Date: Tue, 1 Oct 2019 13:35:49 +0200
|
|
||||||
Subject: [PATCH 03/24] Add (partial, cam id is hardcoded) support for Asus ZF6
|
|
||||||
motor camera
|
|
||||||
|
|
||||||
Change-Id: Iea6e1370780a1d16f728748d1d948d092532d8fe
|
|
||||||
---
|
|
||||||
.../camera/libcameraservice/CameraService.cpp | 26 +++++++++++++++++++
|
|
||||||
.../camera/libcameraservice/CameraService.h | 3 +++
|
|
||||||
2 files changed, 29 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp
|
|
||||||
index 2d55f39b25..1e4001be1c 100644
|
|
||||||
--- a/services/camera/libcameraservice/CameraService.cpp
|
|
||||||
+++ b/services/camera/libcameraservice/CameraService.cpp
|
|
||||||
@@ -28,6 +28,7 @@
|
|
||||||
#include <sstream>
|
|
||||||
#include <string>
|
|
||||||
#include <sys/types.h>
|
|
||||||
+#include <sys/wait.h>
|
|
||||||
#include <inttypes.h>
|
|
||||||
#include <pthread.h>
|
|
||||||
#include <poll.h>
|
|
||||||
@@ -159,6 +160,7 @@ static std::set<std::string> sServiceErrorEventSet;
|
|
||||||
|
|
||||||
CameraService::CameraService(
|
|
||||||
std::shared_ptr<CameraServiceProxyWrapper> cameraServiceProxyWrapper) :
|
|
||||||
+ mPhysicalFrontCamStatus(false),
|
|
||||||
mCameraServiceProxyWrapper(cameraServiceProxyWrapper == nullptr ?
|
|
||||||
std::make_shared<CameraServiceProxyWrapper>() : cameraServiceProxyWrapper),
|
|
||||||
mEventLog(DEFAULT_EVENT_LOG_LENGTH),
|
|
||||||
@@ -2743,6 +2745,7 @@ Status CameraService::connectHelper(const sp<CALLBACK>& cameraCb, const std::str
|
|
||||||
mServiceLock.lock();
|
|
||||||
} else {
|
|
||||||
// Otherwise, add client to active clients list
|
|
||||||
+ physicalFrontCam(cameraId == "1");
|
|
||||||
finishConnectLocked(client, partial, oomScoreOffset, systemNativeClient);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -2869,6 +2872,27 @@ status_t CameraService::addOfflineClient(const std::string &cameraId,
|
|
||||||
return OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
+void CameraService::physicalFrontCam(bool on) {
|
|
||||||
+ if(on == mPhysicalFrontCamStatus) return;
|
|
||||||
+ mPhysicalFrontCamStatus = on;
|
|
||||||
+
|
|
||||||
+ if(access("/dev/asusMotoDrv", F_OK) == 0) {
|
|
||||||
+ int pid = fork();
|
|
||||||
+ if(pid == 0) {
|
|
||||||
+ const char* cmd[] = {
|
|
||||||
+ "/system/bin/asus-motor",
|
|
||||||
+ "0",
|
|
||||||
+ NULL
|
|
||||||
+ };
|
|
||||||
+ cmd[1] = on ? "0" : "1";
|
|
||||||
+ execve("/system/bin/asus-motor", (char**)cmd, environ);
|
|
||||||
+ _exit(1);
|
|
||||||
+ } else {
|
|
||||||
+ waitpid(pid, NULL, 0);
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
Status CameraService::turnOnTorchWithStrengthLevel(const std::string& unresolvedCameraId,
|
|
||||||
int32_t torchStrength, const sp<IBinder>& clientBinder) {
|
|
||||||
Mutex::Autolock lock(mServiceLock);
|
|
||||||
@@ -4138,6 +4162,8 @@ binder::Status CameraService::BasicClient::disconnect() {
|
|
||||||
}
|
|
||||||
mDisconnected = true;
|
|
||||||
|
|
||||||
+ sCameraService->physicalFrontCam(false);
|
|
||||||
+
|
|
||||||
sCameraService->removeByClient(this);
|
|
||||||
sCameraService->logDisconnected(mCameraIdStr, mClientPid, mClientPackageName);
|
|
||||||
sCameraService->mCameraProviderManager->removeRef(CameraProviderManager::DeviceMode::CAMERA,
|
|
||||||
diff --git a/services/camera/libcameraservice/CameraService.h b/services/camera/libcameraservice/CameraService.h
|
|
||||||
index 8822cd37cf..e2c38a9096 100644
|
|
||||||
--- a/services/camera/libcameraservice/CameraService.h
|
|
||||||
+++ b/services/camera/libcameraservice/CameraService.h
|
|
||||||
@@ -276,6 +276,9 @@ public:
|
|
||||||
// Register an offline client for a given active camera id
|
|
||||||
status_t addOfflineClient(const std::string &cameraId, sp<BasicClient> offlineClient);
|
|
||||||
|
|
||||||
+ bool mPhysicalFrontCamStatus;
|
|
||||||
+ void physicalFrontCam(bool on);
|
|
||||||
+
|
|
||||||
/////////////////////////////////////////////////////////////////////
|
|
||||||
// Client functionality
|
|
||||||
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
@ -1,55 +0,0 @@
|
|||||||
From 3ad1c75d98330f969396240399b22e8e4c7c2601 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Peter Cai <peter@typeblog.net>
|
|
||||||
Date: Thu, 23 Jan 2020 11:13:43 +0800
|
|
||||||
Subject: [PATCH 06/24] audiopolicy: try again with trimmed audio port name if
|
|
||||||
not found
|
|
||||||
|
|
||||||
* In Spreadtrum BSP, some audio routes may contain ports with extra
|
|
||||||
spaces at the beginning and the end, causing audiopolicy to refuse to
|
|
||||||
load and leading to broken audio.
|
|
||||||
|
|
||||||
* Fix this by retrying with trimmed port name when not found. Do not
|
|
||||||
use trimmed name all the time because a white space is a valid
|
|
||||||
character in port name, and we cannot be sure nobody is using it for
|
|
||||||
legitimite purposes.
|
|
||||||
|
|
||||||
Change-Id: I993708b28e8404bc8c483d71a850ac69382231bd
|
|
||||||
---
|
|
||||||
.../common/managerdefinitions/src/Serializer.cpp | 14 ++++++++++++++
|
|
||||||
1 file changed, 14 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
|
||||||
index 839974b9d3..21d3282134 100644
|
|
||||||
--- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
|
||||||
+++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
|
||||||
@@ -593,6 +593,17 @@ std::variant<status_t, DevicePortTraits::Element> PolicySerializer::deserialize<
|
|
||||||
return deviceDesc;
|
|
||||||
}
|
|
||||||
|
|
||||||
+char* trim(char * s) {
|
|
||||||
+ int l = strlen(s);
|
|
||||||
+
|
|
||||||
+ if (l > 0) {
|
|
||||||
+ while (isspace(s[l - 1])) --l;
|
|
||||||
+ while (*s && isspace(*s)) ++s, --l;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ return strndup(s, l);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
template<>
|
|
||||||
std::variant<status_t, RouteTraits::Element> PolicySerializer::deserialize<RouteTraits>(
|
|
||||||
const xmlNode *cur, RouteTraits::PtrSerializingCtx ctx)
|
|
||||||
@@ -642,6 +653,9 @@ std::variant<status_t, RouteTraits::Element> PolicySerializer::deserialize<Route
|
|
||||||
while (devTag != NULL) {
|
|
||||||
if (strlen(devTag) != 0) {
|
|
||||||
sp<PolicyAudioPort> source = ctx->findPortByTagName(devTag);
|
|
||||||
+ if (source == NULL) {
|
|
||||||
+ source = ctx->findPortByTagName(trim(devTag));
|
|
||||||
+ }
|
|
||||||
if (source == NULL) {
|
|
||||||
if (!mIgnoreVendorExtensions) {
|
|
||||||
ALOGE("%s: no source found with name \"%s\"", __func__, devTag);
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
@ -1,62 +0,0 @@
|
|||||||
From 5a170e94d2f73ca9ff749b7cc58d90678b6ade04 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Peter Cai <peter@typeblog.net>
|
|
||||||
Date: Wed, 1 Jun 2022 16:56:46 -0400
|
|
||||||
Subject: [PATCH 07/24] camera: Implement property to override default camera
|
|
||||||
|
|
||||||
Complement to the frameworks/base patch.
|
|
||||||
|
|
||||||
Change-Id: I002bfa974bafc2cc01365eeea31c7a5dcb5a2028
|
|
||||||
---
|
|
||||||
.../common/CameraProviderManager.cpp | 22 +++++++++++++++++++
|
|
||||||
1 file changed, 22 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/services/camera/libcameraservice/common/CameraProviderManager.cpp b/services/camera/libcameraservice/common/CameraProviderManager.cpp
|
|
||||||
index 15e2755a98..60e4eb7b42 100644
|
|
||||||
--- a/services/camera/libcameraservice/common/CameraProviderManager.cpp
|
|
||||||
+++ b/services/camera/libcameraservice/common/CameraProviderManager.cpp
|
|
||||||
@@ -41,6 +41,7 @@
|
|
||||||
#include <functional>
|
|
||||||
#include <camera_metadata_hidden.h>
|
|
||||||
#include <android-base/parseint.h>
|
|
||||||
+#include <android-base/properties.h>
|
|
||||||
#include <android-base/logging.h>
|
|
||||||
#include <cutils/properties.h>
|
|
||||||
#include <hwbinder/IPCThreadState.h>
|
|
||||||
@@ -278,6 +279,15 @@ std::vector<std::string> CameraProviderManager::getCameraDeviceIds(std::unordere
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+ int32_t altPrimaryCamera = property_get_int32("persist.sys.alt_primary_camera", 0);
|
|
||||||
+
|
|
||||||
+ if (altPrimaryCamera != 0 && deviceIds.size() > (size_t) altPrimaryCamera) {
|
|
||||||
+ const std::string origPrimary = deviceIds[0];
|
|
||||||
+ deviceIds[0] = deviceIds[altPrimaryCamera];
|
|
||||||
+ deviceIds[altPrimaryCamera] = origPrimary;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
return deviceIds;
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -344,6 +354,18 @@ std::vector<std::string> CameraProviderManager::getAPI1CompatibleCameraDeviceIds
|
|
||||||
std::sort(systemDeviceIds.begin(), systemDeviceIds.end(), sortFunc);
|
|
||||||
deviceIds.insert(deviceIds.end(), publicDeviceIds.begin(), publicDeviceIds.end());
|
|
||||||
deviceIds.insert(deviceIds.end(), systemDeviceIds.begin(), systemDeviceIds.end());
|
|
||||||
+
|
|
||||||
+ // Default camera ID hack should match with android.hardware.camera2.CameraManager.sortCameraIds
|
|
||||||
+ // Note that the alt primary camera may not be available here due to filterLogicalCameraIdsLocked()
|
|
||||||
+ // in which case we will just ignore it.
|
|
||||||
+ int altPrimaryCameraId = base::GetIntProperty("persist.sys.alt_primary_camera", -1);
|
|
||||||
+
|
|
||||||
+ if (altPrimaryCameraId > 0 && altPrimaryCameraId < (int) deviceIds.size()) {
|
|
||||||
+ std::string origPrimary = deviceIds[0];
|
|
||||||
+ deviceIds[0] = deviceIds[altPrimaryCameraId];
|
|
||||||
+ deviceIds[altPrimaryCameraId] = origPrimary;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
return deviceIds;
|
|
||||||
}
|
|
||||||
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
@ -1,46 +0,0 @@
|
|||||||
From 772f3d3d92335d509ce7e669353f15d33df17abe Mon Sep 17 00:00:00 2001
|
|
||||||
From: Pierre-Hugues Husson <phh@phh.me>
|
|
||||||
Date: Mon, 13 Apr 2020 21:01:16 +0200
|
|
||||||
Subject: [PATCH 08/24] There are three SCO devices. Fallback from one to the
|
|
||||||
others if needed
|
|
||||||
|
|
||||||
Change-Id: I414dcb6b154855c00cb8520b23dc1069827864b2
|
|
||||||
---
|
|
||||||
.../managerdefinitions/src/HwModule.cpp | 21 +++++++++++++++++++
|
|
||||||
1 file changed, 21 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/services/audiopolicy/common/managerdefinitions/src/HwModule.cpp b/services/audiopolicy/common/managerdefinitions/src/HwModule.cpp
|
|
||||||
index 6696b45f03..3ea185d873 100644
|
|
||||||
--- a/services/audiopolicy/common/managerdefinitions/src/HwModule.cpp
|
|
||||||
+++ b/services/audiopolicy/common/managerdefinitions/src/HwModule.cpp
|
|
||||||
@@ -321,6 +321,27 @@ sp<HwModule> HwModuleCollection::getModuleForDeviceType(audio_devices_t type,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+ //We didn't find one? Ok but all SCOs are equivalent surely?
|
|
||||||
+ if(type == AUDIO_DEVICE_OUT_BLUETOOTH_SCO ||
|
|
||||||
+ type == AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET ||
|
|
||||||
+ type == AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT) {
|
|
||||||
+ ALOGE("Fallback SCO");
|
|
||||||
+ if(type != AUDIO_DEVICE_OUT_BLUETOOTH_SCO) {
|
|
||||||
+ auto ret = getModuleForDeviceType(AUDIO_DEVICE_OUT_BLUETOOTH_SCO, encodedFormat);
|
|
||||||
+ ALOGE("Fallback SCO simple? %s", (ret != nullptr) ? "yes" : "no");
|
|
||||||
+ if(ret != nullptr) return ret;
|
|
||||||
+ }
|
|
||||||
+ if(type != AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET) {
|
|
||||||
+ auto ret = getModuleForDeviceType(AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET, encodedFormat);
|
|
||||||
+ ALOGE("Fallback SCO headset? %s", (ret != nullptr) ? "yes" : "no");
|
|
||||||
+ if(ret != nullptr) return ret;
|
|
||||||
+ }
|
|
||||||
+ if(type != AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT) {
|
|
||||||
+ auto ret = getModuleForDeviceType(AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT, encodedFormat);
|
|
||||||
+ ALOGE("Fallback SCO carkit? %s", (ret != nullptr) ? "yes" : "no");
|
|
||||||
+ if(ret != nullptr) return ret;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
@ -1,80 +0,0 @@
|
|||||||
From 3bdff36cbdf77acc3d9c277b3b2eef9a2fca1c3c Mon Sep 17 00:00:00 2001
|
|
||||||
From: Pierre-Hugues Husson <phh@phh.me>
|
|
||||||
Date: Thu, 14 May 2020 19:54:55 +0200
|
|
||||||
Subject: [PATCH 09/24] Add persist.sys.phh.samsung.camera_ids property to
|
|
||||||
access hidden Samsung cameras
|
|
||||||
|
|
||||||
Change-Id: I2c7bf535272acc28ed2277e96c78ddd28a0b4593
|
|
||||||
---
|
|
||||||
services/camera/libcameraservice/Android.bp | 1 +
|
|
||||||
.../common/hidl/HidlProviderInfo.cpp | 14 ++++++++++++--
|
|
||||||
2 files changed, 13 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/services/camera/libcameraservice/Android.bp b/services/camera/libcameraservice/Android.bp
|
|
||||||
index 5b76bb0c0f..2f574133c6 100644
|
|
||||||
--- a/services/camera/libcameraservice/Android.bp
|
|
||||||
+++ b/services/camera/libcameraservice/Android.bp
|
|
||||||
@@ -107,6 +107,7 @@ cc_defaults {
|
|
||||||
"android.hardware.camera.provider@2.6",
|
|
||||||
"android.hardware.camera.provider@2.7",
|
|
||||||
"android.hardware.camera.provider-V3-ndk",
|
|
||||||
+ "vendor.samsung.hardware.camera.provider@3.0",
|
|
||||||
"libaidlcommonsupport",
|
|
||||||
"libbinderthreadstateutils",
|
|
||||||
"libcameraservice_device_independent",
|
|
||||||
diff --git a/services/camera/libcameraservice/common/hidl/HidlProviderInfo.cpp b/services/camera/libcameraservice/common/hidl/HidlProviderInfo.cpp
|
|
||||||
index 065f0c5569..1b22767779 100644
|
|
||||||
--- a/services/camera/libcameraservice/common/hidl/HidlProviderInfo.cpp
|
|
||||||
+++ b/services/camera/libcameraservice/common/hidl/HidlProviderInfo.cpp
|
|
||||||
@@ -28,6 +28,7 @@
|
|
||||||
#include <utils/Trace.h>
|
|
||||||
|
|
||||||
#include <android/hardware/camera/device/3.7/ICameraDevice.h>
|
|
||||||
+#include <vendor/samsung/hardware/camera/provider/3.0/ISehCameraProvider.h>
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
const bool kEnableLazyHal(property_get_bool("ro.camera.enableLazyHal", false));
|
|
||||||
@@ -136,6 +137,7 @@ status_t HidlProviderInfo::initializeHidlProvider(
|
|
||||||
mMinorVersion = 6;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+
|
|
||||||
// We need to check again since cast2_6.isOk() succeeds even if the provider
|
|
||||||
// version isn't actually 2.6.
|
|
||||||
if (interface2_6 == nullptr){
|
|
||||||
@@ -172,6 +174,9 @@ status_t HidlProviderInfo::initializeHidlProvider(
|
|
||||||
return mapToStatusT(status);
|
|
||||||
}
|
|
||||||
|
|
||||||
+ auto samsungCast = vendor::samsung::hardware::camera::provider::V3_0::ISehCameraProvider::castFrom(interface);
|
|
||||||
+ auto samsungProvider = samsungCast.isOk() ? static_cast<sp<vendor::samsung::hardware::camera::provider::V3_0::ISehCameraProvider>>(samsungCast) : nullptr;
|
|
||||||
+
|
|
||||||
hardware::Return<bool> linked = interface->linkToDeath(this, /*cookie*/ mId);
|
|
||||||
if (!linked.isOk()) {
|
|
||||||
ALOGE("%s: Transaction error in linking to camera provider '%s' death: %s",
|
|
||||||
@@ -202,7 +207,7 @@ status_t HidlProviderInfo::initializeHidlProvider(
|
|
||||||
|
|
||||||
// Get initial list of camera devices, if any
|
|
||||||
std::vector<std::string> devices;
|
|
||||||
- hardware::Return<void> ret = interface->getCameraIdList([&status, this, &devices](
|
|
||||||
+ auto cb = [&status, this, &devices](
|
|
||||||
Status idStatus,
|
|
||||||
const hardware::hidl_vec<hardware::hidl_string>& cameraDeviceNames) {
|
|
||||||
status = idStatus;
|
|
||||||
@@ -219,7 +224,12 @@ status_t HidlProviderInfo::initializeHidlProvider(
|
|
||||||
mProviderPublicCameraIds.push_back(id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
- } });
|
|
||||||
+ } };
|
|
||||||
+ hardware::Return<void> ret;
|
|
||||||
+ if(samsungProvider != nullptr && property_get_bool("persist.sys.phh.samsung.camera_ids", false))
|
|
||||||
+ ret = samsungProvider->sehGetCameraIdList(cb);
|
|
||||||
+ else
|
|
||||||
+ ret = interface->getCameraIdList(cb);
|
|
||||||
if (!ret.isOk()) {
|
|
||||||
ALOGE("%s: Transaction error in getting camera ID list from provider '%s': %s",
|
|
||||||
__FUNCTION__, mProviderName.c_str(), linked.description().c_str());
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
@ -1,45 +0,0 @@
|
|||||||
From d3b95d0b5dfff1f1470dba177541b2090c8ad85d Mon Sep 17 00:00:00 2001
|
|
||||||
From: Pierre-Hugues Husson <phh@phh.me>
|
|
||||||
Date: Tue, 19 May 2020 14:01:14 +0200
|
|
||||||
Subject: [PATCH 10/24] Add a property to force camera timestamp source
|
|
||||||
|
|
||||||
Some devices wrongly report their timesource
|
|
||||||
Camera's timesource can either be CLOCK_MONOTONIC, or CLOCK_BOOTTIME
|
|
||||||
The former doesn't increment in sleep, while the later does.
|
|
||||||
There is a camera HAL property for that, though some devices don't
|
|
||||||
report it properly.
|
|
||||||
|
|
||||||
This issue happens on Xiaomi Redmi 7A, it needs to force the value to 1
|
|
||||||
|
|
||||||
Add a property persist.sys.phh.camera.force_timestampsource to force
|
|
||||||
timestamp source.
|
|
||||||
---
|
|
||||||
.../libcameraservice/device3/Camera3Device.cpp | 12 ++++++++++--
|
|
||||||
1 file changed, 10 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/services/camera/libcameraservice/device3/Camera3Device.cpp b/services/camera/libcameraservice/device3/Camera3Device.cpp
|
|
||||||
index 303bcfc180..29702c84c0 100644
|
|
||||||
--- a/services/camera/libcameraservice/device3/Camera3Device.cpp
|
|
||||||
+++ b/services/camera/libcameraservice/device3/Camera3Device.cpp
|
|
||||||
@@ -209,8 +209,16 @@ status_t Camera3Device::initializeCommonLocked() {
|
|
||||||
mTimestampOffset = getMonoToBoottimeOffset();
|
|
||||||
camera_metadata_entry timestampSource =
|
|
||||||
mDeviceInfo.find(ANDROID_SENSOR_INFO_TIMESTAMP_SOURCE);
|
|
||||||
- if (timestampSource.count > 0 && timestampSource.data.u8[0] ==
|
|
||||||
- ANDROID_SENSOR_INFO_TIMESTAMP_SOURCE_REALTIME) {
|
|
||||||
+ int timestampSourceValue = 0;
|
|
||||||
+ if ((timestampSource.count > 0 && timestampSource.data.u8[0] ==
|
|
||||||
+ ANDROID_SENSOR_INFO_TIMESTAMP_SOURCE_REALTIME)) {
|
|
||||||
+ timestampSourceValue = 1;
|
|
||||||
+ }
|
|
||||||
+ int forceTimestampSource = property_get_int32("persist.sys.phh.camera.force_timestampsource", -1);
|
|
||||||
+ //Don't override if it's -1, default value
|
|
||||||
+ if(forceTimestampSource == 0) timestampSourceValue = 0;
|
|
||||||
+ if(forceTimestampSource == 1) timestampSourceValue = 1;
|
|
||||||
+ if (timestampSourceValue == 1) {
|
|
||||||
mDeviceTimeBaseIsRealtime = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
@ -1,87 +0,0 @@
|
|||||||
From ab29ebc6a1d51718ee60d28921ce53241433d66c Mon Sep 17 00:00:00 2001
|
|
||||||
From: Pierre-Hugues Husson <phh@phh.me>
|
|
||||||
Date: Tue, 24 Apr 2018 00:14:28 +0200
|
|
||||||
Subject: [PATCH 11/24] FIH devices: Fix "Earpiece" audio output
|
|
||||||
|
|
||||||
On some FIH devices (confirmed on Razer, and probably on Aquos SS2),
|
|
||||||
Earpiece is not listed in attachedDevices, and devicePort's profile
|
|
||||||
mentions it is AUDIO_CHANNEL_IN_MONO, instead of AUDIO_CHANNEL_OUT_MONO.
|
|
||||||
|
|
||||||
Detect such cases (output device, but got only AUDIO_CHANNEL_IN_MONO),
|
|
||||||
and fix both channelMasks and attachedDevices
|
|
||||||
|
|
||||||
Change-Id: I4a88ba6d34d0fcd346eeea2ca903772f0271040a
|
|
||||||
---
|
|
||||||
.../managerdefinitions/src/Serializer.cpp | 27 ++++++++++++++++---
|
|
||||||
1 file changed, 24 insertions(+), 3 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
|
||||||
index 21d3282134..6ee076660b 100644
|
|
||||||
--- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
|
||||||
+++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
|
||||||
@@ -416,23 +416,32 @@ std::variant<status_t, AudioGainTraits::Element> PolicySerializer::deserialize<A
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
+static bool fixedEarpieceChannels = false;
|
|
||||||
template<>
|
|
||||||
std::variant<status_t, AudioProfileTraits::Element>
|
|
||||||
PolicySerializer::deserialize<AudioProfileTraits>(
|
|
||||||
- const xmlNode *cur, AudioProfileTraits::PtrSerializingCtx /*serializingContext*/)
|
|
||||||
+ const xmlNode *cur, AudioProfileTraits::PtrSerializingCtx serializingContext)
|
|
||||||
{
|
|
||||||
using Attributes = AudioProfileTraits::Attributes;
|
|
||||||
+ bool isOutput = serializingContext != nullptr;
|
|
||||||
|
|
||||||
std::string samplingRates = getXmlAttribute(cur, Attributes::samplingRates);
|
|
||||||
std::string format = getXmlAttribute(cur, Attributes::format);
|
|
||||||
std::string channels = getXmlAttribute(cur, Attributes::channelMasks);
|
|
||||||
+ ChannelTraits::Collection channelsMask = channelMasksFromString(channels, mChannelMasksSeparator.c_str());
|
|
||||||
+
|
|
||||||
+ //Some Foxconn devices have wrong earpiece channel mask, leading to no channel mask
|
|
||||||
+ if(channelsMask.size() == 1 && *channelsMask.begin() == AUDIO_CHANNEL_IN_MONO && isOutput) {
|
|
||||||
+ fixedEarpieceChannels = true;
|
|
||||||
+ channelsMask = channelMasksFromString("AUDIO_CHANNEL_OUT_MONO", ",");
|
|
||||||
+ }
|
|
||||||
|
|
||||||
if (mIgnoreVendorExtensions && maybeVendorExtension(format)) {
|
|
||||||
ALOGI("%s: vendor extension format \"%s\" skipped", __func__, format.c_str());
|
|
||||||
return NO_INIT;
|
|
||||||
}
|
|
||||||
AudioProfileTraits::Element profile = new AudioProfile(formatFromString(format, gDynamicFormat),
|
|
||||||
- channelMasksFromString(channels, mChannelMasksSeparator.c_str()),
|
|
||||||
+ channelsMask,
|
|
||||||
samplingRatesFromString(samplingRates, mSamplingRatesSeparator.c_str()));
|
|
||||||
|
|
||||||
profile->setDynamicFormat(profile->getFormat() == gDynamicFormat);
|
|
||||||
@@ -571,7 +580,11 @@ std::variant<status_t, DevicePortTraits::Element> PolicySerializer::deserialize<
|
|
||||||
new DeviceDescriptor(type, name, address, encodedFormats);
|
|
||||||
|
|
||||||
AudioProfileTraits::Collection profiles;
|
|
||||||
- status_t status = deserializeCollection<AudioProfileTraits>(cur, &profiles, NULL);
|
|
||||||
+ status_t status;
|
|
||||||
+ if(audio_is_output_devices(type))
|
|
||||||
+ status = deserializeCollection<AudioProfileTraits>(cur, &profiles, (AudioProfileTraits::PtrSerializingCtx)1);
|
|
||||||
+ else
|
|
||||||
+ status = deserializeCollection<AudioProfileTraits>(cur, &profiles, NULL);
|
|
||||||
if (status != NO_ERROR) {
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
@@ -892,6 +905,14 @@ std::variant<status_t, ModuleTraits::Element> PolicySerializer::deserialize<Modu
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+ if(fixedEarpieceChannels) {
|
|
||||||
+ sp<DeviceDescriptor> device =
|
|
||||||
+ module->getDeclaredDevices().getDeviceFromTagName("Earpiece");
|
|
||||||
+ if(device != 0)
|
|
||||||
+ ctx->addDevice(device);
|
|
||||||
+ fixedEarpieceChannels = false;
|
|
||||||
+ }
|
|
||||||
return module;
|
|
||||||
}
|
|
||||||
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
@ -1,32 +0,0 @@
|
|||||||
From 958fc690726a71004bd0264664968b2bd8eb08ae Mon Sep 17 00:00:00 2001
|
|
||||||
From: Pierre-Hugues Husson <phh@phh.me>
|
|
||||||
Date: Sat, 12 Sep 2020 12:32:50 +0200
|
|
||||||
Subject: [PATCH 12/24] No longer make re-assigning legacy audio groups fatal.
|
|
||||||
Mi9 declares AUDIO_STREAM_PATCH and AUDIO_STREAM_REROUTING which is defined
|
|
||||||
by framework too
|
|
||||||
|
|
||||||
Change-Id: I794fe22d63a8af705be4f5f09b9879ecaab3eae5
|
|
||||||
---
|
|
||||||
services/audiopolicy/engine/common/src/EngineBase.cpp | 6 +++---
|
|
||||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/services/audiopolicy/engine/common/src/EngineBase.cpp b/services/audiopolicy/engine/common/src/EngineBase.cpp
|
|
||||||
index e259e6e048..abd8786b4a 100644
|
|
||||||
--- a/services/audiopolicy/engine/common/src/EngineBase.cpp
|
|
||||||
+++ b/services/audiopolicy/engine/common/src/EngineBase.cpp
|
|
||||||
@@ -264,9 +264,9 @@ engineConfig::ParsingResult EngineBase::processParsingResult(
|
|
||||||
}
|
|
||||||
if (group.stream != AUDIO_STREAM_DEFAULT) {
|
|
||||||
// A legacy stream can be assigned once to a volume group
|
|
||||||
- LOG_ALWAYS_FATAL_IF(checkStreamForGroups(group.stream, mVolumeGroups),
|
|
||||||
- "stream %s already assigned to a volume group, "
|
|
||||||
- "review the configuration", toString(group.stream).c_str());
|
|
||||||
+ if(checkStreamForGroups(group.stream, mVolumeGroups)) {
|
|
||||||
+ ALOGE("stream %s already assigned to a volume group, review the configuration", toString(group.stream).c_str());
|
|
||||||
+ }
|
|
||||||
volumeGroup->addSupportedStream(group.stream);
|
|
||||||
}
|
|
||||||
addSupportedAttributesToGroup(group, volumeGroup, strategy);
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
@ -1,47 +0,0 @@
|
|||||||
From c3dd6050d65fe5793d30771eb8a008670949ba40 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Pierre-Hugues Husson <phh@phh.me>
|
|
||||||
Date: Mon, 21 Dec 2020 20:19:11 +0100
|
|
||||||
Subject: [PATCH 13/24] Make camera IDs filter-out optional
|
|
||||||
|
|
||||||
Nowadays most people have Camera 2 apps, and would like to have all
|
|
||||||
cameras, rather than limit which cameras are available.
|
|
||||||
Add a property for that.
|
|
||||||
---
|
|
||||||
.../common/CameraProviderManager.cpp | 14 +++++++++-----
|
|
||||||
1 file changed, 9 insertions(+), 5 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/services/camera/libcameraservice/common/CameraProviderManager.cpp b/services/camera/libcameraservice/common/CameraProviderManager.cpp
|
|
||||||
index 60e4eb7b42..fbfdecc2ed 100644
|
|
||||||
--- a/services/camera/libcameraservice/common/CameraProviderManager.cpp
|
|
||||||
+++ b/services/camera/libcameraservice/common/CameraProviderManager.cpp
|
|
||||||
@@ -328,7 +328,9 @@ std::vector<std::string> CameraProviderManager::getAPI1CompatibleCameraDeviceIds
|
|
||||||
// API1 app doesn't handle logical and physical camera devices well. So
|
|
||||||
// for each camera facing, only take the first id advertised by HAL in
|
|
||||||
// all [logical, physical1, physical2, ...] id combos, and filter out the rest.
|
|
||||||
- filterLogicalCameraIdsLocked(providerDeviceIds);
|
|
||||||
+ if(!property_get_bool("persist.sys.phh.include_all_cameras", false)) {
|
|
||||||
+ filterLogicalCameraIdsLocked(providerDeviceIds);
|
|
||||||
+ }
|
|
||||||
collectDeviceIdsLocked(providerDeviceIds, publicDeviceIds, systemDeviceIds);
|
|
||||||
}
|
|
||||||
auto sortFunc =
|
|
||||||
@@ -1137,10 +1139,12 @@ SystemCameraKind CameraProviderManager::ProviderInfo::DeviceInfo3::getSystemCame
|
|
||||||
|
|
||||||
// Go through the capabilities and check if it has
|
|
||||||
// ANDROID_REQUEST_AVAILABLE_CAPABILITIES_SYSTEM_CAMERA
|
|
||||||
- for (size_t i = 0; i < entryCap.count; ++i) {
|
|
||||||
- uint8_t capability = entryCap.data.u8[i];
|
|
||||||
- if (capability == ANDROID_REQUEST_AVAILABLE_CAPABILITIES_SYSTEM_CAMERA) {
|
|
||||||
- return SystemCameraKind::SYSTEM_ONLY_CAMERA;
|
|
||||||
+ if(!property_get_bool("persist.sys.phh.include_all_cameras", false)) {
|
|
||||||
+ for (size_t i = 0; i < entryCap.count; ++i) {
|
|
||||||
+ uint8_t capability = entryCap.data.u8[i];
|
|
||||||
+ if (capability == ANDROID_REQUEST_AVAILABLE_CAPABILITIES_SYSTEM_CAMERA) {
|
|
||||||
+ return SystemCameraKind::SYSTEM_ONLY_CAMERA;
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return SystemCameraKind::PUBLIC;
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
@ -1,67 +0,0 @@
|
|||||||
From dfa461bb49279d406df7e6b2e1817acea65e0faa Mon Sep 17 00:00:00 2001
|
|
||||||
From: Pierre-Hugues Husson <phh@phh.me>
|
|
||||||
Date: Sat, 13 Mar 2021 14:20:03 -0500
|
|
||||||
Subject: [PATCH 14/24] Support Samsung R multi-cams
|
|
||||||
|
|
||||||
Change-Id: If46f385e8dd16185cbf37ab083e6a1242e1d1555
|
|
||||||
---
|
|
||||||
services/camera/libcameraservice/Android.bp | 1 +
|
|
||||||
.../libcameraservice/common/hidl/HidlProviderInfo.cpp | 8 +++++++-
|
|
||||||
2 files changed, 8 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/services/camera/libcameraservice/Android.bp b/services/camera/libcameraservice/Android.bp
|
|
||||||
index 2f574133c6..6b7a74edb6 100644
|
|
||||||
--- a/services/camera/libcameraservice/Android.bp
|
|
||||||
+++ b/services/camera/libcameraservice/Android.bp
|
|
||||||
@@ -108,6 +108,7 @@ cc_defaults {
|
|
||||||
"android.hardware.camera.provider@2.7",
|
|
||||||
"android.hardware.camera.provider-V3-ndk",
|
|
||||||
"vendor.samsung.hardware.camera.provider@3.0",
|
|
||||||
+ "vendor.samsung.hardware.camera.provider@4.0",
|
|
||||||
"libaidlcommonsupport",
|
|
||||||
"libbinderthreadstateutils",
|
|
||||||
"libcameraservice_device_independent",
|
|
||||||
diff --git a/services/camera/libcameraservice/common/hidl/HidlProviderInfo.cpp b/services/camera/libcameraservice/common/hidl/HidlProviderInfo.cpp
|
|
||||||
index 1b22767779..c60c0c4ffa 100644
|
|
||||||
--- a/services/camera/libcameraservice/common/hidl/HidlProviderInfo.cpp
|
|
||||||
+++ b/services/camera/libcameraservice/common/hidl/HidlProviderInfo.cpp
|
|
||||||
@@ -29,6 +29,7 @@
|
|
||||||
|
|
||||||
#include <android/hardware/camera/device/3.7/ICameraDevice.h>
|
|
||||||
#include <vendor/samsung/hardware/camera/provider/3.0/ISehCameraProvider.h>
|
|
||||||
+#include <vendor/samsung/hardware/camera/provider/4.0/ISehCameraProvider.h>
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
const bool kEnableLazyHal(property_get_bool("ro.camera.enableLazyHal", false));
|
|
||||||
@@ -175,7 +176,9 @@ status_t HidlProviderInfo::initializeHidlProvider(
|
|
||||||
}
|
|
||||||
|
|
||||||
auto samsungCast = vendor::samsung::hardware::camera::provider::V3_0::ISehCameraProvider::castFrom(interface);
|
|
||||||
+ auto samsung40Cast = vendor::samsung::hardware::camera::provider::V4_0::ISehCameraProvider::castFrom(interface);
|
|
||||||
auto samsungProvider = samsungCast.isOk() ? static_cast<sp<vendor::samsung::hardware::camera::provider::V3_0::ISehCameraProvider>>(samsungCast) : nullptr;
|
|
||||||
+ auto samsung40Provider = samsung40Cast.isOk() ? static_cast<sp<vendor::samsung::hardware::camera::provider::V4_0::ISehCameraProvider>>(samsung40Cast) : nullptr;
|
|
||||||
|
|
||||||
hardware::Return<bool> linked = interface->linkToDeath(this, /*cookie*/ mId);
|
|
||||||
if (!linked.isOk()) {
|
|
||||||
@@ -213,6 +216,7 @@ status_t HidlProviderInfo::initializeHidlProvider(
|
|
||||||
status = idStatus;
|
|
||||||
if (status == Status::OK) {
|
|
||||||
for (auto& name : cameraDeviceNames) {
|
|
||||||
+ ALOGE("Listing camera ID %s", name.c_str());
|
|
||||||
uint16_t major, minor;
|
|
||||||
std::string type, id;
|
|
||||||
status_t res = parseDeviceName(name, &major, &minor, &type, &id);
|
|
||||||
@@ -226,7 +230,9 @@ status_t HidlProviderInfo::initializeHidlProvider(
|
|
||||||
}
|
|
||||||
} };
|
|
||||||
hardware::Return<void> ret;
|
|
||||||
- if(samsungProvider != nullptr && property_get_bool("persist.sys.phh.samsung.camera_ids", false))
|
|
||||||
+ if(samsung40Provider != nullptr && property_get_bool("persist.sys.phh.samsung.camera_ids", false))
|
|
||||||
+ ret = samsung40Provider->sehGetCameraIdList(cb);
|
|
||||||
+ else if(samsungProvider != nullptr && property_get_bool("persist.sys.phh.samsung.camera_ids", false))
|
|
||||||
ret = samsungProvider->sehGetCameraIdList(cb);
|
|
||||||
else
|
|
||||||
ret = interface->getCameraIdList(cb);
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
@ -1,27 +0,0 @@
|
|||||||
From 566af85de4cdf5f65c0b41b78d0973befa8bb6a7 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Pierre-Hugues Husson <phh@phh.me>
|
|
||||||
Date: Sun, 28 Mar 2021 18:54:47 +0200
|
|
||||||
Subject: [PATCH 15/24] Not all sources in a route are valid. Dont ignore the
|
|
||||||
whole route because of one broken source
|
|
||||||
|
|
||||||
Change-Id: If8a51740e71bef3a4738262ad7b43a337b0ec36d
|
|
||||||
---
|
|
||||||
.../audiopolicy/common/managerdefinitions/src/Serializer.cpp | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
|
||||||
index 6ee076660b..146c78b8f6 100644
|
|
||||||
--- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
|
||||||
+++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
|
||||||
@@ -670,7 +670,7 @@ std::variant<status_t, RouteTraits::Element> PolicySerializer::deserialize<Route
|
|
||||||
source = ctx->findPortByTagName(trim(devTag));
|
|
||||||
}
|
|
||||||
if (source == NULL) {
|
|
||||||
- if (!mIgnoreVendorExtensions) {
|
|
||||||
+ if (false && !mIgnoreVendorExtensions) {
|
|
||||||
ALOGE("%s: no source found with name \"%s\"", __func__, devTag);
|
|
||||||
return BAD_VALUE;
|
|
||||||
} else {
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
@ -1,37 +0,0 @@
|
|||||||
From 6f500a59e45d517f5ebcad5893fc6d58e81c496e Mon Sep 17 00:00:00 2001
|
|
||||||
From: Pierre-Hugues Husson <phh@phh.me>
|
|
||||||
Date: Sun, 28 Mar 2021 14:48:49 +0200
|
|
||||||
Subject: [PATCH 16/24] Use a fake volume policy when none has been found
|
|
||||||
|
|
||||||
This is useful, because on Samsung devices, the "real"
|
|
||||||
(=non-gsi-cheating) audio policy doesn't have any volume policy.
|
|
||||||
|
|
||||||
This requires actually adding the fake audio policy xml file (done in
|
|
||||||
device/phh/treble)
|
|
||||||
|
|
||||||
Change-Id: I461a3f22893ab2b1d96d67f22397369b2cae41e5
|
|
||||||
---
|
|
||||||
services/audiopolicy/engine/config/src/EngineConfig.cpp | 7 ++++++-
|
|
||||||
1 file changed, 6 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/services/audiopolicy/engine/config/src/EngineConfig.cpp b/services/audiopolicy/engine/config/src/EngineConfig.cpp
|
|
||||||
index ca78ce7213..59211577c4 100644
|
|
||||||
--- a/services/audiopolicy/engine/config/src/EngineConfig.cpp
|
|
||||||
+++ b/services/audiopolicy/engine/config/src/EngineConfig.cpp
|
|
||||||
@@ -800,7 +800,12 @@ android::status_t parseLegacyVolumeFile(const char* path, VolumeGroups &volumeGr
|
|
||||||
android::status_t parseLegacyVolumes(VolumeGroups &volumeGroups) {
|
|
||||||
if (std::string audioPolicyXmlConfigFile = audio_get_audio_policy_config_file();
|
|
||||||
!audioPolicyXmlConfigFile.empty()) {
|
|
||||||
- return parseLegacyVolumeFile(audioPolicyXmlConfigFile.c_str(), volumeGroups);
|
|
||||||
+ int ret = parseLegacyVolumeFile(audioPolicyXmlConfigFile.c_str(), volumeGroups);
|
|
||||||
+ if (ret == NO_ERROR && volumeGroups.size() == 0) {
|
|
||||||
+ ret = parseLegacyVolumeFile("/system/etc/fake_audio_policy_volume.xml", volumeGroups);
|
|
||||||
+ ALOGE("Parsing volume for /system/etc/fake_audio_policy_volume.xml gave %zu", volumeGroups.size());
|
|
||||||
+ }
|
|
||||||
+ return ret;
|
|
||||||
} else {
|
|
||||||
ALOGE("No readable audio policy config file found");
|
|
||||||
return BAD_VALUE;
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
@ -1,152 +0,0 @@
|
|||||||
From eae358283867bea937c4b9575e352a195d2def54 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
|
||||||
Date: Mon, 11 Oct 2021 16:10:42 -0400
|
|
||||||
Subject: [PATCH 17/24] Revert "Remove support for audio HAL V2 from the
|
|
||||||
framework"
|
|
||||||
|
|
||||||
This reverts commit cbf517f837f7bf8a59f3ff8aa1e0e3e19612e251.
|
|
||||||
|
|
||||||
Also enable new extensions required to actually build
|
|
||||||
|
|
||||||
Change-Id: Icfd638a91b22ffa6d2cd6d19a624e699a85a850a
|
|
||||||
---
|
|
||||||
media/libaudiohal/Android.bp | 1 +
|
|
||||||
media/libaudiohal/FactoryHal.cpp | 3 ++-
|
|
||||||
media/libaudiohal/impl/Android.bp | 26 +++++++++++++++++++
|
|
||||||
media/libaudiohal/impl/DeviceHalHidl.cpp | 10 +++++++
|
|
||||||
.../impl/DevicesFactoryHalHidl.cpp | 4 +++
|
|
||||||
5 files changed, 43 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/media/libaudiohal/Android.bp b/media/libaudiohal/Android.bp
|
|
||||||
index b8d099897f..e4a11a3fa8 100644
|
|
||||||
--- a/media/libaudiohal/Android.bp
|
|
||||||
+++ b/media/libaudiohal/Android.bp
|
|
||||||
@@ -23,6 +23,7 @@ cc_library_shared {
|
|
||||||
],
|
|
||||||
|
|
||||||
required: [
|
|
||||||
+ "libaudiohal@2.0",
|
|
||||||
"libaudiohal@5.0",
|
|
||||||
"libaudiohal@6.0",
|
|
||||||
"libaudiohal@7.0",
|
|
||||||
diff --git a/media/libaudiohal/FactoryHal.cpp b/media/libaudiohal/FactoryHal.cpp
|
|
||||||
index 15cb297b5c..c922dd184d 100644
|
|
||||||
--- a/media/libaudiohal/FactoryHal.cpp
|
|
||||||
+++ b/media/libaudiohal/FactoryHal.cpp
|
|
||||||
@@ -50,12 +50,13 @@ using InterfaceName = std::pair<std::string, std::string>;
|
|
||||||
* This list need to keep sync with AudioHalVersionInfo.VERSIONS in
|
|
||||||
* media/java/android/media/AudioHalVersionInfo.java.
|
|
||||||
*/
|
|
||||||
-static const std::array<AudioHalVersionInfo, 5> sAudioHALVersions = {
|
|
||||||
+static const std::array<AudioHalVersionInfo, 6> sAudioHALVersions = {
|
|
||||||
AudioHalVersionInfo(AudioHalVersionInfo::Type::AIDL, 1, 0),
|
|
||||||
AudioHalVersionInfo(AudioHalVersionInfo::Type::HIDL, 7, 1),
|
|
||||||
AudioHalVersionInfo(AudioHalVersionInfo::Type::HIDL, 7, 0),
|
|
||||||
AudioHalVersionInfo(AudioHalVersionInfo::Type::HIDL, 6, 0),
|
|
||||||
AudioHalVersionInfo(AudioHalVersionInfo::Type::HIDL, 5, 0),
|
|
||||||
+ AudioHalVersionInfo(AudioHalVersionInfo::Type::HIDL, 2, 0),
|
|
||||||
};
|
|
||||||
|
|
||||||
static const std::map<AudioHalVersionInfo::Type, InterfaceName> sDevicesHALInterfaces = {
|
|
||||||
diff --git a/media/libaudiohal/impl/Android.bp b/media/libaudiohal/impl/Android.bp
|
|
||||||
index 4d81f77d8e..23d7f0465b 100644
|
|
||||||
--- a/media/libaudiohal/impl/Android.bp
|
|
||||||
+++ b/media/libaudiohal/impl/Android.bp
|
|
||||||
@@ -82,6 +82,32 @@ cc_defaults {
|
|
||||||
],
|
|
||||||
}
|
|
||||||
|
|
||||||
+cc_library_shared {
|
|
||||||
+ name: "libaudiohal@2.0",
|
|
||||||
+ defaults: [
|
|
||||||
+ "libaudiohal_default",
|
|
||||||
+ "libaudiohal_hidl_default"
|
|
||||||
+ ],
|
|
||||||
+ srcs: [
|
|
||||||
+ ":audio_core_hal_client_sources",
|
|
||||||
+ ":audio_effect_hidl_hal_client_sources",
|
|
||||||
+ "EffectsFactoryHalEntry.cpp",
|
|
||||||
+ ],
|
|
||||||
+ shared_libs: [
|
|
||||||
+ "android.hardware.audio.common@2.0",
|
|
||||||
+ "android.hardware.audio.common@2.0-util",
|
|
||||||
+ "android.hardware.audio.effect@2.0",
|
|
||||||
+ "android.hardware.audio.effect@2.0-util",
|
|
||||||
+ "android.hardware.audio@2.0",
|
|
||||||
+ "android.hardware.audio@2.0-util",
|
|
||||||
+ ],
|
|
||||||
+ cflags: [
|
|
||||||
+ "-DMAJOR_VERSION=2",
|
|
||||||
+ "-DMINOR_VERSION=0",
|
|
||||||
+ "-include common/all-versions/VersionMacro.h",
|
|
||||||
+ ]
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
cc_library_shared {
|
|
||||||
name: "libaudiohal@5.0",
|
|
||||||
defaults: [
|
|
||||||
diff --git a/media/libaudiohal/impl/DeviceHalHidl.cpp b/media/libaudiohal/impl/DeviceHalHidl.cpp
|
|
||||||
index ea4258c878..4d4e8a8717 100644
|
|
||||||
--- a/media/libaudiohal/impl/DeviceHalHidl.cpp
|
|
||||||
+++ b/media/libaudiohal/impl/DeviceHalHidl.cpp
|
|
||||||
@@ -587,6 +587,7 @@ status_t DeviceHalHidl::setConnectedState(const struct audio_port_v7 *port, bool
|
|
||||||
// call is successful. Also remove the cache here to avoid a large cache after a long run.
|
|
||||||
return NO_ERROR;
|
|
||||||
}
|
|
||||||
+#if MAJOR_VERSION > 2
|
|
||||||
#if MAJOR_VERSION == 7 && MINOR_VERSION == 1
|
|
||||||
if (supportsSetConnectedState7_1) {
|
|
||||||
AudioPort hidlPort;
|
|
||||||
@@ -609,11 +610,17 @@ status_t DeviceHalHidl::setConnectedState(const struct audio_port_v7 *port, bool
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
return processReturn("setConnectedState", mDevice->setConnectedState(hidlAddress, connected));
|
|
||||||
+#else
|
|
||||||
+ (void) port;
|
|
||||||
+ (void) connected;
|
|
||||||
+ return NO_ERROR;
|
|
||||||
+#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
error::Result<audio_hw_sync_t> DeviceHalHidl::getHwAvSync() {
|
|
||||||
TIME_CHECK();
|
|
||||||
if (mDevice == 0) return NO_INIT;
|
|
||||||
+#if MAJOR_VERSION > 2
|
|
||||||
audio_hw_sync_t value;
|
|
||||||
Result result;
|
|
||||||
Return<void> ret = mDevice->getHwAvSync([&value, &result](Result r, audio_hw_sync_t v) {
|
|
||||||
@@ -622,6 +629,9 @@ error::Result<audio_hw_sync_t> DeviceHalHidl::getHwAvSync() {
|
|
||||||
});
|
|
||||||
RETURN_IF_ERROR(processReturn("getHwAvSync", ret, result));
|
|
||||||
return value;
|
|
||||||
+#else
|
|
||||||
+ return 0xdeadbeef;
|
|
||||||
+#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
status_t DeviceHalHidl::dump(int fd, const Vector<String16>& args) {
|
|
||||||
diff --git a/media/libaudiohal/impl/DevicesFactoryHalHidl.cpp b/media/libaudiohal/impl/DevicesFactoryHalHidl.cpp
|
|
||||||
index 1cac9dab76..78c0c56416 100644
|
|
||||||
--- a/media/libaudiohal/impl/DevicesFactoryHalHidl.cpp
|
|
||||||
+++ b/media/libaudiohal/impl/DevicesFactoryHalHidl.cpp
|
|
||||||
@@ -119,6 +119,7 @@ status_t DevicesFactoryHalHidl::openDevice(const char *name, sp<DeviceHalInterfa
|
|
||||||
Result retval = Result::NOT_INITIALIZED;
|
|
||||||
for (const auto& factory : factories) {
|
|
||||||
Return<void> ret;
|
|
||||||
+#if MAJOR_VERSION > 2
|
|
||||||
if (strcmp(name, AUDIO_HARDWARE_MODULE_ID_PRIMARY) == 0) {
|
|
||||||
// In V7.1 it's not possible to cast IDevice back to IPrimaryDevice,
|
|
||||||
// thus openPrimaryDevice must be used.
|
|
||||||
@@ -135,6 +136,9 @@ status_t DevicesFactoryHalHidl::openDevice(const char *name, sp<DeviceHalInterfa
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
+#else
|
|
||||||
+ if (true) {
|
|
||||||
+#endif
|
|
||||||
#if MAJOR_VERSION == 7 && MINOR_VERSION == 1
|
|
||||||
ret = factory->openDevice_7_1(
|
|
||||||
#else
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
@ -1,64 +0,0 @@
|
|||||||
From 5b194a7fad55a6bfb5c9a49b58081bb4b2fd4917 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Pierre-Hugues Husson <phh@phh.me>
|
|
||||||
Date: Sat, 16 Apr 2022 14:30:14 -0400
|
|
||||||
Subject: [PATCH 18/24] Add a prop to change Samsung flash strength
|
|
||||||
|
|
||||||
---
|
|
||||||
services/camera/libcameraservice/Android.bp | 2 ++
|
|
||||||
.../common/hidl/HidlProviderInfo.cpp | 20 ++++++++++++++++++-
|
|
||||||
2 files changed, 21 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/services/camera/libcameraservice/Android.bp b/services/camera/libcameraservice/Android.bp
|
|
||||||
index 6b7a74edb6..1e1423f42b 100644
|
|
||||||
--- a/services/camera/libcameraservice/Android.bp
|
|
||||||
+++ b/services/camera/libcameraservice/Android.bp
|
|
||||||
@@ -83,6 +83,8 @@ cc_defaults {
|
|
||||||
"android.hardware.camera.device@3.5",
|
|
||||||
"android.hardware.camera.device@3.6",
|
|
||||||
"android.hardware.camera.device@3.7",
|
|
||||||
+ "vendor.samsung.hardware.camera.device@5.0",
|
|
||||||
+ "vendor.samsung.hardware.camera.device@4.0",
|
|
||||||
"android.hardware.common-V2-ndk",
|
|
||||||
"android.hardware.common.fmq-V1-ndk",
|
|
||||||
"camera_platform_flags_c_lib",
|
|
||||||
diff --git a/services/camera/libcameraservice/common/hidl/HidlProviderInfo.cpp b/services/camera/libcameraservice/common/hidl/HidlProviderInfo.cpp
|
|
||||||
index c60c0c4ffa..9d9275c89c 100644
|
|
||||||
--- a/services/camera/libcameraservice/common/hidl/HidlProviderInfo.cpp
|
|
||||||
+++ b/services/camera/libcameraservice/common/hidl/HidlProviderInfo.cpp
|
|
||||||
@@ -30,6 +30,8 @@
|
|
||||||
#include <android/hardware/camera/device/3.7/ICameraDevice.h>
|
|
||||||
#include <vendor/samsung/hardware/camera/provider/3.0/ISehCameraProvider.h>
|
|
||||||
#include <vendor/samsung/hardware/camera/provider/4.0/ISehCameraProvider.h>
|
|
||||||
+#include <vendor/samsung/hardware/camera/device/5.0/ISehCameraDevice.h>
|
|
||||||
+#include <vendor/samsung/hardware/camera/device/4.0/ISehCameraDevice.h>
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
const bool kEnableLazyHal(property_get_bool("ro.camera.enableLazyHal", false));
|
|
||||||
@@ -812,7 +814,23 @@ HidlProviderInfo::HidlDeviceInfo3::HidlDeviceInfo3(
|
|
||||||
status_t HidlProviderInfo::HidlDeviceInfo3::setTorchMode(bool enabled) {
|
|
||||||
using hardware::camera::common::V1_0::TorchMode;
|
|
||||||
const sp<hardware::camera::device::V3_2::ICameraDevice> interface = startDeviceInterface();
|
|
||||||
- Status s = interface->setTorchMode(enabled ? TorchMode::ON : TorchMode::OFF);
|
|
||||||
+ int32_t flashStrength = property_get_int32("persist.sys.phh.flash_strength", 1);
|
|
||||||
+
|
|
||||||
+ auto sehCast = vendor::samsung::hardware::camera::device::V5_0::ISehCameraDevice::castFrom(interface);
|
|
||||||
+ android::sp<vendor::samsung::hardware::camera::device::V5_0::ISehCameraDevice> seh = sehCast;
|
|
||||||
+
|
|
||||||
+ auto sehCast2 = vendor::samsung::hardware::camera::device::V4_0::ISehCameraDevice::castFrom(interface);
|
|
||||||
+ android::sp<vendor::samsung::hardware::camera::device::V4_0::ISehCameraDevice> seh2 = sehCast2;
|
|
||||||
+
|
|
||||||
+ Status s;
|
|
||||||
+ if(seh != nullptr) {
|
|
||||||
+ s = seh->sehSetTorchModeStrength(enabled ? TorchMode::ON : TorchMode::OFF, flashStrength);
|
|
||||||
+ } else if(seh2 != nullptr) {
|
|
||||||
+ s = seh2->sehSetTorchModeStrength(enabled ? TorchMode::ON : TorchMode::OFF, flashStrength);
|
|
||||||
+ } else {
|
|
||||||
+ s = interface->setTorchMode(enabled ? TorchMode::ON : TorchMode::OFF);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
return mapToStatusT(s);
|
|
||||||
}
|
|
||||||
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
@ -1,46 +0,0 @@
|
|||||||
From 584e013e0e203cd1605073707f36385d7ebf5892 Mon Sep 17 00:00:00 2001
|
|
||||||
From: ponces <ponces26@gmail.com>
|
|
||||||
Date: Mon, 24 Oct 2022 09:38:34 +0100
|
|
||||||
Subject: [PATCH 19/24] voip: Fix high pitched voice on Qualcomm devices
|
|
||||||
|
|
||||||
---
|
|
||||||
.../common/managerdefinitions/src/Serializer.cpp | 9 +++++++++
|
|
||||||
1 file changed, 9 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
|
||||||
index 146c78b8f6..b9f71cc42b 100644
|
|
||||||
--- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
|
||||||
+++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
|
||||||
@@ -252,6 +252,7 @@ private:
|
|
||||||
std::string mChannelMasksSeparator = ",";
|
|
||||||
std::string mSamplingRatesSeparator = ",";
|
|
||||||
std::string mFlagsSeparator = "|";
|
|
||||||
+ std::string mMixPortName = "";
|
|
||||||
|
|
||||||
// Children: ModulesTraits, VolumeTraits, SurroundSoundTraits (optional)
|
|
||||||
};
|
|
||||||
@@ -436,6 +437,13 @@ PolicySerializer::deserialize<AudioProfileTraits>(
|
|
||||||
channelsMask = channelMasksFromString("AUDIO_CHANNEL_OUT_MONO", ",");
|
|
||||||
}
|
|
||||||
|
|
||||||
+ // This breaks in-game voice chat and audio in some messaging apps causing it to play with a higher pitch and speed
|
|
||||||
+ bool disableStereoVoip = property_get_bool("persist.sys.phh.disable_stereo_voip", false);
|
|
||||||
+ if (disableStereoVoip && mMixPortName == "voip_rx") {
|
|
||||||
+ ALOGI("%s: disabling stereo support on voip_rx", __func__);
|
|
||||||
+ channelsMask = channelMasksFromString("AUDIO_CHANNEL_OUT_MONO", ",");
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
if (mIgnoreVendorExtensions && maybeVendorExtension(format)) {
|
|
||||||
ALOGI("%s: vendor extension format \"%s\" skipped", __func__, format.c_str());
|
|
||||||
return NO_INIT;
|
|
||||||
@@ -458,6 +466,7 @@ std::variant<status_t, MixPortTraits::Element> PolicySerializer::deserialize<Mix
|
|
||||||
using Attributes = MixPortTraits::Attributes;
|
|
||||||
|
|
||||||
std::string name = getXmlAttribute(child, Attributes::name);
|
|
||||||
+ mMixPortName = name;
|
|
||||||
if (name.empty()) {
|
|
||||||
ALOGE("%s: No %s found", __func__, Attributes::name);
|
|
||||||
return BAD_VALUE;
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
@ -1,40 +0,0 @@
|
|||||||
From 627bb9864b9022a3c76cbe7f21ea3f003f13e97b Mon Sep 17 00:00:00 2001
|
|
||||||
From: Alberto Ponces <ponces26@gmail.com>
|
|
||||||
Date: Sun, 30 Apr 2023 23:29:04 +0100
|
|
||||||
Subject: [PATCH 20/24] audiopolicy: Fix broken mic while video recording on
|
|
||||||
some Exynos devices
|
|
||||||
|
|
||||||
This should fix https://github.com/phhusson/treble_experimentations/issues/2021 and https://github.com/phhusson/treble_experimentations/issues/2384.
|
|
||||||
Credits to @haridhayal11.
|
|
||||||
---
|
|
||||||
.../common/managerdefinitions/src/Serializer.cpp | 7 +++++++
|
|
||||||
1 file changed, 7 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
|
||||||
index b9f71cc42b..77a96b47a4 100644
|
|
||||||
--- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
|
||||||
+++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
|
||||||
@@ -662,6 +662,9 @@ std::variant<status_t, RouteTraits::Element> PolicySerializer::deserialize<Route
|
|
||||||
}
|
|
||||||
route->setSink(sink);
|
|
||||||
|
|
||||||
+ // This fixes broken mic while video record on some Exynos devices
|
|
||||||
+ bool disableBackMic = property_get_bool("persist.sys.phh.disable_back_mic", false);
|
|
||||||
+
|
|
||||||
std::string sourcesAttr = getXmlAttribute(cur, Attributes::sources);
|
|
||||||
if (sourcesAttr.empty()) {
|
|
||||||
ALOGE("%s: No %s found", __func__, Attributes::sources);
|
|
||||||
@@ -678,6 +681,10 @@ std::variant<status_t, RouteTraits::Element> PolicySerializer::deserialize<Route
|
|
||||||
if (source == NULL) {
|
|
||||||
source = ctx->findPortByTagName(trim(devTag));
|
|
||||||
}
|
|
||||||
+ if (disableBackMic && strcmp(devTag, "Built-In Back Mic") == 0) {
|
|
||||||
+ ALOGW("Skipping route source \"%s\" as it breaks video recording mic", devTag);
|
|
||||||
+ source = NULL;
|
|
||||||
+ }
|
|
||||||
if (source == NULL) {
|
|
||||||
if (false && !mIgnoreVendorExtensions) {
|
|
||||||
ALOGE("%s: no source found with name \"%s\"", __func__, devTag);
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
@ -1,28 +0,0 @@
|
|||||||
From 12536fe15af67eea0aa575396e7c84eba1b1a57e Mon Sep 17 00:00:00 2001
|
|
||||||
From: Pierre-Hugues Husson <phh@phh.me>
|
|
||||||
Date: Mon, 30 Oct 2023 10:30:58 -0400
|
|
||||||
Subject: [PATCH 21/24] Add a prop to disable AUDIO_OUTPUT_FLAG_FAST from audio
|
|
||||||
policies, when CPU can't really handle that kind of load
|
|
||||||
|
|
||||||
---
|
|
||||||
.../audiopolicy/common/managerdefinitions/src/Serializer.cpp | 4 ++++
|
|
||||||
1 file changed, 4 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
|
||||||
index 77a96b47a4..26edcaa1c4 100644
|
|
||||||
--- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
|
||||||
+++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
|
||||||
@@ -504,6 +504,10 @@ std::variant<status_t, MixPortTraits::Element> PolicySerializer::deserialize<Mix
|
|
||||||
// use DEEP_BUFFER+FAST flag combo to indicate the spatializer output profile
|
|
||||||
uint32_t intFlags =
|
|
||||||
OutputFlagConverter::maskFromString(flags, mFlagsSeparator.c_str());
|
|
||||||
+ bool ignore_fast = property_get_bool("persist.sys.phh.disable_fast_audio", false);
|
|
||||||
+ if (ignore_fast)
|
|
||||||
+ intFlags &= ~AUDIO_OUTPUT_FLAG_FAST;
|
|
||||||
+
|
|
||||||
if (intFlags == (AUDIO_OUTPUT_FLAG_FAST | AUDIO_OUTPUT_FLAG_DEEP_BUFFER)) {
|
|
||||||
intFlags = AUDIO_OUTPUT_FLAG_SPATIALIZER;
|
|
||||||
}
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
@ -1,46 +0,0 @@
|
|||||||
From 217b56d5afb18f9cdf8391751f5c81de89044012 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Alberto Ponces <ponces26@gmail.com>
|
|
||||||
Date: Sun, 5 Nov 2023 15:18:03 +0000
|
|
||||||
Subject: [PATCH 22/24] Add a prop to fix echo on incoming or outgoing calls
|
|
||||||
|
|
||||||
May even fix audio calls altogether.
|
|
||||||
|
|
||||||
Change-Id: I3a05608ad7b3f0876160d5f6a12b7c529b8f0961
|
|
||||||
---
|
|
||||||
.../common/managerdefinitions/src/Serializer.cpp | 9 +++++++++
|
|
||||||
1 file changed, 9 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
|
||||||
index 26edcaa1c4..059e4adfa1 100644
|
|
||||||
--- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
|
||||||
+++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
|
||||||
@@ -669,6 +669,9 @@ std::variant<status_t, RouteTraits::Element> PolicySerializer::deserialize<Route
|
|
||||||
// This fixes broken mic while video record on some Exynos devices
|
|
||||||
bool disableBackMic = property_get_bool("persist.sys.phh.disable_back_mic", false);
|
|
||||||
|
|
||||||
+ // This may fix echo or non-working audio on calls
|
|
||||||
+ bool disableVoiceCallIn = property_get_bool("persist.sys.phh.disable_voice_call_in", false);
|
|
||||||
+
|
|
||||||
std::string sourcesAttr = getXmlAttribute(cur, Attributes::sources);
|
|
||||||
if (sourcesAttr.empty()) {
|
|
||||||
ALOGE("%s: No %s found", __func__, Attributes::sources);
|
|
||||||
@@ -685,10 +688,16 @@ std::variant<status_t, RouteTraits::Element> PolicySerializer::deserialize<Route
|
|
||||||
if (source == NULL) {
|
|
||||||
source = ctx->findPortByTagName(trim(devTag));
|
|
||||||
}
|
|
||||||
+
|
|
||||||
if (disableBackMic && strcmp(devTag, "Built-In Back Mic") == 0) {
|
|
||||||
ALOGW("Skipping route source \"%s\" as it breaks video recording mic", devTag);
|
|
||||||
source = NULL;
|
|
||||||
+ } else if (disableVoiceCallIn && strcmp(devTag, "Voice Call In") == 0 &&
|
|
||||||
+ (sinkAttr == "voice tx" || sinkAttr == "voice_tx")) {
|
|
||||||
+ ALOGW("Skipping route source \"%s\" as it breaks audio on calls", devTag);
|
|
||||||
+ source = NULL;
|
|
||||||
}
|
|
||||||
+
|
|
||||||
if (source == NULL) {
|
|
||||||
if (false && !mIgnoreVendorExtensions) {
|
|
||||||
ALOGE("%s: no source found with name \"%s\"", __func__, devTag);
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
@ -1,64 +0,0 @@
|
|||||||
From d7a75909fdfbe115e2026433bc007017532ece82 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Pierre-Hugues Husson <phh@phh.me>
|
|
||||||
Date: Wed, 7 Feb 2024 05:06:32 -0500
|
|
||||||
Subject: [PATCH 23/24] Include Samsung AIDL camera ids
|
|
||||||
|
|
||||||
---
|
|
||||||
services/camera/libcameraservice/Android.bp | 1 +
|
|
||||||
.../common/aidl/AidlProviderInfo.cpp | 21 +++++++++++++++++++
|
|
||||||
2 files changed, 22 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/services/camera/libcameraservice/Android.bp b/services/camera/libcameraservice/Android.bp
|
|
||||||
index 1e1423f42b..bfe9c8bbb5 100644
|
|
||||||
--- a/services/camera/libcameraservice/Android.bp
|
|
||||||
+++ b/services/camera/libcameraservice/Android.bp
|
|
||||||
@@ -111,6 +111,7 @@ cc_defaults {
|
|
||||||
"android.hardware.camera.provider-V3-ndk",
|
|
||||||
"vendor.samsung.hardware.camera.provider@3.0",
|
|
||||||
"vendor.samsung.hardware.camera.provider@4.0",
|
|
||||||
+ "vendor.samsung.hardware.camera.provider-V1-ndk",
|
|
||||||
"libaidlcommonsupport",
|
|
||||||
"libbinderthreadstateutils",
|
|
||||||
"libcameraservice_device_independent",
|
|
||||||
diff --git a/services/camera/libcameraservice/common/aidl/AidlProviderInfo.cpp b/services/camera/libcameraservice/common/aidl/AidlProviderInfo.cpp
|
|
||||||
index a721d287f4..1e16541ed6 100644
|
|
||||||
--- a/services/camera/libcameraservice/common/aidl/AidlProviderInfo.cpp
|
|
||||||
+++ b/services/camera/libcameraservice/common/aidl/AidlProviderInfo.cpp
|
|
||||||
@@ -30,6 +30,8 @@
|
|
||||||
#include <utils/SessionConfigurationUtils.h>
|
|
||||||
#include <utils/Trace.h>
|
|
||||||
|
|
||||||
+#include <aidl/vendor/samsung/hardware/camera/provider/ISehCameraProvider.h>
|
|
||||||
+
|
|
||||||
namespace {
|
|
||||||
const bool kEnableLazyHal(property_get_bool("ro.camera.enableLazyHal", false));
|
|
||||||
} // anonymous namespace
|
|
||||||
@@ -170,6 +172,25 @@ status_t AidlProviderInfo::initializeAidlProvider(
|
|
||||||
return mapToStatusT(status);
|
|
||||||
}
|
|
||||||
|
|
||||||
+ if(true) {
|
|
||||||
+ AIBinder *ext;
|
|
||||||
+ auto spaibinder = interface->asBinder();
|
|
||||||
+
|
|
||||||
+ status_t ret = AIBinder_getExtension(spaibinder.get(), &ext);
|
|
||||||
+ ALOGE("Grabbing CameraProvider extension got %d", ret);
|
|
||||||
+ if (ret == android::OK) {
|
|
||||||
+ using aidl::vendor::samsung::hardware::camera::provider::ISehCameraProvider;
|
|
||||||
+ std::shared_ptr<ISehCameraProvider> provider = ISehCameraProvider::fromBinder(ndk::SpAIBinder(ext));
|
|
||||||
+ ALOGE("Trying to get ISehCameraProvider...");
|
|
||||||
+ if (provider != nullptr) {
|
|
||||||
+ ALOGE("Got it!");
|
|
||||||
+ if(property_get_bool("persist.sys.phh.samsung.camera_ids", false)) {
|
|
||||||
+ provider->getCameraIdListAll(&retDevices);
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
for (auto& name : retDevices) {
|
|
||||||
uint16_t major, minor;
|
|
||||||
std::string type, id;
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
@ -1,106 +0,0 @@
|
|||||||
From 68bee34347886f4cc278ec00729d0105a08defc6 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Pierre-Hugues Husson <phh@phh.me>
|
|
||||||
Date: Sat, 10 Feb 2024 09:30:19 -0500
|
|
||||||
Subject: [PATCH 24/24] Allow using camera modes declared in Samsung
|
|
||||||
proprietary values
|
|
||||||
|
|
||||||
---
|
|
||||||
.../utils/SessionConfigurationUtils.cpp | 79 +++++++++++++------
|
|
||||||
1 file changed, 53 insertions(+), 26 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/services/camera/libcameraservice/utils/SessionConfigurationUtils.cpp b/services/camera/libcameraservice/utils/SessionConfigurationUtils.cpp
|
|
||||||
index b4adf3e5b4..d4d9c433a1 100644
|
|
||||||
--- a/services/camera/libcameraservice/utils/SessionConfigurationUtils.cpp
|
|
||||||
+++ b/services/camera/libcameraservice/utils/SessionConfigurationUtils.cpp
|
|
||||||
@@ -168,35 +168,62 @@ bool roundBufferDimensionNearest(int32_t width, int32_t height,
|
|
||||||
|
|
||||||
bool isJpegRDataSpace = (dataSpace == static_cast<android_dataspace_t>(
|
|
||||||
::aidl::android::hardware::graphics::common::Dataspace::JPEG_R));
|
|
||||||
- camera_metadata_ro_entry streamConfigs =
|
|
||||||
- (isJpegRDataSpace) ? info.find(jpegRSizesTag) :
|
|
||||||
- (dataSpace == HAL_DATASPACE_DEPTH) ? info.find(depthSizesTag) :
|
|
||||||
- (dataSpace == static_cast<android_dataspace>(HAL_DATASPACE_HEIF)) ?
|
|
||||||
- info.find(heicSizesTag) :
|
|
||||||
- info.find(scalerSizesTag);
|
|
||||||
+ bool isDepth = dataSpace == HAL_DATASPACE_DEPTH;
|
|
||||||
+ bool isHeif = dataSpace == static_cast<android_dataspace>(HAL_DATASPACE_HEIF);
|
|
||||||
+ int32_t selectedTag = isJpegRDataSpace ? jpegRSizesTag :
|
|
||||||
+ isDepth ? depthSizesTag :
|
|
||||||
+ isHeif ? heicSizesTag : scalerSizesTag;
|
|
||||||
+
|
|
||||||
+ std::list<int32_t> tags = { selectedTag };
|
|
||||||
+ if (selectedTag == scalerSizesTag) {
|
|
||||||
+ sp<VendorTagDescriptor> vTags;
|
|
||||||
+ sp<VendorTagDescriptorCache> cache = VendorTagDescriptorCache::getGlobalVendorTagCache();
|
|
||||||
+ if (cache.get()) {
|
|
||||||
+ auto vendorId = const_cast<CameraMetadata*>(&info)->getVendorId(); // getVendorId is actually const...
|
|
||||||
+ cache->getVendorTagDescriptor(vendorId, &vTags);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ std::list<std::string> vendorTags = {
|
|
||||||
+ "samsung.android.scaler.availablePictureStreamConfigurations",
|
|
||||||
+ "samsung.android.scaler.availablePreviewStreamConfigurations",
|
|
||||||
+ "samsung.android.scaler.availableThumbnailStreamConfigurations",
|
|
||||||
+ };
|
|
||||||
+ for(auto tagName: vendorTags) {
|
|
||||||
+ uint32_t vendorTag;
|
|
||||||
+ status_t tagStatus = info.getTagFromName(tagName.c_str(), vTags.get(), &vendorTag);
|
|
||||||
+ //ALOGE("Tag by name %s %d %x", tagName.c_str(), tagStatus, vendorTag);
|
|
||||||
+ if (tagStatus == OK)
|
|
||||||
+ tags.push_back(vendorTag);
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
|
|
||||||
int32_t bestWidth = -1;
|
|
||||||
int32_t bestHeight = -1;
|
|
||||||
-
|
|
||||||
- // Iterate through listed stream configurations and find the one with the smallest euclidean
|
|
||||||
- // distance from the given dimensions for the given format.
|
|
||||||
- for (size_t i = 0; i < streamConfigs.count; i += 4) {
|
|
||||||
- int32_t fmt = streamConfigs.data.i32[i];
|
|
||||||
- int32_t w = streamConfigs.data.i32[i + 1];
|
|
||||||
- int32_t h = streamConfigs.data.i32[i + 2];
|
|
||||||
-
|
|
||||||
- // Ignore input/output type for now
|
|
||||||
- if (fmt == format) {
|
|
||||||
- if (w == width && h == height) {
|
|
||||||
- bestWidth = width;
|
|
||||||
- bestHeight = height;
|
|
||||||
- break;
|
|
||||||
- } else if (w <= ROUNDING_WIDTH_CAP && (bestWidth == -1 ||
|
|
||||||
- SessionConfigurationUtils::euclidDistSquare(w, h, width, height) <
|
|
||||||
- SessionConfigurationUtils::euclidDistSquare(bestWidth, bestHeight, width,
|
|
||||||
- height))) {
|
|
||||||
- bestWidth = w;
|
|
||||||
- bestHeight = h;
|
|
||||||
+ for(auto tag: tags) {
|
|
||||||
+ camera_metadata_ro_entry streamConfigs =
|
|
||||||
+ info.find(tag);
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+ // Iterate through listed stream configurations and find the one with the smallest euclidean
|
|
||||||
+ // distance from the given dimensions for the given format.
|
|
||||||
+ for (size_t i = 0; i < streamConfigs.count; i += 4) {
|
|
||||||
+ int32_t fmt = streamConfigs.data.i32[i];
|
|
||||||
+ int32_t w = streamConfigs.data.i32[i + 1];
|
|
||||||
+ int32_t h = streamConfigs.data.i32[i + 2];
|
|
||||||
+
|
|
||||||
+ // Ignore input/output type for now
|
|
||||||
+ if (fmt == format) {
|
|
||||||
+ if (w == width && h == height) {
|
|
||||||
+ bestWidth = width;
|
|
||||||
+ bestHeight = height;
|
|
||||||
+ break;
|
|
||||||
+ } else if (w <= ROUNDING_WIDTH_CAP && (bestWidth == -1 ||
|
|
||||||
+ SessionConfigurationUtils::euclidDistSquare(w, h, width, height) <
|
|
||||||
+ SessionConfigurationUtils::euclidDistSquare(bestWidth, bestHeight, width,
|
|
||||||
+ height))) {
|
|
||||||
+ bestWidth = w;
|
|
||||||
+ bestHeight = h;
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
@ -1,39 +0,0 @@
|
|||||||
From 9f49cb42fc4f9fdfe42d2c2fe6e2ec37bb3e87b4 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Pierre-Hugues Husson <phh@phh.me>
|
|
||||||
Date: Tue, 5 Oct 2021 17:59:16 -0400
|
|
||||||
Subject: [PATCH 01/51] Fallback to stupid autobrightness if brightness values
|
|
||||||
are broken
|
|
||||||
|
|
||||||
This is needed because of:
|
|
||||||
`ava.lang.IllegalArgumentException: The control points must all have strictly increasing X values.`
|
|
||||||
on some Samsung devices
|
|
||||||
|
|
||||||
Change-Id: Ieb679b34239013a5e31b34cb010b12febd9ef6d9
|
|
||||||
---
|
|
||||||
.../com/android/server/display/DisplayDeviceConfig.java | 9 +++++++--
|
|
||||||
1 file changed, 7 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/services/core/java/com/android/server/display/DisplayDeviceConfig.java b/services/core/java/com/android/server/display/DisplayDeviceConfig.java
|
|
||||||
index 9b2dcc53f456..04e06b99d3ee 100644
|
|
||||||
--- a/services/core/java/com/android/server/display/DisplayDeviceConfig.java
|
|
||||||
+++ b/services/core/java/com/android/server/display/DisplayDeviceConfig.java
|
|
||||||
@@ -894,9 +894,14 @@ public class DisplayDeviceConfig {
|
|
||||||
*/
|
|
||||||
public static DisplayDeviceConfig create(Context context, boolean useConfigXml,
|
|
||||||
DisplayManagerFlags flags) {
|
|
||||||
- final DisplayDeviceConfig config;
|
|
||||||
+ DisplayDeviceConfig config;
|
|
||||||
if (useConfigXml) {
|
|
||||||
- config = getConfigFromGlobalXml(context, flags);
|
|
||||||
+ try {
|
|
||||||
+ config = getConfigFromGlobalXml(context, flags);
|
|
||||||
+ } catch(Exception e) {
|
|
||||||
+ android.util.Log.e("PHH", "Failed parsing automatic brightness values, fallbacking", e);
|
|
||||||
+ config = getConfigFromPmValues(context, flags);
|
|
||||||
+ }
|
|
||||||
} else {
|
|
||||||
config = getConfigFromPmValues(context, flags);
|
|
||||||
}
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
|||||||
From 760a17ba02bbab91feb31c26f692b6871d1e3b95 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Raphael Mounier <mounierr07@gmail.com>
|
|
||||||
Date: Sat, 6 Aug 2022 18:08:36 +0200
|
|
||||||
Subject: [PATCH 02/51] Fix env empty string - ANDROID_STORAGE
|
|
||||||
|
|
||||||
Huawei hi6250 define in init.hi6250.rc ANDROID_STORAGE to "", so check empty string and replace with default path. Apply change for all env directory
|
|
||||||
---
|
|
||||||
core/java/android/os/Environment.java | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/core/java/android/os/Environment.java b/core/java/android/os/Environment.java
|
|
||||||
index a459aaa42930..168825411139 100644
|
|
||||||
--- a/core/java/android/os/Environment.java
|
|
||||||
+++ b/core/java/android/os/Environment.java
|
|
||||||
@@ -1526,7 +1526,7 @@ public class Environment {
|
|
||||||
|
|
||||||
static File getDirectory(String variableName, String defaultPath) {
|
|
||||||
String path = System.getenv(variableName);
|
|
||||||
- return path == null ? new File(defaultPath) : new File(path);
|
|
||||||
+ return ((path == null || path.isEmpty()) ? new File(defaultPath) : new File(path));
|
|
||||||
}
|
|
||||||
|
|
||||||
@NonNull
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
|||||||
From 6f528a2a2c0c10884ead901ed412ff2132a6bcd4 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Pierre-Hugues Husson <phh@phh.me>
|
|
||||||
Date: Tue, 28 Nov 2017 18:28:04 +0100
|
|
||||||
Subject: [PATCH 03/51] Relax requirement for visible flag to sdcards
|
|
||||||
|
|
||||||
The vast majority of sdcard readers are stable enough to be declared by
|
|
||||||
the API. (I see no counter-example)
|
|
||||||
FBE broke adoptable storage with SDCard, hence this need.
|
|
||||||
|
|
||||||
Change-Id: Ia616671c03562d1eadaff5531a5c708a62d7ad3a
|
|
||||||
---
|
|
||||||
.../core/java/com/android/server/StorageManagerService.java | 3 ++-
|
|
||||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/services/core/java/com/android/server/StorageManagerService.java b/services/core/java/com/android/server/StorageManagerService.java
|
|
||||||
index 9ec2327352f7..5e5199abe7a6 100644
|
|
||||||
--- a/services/core/java/com/android/server/StorageManagerService.java
|
|
||||||
+++ b/services/core/java/com/android/server/StorageManagerService.java
|
|
||||||
@@ -1621,7 +1621,8 @@ class StorageManagerService extends IStorageManager.Stub
|
|
||||||
|
|
||||||
// Adoptable public disks are visible to apps, since they meet
|
|
||||||
// public API requirement of being in a stable location.
|
|
||||||
- if (vol.disk.isAdoptable()) {
|
|
||||||
+ // Assume all SDs match this as well
|
|
||||||
+ if (vol.disk.isAdoptable() || vol.disk.isSd()) {
|
|
||||||
vol.mountFlags |= VolumeInfo.MOUNT_FLAG_VISIBLE_FOR_WRITE;
|
|
||||||
} else if (vol.disk.isSd()) {
|
|
||||||
vol.mountFlags |= VolumeInfo.MOUNT_FLAG_VISIBLE_FOR_WRITE;
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
@ -1,46 +0,0 @@
|
|||||||
From 501399a9fc8705c6e3967236413af35c157bf051 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Pierre-Hugues Husson <phh@phh.me>
|
|
||||||
Date: Thu, 17 May 2018 20:28:35 +0200
|
|
||||||
Subject: [PATCH 04/51] Don't crash if there is IR HAL is not declared
|
|
||||||
|
|
||||||
Change-Id: I3afded27441bbee8244d5fda544b3e6d1238dc1b
|
|
||||||
---
|
|
||||||
.../core/java/com/android/server/ConsumerIrService.java | 8 --------
|
|
||||||
.../core/jni/com_android_server_ConsumerIrService.cpp | 2 +-
|
|
||||||
2 files changed, 1 insertion(+), 9 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/services/core/java/com/android/server/ConsumerIrService.java b/services/core/java/com/android/server/ConsumerIrService.java
|
|
||||||
index ee6d808aa549..be8e2bb95ece 100644
|
|
||||||
--- a/services/core/java/com/android/server/ConsumerIrService.java
|
|
||||||
+++ b/services/core/java/com/android/server/ConsumerIrService.java
|
|
||||||
@@ -53,14 +53,6 @@ public class ConsumerIrService extends IConsumerIrService.Stub {
|
|
||||||
mWakeLock.setReferenceCounted(true);
|
|
||||||
|
|
||||||
mHasNativeHal = getHalService();
|
|
||||||
-
|
|
||||||
- if (mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_CONSUMER_IR)) {
|
|
||||||
- if (!mHasNativeHal) {
|
|
||||||
- throw new RuntimeException("FEATURE_CONSUMER_IR present, but no IR HAL loaded!");
|
|
||||||
- }
|
|
||||||
- } else if (mHasNativeHal) {
|
|
||||||
- throw new RuntimeException("IR HAL present, but FEATURE_CONSUMER_IR is not set!");
|
|
||||||
- }
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
diff --git a/services/core/jni/com_android_server_ConsumerIrService.cpp b/services/core/jni/com_android_server_ConsumerIrService.cpp
|
|
||||||
index 63daa3503bd5..d068ec06fc14 100644
|
|
||||||
--- a/services/core/jni/com_android_server_ConsumerIrService.cpp
|
|
||||||
+++ b/services/core/jni/com_android_server_ConsumerIrService.cpp
|
|
||||||
@@ -36,7 +36,7 @@ static sp<IConsumerIr> mHal;
|
|
||||||
|
|
||||||
static jboolean getHidlHalService(JNIEnv * /* env */, jobject /* obj */) {
|
|
||||||
// TODO(b/31632518)
|
|
||||||
- mHal = IConsumerIr::getService();
|
|
||||||
+ mHal = IConsumerIr::tryGetService();
|
|
||||||
return mHal != nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
@ -1,51 +0,0 @@
|
|||||||
From 58f6aff63f9c4f42230be0b88f4a84994a0e2f00 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Peter Cai <peter@typeblog.net>
|
|
||||||
Date: Wed, 1 Jun 2022 16:56:20 -0400
|
|
||||||
Subject: [PATCH 05/51] Implement a persistent property to override the default
|
|
||||||
primary camera (0)
|
|
||||||
|
|
||||||
Change-Id: I49b45d00bf71d7932591b3516d49a680e1b6568b
|
|
||||||
---
|
|
||||||
core/java/android/hardware/Camera.java | 5 +++++
|
|
||||||
core/java/android/hardware/camera2/CameraManager.java | 9 +++++++++
|
|
||||||
2 files changed, 14 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/core/java/android/hardware/Camera.java b/core/java/android/hardware/Camera.java
|
|
||||||
index f5de97d698be..f0c6df1c7f2d 100644
|
|
||||||
--- a/core/java/android/hardware/Camera.java
|
|
||||||
+++ b/core/java/android/hardware/Camera.java
|
|
||||||
@@ -441,6 +441,11 @@ public class Camera {
|
|
||||||
* @see #open(int)
|
|
||||||
*/
|
|
||||||
public static Camera open() {
|
|
||||||
+ int altPrimaryCamera = SystemProperties.getInt("persist.sys.alt_primary_camera", -1);
|
|
||||||
+ if (altPrimaryCamera > 0) {
|
|
||||||
+ return new Camera(altPrimaryCamera);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
int numberOfCameras = getNumberOfCameras();
|
|
||||||
CameraInfo cameraInfo = new CameraInfo();
|
|
||||||
for (int i = 0; i < numberOfCameras; i++) {
|
|
||||||
diff --git a/core/java/android/hardware/camera2/CameraManager.java b/core/java/android/hardware/camera2/CameraManager.java
|
|
||||||
index b772d1ba4e9c..b06012320562 100644
|
|
||||||
--- a/core/java/android/hardware/camera2/CameraManager.java
|
|
||||||
+++ b/core/java/android/hardware/camera2/CameraManager.java
|
|
||||||
@@ -2200,6 +2200,15 @@ public final class CameraManager {
|
|
||||||
}
|
|
||||||
}});
|
|
||||||
|
|
||||||
+ // HAXX: Allow overriding default primary camera (assumed to be camera 0) via property
|
|
||||||
+ // Should match with libcameraservice/common/CameraProviderManager.cpp
|
|
||||||
+ int altPrimaryCamera = SystemProperties.getInt("persist.sys.alt_primary_camera", -1);
|
|
||||||
+ if (altPrimaryCamera > 0 && altPrimaryCamera < cameraIds.length) {
|
|
||||||
+ String origPrimary = cameraIds[0];
|
|
||||||
+ cameraIds[0] = cameraIds[altPrimaryCamera];
|
|
||||||
+ cameraIds[altPrimaryCamera] = origPrimary;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean cameraStatusesContains(CameraStatus[] cameraStatuses, String id) {
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
@ -1,25 +0,0 @@
|
|||||||
From 20f793880b1009b6a8f4baa97366d947effe25d3 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Pierre-Hugues Husson <phh@phh.me>
|
|
||||||
Date: Mon, 6 Aug 2018 12:49:00 +0200
|
|
||||||
Subject: [PATCH 06/51] Show APN Settings for CDMA carriers
|
|
||||||
|
|
||||||
---
|
|
||||||
telephony/java/android/telephony/CarrierConfigManager.java | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java
|
|
||||||
index 5d99acd87dd3..cf914d41cac9 100644
|
|
||||||
--- a/telephony/java/android/telephony/CarrierConfigManager.java
|
|
||||||
+++ b/telephony/java/android/telephony/CarrierConfigManager.java
|
|
||||||
@@ -10347,7 +10347,7 @@ public class CarrierConfigManager {
|
|
||||||
sDefaults.putBoolean(KEY_PREFER_2G_BOOL, false);
|
|
||||||
sDefaults.putBoolean(KEY_PREFER_3G_VISIBILITY_BOOL, true);
|
|
||||||
sDefaults.putBoolean(KEY_4G_ONLY_BOOL, false);
|
|
||||||
- sDefaults.putBoolean(KEY_SHOW_APN_SETTING_CDMA_BOOL, false);
|
|
||||||
+ sDefaults.putBoolean(KEY_SHOW_APN_SETTING_CDMA_BOOL, true);
|
|
||||||
sDefaults.putBoolean(KEY_SHOW_CDMA_CHOICES_BOOL, false);
|
|
||||||
sDefaults.putBoolean(KEY_SMS_REQUIRES_DESTINATION_NUMBER_CONVERSION_BOOL, false);
|
|
||||||
sDefaults.putBoolean(KEY_SUPPORT_EMERGENCY_SMS_OVER_IMS_BOOL, false);
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
@ -1,39 +0,0 @@
|
|||||||
From 831dcfef08229154dee1300a8224f527d43e8b53 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Pierre-Hugues Husson <phh@phh.me>
|
|
||||||
Date: Thu, 8 Nov 2018 23:04:03 +0100
|
|
||||||
Subject: [PATCH 07/51] Re-order services so that it works even without qtaguid
|
|
||||||
|
|
||||||
Change-Id: I0c0f527b3ae151d45c68f7ac6c205da3f34e74df
|
|
||||||
---
|
|
||||||
.../android/server/net/NetworkPolicyManagerService.java | 8 ++++----
|
|
||||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/services/core/java/com/android/server/net/NetworkPolicyManagerService.java b/services/core/java/com/android/server/net/NetworkPolicyManagerService.java
|
|
||||||
index 53637d2c5f44..3465e1b31b6c 100644
|
|
||||||
--- a/services/core/java/com/android/server/net/NetworkPolicyManagerService.java
|
|
||||||
+++ b/services/core/java/com/android/server/net/NetworkPolicyManagerService.java
|
|
||||||
@@ -1032,6 +1032,10 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub {
|
|
||||||
Trace.traceBegin(Trace.TRACE_TAG_NETWORK, "systemReady");
|
|
||||||
final int oldPriority = Process.getThreadPriority(Process.myTid());
|
|
||||||
try {
|
|
||||||
+ mUsageStats = LocalServices.getService(UsageStatsManagerInternal.class);
|
|
||||||
+ mAppStandby = LocalServices.getService(AppStandbyInternal.class);
|
|
||||||
+ mActivityManagerInternal = LocalServices.getService(ActivityManagerInternal.class);
|
|
||||||
+
|
|
||||||
// Boost thread's priority during system server init
|
|
||||||
Process.setThreadPriority(Process.THREAD_PRIORITY_FOREGROUND);
|
|
||||||
if (!isBandwidthControlEnabled()) {
|
|
||||||
@@ -1039,10 +1043,6 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
- mUsageStats = LocalServices.getService(UsageStatsManagerInternal.class);
|
|
||||||
- mAppStandby = LocalServices.getService(AppStandbyInternal.class);
|
|
||||||
- mActivityManagerInternal = LocalServices.getService(ActivityManagerInternal.class);
|
|
||||||
-
|
|
||||||
synchronized (mUidRulesFirstLock) {
|
|
||||||
synchronized (mNetworkPoliciesSecondLock) {
|
|
||||||
updatePowerSaveAllowlistUL();
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
|||||||
From 24816a5a9e825447d5f752c53dab6b5ec5567a5b Mon Sep 17 00:00:00 2001
|
|
||||||
From: Pierre-Hugues Husson <phh@phh.me>
|
|
||||||
Date: Sun, 24 Mar 2019 23:05:14 +0100
|
|
||||||
Subject: [PATCH 08/51] Support samsung Pie and Q light hal
|
|
||||||
|
|
||||||
Change-Id: I01f94acd7d0672733e48854d80368f9ac6f861c6
|
|
||||||
---
|
|
||||||
services/core/jni/Android.bp | 2 ++
|
|
||||||
1 file changed, 2 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/services/core/jni/Android.bp b/services/core/jni/Android.bp
|
|
||||||
index e078c6e34912..3fa42184d653 100644
|
|
||||||
--- a/services/core/jni/Android.bp
|
|
||||||
+++ b/services/core/jni/Android.bp
|
|
||||||
@@ -216,6 +216,8 @@ cc_defaults {
|
|
||||||
"android.system.suspend-V1-ndk",
|
|
||||||
"server_configurable_flags",
|
|
||||||
"service.incremental",
|
|
||||||
+ "vendor.samsung.hardware.light@2.0",
|
|
||||||
+ "vendor.samsung.hardware.light@3.0",
|
|
||||||
],
|
|
||||||
|
|
||||||
static_libs: [
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user