diff --git a/README-EN.md b/README-EN.md
index f2ef939..3b08d80 100644
--- a/README-EN.md
+++ b/README-EN.md
@@ -4,7 +4,7 @@
This is an Android project for Miku fans. If you don't like it, please close this page, but don't attack Miku and the author of this project.
## Version
-Latest version: 1.0.1
+Latest version: 0.1.3
[Downloads](https://github.com/xiaoleGun/treble_build_miku/releases)
@@ -14,21 +14,21 @@ Examples
They are
```
-ProjectName-{SNOW | SNOWLAND | TDA}-Miku UI version-arm64-ab-vndklite-gapps-BuildDate-Buildtype
- | | | | | | |
- | | | | | | |
- | | | | | | GMS
- | | | | | |
- | | | | | |
- | | | | | It is used for vndklite devices and
- | | | | | supports system reading and writing.
- | | | | |
- | | | | Partition type, only AB variants are provided.(1)
- | | | |
- | | | |
- | | | CPU bits, build 64 bits and a64(2).
- | | |
- | Android 12 | 12.1 | 13
+ProjectName-{SNOW | SNOWLAND | TDA | Udon}-version-arm64-ab-vndklite-gapps-BuildDate-Buildtype
+ | | | | | | | |
+ | | | | | | | |
+ | | | | | | | GMS
+ | | | | | | |
+ | | | | | | |
+ | | | | | | It is used for vndklite devices and
+ | | | | | | supports system reading and writing.
+ | | | | | |
+ | | | | | Partition type, only AB variants are provided.(1)
+ | | | | |
+ | | | | |
+ | | | | CPU arch, build 64 bits and a64(2).
+ | | | |
+ | Android 12 | 12.1 | 13 | 14
|
Miku UI
```
@@ -49,7 +49,7 @@ To get started with building Miku UI GSI, you'll need to get familiar with [Git
```
- Clone this repo:
```
- git clone https://github.com/xiaoleGun/treble_build_miku -b TDA
+ git clone https://github.com/xiaoleGun/treble_build_miku -b Udon
```
- Finally, start the build script:
```
diff --git a/README-JP.md b/README-JP.md
index c6af115..242afdb 100644
--- a/README-JP.md
+++ b/README-JP.md
@@ -44,7 +44,7 @@ Miku UI GSI のビルドを始めるには、[How to build a GSI](https://github
```
- このリポジトリをクローンする:
```
- git clone https://github.com/xiaoleGun/treble_build_miku -b TDA
+ git clone https://github.com/xiaoleGun/treble_build_miku -b Udon
```
- 最後にビルドスクリプトを実行する:
```
diff --git a/README.md b/README.md
index d34eeca..7d55e51 100644
--- a/README.md
+++ b/README.md
@@ -6,7 +6,7 @@
这是送给所有Miku粉丝的Android项目,如果不喜欢它请关闭本页面,但不要攻击任何人,尤其是其作者。
## 版本
-最新版本: 1.0.1
+最新版本: 0.1.3
[下载](https://github.com/xiaoleGun/treble_build_miku/releases)
@@ -16,21 +16,21 @@
从前到后,分别为
```
-ProjectName-{SNOW | SNOWLAND | TDA}-Miku UI版本-arm64-ab-vndklite-gapps-构建日期-构建类型
- | | | | | | |
- | | | | | | |
- | | | | | | 谷歌服务
- | | | | | |
- | | | | | |
- | | | | | 用于vndklite的设备
- | | | | | 支持system读写
- | | | | |
- | | | | 分区类型,仅构建AB(1)
- | | | |
- | | | |
- | | | CPU位数,构建64位和a64(2)
- | | |
- | Android 12 | 12.1 | 13
+ProjectName-{SNOW | SNOWLAND | TDA | Udon}-版本号-arm64-ab-vndklite-gapps-构建日期-构建类型
+ | | | | | | | |
+ | | | | | | | |
+ | | | | | | | 谷歌服务
+ | | | | | | |
+ | | | | | | |
+ | | | | | | 用于vndklite的设备
+ | | | | | | 支持system读写
+ | | | | | |
+ | | | | | 分区类型,仅构建AB(1)
+ | | | | |
+ | | | | |
+ | | | | CPU架构,构建64位和a64(2)
+ | | | |
+ | Android 12 | 12.1 | 13 | 14
|
Miku UI
```
@@ -51,7 +51,7 @@ Miku UI
```
- 下载本仓库
```
- git clone https://github.com/xiaoleGun/treble_build_miku -b TDA
+ git clone https://github.com/xiaoleGun/treble_build_miku -b Udon
```
- 完成之后运行脚本:
```
diff --git a/build.sh b/build.sh
index 52bdcec..0c7487f 100755
--- a/build.sh
+++ b/build.sh
@@ -4,7 +4,7 @@ set -e
multipleLanguages() {
if [ -n $(echo $LANG | grep zh_CN) ]; then
- BUILDBOT="Miku UI TDA通用镜像自动构建"
+ BUILDBOT="Miku UI Udon通用镜像自动构建"
BUILDBOT_EXIT="3秒后开始构建Miku UI通用镜像 - CTRL-C退出"
SHOW_VERSION="构建版本"
ONCE_PASSWORD="请输入 $USER 的密码: "
@@ -25,7 +25,7 @@ multipleLanguages() {
UP_GITHUB_RELEASE="上传到Github release"
COMPLETED="构建完成,使用了 $1 分钟 $2 秒"
else
- BUILDBOT="Miku UI TDA Treble Buildbot"
+ BUILDBOT="Miku UI Udon Treble Buildbot"
BUILDBOT_EXIT="Executing in 3 seconds - CTRL-C to exit"
SHOW_VERSION="Build version"
ONCE_PASSWORD="Please enter the password of $USER: "
@@ -57,7 +57,7 @@ warning() {
echo " $BUILDBOT_EXIT "
echo "-----------------------------------------"
echo
- echo "$SHOW_VERSION: $VERSION"
+ echo "$SHOW_VERSION: $VERSION_CODE"
echo
}
@@ -90,7 +90,7 @@ initRepo() {
echo
echo "--> $INIT_MIKU_UI"
echo
- repo init -u https://github.com/Miku-UI/manifesto -b TDA --depth=1
+ repo init -u https://github.com/Miku-UI/manifesto -b Udon --depth=1
fi
if [ -d .repo ] && [ ! -f .repo/local_manifests/miku-treble.xml ]; then
@@ -105,11 +105,12 @@ initRepo() {
fetch=\"https://github.com\" />
-
-
+
+
+
" > .repo/local_manifests/miku-treble.xml
@@ -207,8 +208,8 @@ buildSasImages() {
echo
cd sas-creator
if [ -n "$(cat lite-adapter.sh | grep 3500M)" ]; then
- sed -i 's/3500M/4000M/' lite-adapter.sh
- sed -i 's/3500M/4000M/' run.sh
+ sed -i 's/3500M/5000M/' lite-adapter.sh
+ sed -i 's/3500M/5000M/' run.sh
fi
echo "$password" | sudo -S bash lite-adapter.sh 64 $BD/system-$1.img
cp s.img $BD/system-$1-vndklite.img
@@ -222,9 +223,9 @@ generatePackages() {
echo
BASE_IMAGE=$BD/system-$1.img
mkdir --parents $BD/dsu/$1/; mv $BASE_IMAGE $BD/dsu/$1/system.img
- zip -j -v $BD/MikuUI-TDA-$VERSION-$2$3-$BUILD_DATE-UNOFFICIAL.zip $BD/dsu/$1/system.img
+ zip -j -v $BD/MikuUI-$VERSION-$VERSION_CODE-$2$3-$BUILD_DATE-UNOFFICIAL.zip $BD/dsu/$1/system.img
mkdir --parents $BD/dsu/$1-vndklite/; mv ${BASE_IMAGE%.img}-vndklite.img $BD/dsu/$1-vndklite/system.img
- zip -j -v $BD/MikuUI-TDA-$VERSION-$2$3-vndklite-$BUILD_DATE-UNOFFICIAL.zip $BD/dsu/$1-vndklite/system.img
+ zip -j -v $BD/MikuUI-$VERSION-$VERSION_CODE-$2$3-vndklite-$BUILD_DATE-UNOFFICIAL.zip $BD/dsu/$1-vndklite/system.img
rm -rf $BD/dsu
}
@@ -232,9 +233,9 @@ generateOtaJson() {
echo
echo "--> $GEN_UP_JSON"
echo
- prefix="MikuUI-TDA-$VERSION-"
+ prefix="MikuUI-$VERSION-$VERSION_CODE-"
suffix="-$BUILD_DATE-UNOFFICIAL.zip"
- json="{\"version\": \"$VERSION\",\"date\": \"$(date +%s -d '-4hours')\",\"variants\": ["
+ json="{\"version\": \"$VERSION_CODE\",\"date\": \"$(date +%s -d '-4hours')\",\"variants\": ["
find $BD -name "*.zip" | {
while read file; do
packageVariant=$(echo $(basename $file) | sed -e s/^$prefix// -e s/$suffix$//)
@@ -249,7 +250,7 @@ generateOtaJson() {
"arm64-ab-gapps-vndklite") name="miku_treble_arm64_bgN-vndklite" ;;
esac
size=$(wc -c $file | awk '{print $1}')
- url="https://github.com/xiaoleGun/treble_build_miku/releases/download/TDA-$VERSION/$(basename $file)"
+ url="https://github.com/xiaoleGun/treble_build_miku/releases/download/$VERSION-$VERSION_CODE/$(basename $file)"
json="${json} {\"name\": \"$name\",\"size\": \"$size\",\"url\": \"$url\"},"
done
json="${json%?}]}"
@@ -267,15 +268,15 @@ personal() {
GITLATESTTAG=$(git describe --tags --abbrev=0)
GITCHANGELOG=$(git log $GITLATESTTAG..HEAD --pretty=format:"%s")
assets=()
- for f in $BD/MikuUI-TDA-$VERSION-*.zip; do [ -f "$f" ] && assets+=(-a "$f"); done
- hub release create ${assets[@]} -m "Miku UI TDA v$VERSION
+ for f in $BD/MikuUI-$VERSION-$VERSION_CODE-*.zip; do [ -f "$f" ] && assets+=(-a "$f"); done
+ hub release create ${assets[@]} -m "Miku UI $VERSION v$VERSION_CODE
- CI build on $BUILD_DATE
### Change log
-$GITCHANGELOG" TDA-$VERSION
+$GITCHANGELOG" $VERSION-$VERSION_CODE
- rm -rf $BD/MikuUI-TDA-$VERSION-*.zip
+ rm -rf $BD/MikuUI-$VERSION-$VERSION_CODE-*.zip
cd ..
}
@@ -285,7 +286,8 @@ BUILD_DATE="$(date +%Y%m%d)"
SD=$(cd $(dirname $0);pwd)
BD=$HOME/builds
-VERSION=`grep -oP '(?<=最新版本: ).*' $SD/README.md`
+VERSION=Udon
+VERSION_CODE=`grep -oP '(?<=最新版本: ).*' $SD/README.md`
multipleLanguages
warning
diff --git a/patches/personal/packages_modules_Bluetooth/0001-controller-hard-disable-LE_READ_BUFFER_SIZE_V2-and-L.patch b/patches/personal/packages_modules_Bluetooth/0001-controller-hard-disable-LE_READ_BUFFER_SIZE_V2-and-L.patch
deleted file mode 100644
index 798e82e..0000000
--- a/patches/personal/packages_modules_Bluetooth/0001-controller-hard-disable-LE_READ_BUFFER_SIZE_V2-and-L.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-From 4a5995e3c332351d52e349c071780f32edbb96da Mon Sep 17 00:00:00 2001
-From: SGCMarkus
-Date: Sun, 2 Oct 2022 14:47:31 +0200
-Subject: [PATCH] controller: hard disable LE_READ_BUFFER_SIZE_V2 and
- LE_SET_HOST_FEATURE
-
-yupik/shimas bluetooth firmware seems to report these to be working (it
-should work, as these chipsets support Bluetooth 5.2 according to Qcom),
-but something about their implementation seems to be broken.
-
-Disable it for now, till Android 13 firmware becomes available.
-
-Change-Id: Ifa84349d5829995283e19806e1c664365323f9ba
----
- system/gd/hci/controller.cc | 11 +++++++++--
- 1 file changed, 9 insertions(+), 2 deletions(-)
-
-diff --git a/system/gd/hci/controller.cc b/system/gd/hci/controller.cc
-index f02e887567..eb66b0cd76 100644
---- a/system/gd/hci/controller.cc
-+++ b/system/gd/hci/controller.cc
-@@ -807,7 +807,7 @@ struct Controller::impl {
- OP_CODE_MAPPING(LE_SET_DEFAULT_PERIODIC_ADVERTISING_SYNC_TRANSFER_PARAMETERS)
- OP_CODE_MAPPING(LE_GENERATE_DHKEY_COMMAND)
- OP_CODE_MAPPING(LE_MODIFY_SLEEP_CLOCK_ACCURACY)
-- OP_CODE_MAPPING(LE_READ_BUFFER_SIZE_V2)
-+ //OP_CODE_MAPPING(LE_READ_BUFFER_SIZE_V2)
- OP_CODE_MAPPING(LE_READ_ISO_TX_SYNC)
- OP_CODE_MAPPING(LE_SET_CIG_PARAMETERS)
- OP_CODE_MAPPING(LE_SET_CIG_PARAMETERS_TEST)
-@@ -822,7 +822,7 @@ struct Controller::impl {
- OP_CODE_MAPPING(LE_REQUEST_PEER_SCA)
- OP_CODE_MAPPING(LE_SETUP_ISO_DATA_PATH)
- OP_CODE_MAPPING(LE_REMOVE_ISO_DATA_PATH)
-- OP_CODE_MAPPING(LE_SET_HOST_FEATURE)
-+ //OP_CODE_MAPPING(LE_SET_HOST_FEATURE)
- OP_CODE_MAPPING(LE_READ_ISO_LINK_QUALITY)
- OP_CODE_MAPPING(LE_ENHANCED_READ_TRANSMIT_POWER_LEVEL)
- OP_CODE_MAPPING(LE_READ_REMOTE_TRANSMIT_POWER_LEVEL)
-@@ -840,6 +840,13 @@ struct Controller::impl {
- OP_CODE_MAPPING(LE_SUBRATE_REQUEST)
- OP_CODE_MAPPING(SET_MIN_ENCRYPTION_KEY_SIZE)
-
-+ case OpCode::LE_READ_BUFFER_SIZE_V2:
-+ LOG_DEBUG("unsupported command opcode: 0x%04x", (uint16_t)OpCode::LE_READ_BUFFER_SIZE_V2);
-+ return false;
-+ case OpCode::LE_SET_HOST_FEATURE:
-+ LOG_DEBUG("unsupported command opcode: 0x%04x", (uint16_t)OpCode::LE_SET_HOST_FEATURE);
-+ return false;
-+
- // deprecated
- case OpCode::ADD_SCO_CONNECTION:
- return false;
---
-2.32.1 (Apple Git-133)
-
diff --git a/patches/trebledroid/platform_bionic/0001-Disable-vndklite-handling.patch b/patches/trebledroid/platform_bionic/0001-Disable-vndklite-handling.patch
index f93685b..3828e83 100644
--- a/patches/trebledroid/platform_bionic/0001-Disable-vndklite-handling.patch
+++ b/patches/trebledroid/platform_bionic/0001-Disable-vndklite-handling.patch
@@ -1,7 +1,7 @@
-From 9feb90012e1718c8b7ae736134d4465192e52223 Mon Sep 17 00:00:00 2001
+From cb9d1aaacaa105c20551952ead0ad7a49408efce Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson
Date: Wed, 27 Oct 2021 14:39:29 -0400
-Subject: [PATCH 1/4] Disable vndklite handling
+Subject: [PATCH 1/2] Disable vndklite handling
Change-Id: Ic4474cf80fc4b45a9a2760dd51e2ca29c4d961e2
---
@@ -9,10 +9,10 @@ Change-Id: Ic4474cf80fc4b45a9a2760dd51e2ca29c4d961e2
1 file changed, 5 deletions(-)
diff --git a/linker/linker.cpp b/linker/linker.cpp
-index c6588d2cd..545426fd9 100644
+index 17b574fc1..c863f8ea6 100644
--- a/linker/linker.cpp
+++ b/linker/linker.cpp
-@@ -93,7 +93,6 @@ static uint64_t g_module_unload_counter = 0;
+@@ -95,7 +95,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";
@@ -20,7 +20,7 @@ index c6588d2cd..545426fd9 100644
static const char* const kLdGeneratedConfigFilePath = "/linkerconfig/ld.config.txt";
-@@ -3365,10 +3364,6 @@ static std::string get_ld_config_file_apex_path(const char* executable_path) {
+@@ -3423,10 +3422,6 @@ static std::string get_ld_config_file_apex_path(const char* executable_path) {
}
static std::string get_ld_config_file_vndk_path() {
diff --git a/patches/trebledroid/platform_bionic/0002-Add-new-mechanism-to-fake-vendor-props-on-a-per-proc.patch b/patches/trebledroid/platform_bionic/0002-Add-new-mechanism-to-fake-vendor-props-on-a-per-proc.patch
index 742bc0b..a212392 100644
--- a/patches/trebledroid/platform_bionic/0002-Add-new-mechanism-to-fake-vendor-props-on-a-per-proc.patch
+++ b/patches/trebledroid/platform_bionic/0002-Add-new-mechanism-to-fake-vendor-props-on-a-per-proc.patch
@@ -1,28 +1,29 @@
-From 43efb3e3d15e3831d5d08d144df79c1615e36c1f Mon Sep 17 00:00:00 2001
+From ab1289090a65808ee3fbbeb40b0a77e91c1a6aab Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson
Date: Sat, 19 Feb 2022 08:20:25 -0500
-Subject: [PATCH 2/4] Add new mechanism to fake vendor props on a per-process
+Subject: [PATCH 2/2] Add new mechanism to fake vendor props on a per-process
basis
This reads debug.phh.props.. If its value is "vendor",
then ro.product.device/ro.product.manufacturer is read from vendor
---
- libc/system_properties/system_properties.cpp | 38 ++++++++++++++++++++
- 1 file changed, 38 insertions(+)
+ libc/system_properties/system_properties.cpp | 87 +++++++++++++++++++-
+ 1 file changed, 85 insertions(+), 2 deletions(-)
diff --git a/libc/system_properties/system_properties.cpp b/libc/system_properties/system_properties.cpp
-index 1cb15c3df..d6e7e3e68 100644
+index 1cb15c3df..057199318 100644
--- a/libc/system_properties/system_properties.cpp
+++ b/libc/system_properties/system_properties.cpp
-@@ -35,6 +35,7 @@
+@@ -35,6 +35,8 @@
#include
#include
#include
++#include
+#include
#include
-@@ -50,6 +51,32 @@
+@@ -50,6 +52,85 @@
#define SERIAL_DIRTY(serial) ((serial)&1)
#define SERIAL_VALUE_LEN(serial) ((serial) >> 24)
@@ -35,44 +36,101 @@ index 1cb15c3df..d6e7e3e68 100644
+ if(self_ok) return;
+ self_ok = true;
+
-+ int fd = open("/proc/self/comm", O_RDONLY);
++ char cmdline[128];
++ int fd = open("/proc/self/cmdline", O_RDONLY);
+ if(fd<0) return;
-+ read(fd, comm, sizeof(comm)-1);
-+ for(unsigned i=0; i0) return r;
++ return "ro.product.vendor.device";
+ }
+ if(strcmp(name, "ro.product.manufacturer") == 0) {
-+ int r = Get("ro.product.vendor.manufacturer", value);
-+ if(r>0) return r;
++ return "ro.product.vendor.manufacturer";
+ }
+ }
- const prop_info* pi = Find(name);
++ if(strcmp(comm_override, "keymaster") == 0) {
++ if(strcmp(name, "ro.product.model") == 0) {
++ return "ro.keymaster.mod";
++ }
++ if(strcmp(name, "ro.product.brand") == 0) {
++ return "ro.keymaster.brn";
++ }
++ if(strcmp(name, "ro.build.version.release") == 0) {
++ return "ro.keymaster.xxx.release";
++ }
++ if(strcmp(name, "ro.build.version.security_patch") == 0) {
++ return "ro.keymaster.xxx.security_patch";
++ }
++ if(strcmp(name, "ro.boot.vbmeta.device_state") == 0) {
++ return "ro.keymaster.xxx.vbmeta_state";
++ }
++ if(strcmp(name, "ro.boot.verifiedbootstate") == 0) {
++ return "ro.keymaster.xxx.verifiedbootstate";
++ }
++ }
++ return name;
++}
++
+ static bool is_dir(const char* pathname) {
+ struct stat info;
+ if (stat(pathname, &info) == -1) {
+@@ -123,17 +204,19 @@ uint32_t SystemProperties::AreaSerial() {
+ }
+
+ const prop_info* SystemProperties::Find(const char* name) {
++ const char* newName = redirectToProp(name);
++
+ if (!initialized_) {
+ return nullptr;
+ }
+
+- prop_area* pa = contexts_->GetPropAreaForName(name);
++ prop_area* pa = contexts_->GetPropAreaForName(newName);
+ if (!pa) {
+ async_safe_format_log(ANDROID_LOG_WARN, "libc", "Access denied finding property \"%s\"", name);
+ return nullptr;
+ }
+
+- return pa->find(name);
++ return pa->find(newName);
+ }
- if (pi != nullptr) {
+ static bool is_read_only(const char* name) {
--
2.25.1
diff --git a/patches/trebledroid/platform_bionic/0003-Rework-property-overriding.patch b/patches/trebledroid/platform_bionic/0003-Rework-property-overriding.patch
deleted file mode 100644
index 8d48ea6..0000000
--- a/patches/trebledroid/platform_bionic/0003-Rework-property-overriding.patch
+++ /dev/null
@@ -1,145 +0,0 @@
-From 285168dd61e6020c720d9ff6ea9a9fe82c6db2c7 Mon Sep 17 00:00:00 2001
-From: Pierre-Hugues Husson
-Date: Thu, 19 Jan 2023 16:44:01 -0500
-Subject: [PATCH 3/4] Rework property overriding
-
-- Support property read with callback in addition to previous
- constant-size property_get
-- Add another class of redirect "keymaster", to redirect to AOSP/GSI
- props + SPL based on boot.img
----
- libc/system_properties/system_properties.cpp | 77 +++++++++++++++-----
- 1 file changed, 58 insertions(+), 19 deletions(-)
-
-diff --git a/libc/system_properties/system_properties.cpp b/libc/system_properties/system_properties.cpp
-index d6e7e3e68..40ff48bad 100644
---- a/libc/system_properties/system_properties.cpp
-+++ b/libc/system_properties/system_properties.cpp
-@@ -35,6 +35,7 @@
- #include
- #include
- #include
-+#include
- #include
-
- #include
-@@ -60,23 +61,70 @@ static void read_self() {
- if(self_ok) return;
- self_ok = true;
-
-- int fd = open("/proc/self/comm", O_RDONLY);
-+ char cmdline[128];
-+ int fd = open("/proc/self/cmdline", O_RDONLY);
- if(fd<0) return;
-- read(fd, comm, sizeof(comm)-1);
-- for(unsigned i=0; iGetPropAreaForName(name);
-+ prop_area* pa = contexts_->GetPropAreaForName(newName);
- if (!pa) {
- async_safe_format_log(ANDROID_LOG_WARN, "libc", "Access denied finding property \"%s\"", name);
- return nullptr;
- }
-
-- return pa->find(name);
-+ return pa->find(newName);
- }
-
- static bool is_read_only(const char* name) {
-@@ -243,17 +293,6 @@ void SystemProperties::ReadCallback(const prop_info* pi,
- }
-
- int SystemProperties::Get(const char* name, char* value) {
-- read_self();
-- if(strcmp(comm_override, "vendor") == 0) {
-- if(strcmp(name, "ro.product.device") == 0) {
-- int r = Get("ro.product.vendor.device", value);
-- if(r>0) return r;
-- }
-- if(strcmp(name, "ro.product.manufacturer") == 0) {
-- int r = Get("ro.product.vendor.manufacturer", value);
-- if(r>0) return r;
-- }
-- }
- const prop_info* pi = Find(name);
-
- if (pi != nullptr) {
---
-2.25.1
-
diff --git a/patches/trebledroid/platform_bionic/0004-Add-some-properties-to-fake-in-keymaster-prop-replac.patch b/patches/trebledroid/platform_bionic/0004-Add-some-properties-to-fake-in-keymaster-prop-replac.patch
deleted file mode 100644
index 3a35956..0000000
--- a/patches/trebledroid/platform_bionic/0004-Add-some-properties-to-fake-in-keymaster-prop-replac.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From faebb06332fd42fd15316e21a891348ebc7e9406 Mon Sep 17 00:00:00 2001
-From: Pierre-Hugues Husson
-Date: Sun, 28 May 2023 16:46:46 -0400
-Subject: [PATCH 4/4] Add some properties to fake in "keymaster" prop
- replacement mode, to expose unlocked vbmeta state and orange
- verifiedbootstate
-
----
- libc/system_properties/system_properties.cpp | 6 ++++++
- 1 file changed, 6 insertions(+)
-
-diff --git a/libc/system_properties/system_properties.cpp b/libc/system_properties/system_properties.cpp
-index 40ff48bad..057199318 100644
---- a/libc/system_properties/system_properties.cpp
-+++ b/libc/system_properties/system_properties.cpp
-@@ -121,6 +121,12 @@ static const char* redirectToProp(const char *name) {
- if(strcmp(name, "ro.build.version.security_patch") == 0) {
- return "ro.keymaster.xxx.security_patch";
- }
-+ if(strcmp(name, "ro.boot.vbmeta.device_state") == 0) {
-+ return "ro.keymaster.xxx.vbmeta_state";
-+ }
-+ if(strcmp(name, "ro.boot.verifiedbootstate") == 0) {
-+ return "ro.keymaster.xxx.verifiedbootstate";
-+ }
- }
- return name;
- }
---
-2.25.1
-
diff --git a/patches/trebledroid/platform_bootable_recovery/0001-Don-t-reboot-if-we-couldn-t-get-bootctrl.patch b/patches/trebledroid/platform_bootable_recovery/0001-Don-t-reboot-if-we-couldn-t-get-bootctrl.patch
index 32db0eb..c8c91fa 100644
--- a/patches/trebledroid/platform_bootable_recovery/0001-Don-t-reboot-if-we-couldn-t-get-bootctrl.patch
+++ b/patches/trebledroid/platform_bootable_recovery/0001-Don-t-reboot-if-we-couldn-t-get-bootctrl.patch
@@ -1,4 +1,4 @@
-From 3ca17e76a836a951415d087d160c5b805a7e2d22 Mon Sep 17 00:00:00 2001
+From 6b118b279359ded66d661bd5504cfa8a9759b4e2 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson
Date: Thu, 12 Sep 2019 20:31:07 +0200
Subject: [PATCH] Don't reboot if we couldn't get bootctrl
@@ -9,18 +9,18 @@ Change-Id: Id1793660bd1c97ab369607f58a772ca3512ec1af
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/update_verifier/update_verifier.cpp b/update_verifier/update_verifier.cpp
-index 88fcfa50..097a2c4e 100644
+index a0160e2f..24d6ccab 100644
--- a/update_verifier/update_verifier.cpp
+++ b/update_verifier/update_verifier.cpp
-@@ -332,7 +332,7 @@ int update_verifier(int argc, char** argv) {
- sp module = IBootControl::getService();
+@@ -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();
+ uint32_t current_slot = module->GetCurrentSlot();
--
2.25.1
diff --git a/patches/trebledroid/platform_build_make/0001-build-remove-emulator-crap-from-GSI.patch b/patches/trebledroid/platform_build_make/0001-build-remove-emulator-crap-from-GSI.patch
index 8abe53d..6350488 100644
--- a/patches/trebledroid/platform_build_make/0001-build-remove-emulator-crap-from-GSI.patch
+++ b/patches/trebledroid/platform_build_make/0001-build-remove-emulator-crap-from-GSI.patch
@@ -1,35 +1,13 @@
-From 069fc1320095c7a37fc8f24b372e7f9213ee6aa9 Mon Sep 17 00:00:00 2001
+From 7914a65a226e6e9677e869b221aa469a5c5e13c0 Mon Sep 17 00:00:00 2001
From: sooti
Date: Tue, 12 Oct 2021 14:32:52 +0300
-Subject: [PATCH 1/4] build: remove emulator crap from GSI
+Subject: [PATCH 1/5] build: remove emulator crap from GSI
Change-Id: Id45f3ff1d31e3d4492f956e68a1eb4b2fb82ce63
---
- target/product/emulator.mk | 6 +++---
target/product/emulator_vendor.mk | 6 +++---
- 2 files changed, 6 insertions(+), 6 deletions(-)
+ 1 file changed, 3 insertions(+), 3 deletions(-)
-diff --git a/target/product/emulator.mk b/target/product/emulator.mk
-index 36da1f7034..1497c061fc 100644
---- a/target/product/emulator.mk
-+++ b/target/product/emulator.mk
-@@ -36,7 +36,7 @@ PRODUCT_PACKAGES += \
-
- PRODUCT_PACKAGE_OVERLAYS := device/generic/goldfish/overlay
-
--PRODUCT_CHARACTERISTICS := emulator
-+# PRODUCT_CHARACTERISTICS := emulator
-
- PRODUCT_FULL_TREBLE_OVERRIDE := true
-
-@@ -56,5 +56,5 @@ PRODUCT_SYSTEM_EXT_PROPERTIES += \
- ro.com.google.locationfeatures=1
-
- # disable setupwizard
--PRODUCT_SYSTEM_EXT_PROPERTIES += \
-- ro.setupwizard.mode=DISABLED
-+# PRODUCT_SYSTEM_EXT_PROPERTIES += \
-+# ro.setupwizard.mode=DISABLED
diff --git a/target/product/emulator_vendor.mk b/target/product/emulator_vendor.mk
index f71b275b0e..62984253f3 100644
--- a/target/product/emulator_vendor.mk
diff --git a/patches/trebledroid/platform_build_make/0002-build-Bypass-vendor-calls.patch b/patches/trebledroid/platform_build_make/0002-build-Bypass-vendor-calls.patch
index db8bbd2..b719410 100644
--- a/patches/trebledroid/platform_build_make/0002-build-Bypass-vendor-calls.patch
+++ b/patches/trebledroid/platform_build_make/0002-build-Bypass-vendor-calls.patch
@@ -1,7 +1,7 @@
-From 8acba28c3cb28e469268ed57df773fc37a1b0e36 Mon Sep 17 00:00:00 2001
+From 5e102101733669fa99ed8a53f2053f8576d917d8 Mon Sep 17 00:00:00 2001
From: Alberto Ponces
Date: Mon, 18 Oct 2021 17:20:18 +0100
-Subject: [PATCH 2/4] build: Bypass vendor calls
+Subject: [PATCH 2/5] build: Bypass vendor calls
Change-Id: I69830d6264356dadd7b037553a899a4eb3d211f1
---
@@ -9,10 +9,10 @@ Change-Id: I69830d6264356dadd7b037553a899a4eb3d211f1
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/target/product/aosp_arm64.mk b/target/product/aosp_arm64.mk
-index 01897b77d2..a0a7c0d2fc 100644
+index 6c907db0ed..0adced1672 100644
--- a/target/product/aosp_arm64.mk
+++ b/target/product/aosp_arm64.mk
-@@ -51,9 +51,9 @@ $(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_product.mk)
+@@ -54,9 +54,9 @@ $(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_product.mk)
#
# All components inherited here go to vendor or vendor_boot image
#
diff --git a/patches/trebledroid/platform_build_make/0003-Remove-init.vndk-nodef.rc.patch b/patches/trebledroid/platform_build_make/0003-Remove-init.vndk-nodef.rc.patch
index 3c62eef..5a0c1c2 100644
--- a/patches/trebledroid/platform_build_make/0003-Remove-init.vndk-nodef.rc.patch
+++ b/patches/trebledroid/platform_build_make/0003-Remove-init.vndk-nodef.rc.patch
@@ -1,7 +1,7 @@
-From d0da7fbdcc0cc4a65cd6f7c3ada20d36b0aed418 Mon Sep 17 00:00:00 2001
+From 4bfcaea596cc197b184691accda8d73efc752558 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan
Date: Wed, 8 Dec 2021 07:04:53 +0000
-Subject: [PATCH 3/4] Remove init.vndk-nodef.rc
+Subject: [PATCH 3/5] Remove init.vndk-nodef.rc
This partially reverts "Deprecate VNDK-lite support from Legacy GSI".
@@ -19,10 +19,10 @@ Change-Id: I7c14fe5229e953f620bb225fa5c981752d0ac5f9
delete mode 100644 target/product/gsi/init.vndk-nodef.rc
diff --git a/target/product/gsi/Android.mk b/target/product/gsi/Android.mk
-index 85e551d3f2..c1f37e07fa 100644
+index 107c94f685..0ad39c3610 100644
--- a/target/product/gsi/Android.mk
+++ b/target/product/gsi/Android.mk
-@@ -247,16 +247,3 @@ LOCAL_SYSTEM_EXT_MODULE := true
+@@ -256,16 +256,3 @@ LOCAL_SYSTEM_EXT_MODULE := true
LOCAL_MODULE_RELATIVE_PATH := init
include $(BUILD_PREBUILT)
@@ -59,17 +59,17 @@ index 1b141a05e7..0000000000
- # Reboot if BOARD_VNDK_VERSION is not defined
- exec - root -- /system/bin/reboot bootloader
diff --git a/target/product/gsi_release.mk b/target/product/gsi_release.mk
-index 74501cd1f1..575e90b148 100644
+index 3b977927d1..7bade98ca1 100644
--- a/target/product/gsi_release.mk
+++ b/target/product/gsi_release.mk
-@@ -60,7 +60,6 @@ PRODUCT_PACKAGES += com.android.apex.cts.shim.v1_with_prebuilts.flattened
+@@ -62,7 +62,6 @@ PRODUCT_PACKAGES += com.android.apex.cts.shim.v1_with_prebuilts.flattened
PRODUCT_PACKAGES += \
gsi_skip_mount.cfg \
init.gsi.rc \
- init.vndk-nodef.rc \
- # Support additional VNDK snapshots
- PRODUCT_EXTRA_VNDK_VERSIONS := \
+ # Overlay the GSI specific SystemUI setting
+ PRODUCT_PACKAGES += gsi_overlay_systemui
--
2.25.1
diff --git a/patches/trebledroid/platform_build_make/0004-build-Remove-llkd.patch b/patches/trebledroid/platform_build_make/0004-build-Remove-llkd.patch
index c06d8c9..680b622 100644
--- a/patches/trebledroid/platform_build_make/0004-build-Remove-llkd.patch
+++ b/patches/trebledroid/platform_build_make/0004-build-Remove-llkd.patch
@@ -1,7 +1,7 @@
-From 5529146869934316d087ebf5a0d118512bcbc818 Mon Sep 17 00:00:00 2001
+From b69d9d1c76a823d72a1c14128285a47f64e073be Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan
Date: Thu, 14 Oct 2021 12:20:52 +0000
-Subject: [PATCH 4/4] build: Remove llkd
+Subject: [PATCH 4/5] build: Remove llkd
...until someone figures out why Genshin Impact fails it
@@ -11,13 +11,13 @@ Change-Id: I29384a820a0c07b29d3f11d7039bed40eeaee926
1 file changed, 1 deletion(-)
diff --git a/target/product/base_system.mk b/target/product/base_system.mk
-index b0870c32aa..310876804c 100644
+index a3f5ab3470..0096f23b3d 100644
--- a/target/product/base_system.mk
+++ b/target/product/base_system.mk
-@@ -203,7 +203,6 @@ PRODUCT_PACKAGES += \
+@@ -208,7 +208,6 @@ PRODUCT_PACKAGES += \
+ libvulkan \
libwilhelm \
linker \
- linkerconfig \
- llkd \
lmkd \
LocalTransport \
diff --git a/patches/trebledroid/platform_build_make/0005-Include-vndk-v28-sepolicy-support.patch b/patches/trebledroid/platform_build_make/0005-Include-vndk-v28-sepolicy-support.patch
new file mode 100644
index 0000000..4c37892
--- /dev/null
+++ b/patches/trebledroid/platform_build_make/0005-Include-vndk-v28-sepolicy-support.patch
@@ -0,0 +1,24 @@
+From 67dd639c252c6337e9ad361c364a8f799004f089 Mon Sep 17 00:00:00 2001
+From: Pierre-Hugues Husson
+Date: Fri, 6 Oct 2023 19:11:22 -0400
+Subject: [PATCH 5/5] 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 0c086ee090..6006a5e8f5 100644
+--- a/core/config.mk
++++ b/core/config.mk
+@@ -911,6 +911,7 @@ endif
+
+ # A list of SEPolicy versions, besides PLATFORM_SEPOLICY_VERSION, that the framework supports.
+ PLATFORM_SEPOLICY_COMPAT_VERSIONS := \
++ 28.0 \
+ 29.0 \
+ 30.0 \
+ 31.0 \
+--
+2.25.1
+
diff --git a/patches/trebledroid/platform_external_selinux/0001-Increase-default-log_level-to-get-actual-selinux-err.patch b/patches/trebledroid/platform_external_selinux/0001-Increase-default-log_level-to-get-actual-selinux-err.patch
index b7ffc25..153a78a 100644
--- a/patches/trebledroid/platform_external_selinux/0001-Increase-default-log_level-to-get-actual-selinux-err.patch
+++ b/patches/trebledroid/platform_external_selinux/0001-Increase-default-log_level-to-get-actual-selinux-err.patch
@@ -1,4 +1,4 @@
-From e6137af9827acb0134cdf51d70b18c4e9ef67998 Mon Sep 17 00:00:00 2001
+From aa0cbcaebbaf0886abfd6bd97232798c7cb5be9b Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson
Date: Mon, 9 Apr 2018 00:19:49 +0200
Subject: [PATCH 01/10] Increase default log_level to get actual selinux error
diff --git a/patches/trebledroid/platform_external_selinux/0002-Revert-libsepol-Make-an-unknown-permission-an-error-.patch b/patches/trebledroid/platform_external_selinux/0002-Revert-libsepol-Make-an-unknown-permission-an-error-.patch
index 0c25ee9..f89e5ba 100644
--- a/patches/trebledroid/platform_external_selinux/0002-Revert-libsepol-Make-an-unknown-permission-an-error-.patch
+++ b/patches/trebledroid/platform_external_selinux/0002-Revert-libsepol-Make-an-unknown-permission-an-error-.patch
@@ -1,4 +1,4 @@
-From d75d33515d4e39d6165f6b88b0558358736fb587 Mon Sep 17 00:00:00 2001
+From a88a863bdd7cee7e8d8a681d7f32d9ff6d0bc746 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson
Date: Wed, 9 Sep 2020 22:36:42 +0200
Subject: [PATCH 02/10] Revert "libsepol: Make an unknown permission an error
@@ -14,7 +14,7 @@ This is required because some targets calls undefined permissions:
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 69a8a2ed..b63c1359 100644
+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,
diff --git a/patches/trebledroid/platform_external_selinux/0003-Workaround-device-phh-treble-conflict-with-SELinux-p.patch b/patches/trebledroid/platform_external_selinux/0003-Workaround-device-phh-treble-conflict-with-SELinux-p.patch
index 462cd1c..2587ba3 100644
--- a/patches/trebledroid/platform_external_selinux/0003-Workaround-device-phh-treble-conflict-with-SELinux-p.patch
+++ b/patches/trebledroid/platform_external_selinux/0003-Workaround-device-phh-treble-conflict-with-SELinux-p.patch
@@ -1,4 +1,4 @@
-From d6f7237db8247206db3861022b3ab7f1f0b5b96b Mon Sep 17 00:00:00 2001
+From 01034f4009d29c401d5f007f76044482c0ed8bd0 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson
Date: Wed, 31 Mar 2021 23:32:37 +0200
Subject: [PATCH 03/10] Workaround device/phh/treble conflict with SELinux
@@ -18,7 +18,7 @@ simply ignore them.
3 files changed, 28 insertions(+), 6 deletions(-)
diff --git a/libsepol/cil/src/cil_binary.c b/libsepol/cil/src/cil_binary.c
-index 53017e2d..7f2c2e68 100644
+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)
@@ -40,7 +40,7 @@ index 53017e2d..7f2c2e68 100644
goto exit;
}
sepol_alias->s.value = sepol_type->s.value;
-@@ -3904,7 +3908,7 @@ int __cil_node_to_policydb(struct cil_tree_node *node, void *extra_args)
+@@ -3995,7 +3999,7 @@ static int __cil_node_to_policydb(struct cil_tree_node *node, void *extra_args)
exit:
if (rc != SEPOL_OK) {
@@ -50,7 +50,7 @@ index 53017e2d..7f2c2e68 100644
return rc;
}
diff --git a/libsepol/cil/src/cil_build_ast.c b/libsepol/cil/src/cil_build_ast.c
-index 5f9392d1..90f0fee6 100644
+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
@@ -79,10 +79,10 @@ index 5f9392d1..90f0fee6 100644
/* 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 b63c1359..87db4f81 100644
+index 91fa1075..d20fb7ee 100644
--- a/libsepol/cil/src/cil_resolve_ast.c
+++ b/libsepol/cil/src/cil_resolve_ast.c
-@@ -517,7 +517,13 @@ int cil_resolve_aliasactual(struct cil_tree_node *current, void *extra_args, enu
+@@ -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);
@@ -97,7 +97,7 @@ index b63c1359..87db4f81 100644
goto exit;
}
-@@ -558,7 +564,12 @@ int cil_resolve_alias_to_actual(struct cil_tree_node *current, enum cil_flavor f
+@@ -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) {
diff --git a/patches/trebledroid/platform_external_selinux/0004-Allow-devices-virtual-block-genfscon-conflict-seen-o.patch b/patches/trebledroid/platform_external_selinux/0004-Allow-devices-virtual-block-genfscon-conflict-seen-o.patch
index b720f76..4ee6ec7 100644
--- a/patches/trebledroid/platform_external_selinux/0004-Allow-devices-virtual-block-genfscon-conflict-seen-o.patch
+++ b/patches/trebledroid/platform_external_selinux/0004-Allow-devices-virtual-block-genfscon-conflict-seen-o.patch
@@ -1,4 +1,4 @@
-From 7cbbd5b16ba622aef077df4d7caf24ece6451a71 Mon Sep 17 00:00:00 2001
+From 81fa34b00d80113ed4015b99dab093826c1acb89 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson
Date: Fri, 6 Sep 2019 15:07:25 +0200
Subject: [PATCH 04/10] Allow /devices/virtual/block/ genfscon conflict (seen
@@ -10,10 +10,10 @@ Change-Id: I06e4e9d5b82d61a8aeab595b47e2589249675895
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/libsepol/cil/src/cil_post.c b/libsepol/cil/src/cil_post.c
-index 09c02af9..5c0e99c3 100644
+index a7c66ead..99410da0 100644
--- a/libsepol/cil/src/cil_post.c
+++ b/libsepol/cil/src/cil_post.c
-@@ -491,7 +491,23 @@ int cil_post_genfscon_context_compare(const void *a, const void *b)
+@@ -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;
@@ -37,7 +37,7 @@ index 09c02af9..5c0e99c3 100644
+ return rc;
}
- int cil_post_netifcon_context_compare(const void *a, const void *b)
+ static int cil_post_netifcon_context_compare(const void *a, const void *b)
--
2.25.1
diff --git a/patches/trebledroid/platform_external_selinux/0005-if-service-is-rcs-accept-conflict.-Seen-on-Moto-E5.patch b/patches/trebledroid/platform_external_selinux/0005-if-service-is-rcs-accept-conflict.-Seen-on-Moto-E5.patch
index 6dd5095..bbbc4da 100644
--- a/patches/trebledroid/platform_external_selinux/0005-if-service-is-rcs-accept-conflict.-Seen-on-Moto-E5.patch
+++ b/patches/trebledroid/platform_external_selinux/0005-if-service-is-rcs-accept-conflict.-Seen-on-Moto-E5.patch
@@ -1,4 +1,4 @@
-From 53f1d10bbab3d7d5a70456be39851538118ee122 Mon Sep 17 00:00:00 2001
+From 0bc7791b9f1423f70c17b68dd7fb9d672b2bb924 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson
Date: Thu, 12 Sep 2019 20:37:04 +0200
Subject: [PATCH 05/10] if service is "rcs", accept conflict. Seen on Moto E5
@@ -9,7 +9,7 @@ Change-Id: I0cc2d0fad83f403f2b5d7458039b1564ce5ed9dd
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/libselinux/src/label_backends_android.c b/libselinux/src/label_backends_android.c
-index e52b44d4..3b8a2bd8 100644
+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)
diff --git a/patches/trebledroid/platform_external_selinux/0006-Allow-mismatches-of-exfat-genfscon.patch b/patches/trebledroid/platform_external_selinux/0006-Allow-mismatches-of-exfat-genfscon.patch
index 2b9b7a3..90d8b43 100644
--- a/patches/trebledroid/platform_external_selinux/0006-Allow-mismatches-of-exfat-genfscon.patch
+++ b/patches/trebledroid/platform_external_selinux/0006-Allow-mismatches-of-exfat-genfscon.patch
@@ -1,4 +1,4 @@
-From 207b6ab1b4fe3bdafc66b65edd4e486a80541ee8 Mon Sep 17 00:00:00 2001
+From c4100e160008273781973b2098267e7d343b8956 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson
Date: Sun, 24 May 2020 17:22:22 +0200
Subject: [PATCH 06/10] Allow mismatches of exfat genfscon
@@ -8,10 +8,10 @@ Subject: [PATCH 06/10] Allow mismatches of exfat genfscon
1 file changed, 4 insertions(+)
diff --git a/libsepol/cil/src/cil_post.c b/libsepol/cil/src/cil_post.c
-index 5c0e99c3..97bf54f8 100644
+index 99410da0..7f614c03 100644
--- a/libsepol/cil/src/cil_post.c
+++ b/libsepol/cil/src/cil_post.c
-@@ -502,6 +502,10 @@ int cil_post_genfscon_context_compare(const void *a, const void *b)
+@@ -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;
diff --git a/patches/trebledroid/platform_external_selinux/0007-Enable-multipl_decls-by-default.-This-is-needed-beca.patch b/patches/trebledroid/platform_external_selinux/0007-Enable-multipl_decls-by-default.-This-is-needed-beca.patch
deleted file mode 100644
index 16f7647..0000000
--- a/patches/trebledroid/platform_external_selinux/0007-Enable-multipl_decls-by-default.-This-is-needed-beca.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From d79ea4efefc24741fcc9e664f4e7e5f3607b414d Mon Sep 17 00:00:00 2001
-From: Pierre-Hugues Husson
-Date: Fri, 2 Mar 2018 22:49:55 +0100
-Subject: [PATCH 07/10] Enable multipl_decls by default. This is needed because
- 8.0 init doesn't add -m
-
-Change-Id: I43dc661d519f7b8576d72a828d8cbd444592bf5e
----
- secilc/secilc.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/secilc/secilc.c b/secilc/secilc.c
-index a51630b2..d9841ab0 100644
---- a/secilc/secilc.c
-+++ b/secilc/secilc.c
-@@ -94,7 +94,7 @@ int main(int argc, char *argv[])
- int target = SEPOL_TARGET_SELINUX;
- int mls = -1;
- int disable_dontaudit = 0;
-- int multiple_decls = 0;
-+ int multiple_decls = 1;
- int disable_neverallow = 0;
- int preserve_tunables = 0;
- int qualified_names = 0;
---
-2.25.1
-
diff --git a/patches/trebledroid/platform_external_selinux/0008-Fix-boot-on-Moto-devices-using-unknown-class.patch b/patches/trebledroid/platform_external_selinux/0007-Fix-boot-on-Moto-devices-using-unknown-class.patch
similarity index 94%
rename from patches/trebledroid/platform_external_selinux/0008-Fix-boot-on-Moto-devices-using-unknown-class.patch
rename to patches/trebledroid/platform_external_selinux/0007-Fix-boot-on-Moto-devices-using-unknown-class.patch
index 9b51763..0f21ff9 100644
--- a/patches/trebledroid/platform_external_selinux/0008-Fix-boot-on-Moto-devices-using-unknown-class.patch
+++ b/patches/trebledroid/platform_external_selinux/0007-Fix-boot-on-Moto-devices-using-unknown-class.patch
@@ -1,7 +1,7 @@
-From fbfaccf212f18ce1e2c0c6e10a3fb6900fd5e17b Mon Sep 17 00:00:00 2001
+From 4c0afb19a2170e2cd9c4e2a1fdb48cdb16d4100e Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson
Date: Fri, 25 Oct 2019 13:29:20 +0200
-Subject: [PATCH 08/10] Fix boot on Moto devices using unknown class
+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.
@@ -31,7 +31,7 @@ Change-Id: I66339857634ebfdba359f12a99dfd0bff709d80b
1 file changed, 24 insertions(+)
diff --git a/libsepol/cil/src/cil_build_ast.c b/libsepol/cil/src/cil_build_ast.c
-index 90f0fee6..023fd6c7 100644
+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
diff --git a/patches/trebledroid/platform_external_selinux/0009-Improve-SELinux-policy-workaround-on-device-phh-treb.patch b/patches/trebledroid/platform_external_selinux/0008-Improve-SELinux-policy-workaround-on-device-phh-treb.patch
similarity index 83%
rename from patches/trebledroid/platform_external_selinux/0009-Improve-SELinux-policy-workaround-on-device-phh-treb.patch
rename to patches/trebledroid/platform_external_selinux/0008-Improve-SELinux-policy-workaround-on-device-phh-treb.patch
index c191de5..88ab3b3 100644
--- a/patches/trebledroid/platform_external_selinux/0009-Improve-SELinux-policy-workaround-on-device-phh-treb.patch
+++ b/patches/trebledroid/platform_external_selinux/0008-Improve-SELinux-policy-workaround-on-device-phh-treb.patch
@@ -1,7 +1,7 @@
-From 1a18553654f2b6e307f99b256cc272ee63b7b651 Mon Sep 17 00:00:00 2001
+From 18cdd4e9ff37377b80f837c92026f1ce3514d074 Mon Sep 17 00:00:00 2001
From: ponces
Date: Mon, 7 Nov 2022 16:14:20 +0000
-Subject: [PATCH 09/10] Improve SELinux policy workaround on device/phh/treble
+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
@@ -10,7 +10,7 @@ This fixes boot on many Samsung devices as exiting with SEPOL_EEXIST will preven
1 file changed, 1 deletion(-)
diff --git a/libsepol/cil/src/cil_build_ast.c b/libsepol/cil/src/cil_build_ast.c
-index 023fd6c7..61c8864b 100644
+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
diff --git a/patches/trebledroid/platform_external_selinux/0010-Allow-sys-vm-watermark_scale_factor-conflict-seen-on.patch b/patches/trebledroid/platform_external_selinux/0009-Allow-sys-vm-watermark_scale_factor-conflict-seen-on.patch
similarity index 80%
rename from patches/trebledroid/platform_external_selinux/0010-Allow-sys-vm-watermark_scale_factor-conflict-seen-on.patch
rename to patches/trebledroid/platform_external_selinux/0009-Allow-sys-vm-watermark_scale_factor-conflict-seen-on.patch
index 5712cf6..eeefa34 100644
--- a/patches/trebledroid/platform_external_selinux/0010-Allow-sys-vm-watermark_scale_factor-conflict-seen-on.patch
+++ b/patches/trebledroid/platform_external_selinux/0009-Allow-sys-vm-watermark_scale_factor-conflict-seen-on.patch
@@ -1,7 +1,7 @@
-From 24b3713d636c6869b35a511a00495642c9b23ccd Mon Sep 17 00:00:00 2001
+From e62c978dbf5f214f392355a0d111adc772f10b60 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson
Date: Thu, 20 Jul 2023 14:21:21 -0400
-Subject: [PATCH 10/10] Allow /sys/vm/watermark_scale_factor conflict -- seen
+Subject: [PATCH 09/10] Allow /sys/vm/watermark_scale_factor conflict -- seen
on Freebox Player Pop
---
@@ -9,10 +9,10 @@ Subject: [PATCH 10/10] Allow /sys/vm/watermark_scale_factor conflict -- seen
1 file changed, 9 insertions(+)
diff --git a/libsepol/cil/src/cil_post.c b/libsepol/cil/src/cil_post.c
-index 97bf54f8..4cf1f2d3 100644
+index 7f614c03..1703b3b6 100644
--- a/libsepol/cil/src/cil_post.c
+++ b/libsepol/cil/src/cil_post.c
-@@ -502,6 +502,15 @@ int cil_post_genfscon_context_compare(const void *a, const void *b)
+@@ -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;
diff --git a/patches/trebledroid/platform_external_selinux/0010-Allow-conflict-on-fuseblk.patch b/patches/trebledroid/platform_external_selinux/0010-Allow-conflict-on-fuseblk.patch
new file mode 100644
index 0000000..452fd3f
--- /dev/null
+++ b/patches/trebledroid/platform_external_selinux/0010-Allow-conflict-on-fuseblk.patch
@@ -0,0 +1,25 @@
+From d69b637d22bd02e44ece4e68e53b9151dfda8247 Mon Sep 17 00:00:00 2001
+From: Pierre-Hugues Husson
+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
+
diff --git a/patches/trebledroid/platform_frameworks_av/0001-APM-Restore-S-R-and-Q-behavior-respectively-for-tele.patch b/patches/trebledroid/platform_frameworks_av/0001-APM-Restore-S-R-and-Q-behavior-respectively-for-tele.patch
index ae23536..05266ca 100644
--- a/patches/trebledroid/platform_frameworks_av/0001-APM-Restore-S-R-and-Q-behavior-respectively-for-tele.patch
+++ b/patches/trebledroid/platform_frameworks_av/0001-APM-Restore-S-R-and-Q-behavior-respectively-for-tele.patch
@@ -1,7 +1,7 @@
-From d880ce937f082e4b948698961d41a7cb7aedceaa Mon Sep 17 00:00:00 2001
+From 22e5fe9453c87c2d7479a8c3da929b1b60eea764 Mon Sep 17 00:00:00 2001
From: Peter Cai
Date: Thu, 18 Aug 2022 15:44:46 -0400
-Subject: [PATCH 01/28] APM: Restore S, R and Q behavior respectively for
+Subject: [PATCH 01/22] APM: Restore S, R and Q behavior respectively for
telephony audio
This conditionally reverts part of b2e5cb (T), 51c9cc (S) and afd4ce (R)
@@ -31,15 +31,15 @@ relying on the value of `ro.vndk.version`.
Change-Id: I56d36d2aef4319935cb88a3e4771b23c6d5b2145
---
- .../managerdefault/AudioPolicyManager.cpp | 197 +++++++++++++-----
+ .../managerdefault/AudioPolicyManager.cpp | 206 ++++++++++++------
.../managerdefault/AudioPolicyManager.h | 3 +
- 2 files changed, 143 insertions(+), 57 deletions(-)
+ 2 files changed, 147 insertions(+), 62 deletions(-)
diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
-index f625fdb3be..6c45696005 100644
+index f093e685ba..9a90009f9e 100644
--- a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
+++ b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
-@@ -675,6 +675,17 @@ status_t AudioPolicyManager::updateCallRoutingInternal(
+@@ -689,6 +689,17 @@ status_t AudioPolicyManager::updateCallRoutingInternal(
disconnectTelephonyAudioSource(mCallRxSourceClient);
disconnectTelephonyAudioSource(mCallTxSourceClient);
@@ -57,7 +57,7 @@ index f625fdb3be..6c45696005 100644
auto telephonyRxModule =
mHwModules.getModuleForDeviceType(AUDIO_DEVICE_IN_TELEPHONY_RX, AUDIO_FORMAT_DEFAULT);
auto telephonyTxModule =
-@@ -697,9 +708,20 @@ status_t AudioPolicyManager::updateCallRoutingInternal(
+@@ -711,9 +722,20 @@ status_t AudioPolicyManager::updateCallRoutingInternal(
ALOGE("%s() no telephony Tx and/or RX device", __func__);
return INVALID_OPERATION;
}
@@ -81,7 +81,7 @@ index f625fdb3be..6c45696005 100644
} else {
// If the RX device is on the primary HW module, then use legacy routing method for
// voice calls via setOutputDevice() on primary output.
-@@ -716,7 +738,14 @@ status_t AudioPolicyManager::updateCallRoutingInternal(
+@@ -730,7 +752,14 @@ status_t AudioPolicyManager::updateCallRoutingInternal(
if (!createRxPatch) {
muteWaitMs = setOutputDevices(mPrimaryOutput, rxDevices, true, delayMs);
} else { // create RX path audio patch
@@ -97,7 +97,7 @@ index f625fdb3be..6c45696005 100644
// If the TX device is on the primary HW module but RX device is
// on other HW module, SinkMetaData of telephony input should handle it
// assuming the device uses audio HAL V5.0 and above
-@@ -731,7 +760,12 @@ status_t AudioPolicyManager::updateCallRoutingInternal(
+@@ -745,7 +774,12 @@ status_t AudioPolicyManager::updateCallRoutingInternal(
closeActiveClients(activeDesc);
}
}
@@ -111,7 +111,7 @@ index f625fdb3be..6c45696005 100644
}
if (waitMs != nullptr) {
*waitMs = muteWaitMs;
-@@ -739,6 +773,36 @@ status_t AudioPolicyManager::updateCallRoutingInternal(
+@@ -753,6 +787,36 @@ status_t AudioPolicyManager::updateCallRoutingInternal(
return NO_ERROR;
}
@@ -148,7 +148,7 @@ index f625fdb3be..6c45696005 100644
bool AudioPolicyManager::isDeviceOfModule(
const sp& devDesc, const char *moduleId) const {
sp module = mHwModules.getModuleFromName(moduleId);
-@@ -4550,78 +4614,97 @@ status_t AudioPolicyManager::createAudioPatchInternal(const struct audio_patch *
+@@ -4958,83 +5022,101 @@ status_t AudioPolicyManager::createAudioPatchInternal(const struct audio_patch *
// in config XML to reach the sink so that is can be declared as available.
audio_io_handle_t output = AUDIO_IO_HANDLE_NONE;
sp outputDesc;
@@ -159,17 +159,22 @@ index f625fdb3be..6c45696005 100644
- audio_attributes_t resultAttr;
- audio_config_t config = AUDIO_CONFIG_INITIALIZER;
- config.sample_rate = sourceDesc->config().sample_rate;
-- config.channel_mask = sourceDesc->config().channel_mask;
+- audio_channel_mask_t sourceMask = sourceDesc->config().channel_mask;
+- config.channel_mask =
+- (audio_channel_mask_get_representation(sourceMask)
+- == AUDIO_CHANNEL_REPRESENTATION_INDEX) ? sourceMask
+- : audio_channel_mask_in_to_out(sourceMask);
- config.format = sourceDesc->config().format;
- audio_output_flags_t flags = AUDIO_OUTPUT_FLAG_NONE;
- audio_port_handle_t selectedDeviceId = AUDIO_PORT_HANDLE_NONE;
- bool isRequestedDeviceForExclusiveUse = false;
- output_type_t outputType;
- bool isSpatialized;
+- bool isBitPerfect;
- getOutputForAttrInt(&resultAttr, &output, AUDIO_SESSION_NONE, &attributes,
- &stream, sourceDesc->uid(), &config, &flags,
- &selectedDeviceId, &isRequestedDeviceForExclusiveUse,
-- nullptr, &outputType, &isSpatialized);
+- nullptr, &outputType, &isSpatialized, &isBitPerfect);
- if (output == AUDIO_IO_HANDLE_NONE) {
- ALOGV("%s no output for device %s",
- __FUNCTION__, sinkDevice->toString().c_str());
@@ -207,20 +212,25 @@ index f625fdb3be..6c45696005 100644
+ audio_attributes_t resultAttr;
+ audio_config_t config = AUDIO_CONFIG_INITIALIZER;
+ config.sample_rate = sourceDesc->config().sample_rate;
-+ config.channel_mask = sourceDesc->config().channel_mask;
++ audio_channel_mask_t sourceMask = sourceDesc->config().channel_mask;
++ config.channel_mask =
++ (audio_channel_mask_get_representation(sourceMask)
++ == AUDIO_CHANNEL_REPRESENTATION_INDEX) ? sourceMask
++ : audio_channel_mask_in_to_out(sourceMask);
+ config.format = sourceDesc->config().format;
+ audio_output_flags_t flags = AUDIO_OUTPUT_FLAG_NONE;
+ audio_port_handle_t selectedDeviceId = AUDIO_PORT_HANDLE_NONE;
+ bool isRequestedDeviceForExclusiveUse = false;
+ output_type_t outputType;
+ bool isSpatialized;
++ bool isBitPerfect;
+ getOutputForAttrInt(&resultAttr, &output, AUDIO_SESSION_NONE, &attributes,
+ &stream, sourceDesc->uid(), &config, &flags,
+ &selectedDeviceId, &isRequestedDeviceForExclusiveUse,
-+ nullptr, &outputType, &isSpatialized);
++ nullptr, &outputType, &isSpatialized, &isBitPerfect);
+ if (output == AUDIO_IO_HANDLE_NONE) {
+ ALOGV("%s no output for device %s",
-+ __FUNCTION__, sinkDevice->toString().c_str());
++ __FUNCTION__, sinkDevice->toString().c_str());
+ return INVALID_OPERATION;
+ }
+ outputDesc = mOutputs.valueFor(output);
@@ -245,10 +255,9 @@ index f625fdb3be..6c45696005 100644
+ outputDesc = mOutputs.valueFor(output);
+ if (outputDesc->isDuplicated()) {
+ ALOGV("%s output for device %s is duplicated",
-+ __func__, sinkDevice->toString().c_str());
++ __func__, sinkDevice->toString().c_str());
+ return INVALID_OPERATION;
+ }
-+ sourceDesc->setSwOutput(outputDesc, /* closeOutput= */ false);
}
- sourceDesc->setSwOutput(outputDesc, /* closeOutput= */ false);
}
@@ -299,10 +308,10 @@ index f625fdb3be..6c45696005 100644
AUDIO_STREAM_PATCH;
patchBuilder.addSource(srcMixPortConfig);
diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.h b/services/audiopolicy/managerdefault/AudioPolicyManager.h
-index a69e08871b..f8762016db 100644
+index 88bafefdb1..188b5732b3 100644
--- a/services/audiopolicy/managerdefault/AudioPolicyManager.h
+++ b/services/audiopolicy/managerdefault/AudioPolicyManager.h
-@@ -944,6 +944,9 @@ protected:
+@@ -953,6 +953,9 @@ protected:
SoundTriggerSessionCollection mSoundTriggerSessions;
diff --git a/patches/trebledroid/platform_frameworks_av/0002-Fix-BT-in-call-on-CAF-devices.patch b/patches/trebledroid/platform_frameworks_av/0002-Fix-BT-in-call-on-CAF-devices.patch
index b5a24fd..390396d 100644
--- a/patches/trebledroid/platform_frameworks_av/0002-Fix-BT-in-call-on-CAF-devices.patch
+++ b/patches/trebledroid/platform_frameworks_av/0002-Fix-BT-in-call-on-CAF-devices.patch
@@ -1,7 +1,7 @@
-From d36693f46b84d03101f07647c321ab44867dcaef Mon Sep 17 00:00:00 2001
+From 78d9273cc66e2e8760ffd278b16feeb92b311adf Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson
Date: Mon, 5 Aug 2019 18:09:50 +0200
-Subject: [PATCH 02/28] Fix BT in-call on CAF devices
+Subject: [PATCH 02/22] Fix BT in-call on CAF devices
See https://github.com/phhusson/treble_experimentations/issues/374
@@ -16,7 +16,7 @@ Change-Id: Ifea0f88276ec9a0811f3cb1973c4b06f2c82077b
1 file changed, 93 insertions(+)
diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
-index d446e9667b..2f0ce75e47 100644
+index 3d5c1d2e42..5ca409cfe7 100644
--- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
+++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
@@ -663,6 +663,98 @@ std::variant PolicySerializer::deserialize
Date: Tue, 1 Oct 2019 13:35:49 +0200
-Subject: [PATCH 03/28] Add (partial, cam id is hardcoded) support for Asus ZF6
+Subject: [PATCH 03/22] Add (partial, cam id is hardcoded) support for Asus ZF6
motor camera
Change-Id: Iea6e1370780a1d16f728748d1d948d092532d8fe
@@ -11,7 +11,7 @@ Change-Id: Iea6e1370780a1d16f728748d1d948d092532d8fe
2 files changed, 29 insertions(+)
diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp
-index a6cd5cdb17..a5cf86402a 100644
+index 668a51ae6d..a18425e6b8 100644
--- a/services/camera/libcameraservice/CameraService.cpp
+++ b/services/camera/libcameraservice/CameraService.cpp
@@ -26,6 +26,7 @@
@@ -22,15 +22,15 @@ index a6cd5cdb17..a5cf86402a 100644
#include
#include
#include
-@@ -143,6 +144,7 @@ const String16 CameraService::kWatchAllClientsFlag("all");
- static std::set sServiceErrorEventSet;
+@@ -154,6 +155,7 @@ static std::set sServiceErrorEventSet;
- CameraService::CameraService() :
+ CameraService::CameraService(
+ std::shared_ptr cameraServiceProxyWrapper) :
+ mPhysicalFrontCamStatus(false),
+ mCameraServiceProxyWrapper(cameraServiceProxyWrapper == nullptr ?
+ std::make_shared() : cameraServiceProxyWrapper),
mEventLog(DEFAULT_EVENT_LOG_LENGTH),
- mNumberOfCameras(0),
- mNumberOfCamerasWithoutSystemCamera(0),
-@@ -2044,6 +2046,7 @@ Status CameraService::connectHelper(const sp& cameraCb, const String8&
+@@ -2154,6 +2156,7 @@ Status CameraService::connectHelper(const sp& cameraCb, const String8&
mServiceLock.lock();
} else {
// Otherwise, add client to active clients list
@@ -38,7 +38,7 @@ index a6cd5cdb17..a5cf86402a 100644
finishConnectLocked(client, partial, oomScoreOffset, systemNativeClient);
}
-@@ -2163,6 +2166,27 @@ status_t CameraService::addOfflineClient(String8 cameraId, sp offli
+@@ -2278,6 +2281,27 @@ status_t CameraService::addOfflineClient(String8 cameraId, sp offli
return OK;
}
@@ -66,7 +66,7 @@ index a6cd5cdb17..a5cf86402a 100644
Status CameraService::turnOnTorchWithStrengthLevel(const String16& cameraId, int32_t torchStrength,
const sp& clientBinder) {
Mutex::Autolock lock(mServiceLock);
-@@ -3394,6 +3418,8 @@ binder::Status CameraService::BasicClient::disconnect() {
+@@ -3539,6 +3563,8 @@ binder::Status CameraService::BasicClient::disconnect() {
}
mDisconnected = true;
@@ -76,10 +76,10 @@ index a6cd5cdb17..a5cf86402a 100644
sCameraService->logDisconnected(mCameraIdStr, mClientPid, String8(mClientPackageName));
sCameraService->mCameraProviderManager->removeRef(CameraProviderManager::DeviceMode::CAMERA,
diff --git a/services/camera/libcameraservice/CameraService.h b/services/camera/libcameraservice/CameraService.h
-index 70293f4c5b..4ab725230c 100644
+index 3214d4c475..69e189d844 100644
--- a/services/camera/libcameraservice/CameraService.h
+++ b/services/camera/libcameraservice/CameraService.h
-@@ -227,6 +227,9 @@ public:
+@@ -244,6 +244,9 @@ public:
// Register an offline client for a given active camera id
status_t addOfflineClient(String8 cameraId, sp offlineClient);
diff --git a/patches/trebledroid/platform_frameworks_av/0004-APM-Optionally-force-load-audio-policy-for-system-si.patch b/patches/trebledroid/platform_frameworks_av/0004-APM-Optionally-force-load-audio-policy-for-system-si.patch
index 9580c24..ed272a1 100644
--- a/patches/trebledroid/platform_frameworks_av/0004-APM-Optionally-force-load-audio-policy-for-system-si.patch
+++ b/patches/trebledroid/platform_frameworks_av/0004-APM-Optionally-force-load-audio-policy-for-system-si.patch
@@ -1,7 +1,7 @@
-From 87c7df3a8aef5bd56c658b692b71c9f7ddacfc12 Mon Sep 17 00:00:00 2001
+From fbf69fb913faabfcc6a273eba6f53c2fe22f99ea Mon Sep 17 00:00:00 2001
From: Peter Cai
Date: Wed, 24 Aug 2022 15:42:39 -0400
-Subject: [PATCH 04/28] APM: Optionally force-load audio policy for system-side
+Subject: [PATCH 04/22] APM: Optionally force-load audio policy for system-side
bt audio HAL
Required to support our system-side bt audio implementation, i.e.
@@ -14,7 +14,7 @@ Change-Id: I279fff541a531f922f3fa55b8f14d00237db59ff
1 file changed, 25 insertions(+)
diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
-index 2f0ce75e47..b35d34a599 100644
+index 5ca409cfe7..14b19e76ad 100644
--- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
+++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
@@ -25,6 +25,7 @@
@@ -25,7 +25,7 @@ index 2f0ce75e47..b35d34a599 100644
#include
#include
#include
-@@ -983,6 +984,30 @@ status_t PolicySerializer::deserialize(const char *configFile, AudioPolicyConfig
+@@ -978,6 +979,30 @@ status_t PolicySerializer::deserialize(const char *configFile, AudioPolicyConfig
if (status != NO_ERROR) {
return status;
}
diff --git a/patches/trebledroid/platform_frameworks_av/0005-APM-Remove-A2DP-audio-ports-from-the-primary-HAL.patch b/patches/trebledroid/platform_frameworks_av/0005-APM-Remove-A2DP-audio-ports-from-the-primary-HAL.patch
index 7b5354b..511c13a 100644
--- a/patches/trebledroid/platform_frameworks_av/0005-APM-Remove-A2DP-audio-ports-from-the-primary-HAL.patch
+++ b/patches/trebledroid/platform_frameworks_av/0005-APM-Remove-A2DP-audio-ports-from-the-primary-HAL.patch
@@ -1,7 +1,7 @@
-From 4f4ac9bdd43707f12c524c3fb2d80c2ed333fe9a Mon Sep 17 00:00:00 2001
+From 67dbd6dea1283000c06e43f5e4da693a60801605 Mon Sep 17 00:00:00 2001
From: Peter Cai
Date: Thu, 25 Aug 2022 13:30:29 -0400
-Subject: [PATCH 05/28] APM: Remove A2DP audio ports from the primary HAL
+Subject: [PATCH 05/22] APM: Remove A2DP audio ports from the primary HAL
These ports defined in the primary HAL are intended for A2DP offloading,
however they do not work in general on GSIs, and will interfere with
@@ -16,7 +16,7 @@ Change-Id: I3305594a17285da113167b419543543f0ef71122
1 file changed, 22 insertions(+), 4 deletions(-)
diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
-index b35d34a599..456c5a935c 100644
+index 14b19e76ad..b30ad7e8af 100644
--- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
+++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
@@ -26,6 +26,7 @@
diff --git a/patches/trebledroid/platform_frameworks_av/0006-audiopolicy-try-again-with-trimmed-audio-port-name-i.patch b/patches/trebledroid/platform_frameworks_av/0006-audiopolicy-try-again-with-trimmed-audio-port-name-i.patch
index 256e27c..2ce3833 100644
--- a/patches/trebledroid/platform_frameworks_av/0006-audiopolicy-try-again-with-trimmed-audio-port-name-i.patch
+++ b/patches/trebledroid/platform_frameworks_av/0006-audiopolicy-try-again-with-trimmed-audio-port-name-i.patch
@@ -1,7 +1,7 @@
-From f310ec6095f06709cbb087a1a34642e51e4f1b91 Mon Sep 17 00:00:00 2001
+From 3feedb8b6d853c538ad2cb64081ae0eec5c88e33 Mon Sep 17 00:00:00 2001
From: Peter Cai
Date: Thu, 23 Jan 2020 11:13:43 +0800
-Subject: [PATCH 06/28] audiopolicy: try again with trimmed audio port name if
+Subject: [PATCH 06/22] audiopolicy: try again with trimmed audio port name if
not found
* In Spreadtrum BSP, some audio routes may contain ports with extra
@@ -19,7 +19,7 @@ Change-Id: I993708b28e8404bc8c483d71a850ac69382231bd
1 file changed, 14 insertions(+)
diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
-index 456c5a935c..45ee70ab6e 100644
+index b30ad7e8af..53fabcc71e 100644
--- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
+++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
@@ -593,6 +593,17 @@ std::variant PolicySerializer::deserialize<
diff --git a/patches/trebledroid/platform_frameworks_av/0007-camera-Implement-property-to-override-default-camera.patch b/patches/trebledroid/platform_frameworks_av/0007-camera-Implement-property-to-override-default-camera.patch
index da4bd37..bcd5e75 100644
--- a/patches/trebledroid/platform_frameworks_av/0007-camera-Implement-property-to-override-default-camera.patch
+++ b/patches/trebledroid/platform_frameworks_av/0007-camera-Implement-property-to-override-default-camera.patch
@@ -1,7 +1,7 @@
-From da5a18b71f25d6c8de39f3299bb6c25ed6b8ecb3 Mon Sep 17 00:00:00 2001
+From 111915f4efcfc83d0869606d9610f430eaa180ea Mon Sep 17 00:00:00 2001
From: Peter Cai
Date: Wed, 1 Jun 2022 16:56:46 -0400
-Subject: [PATCH 07/28] camera: Implement property to override default camera
+Subject: [PATCH 07/22] camera: Implement property to override default camera
Complement to the frameworks/base patch.
@@ -11,10 +11,10 @@ Change-Id: I002bfa974bafc2cc01365eeea31c7a5dcb5a2028
1 file changed, 22 insertions(+)
diff --git a/services/camera/libcameraservice/common/CameraProviderManager.cpp b/services/camera/libcameraservice/common/CameraProviderManager.cpp
-index 43f92a9927..d9fc2ef135 100644
+index fac6e4e189..0ec647a941 100644
--- a/services/camera/libcameraservice/common/CameraProviderManager.cpp
+++ b/services/camera/libcameraservice/common/CameraProviderManager.cpp
-@@ -36,6 +36,7 @@
+@@ -38,6 +38,7 @@
#include
#include
#include
@@ -22,7 +22,7 @@ index 43f92a9927..d9fc2ef135 100644
#include
#include
#include
-@@ -210,6 +211,15 @@ std::vector CameraProviderManager::getCameraDeviceIds(std::unordere
+@@ -215,6 +216,15 @@ std::vector CameraProviderManager::getCameraDeviceIds(std::unordere
}
}
}
@@ -38,7 +38,7 @@ index 43f92a9927..d9fc2ef135 100644
return deviceIds;
}
-@@ -276,6 +286,18 @@ std::vector CameraProviderManager::getAPI1CompatibleCameraDeviceIds
+@@ -281,6 +291,18 @@ std::vector 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());
diff --git a/patches/trebledroid/platform_frameworks_av/0008-There-are-three-SCO-devices.-Fallback-from-one-to-th.patch b/patches/trebledroid/platform_frameworks_av/0008-There-are-three-SCO-devices.-Fallback-from-one-to-th.patch
index dd20287..5fa5e27 100644
--- a/patches/trebledroid/platform_frameworks_av/0008-There-are-three-SCO-devices.-Fallback-from-one-to-th.patch
+++ b/patches/trebledroid/platform_frameworks_av/0008-There-are-three-SCO-devices.-Fallback-from-one-to-th.patch
@@ -1,7 +1,7 @@
-From a75f8ef23865c64ea6cb340623b6b2425d8dfa54 Mon Sep 17 00:00:00 2001
+From 45bdf7575551dc1e2d97624c3a0c8d4dd6fda1d0 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson
Date: Mon, 13 Apr 2020 21:01:16 +0200
-Subject: [PATCH 08/28] There are three SCO devices. Fallback from one to the
+Subject: [PATCH 08/22] There are three SCO devices. Fallback from one to the
others if needed
Change-Id: I414dcb6b154855c00cb8520b23dc1069827864b2
diff --git a/patches/trebledroid/platform_frameworks_av/0009-Add-persist.sys.phh.samsung.camera_ids-property-to-a.patch b/patches/trebledroid/platform_frameworks_av/0009-Add-persist.sys.phh.samsung.camera_ids-property-to-a.patch
index 619e108..72f0f49 100644
--- a/patches/trebledroid/platform_frameworks_av/0009-Add-persist.sys.phh.samsung.camera_ids-property-to-a.patch
+++ b/patches/trebledroid/platform_frameworks_av/0009-Add-persist.sys.phh.samsung.camera_ids-property-to-a.patch
@@ -1,7 +1,7 @@
-From 0f0f9092e7db6d60e076ff8d02d5f3ccc3a16f9c Mon Sep 17 00:00:00 2001
+From 84a0b30b1e7c0aca15c76560349ccc64eafca25c Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson
Date: Thu, 14 May 2020 19:54:55 +0200
-Subject: [PATCH 09/28] Add persist.sys.phh.samsung.camera_ids property to
+Subject: [PATCH 09/22] Add persist.sys.phh.samsung.camera_ids property to
access hidden Samsung cameras
Change-Id: I2c7bf535272acc28ed2277e96c78ddd28a0b4593
@@ -11,19 +11,19 @@ Change-Id: I2c7bf535272acc28ed2277e96c78ddd28a0b4593
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/services/camera/libcameraservice/Android.bp b/services/camera/libcameraservice/Android.bp
-index 981c56942c..7c4e4d9bcd 100644
+index a45365ad53..25fd8451a9 100644
--- a/services/camera/libcameraservice/Android.bp
+++ b/services/camera/libcameraservice/Android.bp
-@@ -164,6 +164,7 @@ cc_library_shared {
+@@ -175,6 +175,7 @@ cc_library_shared {
"android.hardware.camera.device@3.6",
"android.hardware.camera.device@3.7",
- "android.hardware.camera.device-V1-ndk",
+ "android.hardware.camera.device-V2-ndk",
+ "vendor.samsung.hardware.camera.provider@3.0",
"media_permission-aidl-cpp",
],
diff --git a/services/camera/libcameraservice/common/hidl/HidlProviderInfo.cpp b/services/camera/libcameraservice/common/hidl/HidlProviderInfo.cpp
-index 630090b4ac..1acf9c2990 100644
+index 8ff5c3fb01..d498ecbee5 100644
--- a/services/camera/libcameraservice/common/hidl/HidlProviderInfo.cpp
+++ b/services/camera/libcameraservice/common/hidl/HidlProviderInfo.cpp
@@ -27,6 +27,7 @@
diff --git a/patches/trebledroid/platform_frameworks_av/0011-Add-a-property-to-force-camera-timestamp-source.patch b/patches/trebledroid/platform_frameworks_av/0010-Add-a-property-to-force-camera-timestamp-source.patch
similarity index 88%
rename from patches/trebledroid/platform_frameworks_av/0011-Add-a-property-to-force-camera-timestamp-source.patch
rename to patches/trebledroid/platform_frameworks_av/0010-Add-a-property-to-force-camera-timestamp-source.patch
index 3f3c840..57017c4 100644
--- a/patches/trebledroid/platform_frameworks_av/0011-Add-a-property-to-force-camera-timestamp-source.patch
+++ b/patches/trebledroid/platform_frameworks_av/0010-Add-a-property-to-force-camera-timestamp-source.patch
@@ -1,7 +1,7 @@
-From aa3472198d0129de4e727b23e82a1f718d34dd91 Mon Sep 17 00:00:00 2001
+From aed8d42599ec27f307fa4a6faf040304d8b46992 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson
Date: Tue, 19 May 2020 14:01:14 +0200
-Subject: [PATCH 11/28] Add a property to force camera timestamp source
+Subject: [PATCH 10/22] 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
@@ -18,10 +18,10 @@ timestamp source.
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/services/camera/libcameraservice/device3/Camera3Device.cpp b/services/camera/libcameraservice/device3/Camera3Device.cpp
-index e55d724b9f..5362312085 100644
+index 61c3298403..db2ecbc703 100644
--- a/services/camera/libcameraservice/device3/Camera3Device.cpp
+++ b/services/camera/libcameraservice/device3/Camera3Device.cpp
-@@ -194,8 +194,16 @@ status_t Camera3Device::initializeCommonLocked() {
+@@ -210,8 +210,16 @@ status_t Camera3Device::initializeCommonLocked() {
mTimestampOffset = getMonoToBoottimeOffset();
camera_metadata_entry timestampSource =
mDeviceInfo.find(ANDROID_SENSOR_INFO_TIMESTAMP_SOURCE);
diff --git a/patches/trebledroid/platform_frameworks_av/0010-Camera-Avoid-unnecessary-close-of-buffer-acquire-fen.patch b/patches/trebledroid/platform_frameworks_av/0010-Camera-Avoid-unnecessary-close-of-buffer-acquire-fen.patch
deleted file mode 100644
index 74d0a4e..0000000
--- a/patches/trebledroid/platform_frameworks_av/0010-Camera-Avoid-unnecessary-close-of-buffer-acquire-fen.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From b6c4e40b4592be217fd41e4e78dee5dc856d9e9b Mon Sep 17 00:00:00 2001
-From: Emilian Peev
-Date: Fri, 5 Aug 2022 17:28:06 -0700
-Subject: [PATCH 10/28] Camera: Avoid unnecessary close of buffer acquire fence
- fds
-
-According to the gralloc lock documentation:
-The ownership of acquireFence is always transferred to the callee, even
-on errors.
-
-Bug: 241455881
-Test: Manual using camera application
-Change-Id: Ieec34b54aaa7f0d773eccb593c3daaa3e41bae0b
-Merged-In: Ieec34b54aaa7f0d773eccb593c3daaa3e41bae0b
----
- .../camera/libcameraservice/device3/Camera3OutputStream.cpp | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/services/camera/libcameraservice/device3/Camera3OutputStream.cpp b/services/camera/libcameraservice/device3/Camera3OutputStream.cpp
-index ef12b64972..26fab414c6 100644
---- a/services/camera/libcameraservice/device3/Camera3OutputStream.cpp
-+++ b/services/camera/libcameraservice/device3/Camera3OutputStream.cpp
-@@ -331,7 +331,7 @@ status_t Camera3OutputStream::fixUpHidlJpegBlobHeader(ANativeWindowBuffer* anwBu
- status_t res =
- gbLocker.lockAsync(
- GraphicBuffer::USAGE_SW_READ_OFTEN | GraphicBuffer::USAGE_SW_WRITE_RARELY,
-- &mapped, fenceFd.get());
-+ &mapped, fenceFd.release());
- if (res != OK) {
- ALOGE("%s: Failed to lock the buffer: %s (%d)", __FUNCTION__, strerror(-res), res);
- return res;
-@@ -1327,7 +1327,7 @@ void Camera3OutputStream::dumpImageToDisk(nsecs_t timestamp,
- void* mapped = nullptr;
- base::unique_fd fenceFd(dup(fence));
- status_t res = graphicBuffer->lockAsync(GraphicBuffer::USAGE_SW_READ_OFTEN, &mapped,
-- fenceFd.get());
-+ fenceFd.release());
- if (res != OK) {
- ALOGE("%s: Failed to lock the buffer: %s (%d)", __FUNCTION__, strerror(-res), res);
- return;
---
-2.25.1
-
diff --git a/patches/trebledroid/platform_frameworks_av/0012-FIH-devices-Fix-Earpiece-audio-output.patch b/patches/trebledroid/platform_frameworks_av/0011-FIH-devices-Fix-Earpiece-audio-output.patch
similarity index 94%
rename from patches/trebledroid/platform_frameworks_av/0012-FIH-devices-Fix-Earpiece-audio-output.patch
rename to patches/trebledroid/platform_frameworks_av/0011-FIH-devices-Fix-Earpiece-audio-output.patch
index 179cc70..e38546b 100644
--- a/patches/trebledroid/platform_frameworks_av/0012-FIH-devices-Fix-Earpiece-audio-output.patch
+++ b/patches/trebledroid/platform_frameworks_av/0011-FIH-devices-Fix-Earpiece-audio-output.patch
@@ -1,7 +1,7 @@
-From 1e60052213497b6900aaad2c964874275d2dbc74 Mon Sep 17 00:00:00 2001
+From 139301c7192accbbab701366bba4bb2aafe48e4e Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson
Date: Tue, 24 Apr 2018 00:14:28 +0200
-Subject: [PATCH 12/28] FIH devices: Fix "Earpiece" audio output
+Subject: [PATCH 11/22] 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
@@ -16,7 +16,7 @@ Change-Id: I4a88ba6d34d0fcd346eeea2ca903772f0271040a
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 45ee70ab6e..2bf5705512 100644
+index 53fabcc71e..83eafc2f79 100644
--- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
+++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
@@ -416,23 +416,32 @@ std::variant PolicySerializer::deserialize
Date: Sat, 12 Sep 2020 12:32:50 +0200
-Subject: [PATCH 13/28] No longer make re-assigning legacy audio groups fatal.
+Subject: [PATCH 12/22] No longer make re-assigning legacy audio groups fatal.
Mi9 declares AUDIO_STREAM_PATCH and AUDIO_STREAM_REROUTING which is defined
by framework too
@@ -11,10 +11,10 @@ Change-Id: I794fe22d63a8af705be4f5f09b9879ecaab3eae5
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 99507eee5d..e31cc21b17 100644
+index 7d6a3087c3..356ca7645c 100644
--- a/services/audiopolicy/engine/common/src/EngineBase.cpp
+++ b/services/audiopolicy/engine/common/src/EngineBase.cpp
-@@ -222,9 +222,9 @@ engineConfig::ParsingResult EngineBase::loadAudioPolicyEngineConfig()
+@@ -223,9 +223,9 @@ engineConfig::ParsingResult EngineBase::loadAudioPolicyEngineConfig(const std::s
}
if (group.stream != AUDIO_STREAM_DEFAULT) {
// A legacy stream can be assigned once to a volume group
diff --git a/patches/trebledroid/platform_frameworks_av/0013-Make-camera-IDs-filter-out-optional.patch b/patches/trebledroid/platform_frameworks_av/0013-Make-camera-IDs-filter-out-optional.patch
new file mode 100644
index 0000000..13bd056
--- /dev/null
+++ b/patches/trebledroid/platform_frameworks_av/0013-Make-camera-IDs-filter-out-optional.patch
@@ -0,0 +1,47 @@
+From 6836703b7235859020c6e23edd97ad89f170df1a Mon Sep 17 00:00:00 2001
+From: Pierre-Hugues Husson
+Date: Mon, 21 Dec 2020 20:19:11 +0100
+Subject: [PATCH 13/22] 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 0ec647a941..bba0fedaea 100644
+--- a/services/camera/libcameraservice/common/CameraProviderManager.cpp
++++ b/services/camera/libcameraservice/common/CameraProviderManager.cpp
+@@ -265,7 +265,9 @@ std::vector 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 =
+@@ -997,10 +999,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.25.1
+
diff --git a/patches/trebledroid/platform_frameworks_av/0014-Make-camera-IDs-filter-out-optional.patch b/patches/trebledroid/platform_frameworks_av/0014-Make-camera-IDs-filter-out-optional.patch
deleted file mode 100644
index 7e1d9af..0000000
--- a/patches/trebledroid/platform_frameworks_av/0014-Make-camera-IDs-filter-out-optional.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From a10dd094dfbdc44e7ccdeab5437e6bc9925b922f Mon Sep 17 00:00:00 2001
-From: Pierre-Hugues Husson
-Date: Mon, 21 Dec 2020 20:19:11 +0100
-Subject: [PATCH 14/28] 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.
----
- .../camera/libcameraservice/common/CameraProviderManager.cpp | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
-
-diff --git a/services/camera/libcameraservice/common/CameraProviderManager.cpp b/services/camera/libcameraservice/common/CameraProviderManager.cpp
-index d9fc2ef135..292342238d 100644
---- a/services/camera/libcameraservice/common/CameraProviderManager.cpp
-+++ b/services/camera/libcameraservice/common/CameraProviderManager.cpp
-@@ -260,7 +260,9 @@ std::vector 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 =
---
-2.25.1
-
diff --git a/patches/trebledroid/platform_frameworks_av/0015-Support-Samsung-R-multi-cams.patch b/patches/trebledroid/platform_frameworks_av/0014-Support-Samsung-R-multi-cams.patch
similarity index 91%
rename from patches/trebledroid/platform_frameworks_av/0015-Support-Samsung-R-multi-cams.patch
rename to patches/trebledroid/platform_frameworks_av/0014-Support-Samsung-R-multi-cams.patch
index a8a0924..9b5db0a 100644
--- a/patches/trebledroid/platform_frameworks_av/0015-Support-Samsung-R-multi-cams.patch
+++ b/patches/trebledroid/platform_frameworks_av/0014-Support-Samsung-R-multi-cams.patch
@@ -1,7 +1,7 @@
-From e97d52e101b3e9a5db870cd06cd248ac40ed0524 Mon Sep 17 00:00:00 2001
+From b00f88c4281727344e601641b08c2f2441ebca40 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson
Date: Sat, 13 Mar 2021 14:20:03 -0500
-Subject: [PATCH 15/28] Support Samsung R multi-cams
+Subject: [PATCH 14/22] Support Samsung R multi-cams
Change-Id: If46f385e8dd16185cbf37ab083e6a1242e1d1555
---
@@ -10,19 +10,19 @@ Change-Id: If46f385e8dd16185cbf37ab083e6a1242e1d1555
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/services/camera/libcameraservice/Android.bp b/services/camera/libcameraservice/Android.bp
-index 7c4e4d9bcd..1faeb60ba7 100644
+index 25fd8451a9..3136bbd30f 100644
--- a/services/camera/libcameraservice/Android.bp
+++ b/services/camera/libcameraservice/Android.bp
-@@ -165,6 +165,7 @@ cc_library_shared {
+@@ -176,6 +176,7 @@ cc_library_shared {
"android.hardware.camera.device@3.7",
- "android.hardware.camera.device-V1-ndk",
+ "android.hardware.camera.device-V2-ndk",
"vendor.samsung.hardware.camera.provider@3.0",
+ "vendor.samsung.hardware.camera.provider@4.0",
"media_permission-aidl-cpp",
],
diff --git a/services/camera/libcameraservice/common/hidl/HidlProviderInfo.cpp b/services/camera/libcameraservice/common/hidl/HidlProviderInfo.cpp
-index 1acf9c2990..367ffb8cdc 100644
+index d498ecbee5..587d3eeda7 100644
--- a/services/camera/libcameraservice/common/hidl/HidlProviderInfo.cpp
+++ b/services/camera/libcameraservice/common/hidl/HidlProviderInfo.cpp
@@ -28,6 +28,7 @@
diff --git a/patches/trebledroid/platform_frameworks_av/0016-Don-t-crash-on-unknown-audio-devices.patch b/patches/trebledroid/platform_frameworks_av/0015-Don-t-crash-on-unknown-audio-devices.patch
similarity index 89%
rename from patches/trebledroid/platform_frameworks_av/0016-Don-t-crash-on-unknown-audio-devices.patch
rename to patches/trebledroid/platform_frameworks_av/0015-Don-t-crash-on-unknown-audio-devices.patch
index 35e1913..684c818 100644
--- a/patches/trebledroid/platform_frameworks_av/0016-Don-t-crash-on-unknown-audio-devices.patch
+++ b/patches/trebledroid/platform_frameworks_av/0015-Don-t-crash-on-unknown-audio-devices.patch
@@ -1,7 +1,7 @@
-From c187aaef80cf27f231faffa8029e2dfb89e1a1eb Mon Sep 17 00:00:00 2001
+From eb2f8fc537129eeffa0044de14466a9c3aeef808 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson
Date: Tue, 23 Mar 2021 00:16:42 +0100
-Subject: [PATCH 16/28] Don't crash on unknown audio devices
+Subject: [PATCH 15/22] Don't crash on unknown audio devices
Change-Id: I2df8d88f742da6a84aa8888cdf19de25444de919
---
@@ -9,7 +9,7 @@ Change-Id: I2df8d88f742da6a84aa8888cdf19de25444de919
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 2bf5705512..78812b1098 100644
+index 83eafc2f79..91fc5f57da 100644
--- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
+++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
@@ -867,7 +867,7 @@ std::variant PolicySerializer::deserialize
Date: Sun, 28 Mar 2021 18:54:47 +0200
-Subject: [PATCH 17/28] Not all sources in a route are valid. Dont ignore the
+Subject: [PATCH 16/22] Not all sources in a route are valid. Dont ignore the
whole route because of one broken source
Change-Id: If8a51740e71bef3a4738262ad7b43a337b0ec36d
@@ -10,7 +10,7 @@ Change-Id: If8a51740e71bef3a4738262ad7b43a337b0ec36d
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 78812b1098..9addf7dbdc 100644
+index 91fc5f57da..d2fcc13b00 100644
--- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
+++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
@@ -667,7 +667,7 @@ std::variant PolicySerializer::deserializefindPortByTagName(trim(devTag));
}
- if (source == NULL && !mIgnoreVendorExtensions) {
-+ if (source == NULL) {
++ if (source == NULL && false) {
ALOGE("%s: no source found with name=%s", __func__, devTag);
return BAD_VALUE;
} else if (source == NULL) {
diff --git a/patches/trebledroid/platform_frameworks_av/0018-Use-a-fake-volume-policy-when-none-has-been-found.patch b/patches/trebledroid/platform_frameworks_av/0017-Use-a-fake-volume-policy-when-none-has-been-found.patch
similarity index 87%
rename from patches/trebledroid/platform_frameworks_av/0018-Use-a-fake-volume-policy-when-none-has-been-found.patch
rename to patches/trebledroid/platform_frameworks_av/0017-Use-a-fake-volume-policy-when-none-has-been-found.patch
index 293ef89..fa0613e 100644
--- a/patches/trebledroid/platform_frameworks_av/0018-Use-a-fake-volume-policy-when-none-has-been-found.patch
+++ b/patches/trebledroid/platform_frameworks_av/0017-Use-a-fake-volume-policy-when-none-has-been-found.patch
@@ -1,7 +1,7 @@
-From 3e0c434220216a0fb1fa0846554bade8cb99eb4e Mon Sep 17 00:00:00 2001
+From f2fc80503fa719af9c1a2d158c798cb992707d19 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson
Date: Sun, 28 Mar 2021 14:48:49 +0200
-Subject: [PATCH 18/28] Use a fake volume policy when none has been found
+Subject: [PATCH 17/22] 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.
@@ -15,10 +15,10 @@ Change-Id: I461a3f22893ab2b1d96d67f22397369b2cae41e5
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 6f560d558d..92cf03e418 100644
+index ac117f0efb..06d2adc1a3 100644
--- a/services/audiopolicy/engine/config/src/EngineConfig.cpp
+++ b/services/audiopolicy/engine/config/src/EngineConfig.cpp
-@@ -724,7 +724,12 @@ android::status_t parseLegacyVolumeFile(const char* path, VolumeGroups &volumeGr
+@@ -717,7 +717,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()) {
diff --git a/patches/trebledroid/platform_frameworks_av/0018-Revert-Remove-support-for-audio-HAL-V2-from-the-fram.patch b/patches/trebledroid/platform_frameworks_av/0018-Revert-Remove-support-for-audio-HAL-V2-from-the-fram.patch
new file mode 100644
index 0000000..87e450d
--- /dev/null
+++ b/patches/trebledroid/platform_frameworks_av/0018-Revert-Remove-support-for-audio-HAL-V2-from-the-fram.patch
@@ -0,0 +1,154 @@
+From 487baf3933e16834bbe93ba2c154f4cb407effad Mon Sep 17 00:00:00 2001
+From: Andy CrossGate Yan
+Date: Mon, 11 Oct 2021 16:10:42 -0400
+Subject: [PATCH 18/22] 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 3c05b0b472..1426930603 100644
+--- a/media/libaudiohal/Android.bp
++++ b/media/libaudiohal/Android.bp
+@@ -23,6 +23,7 @@ cc_library_shared {
+ ],
+
+ required: [
++ "libaudiohal@2.0",
+ "libaudiohal@4.0",
+ "libaudiohal@5.0",
+ "libaudiohal@6.0",
+diff --git a/media/libaudiohal/FactoryHal.cpp b/media/libaudiohal/FactoryHal.cpp
+index f88915d7f4..24e5adbae3 100644
+--- a/media/libaudiohal/FactoryHal.cpp
++++ b/media/libaudiohal/FactoryHal.cpp
+@@ -50,7 +50,7 @@ using InterfaceName = std::pair;
+ * This list need to keep sync with AudioHalVersionInfo.VERSIONS in
+ * media/java/android/media/AudioHalVersionInfo.java.
+ */
+-static const std::array sAudioHALVersions = {
++static const std::array sAudioHALVersions = {
+ // TODO: remove this comment to get AIDL
+ // AudioHalVersionInfo(AudioHalVersionInfo::Type::AIDL, 1, 0),
+ AudioHalVersionInfo(AudioHalVersionInfo::Type::HIDL, 7, 1),
+@@ -58,6 +58,7 @@ static const std::array sAudioHALVersions = {
+ AudioHalVersionInfo(AudioHalVersionInfo::Type::HIDL, 6, 0),
+ AudioHalVersionInfo(AudioHalVersionInfo::Type::HIDL, 5, 0),
+ AudioHalVersionInfo(AudioHalVersionInfo::Type::HIDL, 4, 0),
++ AudioHalVersionInfo(AudioHalVersionInfo::Type::HIDL, 2, 0),
+ };
+
+ static const std::map sDevicesHALInterfaces = {
+diff --git a/media/libaudiohal/impl/Android.bp b/media/libaudiohal/impl/Android.bp
+index 09e70ebfb8..78050513ae 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@4.0",
+ defaults: [
+diff --git a/media/libaudiohal/impl/DeviceHalHidl.cpp b/media/libaudiohal/impl/DeviceHalHidl.cpp
+index 826461f9a5..b05c9e1427 100644
+--- a/media/libaudiohal/impl/DeviceHalHidl.cpp
++++ b/media/libaudiohal/impl/DeviceHalHidl.cpp
+@@ -574,6 +574,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;
+@@ -596,11 +597,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 DeviceHalHidl::getHwAvSync() {
+ TIME_CHECK();
+ if (mDevice == 0) return NO_INIT;
++#if MAJOR_VERSION > 2
+ audio_hw_sync_t value;
+ Result result;
+ Return ret = mDevice->getHwAvSync([&value, &result](Result r, audio_hw_sync_t v) {
+@@ -609,6 +616,9 @@ error::Result DeviceHalHidl::getHwAvSync() {
+ });
+ RETURN_IF_ERROR(processReturn("getHwAvSync", ret, result));
+ return value;
++#else
++ return 0xdeadbeef;
++#endif
+ }
+
+ status_t DeviceHalHidl::dump(int fd, const Vector& args) {
+diff --git a/media/libaudiohal/impl/DevicesFactoryHalHidl.cpp b/media/libaudiohal/impl/DevicesFactoryHalHidl.cpp
+index eef60b506c..e303e54b41 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 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, spopenDevice_7_1(
+ #else
+--
+2.25.1
+
diff --git a/patches/trebledroid/platform_frameworks_av/0023-Add-a-prop-to-change-Samsung-flash-strength.patch b/patches/trebledroid/platform_frameworks_av/0019-Add-a-prop-to-change-Samsung-flash-strength.patch
similarity index 67%
rename from patches/trebledroid/platform_frameworks_av/0023-Add-a-prop-to-change-Samsung-flash-strength.patch
rename to patches/trebledroid/platform_frameworks_av/0019-Add-a-prop-to-change-Samsung-flash-strength.patch
index fda025d..c11c064 100644
--- a/patches/trebledroid/platform_frameworks_av/0023-Add-a-prop-to-change-Samsung-flash-strength.patch
+++ b/patches/trebledroid/platform_frameworks_av/0019-Add-a-prop-to-change-Samsung-flash-strength.patch
@@ -1,38 +1,40 @@
-From 618216bf303f76f6cb62d04de25eefe0d4a39494 Mon Sep 17 00:00:00 2001
+From 62e86c3346659667a1902917ce148d0f079a0089 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson
Date: Sat, 16 Apr 2022 14:30:14 -0400
-Subject: [PATCH 23/28] Add a prop to change Samsung flash strength
+Subject: [PATCH 19/22] Add a prop to change Samsung flash strength
---
- services/camera/libcameraservice/Android.bp | 1 +
- .../common/hidl/HidlProviderInfo.cpp | 14 +++++++++++++-
- 2 files changed, 14 insertions(+), 1 deletion(-)
+ 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 1faeb60ba7..8c588065cf 100644
+index 3136bbd30f..7ef870c1eb 100644
--- a/services/camera/libcameraservice/Android.bp
+++ b/services/camera/libcameraservice/Android.bp
-@@ -166,6 +166,7 @@ cc_library_shared {
- "android.hardware.camera.device-V1-ndk",
+@@ -177,6 +177,8 @@ cc_library_shared {
+ "android.hardware.camera.device-V2-ndk",
"vendor.samsung.hardware.camera.provider@3.0",
"vendor.samsung.hardware.camera.provider@4.0",
+ "vendor.samsung.hardware.camera.device@5.0",
++ "vendor.samsung.hardware.camera.device@4.0",
"media_permission-aidl-cpp",
],
diff --git a/services/camera/libcameraservice/common/hidl/HidlProviderInfo.cpp b/services/camera/libcameraservice/common/hidl/HidlProviderInfo.cpp
-index 367ffb8cdc..362945a1ea 100644
+index 587d3eeda7..a345d6a2bf 100644
--- a/services/camera/libcameraservice/common/hidl/HidlProviderInfo.cpp
+++ b/services/camera/libcameraservice/common/hidl/HidlProviderInfo.cpp
-@@ -29,6 +29,7 @@
+@@ -29,6 +29,8 @@
#include
#include
#include
+#include
++#include
namespace {
const bool kEnableLazyHal(property_get_bool("ro.camera.enableLazyHal", false));
-@@ -781,7 +782,18 @@ HidlProviderInfo::HidlDeviceInfo3::HidlDeviceInfo3(
+@@ -783,7 +785,23 @@ HidlProviderInfo::HidlDeviceInfo3::HidlDeviceInfo3(
status_t HidlProviderInfo::HidlDeviceInfo3::setTorchMode(bool enabled) {
using hardware::camera::common::V1_0::TorchMode;
const sp interface = startDeviceInterface();
@@ -42,9 +44,14 @@ index 367ffb8cdc..362945a1ea 100644
+ auto sehCast = vendor::samsung::hardware::camera::device::V5_0::ISehCameraDevice::castFrom(interface);
+ android::sp seh = sehCast;
+
++ auto sehCast2 = vendor::samsung::hardware::camera::device::V4_0::ISehCameraDevice::castFrom(interface);
++ android::sp 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);
+ }
diff --git a/patches/trebledroid/platform_frameworks_av/0019-When-aux-cameras-are-enabled-ignore-system-only-came.patch b/patches/trebledroid/platform_frameworks_av/0019-When-aux-cameras-are-enabled-ignore-system-only-came.patch
deleted file mode 100644
index 47e2b25..0000000
--- a/patches/trebledroid/platform_frameworks_av/0019-When-aux-cameras-are-enabled-ignore-system-only-came.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From bf517313198b46533ea87c534a0d7592eb6573ce Mon Sep 17 00:00:00 2001
-From: Pierre-Hugues Husson
-Date: Sat, 7 Aug 2021 11:11:39 +0200
-Subject: [PATCH 19/28] When aux cameras are enabled, ignore "system only"
- camera flag (it shouldnt be q security issue since secure cameras are listed
- otherwise)
-
----
- .../libcameraservice/common/CameraProviderManager.cpp | 10 ++++++----
- 1 file changed, 6 insertions(+), 4 deletions(-)
-
-diff --git a/services/camera/libcameraservice/common/CameraProviderManager.cpp b/services/camera/libcameraservice/common/CameraProviderManager.cpp
-index 292342238d..4a2fb94da3 100644
---- a/services/camera/libcameraservice/common/CameraProviderManager.cpp
-+++ b/services/camera/libcameraservice/common/CameraProviderManager.cpp
-@@ -978,10 +978,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.25.1
-
diff --git a/patches/trebledroid/platform_frameworks_av/0020-Revert-Remove-support-for-audio-HAL-V2-from-the-fram.patch b/patches/trebledroid/platform_frameworks_av/0020-Revert-Remove-support-for-audio-HAL-V2-from-the-fram.patch
deleted file mode 100644
index b675115..0000000
--- a/patches/trebledroid/platform_frameworks_av/0020-Revert-Remove-support-for-audio-HAL-V2-from-the-fram.patch
+++ /dev/null
@@ -1,81 +0,0 @@
-From ddbd0ab98d69ddaa73ee765432de3573208ad9dc Mon Sep 17 00:00:00 2001
-From: Pierre-Hugues Husson
-Date: Mon, 11 Oct 2021 16:10:42 -0400
-Subject: [PATCH 20/28] 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/FactoryHalHidl.cpp | 5 +++--
- media/libaudiohal/impl/Android.bp | 18 ++++++++++++++++++
- 3 files changed, 22 insertions(+), 2 deletions(-)
-
-diff --git a/media/libaudiohal/Android.bp b/media/libaudiohal/Android.bp
-index 5f63e8de04..aa1d825d2f 100644
---- a/media/libaudiohal/Android.bp
-+++ b/media/libaudiohal/Android.bp
-@@ -23,6 +23,7 @@ cc_library_shared {
- ],
-
- required: [
-+ "libaudiohal@2.0",
- "libaudiohal@4.0",
- "libaudiohal@5.0",
- "libaudiohal@6.0",
-diff --git a/media/libaudiohal/FactoryHalHidl.cpp b/media/libaudiohal/FactoryHalHidl.cpp
-index 590fec5443..46b6bd757a 100644
---- a/media/libaudiohal/FactoryHalHidl.cpp
-+++ b/media/libaudiohal/FactoryHalHidl.cpp
-@@ -36,12 +36,13 @@ namespace {
- */
- #define CONC_VERSION(maj, min) #maj "." #min
- #define DECLARE_VERSION(maj, min) std::make_pair(std::make_pair(maj, min), CONC_VERSION(maj, min))
--static constexpr std::array, const char*>, 5> sAudioHALVersions = {
-+static constexpr std::array, const char*>, 6> sAudioHALVersions = {
- DECLARE_VERSION(7, 1),
- DECLARE_VERSION(7, 0),
- DECLARE_VERSION(6, 0),
- DECLARE_VERSION(5, 0),
-- DECLARE_VERSION(4, 0)
-+ DECLARE_VERSION(4, 0),
-+ DECLARE_VERSION(2, 0)
- };
-
- bool createHalService(const std::string& version, const std::string& interface,
-diff --git a/media/libaudiohal/impl/Android.bp b/media/libaudiohal/impl/Android.bp
-index d30883a95c..7bba88ca0a 100644
---- a/media/libaudiohal/impl/Android.bp
-+++ b/media/libaudiohal/impl/Android.bp
-@@ -68,6 +68,24 @@ cc_defaults {
- ],
- }
-
-+cc_library_shared {
-+ name: "libaudiohal@2.0",
-+ defaults: ["libaudiohal_default"],
-+ 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@4.0",
- defaults: ["libaudiohal_default"],
---
-2.25.1
-
diff --git a/patches/trebledroid/platform_frameworks_av/0025-voip-Fix-high-pitched-voice-on-Qualcomm-devices.patch b/patches/trebledroid/platform_frameworks_av/0020-voip-Fix-high-pitched-voice-on-Qualcomm-devices.patch
similarity index 92%
rename from patches/trebledroid/platform_frameworks_av/0025-voip-Fix-high-pitched-voice-on-Qualcomm-devices.patch
rename to patches/trebledroid/platform_frameworks_av/0020-voip-Fix-high-pitched-voice-on-Qualcomm-devices.patch
index 9134a35..dd3624e 100644
--- a/patches/trebledroid/platform_frameworks_av/0025-voip-Fix-high-pitched-voice-on-Qualcomm-devices.patch
+++ b/patches/trebledroid/platform_frameworks_av/0020-voip-Fix-high-pitched-voice-on-Qualcomm-devices.patch
@@ -1,14 +1,14 @@
-From 43d61efb58d846901e3d08925537fe2710717917 Mon Sep 17 00:00:00 2001
+From 826b61a88791da133524738277ca1df6369cce9e Mon Sep 17 00:00:00 2001
From: ponces
Date: Mon, 24 Oct 2022 09:38:34 +0100
-Subject: [PATCH 25/28] voip: Fix high pitched voice on Qualcomm devices
+Subject: [PATCH 20/22] 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 95d2463230..ef310977b2 100644
+index d2fcc13b00..fc6cc72c1c 100644
--- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
+++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
@@ -252,6 +252,7 @@ private:
diff --git a/patches/trebledroid/platform_frameworks_av/0021-Fix-parsing-audio-hal-7.0-audio-policies.patch b/patches/trebledroid/platform_frameworks_av/0021-Fix-parsing-audio-hal-7.0-audio-policies.patch
deleted file mode 100644
index 19eca94..0000000
--- a/patches/trebledroid/platform_frameworks_av/0021-Fix-parsing-audio-hal-7.0-audio-policies.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From e67d36dfa5bfad87870ad8c5fb3cba154ab05048 Mon Sep 17 00:00:00 2001
-From: Pierre-Hugues Husson
-Date: Sun, 30 Jan 2022 07:40:19 -0500
-Subject: [PATCH 21/28] Fix parsing audio hal 7.0 audio policies
-
-Google changed separator from natural "," to weird " "
-We broke its support in "FIH devices: Fix "Earpiece" audio output"
-
-Change-Id: I458b8b6a6498dd9cf748e00843ff65c561579902
----
- .../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 9addf7dbdc..9d3d9fd169 100644
---- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
-+++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
-@@ -428,7 +428,7 @@ PolicySerializer::deserialize(
- 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, ",");
-+ 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) {
---
-2.25.1
-
diff --git a/patches/trebledroid/platform_frameworks_av/0028-audiopolicy-Fix-broken-mic-while-video-recording-on-.patch b/patches/trebledroid/platform_frameworks_av/0021-audiopolicy-Fix-broken-mic-while-video-recording-on-.patch
similarity index 94%
rename from patches/trebledroid/platform_frameworks_av/0028-audiopolicy-Fix-broken-mic-while-video-recording-on-.patch
rename to patches/trebledroid/platform_frameworks_av/0021-audiopolicy-Fix-broken-mic-while-video-recording-on-.patch
index ab324a5..f7c77f6 100644
--- a/patches/trebledroid/platform_frameworks_av/0028-audiopolicy-Fix-broken-mic-while-video-recording-on-.patch
+++ b/patches/trebledroid/platform_frameworks_av/0021-audiopolicy-Fix-broken-mic-while-video-recording-on-.patch
@@ -1,7 +1,7 @@
-From 4d5623f0dd2196fbe8adf26895133d65faeac7ef Mon Sep 17 00:00:00 2001
+From e7ad97b0d5b482e6f857d4650c847653723a6699 Mon Sep 17 00:00:00 2001
From: Alberto Ponces
Date: Sun, 30 Apr 2023 23:29:04 +0100
-Subject: [PATCH 28/28] audiopolicy: Fix broken mic while video recording on
+Subject: [PATCH 21/22] 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
@@ -12,7 +12,7 @@ Subject: [PATCH 28/28] audiopolicy: Fix broken mic while video recording on
1 file changed, 18 insertions(+), 11 deletions(-)
diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
-index ef310977b2..da2842656a 100644
+index fc6cc72c1c..8b3a1f0e4f 100644
--- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
+++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
@@ -660,6 +660,9 @@ std::variant PolicySerializer::deserialize
+Date: Mon, 30 Oct 2023 10:30:58 -0400
+Subject: [PATCH 22/22] 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 8b3a1f0e4f..913cbc0e90 100644
+--- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
++++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
+@@ -504,6 +504,10 @@ std::variant PolicySerializer::deserialize
-Date: Sat, 12 Mar 2022 18:07:43 -0500
-Subject: [PATCH 22/28] fixup! Not all sources in a route are valid. Dont
- ignore the whole route because of one broken source
-
----
- .../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 9d3d9fd169..95d2463230 100644
---- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
-+++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
-@@ -667,7 +667,7 @@ std::variant PolicySerializer::deserializefindPortByTagName(trim(devTag));
- }
-- if (source == NULL) {
-+ if (source == NULL && false) {
- ALOGE("%s: no source found with name=%s", __func__, devTag);
- return BAD_VALUE;
- } else if (source == NULL) {
---
-2.25.1
-
diff --git a/patches/trebledroid/platform_frameworks_av/0024-Support-variable-flash-strength-on-samsung-hal-4.0.patch b/patches/trebledroid/platform_frameworks_av/0024-Support-variable-flash-strength-on-samsung-hal-4.0.patch
deleted file mode 100644
index b9c0fcc..0000000
--- a/patches/trebledroid/platform_frameworks_av/0024-Support-variable-flash-strength-on-samsung-hal-4.0.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-From 77d472080eb00e2da0d4892bfb9426d7977517c0 Mon Sep 17 00:00:00 2001
-From: Pierre-Hugues Husson
-Date: Mon, 2 May 2022 17:37:09 -0400
-Subject: [PATCH 24/28] Support variable flash strength on samsung hal 4.0
-
----
- services/camera/libcameraservice/Android.bp | 1 +
- .../libcameraservice/common/hidl/HidlProviderInfo.cpp | 6 ++++++
- 2 files changed, 7 insertions(+)
-
-diff --git a/services/camera/libcameraservice/Android.bp b/services/camera/libcameraservice/Android.bp
-index 8c588065cf..769862aaa2 100644
---- a/services/camera/libcameraservice/Android.bp
-+++ b/services/camera/libcameraservice/Android.bp
-@@ -167,6 +167,7 @@ cc_library_shared {
- "vendor.samsung.hardware.camera.provider@3.0",
- "vendor.samsung.hardware.camera.provider@4.0",
- "vendor.samsung.hardware.camera.device@5.0",
-+ "vendor.samsung.hardware.camera.device@4.0",
- "media_permission-aidl-cpp",
- ],
-
-diff --git a/services/camera/libcameraservice/common/hidl/HidlProviderInfo.cpp b/services/camera/libcameraservice/common/hidl/HidlProviderInfo.cpp
-index 362945a1ea..62c57cd4f7 100644
---- a/services/camera/libcameraservice/common/hidl/HidlProviderInfo.cpp
-+++ b/services/camera/libcameraservice/common/hidl/HidlProviderInfo.cpp
-@@ -30,6 +30,7 @@
- #include
- #include
- #include
-+#include
-
- namespace {
- const bool kEnableLazyHal(property_get_bool("ro.camera.enableLazyHal", false));
-@@ -787,9 +788,14 @@ status_t HidlProviderInfo::HidlDeviceInfo3::setTorchMode(bool enabled) {
- auto sehCast = vendor::samsung::hardware::camera::device::V5_0::ISehCameraDevice::castFrom(interface);
- android::sp seh = sehCast;
-
-+ auto sehCast2 = vendor::samsung::hardware::camera::device::V4_0::ISehCameraDevice::castFrom(interface);
-+ android::sp 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);
- }
---
-2.25.1
-
diff --git a/patches/trebledroid/platform_frameworks_av/0026-Fix-audio-hal-2.0-support.-Fixup-of-Revert-Remove-su.patch b/patches/trebledroid/platform_frameworks_av/0026-Fix-audio-hal-2.0-support.-Fixup-of-Revert-Remove-su.patch
deleted file mode 100644
index a06bee9..0000000
--- a/patches/trebledroid/platform_frameworks_av/0026-Fix-audio-hal-2.0-support.-Fixup-of-Revert-Remove-su.patch
+++ /dev/null
@@ -1,93 +0,0 @@
-From 4c5cbb119984594bbb783dca00bf905121710a44 Mon Sep 17 00:00:00 2001
-From: Pierre-Hugues Husson
-Date: Wed, 9 Nov 2022 17:10:52 -0500
-Subject: [PATCH 26/28] Fix audio hal 2.0 support. Fixup of Revert "Remove
- support for audio HAL V2 from the framework"
-
----
- media/libaudiohal/impl/Android.bp | 5 +++++
- media/libaudiohal/impl/DeviceHalHidl.cpp | 10 ++++++++++
- media/libaudiohal/impl/DevicesFactoryHalHidl.cpp | 4 ++++
- 3 files changed, 19 insertions(+)
-
-diff --git a/media/libaudiohal/impl/Android.bp b/media/libaudiohal/impl/Android.bp
-index 7bba88ca0a..e53289c935 100644
---- a/media/libaudiohal/impl/Android.bp
-+++ b/media/libaudiohal/impl/Android.bp
-@@ -71,6 +71,11 @@ cc_defaults {
- cc_library_shared {
- name: "libaudiohal@2.0",
- defaults: ["libaudiohal_default"],
-+ srcs: [
-+ ":audio_core_hal_client_sources",
-+ ":audio_effect_hal_client_sources",
-+ "EffectsFactoryHalHidlEntry.cpp",
-+ ],
- shared_libs: [
- "android.hardware.audio.common@2.0",
- "android.hardware.audio.common@2.0-util",
-diff --git a/media/libaudiohal/impl/DeviceHalHidl.cpp b/media/libaudiohal/impl/DeviceHalHidl.cpp
-index 0cdf621c7a..1dffa87c90 100644
---- a/media/libaudiohal/impl/DeviceHalHidl.cpp
-+++ b/media/libaudiohal/impl/DeviceHalHidl.cpp
-@@ -516,6 +516,7 @@ status_t DeviceHalHidl::removeDeviceEffect(
- status_t DeviceHalHidl::setConnectedState(const struct audio_port_v7 *port, bool connected) {
- TIME_CHECK();
- if (mDevice == 0) return NO_INIT;
-+#if MAJOR_VERSION > 2
- #if MAJOR_VERSION == 7 && MINOR_VERSION == 1
- if (supportsSetConnectedState7_1) {
- AudioPort hidlPort;
-@@ -538,11 +539,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 DeviceHalHidl::getHwAvSync() {
- TIME_CHECK();
- if (mDevice == 0) return NO_INIT;
-+#if MAJOR_VERSION > 2
- audio_hw_sync_t value;
- Result result;
- Return ret = mDevice->getHwAvSync([&value, &result](Result r, audio_hw_sync_t v) {
-@@ -551,6 +558,9 @@ error::Result DeviceHalHidl::getHwAvSync() {
- });
- RETURN_IF_ERROR(processReturn("getHwAvSync", ret, result));
- return value;
-+#else
-+ return 0xdeadbeef;
-+#endif
- }
-
- status_t DeviceHalHidl::dump(int fd, const Vector& args) {
-diff --git a/media/libaudiohal/impl/DevicesFactoryHalHidl.cpp b/media/libaudiohal/impl/DevicesFactoryHalHidl.cpp
-index 4069a6bdbd..e9d2af5d2c 100644
---- a/media/libaudiohal/impl/DevicesFactoryHalHidl.cpp
-+++ b/media/libaudiohal/impl/DevicesFactoryHalHidl.cpp
-@@ -114,6 +114,7 @@ status_t DevicesFactoryHalHidl::openDevice(const char *name, sp 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.
-@@ -130,6 +131,9 @@ status_t DevicesFactoryHalHidl::openDevice(const char *name, spopenDevice_7_1(
- #else
---
-2.25.1
-
diff --git a/patches/trebledroid/platform_frameworks_av/0027-Allow-uname-syscall-in-all-seccomp-This-is-needed-be.patch b/patches/trebledroid/platform_frameworks_av/0027-Allow-uname-syscall-in-all-seccomp-This-is-needed-be.patch
deleted file mode 100644
index 035c39d..0000000
--- a/patches/trebledroid/platform_frameworks_av/0027-Allow-uname-syscall-in-all-seccomp-This-is-needed-be.patch
+++ /dev/null
@@ -1,168 +0,0 @@
-From f019bfa8bb659871cff711acb8ed798b7d1c323c Mon Sep 17 00:00:00 2001
-From: Pierre-Hugues Husson
-Date: Wed, 29 Mar 2023 16:53:18 -0400
-Subject: [PATCH 27/28] Allow uname syscall in all seccomp -- This is needed
- because of the getCallingSid change in fw/n libbinder
-
----
- services/mediacodec/seccomp_policy/mediacodec-arm.policy | 2 ++
- services/mediacodec/seccomp_policy/mediacodec-arm64.policy | 2 ++
- services/mediacodec/seccomp_policy/mediacodec-x86.policy | 2 ++
- services/mediacodec/seccomp_policy/mediacodec-x86_64.policy | 2 ++
- services/mediacodec/seccomp_policy/mediaswcodec-arm.policy | 2 ++
- services/mediacodec/seccomp_policy/mediaswcodec-arm64.policy | 2 ++
- services/mediacodec/seccomp_policy/mediaswcodec-x86.policy | 2 ++
- services/mediacodec/seccomp_policy/mediaswcodec-x86_64.policy | 2 ++
- .../mediaextractor/seccomp_policy/mediaextractor-arm.policy | 2 ++
- .../mediaextractor/seccomp_policy/mediaextractor-arm64.policy | 2 ++
- .../mediaextractor/seccomp_policy/mediaextractor-x86.policy | 2 ++
- .../mediaextractor/seccomp_policy/mediaextractor-x86_64.policy | 2 ++
- 12 files changed, 24 insertions(+)
-
-diff --git a/services/mediacodec/seccomp_policy/mediacodec-arm.policy b/services/mediacodec/seccomp_policy/mediacodec-arm.policy
-index b4a9ff6249..aa6fc70d45 100644
---- a/services/mediacodec/seccomp_policy/mediacodec-arm.policy
-+++ b/services/mediacodec/seccomp_policy/mediacodec-arm.policy
-@@ -58,6 +58,8 @@ ugetrlimit: 1
- getdents64: 1
- getrandom: 1
-
-+uname: 1
-+
- @include /system/etc/seccomp_policy/crash_dump.arm.policy
-
- @include /system/etc/seccomp_policy/code_coverage.arm.policy
-diff --git a/services/mediacodec/seccomp_policy/mediacodec-arm64.policy b/services/mediacodec/seccomp_policy/mediacodec-arm64.policy
-index b4a9ff6249..aa6fc70d45 100644
---- a/services/mediacodec/seccomp_policy/mediacodec-arm64.policy
-+++ b/services/mediacodec/seccomp_policy/mediacodec-arm64.policy
-@@ -58,6 +58,8 @@ ugetrlimit: 1
- getdents64: 1
- getrandom: 1
-
-+uname: 1
-+
- @include /system/etc/seccomp_policy/crash_dump.arm.policy
-
- @include /system/etc/seccomp_policy/code_coverage.arm.policy
-diff --git a/services/mediacodec/seccomp_policy/mediacodec-x86.policy b/services/mediacodec/seccomp_policy/mediacodec-x86.policy
-index 4bcc077ce8..3a08ff6f09 100644
---- a/services/mediacodec/seccomp_policy/mediacodec-x86.policy
-+++ b/services/mediacodec/seccomp_policy/mediacodec-x86.policy
-@@ -69,5 +69,7 @@ sched_yield: 1
- getpid: 1
- gettid: 1
-
-+uname: 1
-+
- @include /system/etc/seccomp_policy/crash_dump.x86.policy
- @include /system/etc/seccomp_policy/code_coverage.x86.policy
-diff --git a/services/mediacodec/seccomp_policy/mediacodec-x86_64.policy b/services/mediacodec/seccomp_policy/mediacodec-x86_64.policy
-index 4bcc077ce8..3a08ff6f09 100644
---- a/services/mediacodec/seccomp_policy/mediacodec-x86_64.policy
-+++ b/services/mediacodec/seccomp_policy/mediacodec-x86_64.policy
-@@ -69,5 +69,7 @@ sched_yield: 1
- getpid: 1
- gettid: 1
-
-+uname: 1
-+
- @include /system/etc/seccomp_policy/crash_dump.x86.policy
- @include /system/etc/seccomp_policy/code_coverage.x86.policy
-diff --git a/services/mediacodec/seccomp_policy/mediaswcodec-arm.policy b/services/mediacodec/seccomp_policy/mediaswcodec-arm.policy
-index 41efce08b1..3c74e077c6 100644
---- a/services/mediacodec/seccomp_policy/mediaswcodec-arm.policy
-+++ b/services/mediacodec/seccomp_policy/mediaswcodec-arm.policy
-@@ -86,4 +86,6 @@ getegid32: 1
- getgroups32: 1
- sysinfo: 1
-
-+uname: 1
-+
- @include /apex/com.android.media.swcodec/etc/seccomp_policy/code_coverage.arm.policy
-diff --git a/services/mediacodec/seccomp_policy/mediaswcodec-arm64.policy b/services/mediacodec/seccomp_policy/mediaswcodec-arm64.policy
-index 4317cccfdd..9d9b11538f 100644
---- a/services/mediacodec/seccomp_policy/mediaswcodec-arm64.policy
-+++ b/services/mediacodec/seccomp_policy/mediaswcodec-arm64.policy
-@@ -90,4 +90,6 @@ sysinfo: 1
- setsockopt: 1
- sendmsg: 1
-
-+uname: 1
-+
- @include /apex/com.android.media.swcodec/etc/seccomp_policy/code_coverage.arm64.policy
-diff --git a/services/mediacodec/seccomp_policy/mediaswcodec-x86.policy b/services/mediacodec/seccomp_policy/mediaswcodec-x86.policy
-index 9bafe7bc55..4d9192cfe9 100644
---- a/services/mediacodec/seccomp_policy/mediaswcodec-x86.policy
-+++ b/services/mediacodec/seccomp_policy/mediaswcodec-x86.policy
-@@ -69,5 +69,7 @@ sched_yield: 1
- getpid: 1
- gettid: 1
-
-+uname: 1
-+
- @include /apex/com.android.media.swcodec/etc/seccomp_policy/crash_dump.x86.policy
- @include /apex/com.android.media.swcodec/etc/seccomp_policy/code_coverage.x86.policy
-diff --git a/services/mediacodec/seccomp_policy/mediaswcodec-x86_64.policy b/services/mediacodec/seccomp_policy/mediaswcodec-x86_64.policy
-index b0ed0402bb..607d8dadd8 100644
---- a/services/mediacodec/seccomp_policy/mediaswcodec-x86_64.policy
-+++ b/services/mediacodec/seccomp_policy/mediaswcodec-x86_64.policy
-@@ -69,5 +69,7 @@ sched_yield: 1
- getpid: 1
- gettid: 1
-
-+uname: 1
-+
- @include /apex/com.android.media.swcodec/etc/seccomp_policy/crash_dump.x86_64.policy
- @include /apex/com.android.media.swcodec/etc/seccomp_policy/code_coverage.x86_64.policy
-diff --git a/services/mediaextractor/seccomp_policy/mediaextractor-arm.policy b/services/mediaextractor/seccomp_policy/mediaextractor-arm.policy
-index e1f7fe7265..435f76cf9d 100644
---- a/services/mediaextractor/seccomp_policy/mediaextractor-arm.policy
-+++ b/services/mediaextractor/seccomp_policy/mediaextractor-arm.policy
-@@ -60,5 +60,7 @@ mremap: arg3 == 3 || arg3 == MREMAP_MAYMOVE
- readlinkat: 1
- _llseek: 1
-
-+uname: 1
-+
- @include /apex/com.android.media/etc/seccomp_policy/crash_dump.arm.policy
- @include /apex/com.android.media/etc/seccomp_policy/code_coverage.arm.policy
-diff --git a/services/mediaextractor/seccomp_policy/mediaextractor-arm64.policy b/services/mediaextractor/seccomp_policy/mediaextractor-arm64.policy
-index e54c9187e7..c2be7cf820 100644
---- a/services/mediaextractor/seccomp_policy/mediaextractor-arm64.policy
-+++ b/services/mediaextractor/seccomp_policy/mediaextractor-arm64.policy
-@@ -57,5 +57,7 @@ setsockopt: 1
- sendmsg: 1
- set_tid_address: 1
-
-+uname: 1
-+
- @include /apex/com.android.media/etc/seccomp_policy/crash_dump.arm64.policy
- @include /apex/com.android.media/etc/seccomp_policy/code_coverage.arm64.policy
-diff --git a/services/mediaextractor/seccomp_policy/mediaextractor-x86.policy b/services/mediaextractor/seccomp_policy/mediaextractor-x86.policy
-index 5b3762712d..5897402ca1 100644
---- a/services/mediaextractor/seccomp_policy/mediaextractor-x86.policy
-+++ b/services/mediaextractor/seccomp_policy/mediaextractor-x86.policy
-@@ -59,5 +59,7 @@ sched_yield: 1
- getpid: 1
- gettid: 1
-
-+uname: 1
-+
- @include /apex/com.android.media/etc/seccomp_policy/crash_dump.x86.policy
- @include /apex/com.android.media/etc/seccomp_policy/code_coverage.x86.policy
-diff --git a/services/mediaextractor/seccomp_policy/mediaextractor-x86_64.policy b/services/mediaextractor/seccomp_policy/mediaextractor-x86_64.policy
-index 51df1a238d..6846c01d0e 100644
---- a/services/mediaextractor/seccomp_policy/mediaextractor-x86_64.policy
-+++ b/services/mediaextractor/seccomp_policy/mediaextractor-x86_64.policy
-@@ -53,5 +53,7 @@ sched_yield: 1
- getpid: 1
- gettid: 1
-
-+uname: 1
-+
- @include /apex/com.android.media/etc/seccomp_policy/crash_dump.x86_64.policy
- @include /apex/com.android.media/etc/seccomp_policy/code_coverage.x86_64.policy
---
-2.25.1
-
diff --git a/patches/trebledroid/platform_frameworks_base/0001-Disable-vendor-mismatch-warning.patch b/patches/trebledroid/platform_frameworks_base/0001-Disable-vendor-mismatch-warning.patch
index ae3805b..1cdd2b3 100644
--- a/patches/trebledroid/platform_frameworks_base/0001-Disable-vendor-mismatch-warning.patch
+++ b/patches/trebledroid/platform_frameworks_base/0001-Disable-vendor-mismatch-warning.patch
@@ -1,7 +1,7 @@
-From 916f0264f7aa78581213998e436888896137aa2f Mon Sep 17 00:00:00 2001
+From b8163cd4046c6bbfd36cbe82113e532881ad70bf Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan
Date: Thu, 5 Apr 2018 10:01:19 +0800
-Subject: [PATCH 01/43] Disable vendor mismatch warning
+Subject: [PATCH 01/48] Disable vendor mismatch warning
Change-Id: Ieb8fe91e2f02462f074312ed0f4885d183e9780b
---
@@ -9,10 +9,10 @@ Change-Id: Ieb8fe91e2f02462f074312ed0f4885d183e9780b
1 file changed, 2 insertions(+), 14 deletions(-)
diff --git a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
-index b89a3c5edc39..eb51d07cc93a 100644
+index 13812e9bd9d2..cf3f28639d4d 100644
--- a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
+++ b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
-@@ -5847,20 +5847,8 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
+@@ -6081,20 +6081,8 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
}
if (!Build.isBuildConsistent()) {
@@ -36,5 +36,5 @@ index b89a3c5edc39..eb51d07cc93a 100644
}
}
--
-2.37.1 (Apple Git-137.1)
+2.41.0
diff --git a/patches/trebledroid/platform_frameworks_base/0002-Fallback-to-stupid-autobrightness-if-brightness-valu.patch b/patches/trebledroid/platform_frameworks_base/0002-Fallback-to-stupid-autobrightness-if-brightness-valu.patch
index 9bb7012..11be9cd 100644
--- a/patches/trebledroid/platform_frameworks_base/0002-Fallback-to-stupid-autobrightness-if-brightness-valu.patch
+++ b/patches/trebledroid/platform_frameworks_base/0002-Fallback-to-stupid-autobrightness-if-brightness-valu.patch
@@ -1,7 +1,7 @@
-From caea872564bc75853d64c1da774b930fd1708472 Mon Sep 17 00:00:00 2001
+From a745957dda8ed7cac3a8f13d41a6f8c059b96d95 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson
Date: Tue, 5 Oct 2021 17:59:16 -0400
-Subject: [PATCH 02/43] Fallback to stupid autobrightness if brightness values
+Subject: [PATCH 02/48] Fallback to stupid autobrightness if brightness values
are broken
This is needed because of:
@@ -14,10 +14,10 @@ Change-Id: Ieb679b34239013a5e31b34cb010b12febd9ef6d9
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 482dd7a726b2..44150f8f68d0 100644
+index 7a797dd2250c..3af484071e43 100644
--- a/services/core/java/com/android/server/display/DisplayDeviceConfig.java
+++ b/services/core/java/com/android/server/display/DisplayDeviceConfig.java
-@@ -676,9 +676,14 @@ public class DisplayDeviceConfig {
+@@ -732,9 +732,14 @@ public class DisplayDeviceConfig {
* @return A configuration instance.
*/
public static DisplayDeviceConfig create(Context context, boolean useConfigXml) {
@@ -35,5 +35,5 @@ index 482dd7a726b2..44150f8f68d0 100644
config = getConfigFromPmValues(context);
}
--
-2.37.1 (Apple Git-137.1)
+2.41.0
diff --git a/patches/trebledroid/platform_frameworks_base/0003-Fix-env-empty-string-ANDROID_STORAGE.patch b/patches/trebledroid/platform_frameworks_base/0003-Fix-env-empty-string-ANDROID_STORAGE.patch
index 027bf1d..6d69701 100644
--- a/patches/trebledroid/platform_frameworks_base/0003-Fix-env-empty-string-ANDROID_STORAGE.patch
+++ b/patches/trebledroid/platform_frameworks_base/0003-Fix-env-empty-string-ANDROID_STORAGE.patch
@@ -1,7 +1,7 @@
-From 2738638649e501c099d41fd25499b5b359b7cd78 Mon Sep 17 00:00:00 2001
+From 45b3da3a120fa8ab20427caf1ef140fd16a1c892 Mon Sep 17 00:00:00 2001
From: Raphael Mounier
Date: Sat, 6 Aug 2022 18:08:36 +0200
-Subject: [PATCH 03/43] Fix env empty string - ANDROID_STORAGE
+Subject: [PATCH 03/48] 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
---
@@ -9,10 +9,10 @@ Huawei hi6250 define in init.hi6250.rc ANDROID_STORAGE to "", so check empty str
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/core/java/android/os/Environment.java b/core/java/android/os/Environment.java
-index 5177cb4f8549..f593dc38bc1c 100644
+index 536ef31f334a..bebab95189d7 100644
--- a/core/java/android/os/Environment.java
+++ b/core/java/android/os/Environment.java
-@@ -1471,7 +1471,7 @@ public class Environment {
+@@ -1523,7 +1523,7 @@ public class Environment {
static File getDirectory(String variableName, String defaultPath) {
String path = System.getenv(variableName);
@@ -22,5 +22,5 @@ index 5177cb4f8549..f593dc38bc1c 100644
@NonNull
--
-2.37.1 (Apple Git-137.1)
+2.41.0
diff --git a/patches/trebledroid/platform_frameworks_base/0004-Relax-requirement-for-visible-flag-to-sdcards.patch b/patches/trebledroid/platform_frameworks_base/0004-Relax-requirement-for-visible-flag-to-sdcards.patch
index 150d8ea..9a92ce7 100644
--- a/patches/trebledroid/platform_frameworks_base/0004-Relax-requirement-for-visible-flag-to-sdcards.patch
+++ b/patches/trebledroid/platform_frameworks_base/0004-Relax-requirement-for-visible-flag-to-sdcards.patch
@@ -1,7 +1,7 @@
-From 1b9dbe7453b7200f5a45f557e6893ef5c0a9eecd Mon Sep 17 00:00:00 2001
+From e18ed2bc3ea90e8fca185be2cc9ae8784013e24d Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson
Date: Tue, 28 Nov 2017 18:28:04 +0100
-Subject: [PATCH 04/43] Relax requirement for visible flag to sdcards
+Subject: [PATCH 04/48] 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)
@@ -13,10 +13,10 @@ Change-Id: Ia616671c03562d1eadaff5531a5c708a62d7ad3a
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 64441f33c817..54f59eaad19f 100644
+index 312de9d85ed1..b514b9791387 100644
--- a/services/core/java/com/android/server/StorageManagerService.java
+++ b/services/core/java/com/android/server/StorageManagerService.java
-@@ -1616,7 +1616,8 @@ class StorageManagerService extends IStorageManager.Stub
+@@ -1531,7 +1531,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.
@@ -27,5 +27,5 @@ index 64441f33c817..54f59eaad19f 100644
}
--
-2.37.1 (Apple Git-137.1)
+2.41.0
diff --git a/patches/trebledroid/platform_frameworks_base/0006-Don-t-crash-if-there-is-IR-HAL-is-not-declared.patch b/patches/trebledroid/platform_frameworks_base/0005-Don-t-crash-if-there-is-IR-HAL-is-not-declared.patch
similarity index 86%
rename from patches/trebledroid/platform_frameworks_base/0006-Don-t-crash-if-there-is-IR-HAL-is-not-declared.patch
rename to patches/trebledroid/platform_frameworks_base/0005-Don-t-crash-if-there-is-IR-HAL-is-not-declared.patch
index 23fe890..dda5f48 100644
--- a/patches/trebledroid/platform_frameworks_base/0006-Don-t-crash-if-there-is-IR-HAL-is-not-declared.patch
+++ b/patches/trebledroid/platform_frameworks_base/0005-Don-t-crash-if-there-is-IR-HAL-is-not-declared.patch
@@ -1,7 +1,7 @@
-From 4073f0f1a3cb08ffd70dbcfd20018f6e04cde82b Mon Sep 17 00:00:00 2001
+From c53b9dd9eccf11dd451eab6e60ac9d3e8ed35c68 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson
Date: Thu, 17 May 2018 20:28:35 +0200
-Subject: [PATCH 06/43] Don't crash if there is IR HAL is not declared
+Subject: [PATCH 05/48] Don't crash if there is IR HAL is not declared
Change-Id: I3afded27441bbee8244d5fda544b3e6d1238dc1b
---
@@ -10,10 +10,10 @@ Change-Id: I3afded27441bbee8244d5fda544b3e6d1238dc1b
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 c4e84a4cd138..2654f499db09 100644
+index ee6d808aa549..be8e2bb95ece 100644
--- a/services/core/java/com/android/server/ConsumerIrService.java
+++ b/services/core/java/com/android/server/ConsumerIrService.java
-@@ -49,14 +49,6 @@ public class ConsumerIrService extends IConsumerIrService.Stub {
+@@ -53,14 +53,6 @@ public class ConsumerIrService extends IConsumerIrService.Stub {
mWakeLock.setReferenceCounted(true);
mHasNativeHal = getHalService();
@@ -42,5 +42,5 @@ index 63daa3503bd5..d068ec06fc14 100644
}
--
-2.37.1 (Apple Git-137.1)
+2.41.0
diff --git a/patches/trebledroid/platform_frameworks_base/0007-Implement-a-persistent-property-to-override-the-defa.patch b/patches/trebledroid/platform_frameworks_base/0006-Implement-a-persistent-property-to-override-the-defa.patch
similarity index 85%
rename from patches/trebledroid/platform_frameworks_base/0007-Implement-a-persistent-property-to-override-the-defa.patch
rename to patches/trebledroid/platform_frameworks_base/0006-Implement-a-persistent-property-to-override-the-defa.patch
index c976634..03cb37e 100644
--- a/patches/trebledroid/platform_frameworks_base/0007-Implement-a-persistent-property-to-override-the-defa.patch
+++ b/patches/trebledroid/platform_frameworks_base/0006-Implement-a-persistent-property-to-override-the-defa.patch
@@ -1,7 +1,7 @@
-From cf1f80b540aeb55df25946d19ceeb0aaa6cc9dc4 Mon Sep 17 00:00:00 2001
+From a6a4af0efb3988d893a02402c1265b556becaaaa Mon Sep 17 00:00:00 2001
From: Peter Cai
Date: Wed, 1 Jun 2022 16:56:20 -0400
-Subject: [PATCH 07/43] Implement a persistent property to override the default
+Subject: [PATCH 06/48] Implement a persistent property to override the default
primary camera (0)
Change-Id: I49b45d00bf71d7932591b3516d49a680e1b6568b
@@ -11,10 +11,10 @@ Change-Id: I49b45d00bf71d7932591b3516d49a680e1b6568b
2 files changed, 14 insertions(+)
diff --git a/core/java/android/hardware/Camera.java b/core/java/android/hardware/Camera.java
-index 854f38734447..9c83b00b0b30 100644
+index 358e5cfa4c4e..3114f2a6b911 100644
--- a/core/java/android/hardware/Camera.java
+++ b/core/java/android/hardware/Camera.java
-@@ -471,6 +471,11 @@ public class Camera {
+@@ -470,6 +470,11 @@ public class Camera {
* @see #open(int)
*/
public static Camera open() {
@@ -27,10 +27,10 @@ index 854f38734447..9c83b00b0b30 100644
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 3e5fee84b7be..06519a49b7b4 100644
+index 47aaadc40b51..92dbc2356d2f 100644
--- a/core/java/android/hardware/camera2/CameraManager.java
+++ b/core/java/android/hardware/camera2/CameraManager.java
-@@ -1829,6 +1829,15 @@ public final class CameraManager {
+@@ -2025,6 +2025,15 @@ public final class CameraManager {
}
}});
@@ -47,5 +47,5 @@ index 3e5fee84b7be..06519a49b7b4 100644
public static boolean cameraStatusesContains(CameraStatus[] cameraStatuses, String id) {
--
-2.37.1 (Apple Git-137.1)
+2.41.0
diff --git a/patches/trebledroid/platform_frameworks_base/0008-Show-APN-Settings-for-CDMA-carriers.patch b/patches/trebledroid/platform_frameworks_base/0007-Show-APN-Settings-for-CDMA-carriers.patch
similarity index 80%
rename from patches/trebledroid/platform_frameworks_base/0008-Show-APN-Settings-for-CDMA-carriers.patch
rename to patches/trebledroid/platform_frameworks_base/0007-Show-APN-Settings-for-CDMA-carriers.patch
index dc8c064..1444a6e 100644
--- a/patches/trebledroid/platform_frameworks_base/0008-Show-APN-Settings-for-CDMA-carriers.patch
+++ b/patches/trebledroid/platform_frameworks_base/0007-Show-APN-Settings-for-CDMA-carriers.patch
@@ -1,17 +1,17 @@
-From 3fa42e589cef9f210df2c8b31e46086f2d18678a Mon Sep 17 00:00:00 2001
+From a18829f28557a695c2dc04712da3281d989d0a01 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson
Date: Mon, 6 Aug 2018 12:49:00 +0200
-Subject: [PATCH 08/43] Show APN Settings for CDMA carriers
+Subject: [PATCH 07/48] 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 741721d14ac1..2b08fa644779 100644
+index 5b1c6b1c88b8..f38d900d3b58 100644
--- a/telephony/java/android/telephony/CarrierConfigManager.java
+++ b/telephony/java/android/telephony/CarrierConfigManager.java
-@@ -8712,7 +8712,7 @@ public class CarrierConfigManager {
+@@ -9823,7 +9823,7 @@ public class CarrierConfigManager {
sDefaults.putBoolean(KEY_OPERATOR_SELECTION_EXPAND_BOOL, true);
sDefaults.putBoolean(KEY_PREFER_2G_BOOL, false);
sDefaults.putBoolean(KEY_4G_ONLY_BOOL, false);
@@ -21,5 +21,5 @@ index 741721d14ac1..2b08fa644779 100644
sDefaults.putBoolean(KEY_SMS_REQUIRES_DESTINATION_NUMBER_CONVERSION_BOOL, false);
sDefaults.putBoolean(KEY_SUPPORT_EMERGENCY_SMS_OVER_IMS_BOOL, false);
--
-2.37.1 (Apple Git-137.1)
+2.41.0
diff --git a/patches/trebledroid/platform_frameworks_base/0009-Re-order-services-so-that-it-works-even-without-qtag.patch b/patches/trebledroid/platform_frameworks_base/0008-Re-order-services-so-that-it-works-even-without-qtag.patch
similarity index 84%
rename from patches/trebledroid/platform_frameworks_base/0009-Re-order-services-so-that-it-works-even-without-qtag.patch
rename to patches/trebledroid/platform_frameworks_base/0008-Re-order-services-so-that-it-works-even-without-qtag.patch
index 66fd8f3..7eb8ff7 100644
--- a/patches/trebledroid/platform_frameworks_base/0009-Re-order-services-so-that-it-works-even-without-qtag.patch
+++ b/patches/trebledroid/platform_frameworks_base/0008-Re-order-services-so-that-it-works-even-without-qtag.patch
@@ -1,7 +1,7 @@
-From 76bc641460044ffbf3a78036144712a04cab7b3e Mon Sep 17 00:00:00 2001
+From 42cfb9859a2e834f95093bda93861990c64b5ff6 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson
Date: Thu, 8 Nov 2018 23:04:03 +0100
-Subject: [PATCH 09/43] Re-order services so that it works even without qtaguid
+Subject: [PATCH 08/48] Re-order services so that it works even without qtaguid
Change-Id: I0c0f527b3ae151d45c68f7ac6c205da3f34e74df
---
@@ -9,10 +9,10 @@ Change-Id: I0c0f527b3ae151d45c68f7ac6c205da3f34e74df
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 2f818fa10b72..b0b63174d660 100644
+index b7082690276c..ab190a39e2e6 100644
--- a/services/core/java/com/android/server/net/NetworkPolicyManagerService.java
+++ b/services/core/java/com/android/server/net/NetworkPolicyManagerService.java
-@@ -923,6 +923,10 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub {
+@@ -925,6 +925,10 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub {
Trace.traceBegin(Trace.TRACE_TAG_NETWORK, "systemReady");
final int oldPriority = Process.getThreadPriority(Process.myTid());
try {
@@ -23,7 +23,7 @@ index 2f818fa10b72..b0b63174d660 100644
// Boost thread's priority during system server init
Process.setThreadPriority(Process.THREAD_PRIORITY_FOREGROUND);
if (!isBandwidthControlEnabled()) {
-@@ -930,10 +934,6 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub {
+@@ -932,10 +936,6 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub {
return;
}
@@ -35,5 +35,5 @@ index 2f818fa10b72..b0b63174d660 100644
synchronized (mNetworkPoliciesSecondLock) {
updatePowerSaveWhitelistUL();
--
-2.37.1 (Apple Git-137.1)
+2.41.0
diff --git a/patches/trebledroid/platform_frameworks_base/0010-Support-samsung-Pie-and-Q-light-hal.patch b/patches/trebledroid/platform_frameworks_base/0009-Support-samsung-Pie-and-Q-light-hal.patch
similarity index 66%
rename from patches/trebledroid/platform_frameworks_base/0010-Support-samsung-Pie-and-Q-light-hal.patch
rename to patches/trebledroid/platform_frameworks_base/0009-Support-samsung-Pie-and-Q-light-hal.patch
index 360f344..2064360 100644
--- a/patches/trebledroid/platform_frameworks_base/0010-Support-samsung-Pie-and-Q-light-hal.patch
+++ b/patches/trebledroid/platform_frameworks_base/0009-Support-samsung-Pie-and-Q-light-hal.patch
@@ -1,7 +1,7 @@
-From 27334518f1bb6d6be046e1c6e48be94098bd0887 Mon Sep 17 00:00:00 2001
+From 8aab0e87b3f2780700cc2e4f6de89222747c5f9a Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson
Date: Sun, 24 Mar 2019 23:05:14 +0100
-Subject: [PATCH 10/43] Support samsung Pie and Q light hal
+Subject: [PATCH 09/48] Support samsung Pie and Q light hal
Change-Id: I01f94acd7d0672733e48854d80368f9ac6f861c6
---
@@ -9,12 +9,12 @@ Change-Id: I01f94acd7d0672733e48854d80368f9ac6f861c6
1 file changed, 2 insertions(+)
diff --git a/services/core/jni/Android.bp b/services/core/jni/Android.bp
-index 0d49f5fffb4b..1fc974ebc56f 100644
+index d5217c8295bd..ea0da6918ecc 100644
--- a/services/core/jni/Android.bp
+++ b/services/core/jni/Android.bp
-@@ -186,6 +186,8 @@ cc_defaults {
- "android.system.suspend.control.internal-cpp",
+@@ -201,6 +201,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",
@@ -22,5 +22,5 @@ index 0d49f5fffb4b..1fc974ebc56f 100644
static_libs: [
--
-2.37.1 (Apple Git-137.1)
+2.41.0
diff --git a/patches/trebledroid/platform_frameworks_base/0011-Add-support-for-samsung-touch-physical-and-hover-pro.patch b/patches/trebledroid/platform_frameworks_base/0010-Add-support-for-samsung-touch-physical-and-hover-pro.patch
similarity index 86%
rename from patches/trebledroid/platform_frameworks_base/0011-Add-support-for-samsung-touch-physical-and-hover-pro.patch
rename to patches/trebledroid/platform_frameworks_base/0010-Add-support-for-samsung-touch-physical-and-hover-pro.patch
index d849dd5..2e8c5d6 100644
--- a/patches/trebledroid/platform_frameworks_base/0011-Add-support-for-samsung-touch-physical-and-hover-pro.patch
+++ b/patches/trebledroid/platform_frameworks_base/0010-Add-support-for-samsung-touch-physical-and-hover-pro.patch
@@ -1,7 +1,7 @@
-From f7a97f5138a02bc9be251b39c246905c7c3db2b0 Mon Sep 17 00:00:00 2001
+From 033794e44c528792f9168081ab92a257c3e7c5b8 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson
Date: Mon, 12 Aug 2019 23:08:26 +0200
-Subject: [PATCH 11/43] Add support for samsung touch, physical and hover
+Subject: [PATCH 10/48] Add support for samsung touch, physical and hover
proximity sensor as fallback to real proximity sensor
Change-Id: I7a0f8b4665c802140d19197d850b77b2a7ac1865
@@ -10,13 +10,13 @@ Change-Id: I7a0f8b4665c802140d19197d850b77b2a7ac1865
1 file changed, 35 insertions(+)
diff --git a/services/core/java/com/android/server/display/DisplayPowerController.java b/services/core/java/com/android/server/display/DisplayPowerController.java
-index 9575fbd95729..0468c0b336b3 100644
+index e3b2ef4e0090..e69570132a73 100644
--- a/services/core/java/com/android/server/display/DisplayPowerController.java
+++ b/services/core/java/com/android/server/display/DisplayPowerController.java
-@@ -2179,6 +2179,27 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
- ? Sensor.TYPE_PROXIMITY : SensorUtils.NO_FALLBACK;
+@@ -2328,6 +2328,27 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
+ mDisplayDeviceConfig.getProximitySensor();
mProximitySensor = SensorUtils.findSensor(mSensorManager, proxSensor.type, proxSensor.name,
- fallbackType);
+ Sensor.TYPE_PROXIMITY);
+ if(mProximitySensor == null) {
+ java.util.List sensors = mSensorManager.getSensorList(Sensor.TYPE_ALL);
+ for(Sensor sensor: sensors) {
@@ -41,10 +41,10 @@ index 9575fbd95729..0468c0b336b3 100644
if (mProximitySensor != null) {
mProximityThreshold = Math.min(mProximitySensor.getMaximumRange(),
TYPICAL_PROXIMITY_THRESHOLD);
-@@ -3290,6 +3311,20 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
+@@ -3346,6 +3367,20 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
public void onSensorChanged(SensorEvent event) {
if (mProximitySensorEnabled) {
- final long time = SystemClock.uptimeMillis();
+ final long time = mClock.uptimeMillis();
+ if("com.samsung.sensor.touch_proximity".equals(mProximitySensor.getStringType())) {
+ int v = (int)event.values[0];
+ boolean positive = (v <= 4);
@@ -63,5 +63,5 @@ index 9575fbd95729..0468c0b336b3 100644
boolean positive = distance >= 0.0f && distance < mProximityThreshold;
handleProximitySensorEvent(time, positive);
--
-2.37.1 (Apple Git-137.1)
+2.41.0
diff --git a/patches/trebledroid/platform_frameworks_base/0012-Always-allow-overriding-the-number-of-work-profiles.patch b/patches/trebledroid/platform_frameworks_base/0011-Always-allow-overriding-the-number-of-work-profiles.patch
similarity index 82%
rename from patches/trebledroid/platform_frameworks_base/0012-Always-allow-overriding-the-number-of-work-profiles.patch
rename to patches/trebledroid/platform_frameworks_base/0011-Always-allow-overriding-the-number-of-work-profiles.patch
index c33b483..2123209 100644
--- a/patches/trebledroid/platform_frameworks_base/0012-Always-allow-overriding-the-number-of-work-profiles.patch
+++ b/patches/trebledroid/platform_frameworks_base/0011-Always-allow-overriding-the-number-of-work-profiles.patch
@@ -1,7 +1,7 @@
-From 57d85dc14ee44e29fd646ec1c22eab9da4964418 Mon Sep 17 00:00:00 2001
+From 991b15cf3708d64f88f6660cb09c09db06d63bea Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson
Date: Sun, 5 Apr 2020 16:32:46 +0200
-Subject: [PATCH 12/43] Always allow overriding the number of work profiles
+Subject: [PATCH 11/48] Always allow overriding the number of work profiles
Change-Id: I6eb09aa71663c6fbe7563e3038bffcabdba0ff6a
---
@@ -9,10 +9,10 @@ Change-Id: I6eb09aa71663c6fbe7563e3038bffcabdba0ff6a
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/services/core/java/com/android/server/pm/UserManagerService.java b/services/core/java/com/android/server/pm/UserManagerService.java
-index 88aeb17dc2b4..03eb0cd15aac 100644
+index 7e88e13e1788..9c35b31cf283 100644
--- a/services/core/java/com/android/server/pm/UserManagerService.java
+++ b/services/core/java/com/android/server/pm/UserManagerService.java
-@@ -6490,12 +6490,8 @@ public class UserManagerService extends IUserManager.Stub {
+@@ -7327,12 +7327,8 @@ public class UserManagerService extends IUserManager.Stub {
*/
private static int getMaxUsersOfTypePerParent(UserTypeDetails userTypeDetails) {
final int defaultMax = userTypeDetails.getMaxAllowedPerParent();
@@ -28,5 +28,5 @@ index 88aeb17dc2b4..03eb0cd15aac 100644
return defaultMax;
}
--
-2.37.1 (Apple Git-137.1)
+2.41.0
diff --git a/patches/trebledroid/platform_frameworks_base/0013-HOME-deserves-to-wake-up-devices-just-as-well-as-bac.patch b/patches/trebledroid/platform_frameworks_base/0012-HOME-deserves-to-wake-up-devices-just-as-well-as-bac.patch
similarity index 73%
rename from patches/trebledroid/platform_frameworks_base/0013-HOME-deserves-to-wake-up-devices-just-as-well-as-bac.patch
rename to patches/trebledroid/platform_frameworks_base/0012-HOME-deserves-to-wake-up-devices-just-as-well-as-bac.patch
index 08c73c6..0900edf 100644
--- a/patches/trebledroid/platform_frameworks_base/0013-HOME-deserves-to-wake-up-devices-just-as-well-as-bac.patch
+++ b/patches/trebledroid/platform_frameworks_base/0012-HOME-deserves-to-wake-up-devices-just-as-well-as-bac.patch
@@ -1,7 +1,7 @@
-From c948a5e1ace81ecfa2f05966f3054168707d87e6 Mon Sep 17 00:00:00 2001
+From a100c138a4d3287419c7d7c8ad3e5efc70d9e4d2 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson
Date: Sat, 6 Jun 2020 18:21:56 +0200
-Subject: [PATCH 13/43] HOME deserves to wake-up devices just as well as back
+Subject: [PATCH 12/48] HOME deserves to wake-up devices just as well as back
and menu
Change-Id: Ia562bafd8c620d00c17e8eb338e4701c6c4a3c3a
@@ -10,10 +10,10 @@ Change-Id: Ia562bafd8c620d00c17e8eb338e4701c6c4a3c3a
1 file changed, 1 insertion(+)
diff --git a/core/java/android/view/KeyEvent.java b/core/java/android/view/KeyEvent.java
-index c3a638c4c36a..a392a953371d 100644
+index 858da554c670..df9b4d938061 100644
--- a/core/java/android/view/KeyEvent.java
+++ b/core/java/android/view/KeyEvent.java
-@@ -2035,6 +2035,7 @@ public class KeyEvent extends InputEvent implements Parcelable {
+@@ -2061,6 +2061,7 @@ public class KeyEvent extends InputEvent implements Parcelable {
switch (keyCode) {
case KeyEvent.KEYCODE_CAMERA:
case KeyEvent.KEYCODE_MENU:
@@ -22,5 +22,5 @@ index c3a638c4c36a..a392a953371d 100644
case KeyEvent.KEYCODE_STEM_1:
case KeyEvent.KEYCODE_STEM_2:
--
-2.37.1 (Apple Git-137.1)
+2.41.0
diff --git a/patches/trebledroid/platform_frameworks_base/0014-Some-devices-have-proximity-sensor-reporting-NaN-as-.patch b/patches/trebledroid/platform_frameworks_base/0013-Some-devices-have-proximity-sensor-reporting-NaN-as-.patch
similarity index 79%
rename from patches/trebledroid/platform_frameworks_base/0014-Some-devices-have-proximity-sensor-reporting-NaN-as-.patch
rename to patches/trebledroid/platform_frameworks_base/0013-Some-devices-have-proximity-sensor-reporting-NaN-as-.patch
index ab50f65..46febc7 100644
--- a/patches/trebledroid/platform_frameworks_base/0014-Some-devices-have-proximity-sensor-reporting-NaN-as-.patch
+++ b/patches/trebledroid/platform_frameworks_base/0013-Some-devices-have-proximity-sensor-reporting-NaN-as-.patch
@@ -1,7 +1,7 @@
-From 72194bf432702faeb1e92797feb12a8f31643049 Mon Sep 17 00:00:00 2001
+From ccc05a174889d9b602af347c14ac58a06822f23a Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson
Date: Tue, 29 Sep 2020 22:39:47 +0200
-Subject: [PATCH 14/43] Some devices have proximity sensor reporting NaN as max
+Subject: [PATCH 13/48] Some devices have proximity sensor reporting NaN as max
range for some reason. Make them behave standard way by setting 5 cm
Change-Id: I3c39e3e914a05903c140235702e0480d2d58a612
@@ -10,10 +10,10 @@ Change-Id: I3c39e3e914a05903c140235702e0480d2d58a612
1 file changed, 3 insertions(+)
diff --git a/services/core/java/com/android/server/display/DisplayPowerController.java b/services/core/java/com/android/server/display/DisplayPowerController.java
-index 0468c0b336b3..51ef6cd6bbec 100644
+index e69570132a73..ddefef853a0a 100644
--- a/services/core/java/com/android/server/display/DisplayPowerController.java
+++ b/services/core/java/com/android/server/display/DisplayPowerController.java
-@@ -2203,6 +2203,9 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
+@@ -2352,6 +2352,9 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
if (mProximitySensor != null) {
mProximityThreshold = Math.min(mProximitySensor.getMaximumRange(),
TYPICAL_PROXIMITY_THRESHOLD);
@@ -24,5 +24,5 @@ index 0468c0b336b3..51ef6cd6bbec 100644
}
--
-2.37.1 (Apple Git-137.1)
+2.41.0
diff --git a/patches/trebledroid/platform_frameworks_base/0015-Fix-brightness-range-not-being-complete-on-Samsung-d.patch b/patches/trebledroid/platform_frameworks_base/0014-Fix-brightness-range-not-being-complete-on-Samsung-d.patch
similarity index 87%
rename from patches/trebledroid/platform_frameworks_base/0015-Fix-brightness-range-not-being-complete-on-Samsung-d.patch
rename to patches/trebledroid/platform_frameworks_base/0014-Fix-brightness-range-not-being-complete-on-Samsung-d.patch
index 47a4d72..904d133 100644
--- a/patches/trebledroid/platform_frameworks_base/0015-Fix-brightness-range-not-being-complete-on-Samsung-d.patch
+++ b/patches/trebledroid/platform_frameworks_base/0014-Fix-brightness-range-not-being-complete-on-Samsung-d.patch
@@ -1,7 +1,7 @@
-From 0e8c18091beb62314dffed9177a04f02d4e8bb4d Mon Sep 17 00:00:00 2001
+From 58ad15827b6d1b35d429d8e10e03c7e09bd28520 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson
Date: Tue, 29 Sep 2020 22:40:10 +0200
-Subject: [PATCH 15/43] Fix brightness range not being complete on Samsung
+Subject: [PATCH 14/48] Fix brightness range not being complete on Samsung
devices
On some devices, minimum brightness is 0, which totally messes with
@@ -15,10 +15,10 @@ Change-Id: I4d97cbc32490949e83272b81ec6320a5483310b1
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/services/core/java/com/android/server/power/PowerManagerService.java b/services/core/java/com/android/server/power/PowerManagerService.java
-index 2a05d41042fe..b5c95285f304 100644
+index d82f7a56a830..fe397d53c5d6 100644
--- a/services/core/java/com/android/server/power/PowerManagerService.java
+++ b/services/core/java/com/android/server/power/PowerManagerService.java
-@@ -1115,9 +1115,11 @@ public final class PowerManagerService extends SystemService
+@@ -1191,9 +1191,11 @@ public final class PowerManagerService extends SystemService
if (min == INVALID_BRIGHTNESS_IN_CONFIG || max == INVALID_BRIGHTNESS_IN_CONFIG
|| def == INVALID_BRIGHTNESS_IN_CONFIG) {
@@ -33,5 +33,5 @@ index 2a05d41042fe..b5c95285f304 100644
mContext.getResources().getInteger(com.android.internal.R.integer
.config_screenBrightnessSettingMaximum));
--
-2.37.1 (Apple Git-137.1)
+2.41.0
diff --git a/patches/trebledroid/platform_frameworks_base/0016-Re-implement-fnmatch-like-behaviour-for-RRO-java-sid.patch b/patches/trebledroid/platform_frameworks_base/0015-Re-implement-fnmatch-like-behaviour-for-RRO-java-sid.patch
similarity index 93%
rename from patches/trebledroid/platform_frameworks_base/0016-Re-implement-fnmatch-like-behaviour-for-RRO-java-sid.patch
rename to patches/trebledroid/platform_frameworks_base/0015-Re-implement-fnmatch-like-behaviour-for-RRO-java-sid.patch
index ccc810a..19bbf45 100644
--- a/patches/trebledroid/platform_frameworks_base/0016-Re-implement-fnmatch-like-behaviour-for-RRO-java-sid.patch
+++ b/patches/trebledroid/platform_frameworks_base/0015-Re-implement-fnmatch-like-behaviour-for-RRO-java-sid.patch
@@ -1,7 +1,7 @@
-From 1a016392dd3c0fb9d54e26238cd337419269b6e7 Mon Sep 17 00:00:00 2001
+From 56a17f6284671de1e7c923b09e53ed5f7cfd1abf Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson
Date: Sun, 25 Oct 2020 23:57:26 +0100
-Subject: [PATCH 16/43] Re-implement fnmatch-like behaviour for RRO java-side
+Subject: [PATCH 15/48] Re-implement fnmatch-like behaviour for RRO java-side
T: Also apply to FrameworkParsingPackageUtils (@PeterCxy)
@@ -12,7 +12,7 @@ Change-Id: Id38292a9a1453aa87b8401c1fdb390fa4e63c7d1
2 files changed, 22 insertions(+), 4 deletions(-)
diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java
-index 2333bd9e7818..99891fb340b5 100644
+index 223953a1c71c..d37ad6f90432 100644
--- a/core/java/android/content/pm/PackageParser.java
+++ b/core/java/android/content/pm/PackageParser.java
@@ -2545,8 +2545,17 @@ public class PackageParser {
@@ -60,5 +60,5 @@ index 3e1c5bb3d7ec..8182e9e0c771 100644
}
return true;
--
-2.37.1 (Apple Git-137.1)
+2.41.0
diff --git a/patches/trebledroid/platform_frameworks_base/0017-Remove-useless-notification-about-console-service-be.patch b/patches/trebledroid/platform_frameworks_base/0016-Remove-useless-notification-about-console-service-be.patch
similarity index 76%
rename from patches/trebledroid/platform_frameworks_base/0017-Remove-useless-notification-about-console-service-be.patch
rename to patches/trebledroid/platform_frameworks_base/0016-Remove-useless-notification-about-console-service-be.patch
index 8eecdc5..23892f7 100644
--- a/patches/trebledroid/platform_frameworks_base/0017-Remove-useless-notification-about-console-service-be.patch
+++ b/patches/trebledroid/platform_frameworks_base/0016-Remove-useless-notification-about-console-service-be.patch
@@ -1,7 +1,7 @@
-From 04283b03dea88c17c0e18c02bcfb968413ac90a5 Mon Sep 17 00:00:00 2001
+From 97230b72e33fa264010e15a2be991a00312d30d3 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson
Date: Fri, 11 Dec 2020 14:41:09 +0100
-Subject: [PATCH 17/43] Remove useless notification about "console" service
+Subject: [PATCH 16/48] Remove useless notification about "console" service
being running
---
@@ -9,10 +9,10 @@ Subject: [PATCH 17/43] Remove useless notification about "console" service
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
-index 0f87d1dbf1f1..1e4ff7dd05c9 100644
+index 15d1e0cdc450..30f3dbe15b90 100644
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
-@@ -5288,7 +5288,7 @@ public class ActivityManagerService extends IActivityManager.Stub
+@@ -5169,7 +5169,7 @@ public class ActivityManagerService extends IActivityManager.Stub
}
private void showConsoleNotificationIfActive() {
@@ -22,5 +22,5 @@ index 0f87d1dbf1f1..1e4ff7dd05c9 100644
}
String title = mContext
--
-2.37.1 (Apple Git-137.1)
+2.41.0
diff --git a/patches/trebledroid/platform_frameworks_base/0018-Revert-Remove-unused-SystemProperties.set.patch b/patches/trebledroid/platform_frameworks_base/0017-Revert-Remove-unused-SystemProperties.set.patch
similarity index 92%
rename from patches/trebledroid/platform_frameworks_base/0018-Revert-Remove-unused-SystemProperties.set.patch
rename to patches/trebledroid/platform_frameworks_base/0017-Revert-Remove-unused-SystemProperties.set.patch
index 05ae721..ab687f7 100644
--- a/patches/trebledroid/platform_frameworks_base/0018-Revert-Remove-unused-SystemProperties.set.patch
+++ b/patches/trebledroid/platform_frameworks_base/0017-Revert-Remove-unused-SystemProperties.set.patch
@@ -1,7 +1,7 @@
-From fac1a98099b41787e53b2f3ce96a161737ee31cd Mon Sep 17 00:00:00 2001
+From e241c43aab7cb12066b03fa8d9991fa9058d2b25 Mon Sep 17 00:00:00 2001
From: Peter Cai
Date: Wed, 16 Dec 2020 21:24:12 +0800
-Subject: [PATCH 18/43] Revert "Remove unused SystemProperties.set"
+Subject: [PATCH 17/48] Revert "Remove unused SystemProperties.set"
This reverts commit debb4616ef67f9ed5054eca51ec58592358ff55f.
@@ -11,10 +11,10 @@ This reverts commit debb4616ef67f9ed5054eca51ec58592358ff55f.
1 file changed, 69 insertions(+)
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
-index ecd8c7a3d917..64aac1802c6e 100644
+index 2a6099a18fab..aa85332f2946 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
-@@ -8028,6 +8028,75 @@ public class TelephonyManager {
+@@ -8095,6 +8095,75 @@ public class TelephonyManager {
}
}
@@ -91,5 +91,5 @@ index ecd8c7a3d917..64aac1802c6e 100644
* Inserts or updates a list property. Expands the list if its length is not enough.
*/
--
-2.37.1 (Apple Git-137.1)
+2.41.0
diff --git a/patches/trebledroid/platform_frameworks_base/0019-TelephonyManager-bring-back-getNetworkClass.patch b/patches/trebledroid/platform_frameworks_base/0018-TelephonyManager-bring-back-getNetworkClass.patch
similarity index 92%
rename from patches/trebledroid/platform_frameworks_base/0019-TelephonyManager-bring-back-getNetworkClass.patch
rename to patches/trebledroid/platform_frameworks_base/0018-TelephonyManager-bring-back-getNetworkClass.patch
index 7ac85df..b6b1d94 100644
--- a/patches/trebledroid/platform_frameworks_base/0019-TelephonyManager-bring-back-getNetworkClass.patch
+++ b/patches/trebledroid/platform_frameworks_base/0018-TelephonyManager-bring-back-getNetworkClass.patch
@@ -1,7 +1,7 @@
-From 47103a3dfc64edb2233448283cf97dc7b60c16d8 Mon Sep 17 00:00:00 2001
+From 2a98afe8f2cbd7c9aacb2e1422738b11bcd78e6d Mon Sep 17 00:00:00 2001
From: Peter Cai
Date: Wed, 16 Dec 2020 13:46:15 +0800
-Subject: [PATCH 19/43] TelephonyManager: bring back getNetworkClass()
+Subject: [PATCH 18/48] TelephonyManager: bring back getNetworkClass()
This partially reverts commit c058cac051ab083dc7fb7ea6aa85699110b2e9bf.
@@ -11,10 +11,10 @@ This partially reverts commit c058cac051ab083dc7fb7ea6aa85699110b2e9bf.
1 file changed, 58 insertions(+)
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
-index 64aac1802c6e..960824e9dd15 100644
+index aa85332f2946..2146bbf33c80 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
-@@ -3164,6 +3164,64 @@ public class TelephonyManager {
+@@ -3204,6 +3204,64 @@ public class TelephonyManager {
}
}
@@ -80,5 +80,5 @@ index 64aac1802c6e..960824e9dd15 100644
* Returns a string representation of the radio technology (network type)
* currently in use on the device.
--
-2.37.1 (Apple Git-137.1)
+2.41.0
diff --git a/patches/trebledroid/platform_frameworks_base/0020-TelephonyManager-add-API-annotations-for-setTelephon.patch b/patches/trebledroid/platform_frameworks_base/0019-TelephonyManager-add-API-annotations-for-setTelephon.patch
similarity index 81%
rename from patches/trebledroid/platform_frameworks_base/0020-TelephonyManager-add-API-annotations-for-setTelephon.patch
rename to patches/trebledroid/platform_frameworks_base/0019-TelephonyManager-add-API-annotations-for-setTelephon.patch
index 4786184..a0d273d 100644
--- a/patches/trebledroid/platform_frameworks_base/0020-TelephonyManager-add-API-annotations-for-setTelephon.patch
+++ b/patches/trebledroid/platform_frameworks_base/0019-TelephonyManager-add-API-annotations-for-setTelephon.patch
@@ -1,7 +1,7 @@
-From d8cbd52861f3a75d604e68be024b0d440b3cf4f4 Mon Sep 17 00:00:00 2001
+From 68dc69db169a81ad0ef5945aad55eef1391853dc Mon Sep 17 00:00:00 2001
From: Peter Cai
Date: Wed, 16 Dec 2020 21:26:45 +0800
-Subject: [PATCH 20/43] TelephonyManager: add API annotations for
+Subject: [PATCH 19/48] TelephonyManager: add API annotations for
setTelephonyProperty
* This method was added back by reverting commit
@@ -14,10 +14,10 @@ Subject: [PATCH 20/43] TelephonyManager: add API annotations for
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
-index 960824e9dd15..f66168b21d2b 100644
+index 2146bbf33c80..cd42a761ba27 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
-@@ -8092,7 +8092,7 @@ public class TelephonyManager {
+@@ -8159,7 +8159,7 @@ public class TelephonyManager {
* @hide
*/
@UnsupportedAppUsage
@@ -26,7 +26,7 @@ index 960824e9dd15..f66168b21d2b 100644
String propVal = "";
String p[] = null;
String prop = SystemProperties.get(property);
-@@ -8146,7 +8146,8 @@ public class TelephonyManager {
+@@ -8213,7 +8213,8 @@ public class TelephonyManager {
*
* @hide
*/
@@ -37,5 +37,5 @@ index 960824e9dd15..f66168b21d2b 100644
value = "";
}
--
-2.37.1 (Apple Git-137.1)
+2.41.0
diff --git a/patches/trebledroid/platform_frameworks_base/0021-Fix-Wakelock-issue.patch b/patches/trebledroid/platform_frameworks_base/0020-Fix-Wakelock-issue.patch
similarity index 74%
rename from patches/trebledroid/platform_frameworks_base/0021-Fix-Wakelock-issue.patch
rename to patches/trebledroid/platform_frameworks_base/0020-Fix-Wakelock-issue.patch
index 2b1369b..8085a40 100644
--- a/patches/trebledroid/platform_frameworks_base/0021-Fix-Wakelock-issue.patch
+++ b/patches/trebledroid/platform_frameworks_base/0020-Fix-Wakelock-issue.patch
@@ -1,7 +1,7 @@
-From ae20ca4f974d56d354a75579fc08a0a8adc0b398 Mon Sep 17 00:00:00 2001
+From 5a9b20ef70d7dade1990618cbe38635e07649d1c Mon Sep 17 00:00:00 2001
From: Alberto Ponces
Date: Tue, 2 Feb 2021 10:20:51 +0000
-Subject: [PATCH 21/43] Fix Wakelock issue
+Subject: [PATCH 20/48] Fix Wakelock issue
Prevent SystemUI crash due to "WakeLock under-locked Doze" (issue #12) by only releasing a wakelock that was not already released
---
@@ -9,12 +9,12 @@ Prevent SystemUI crash due to "WakeLock under-locked Doze" (issue #12) by only r
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/packages/SystemUI/src/com/android/systemui/util/wakelock/WakeLock.java b/packages/SystemUI/src/com/android/systemui/util/wakelock/WakeLock.java
-index f320d071b54f..9f98937c2a06 100644
+index 6128feee8116..b60905b39e32 100644
--- a/packages/SystemUI/src/com/android/systemui/util/wakelock/WakeLock.java
+++ b/packages/SystemUI/src/com/android/systemui/util/wakelock/WakeLock.java
-@@ -123,7 +123,9 @@ public interface WakeLock {
- } else {
- mActiveClients.put(why, count - 1);
+@@ -143,7 +143,9 @@ public interface WakeLock {
+ if (logger != null) {
+ logger.logRelease(inner, why, count);
}
- inner.release();
+ if (inner.isHeld()) {
@@ -24,5 +24,5 @@ index f320d071b54f..9f98937c2a06 100644
/** @see PowerManager.WakeLock#wrap(Runnable) */
--
-2.37.1 (Apple Git-137.1)
+2.41.0
diff --git a/patches/trebledroid/platform_frameworks_base/0022-Automatically-detect-pick-up-sensor-so-that-an-overl.patch b/patches/trebledroid/platform_frameworks_base/0021-Automatically-detect-pick-up-sensor-so-that-an-overl.patch
similarity index 92%
rename from patches/trebledroid/platform_frameworks_base/0022-Automatically-detect-pick-up-sensor-so-that-an-overl.patch
rename to patches/trebledroid/platform_frameworks_base/0021-Automatically-detect-pick-up-sensor-so-that-an-overl.patch
index 85e8170..91c07c9 100644
--- a/patches/trebledroid/platform_frameworks_base/0022-Automatically-detect-pick-up-sensor-so-that-an-overl.patch
+++ b/patches/trebledroid/platform_frameworks_base/0021-Automatically-detect-pick-up-sensor-so-that-an-overl.patch
@@ -1,7 +1,7 @@
-From cbed20e030637e32345b0293de760671f7fb6ed3 Mon Sep 17 00:00:00 2001
+From 3dacf30a5c6c2aa2cc1d5dddb474939900538a2b Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson
Date: Sat, 20 Mar 2021 14:31:01 +0100
-Subject: [PATCH 22/43] Automatically detect pick up sensor, so that an overlay
+Subject: [PATCH 21/48] Automatically detect pick up sensor, so that an overlay
is required for the sole purpose of enabling pulse doze on pick up sensor
---
@@ -46,5 +46,5 @@ index 47541ca16cda..28168b9208f5 100644
/** @hide */
public boolean tapGestureEnabled(int user) {
--
-2.37.1 (Apple Git-137.1)
+2.41.0
diff --git a/patches/trebledroid/platform_frameworks_base/0023-Catch-broken-mainBuiltInDisplayCutoutRectApproximati.patch b/patches/trebledroid/platform_frameworks_base/0022-Catch-broken-mainBuiltInDisplayCutoutRectApproximati.patch
similarity index 90%
rename from patches/trebledroid/platform_frameworks_base/0023-Catch-broken-mainBuiltInDisplayCutoutRectApproximati.patch
rename to patches/trebledroid/platform_frameworks_base/0022-Catch-broken-mainBuiltInDisplayCutoutRectApproximati.patch
index 9dc02b1..ad81b51 100644
--- a/patches/trebledroid/platform_frameworks_base/0023-Catch-broken-mainBuiltInDisplayCutoutRectApproximati.patch
+++ b/patches/trebledroid/platform_frameworks_base/0022-Catch-broken-mainBuiltInDisplayCutoutRectApproximati.patch
@@ -1,7 +1,7 @@
-From 1c8ad1633623ae77ffa878dd451a1a65ebac7492 Mon Sep 17 00:00:00 2001
+From c556f73d66e6b941c2ccbdce465c20d8326a65f3 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson
Date: Tue, 23 Mar 2021 19:43:26 +0100
-Subject: [PATCH 23/43] Catch broken mainBuiltInDisplayCutoutRectApproximation
+Subject: [PATCH 22/48] Catch broken mainBuiltInDisplayCutoutRectApproximation
Some devices (Redmi Note 9T) have:
mainBuiltInDisplayCutoutRectApproximation = @android:mainBuiltInDisplayCutout
@@ -18,10 +18,10 @@ Change-Id: I03b6e78bac2cc38f3a623c8add801405ad6ba7ba
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/core/java/android/view/DisplayCutout.java b/core/java/android/view/DisplayCutout.java
-index 83a7b3f01a95..78c74ed51910 100644
+index 712d1d67c942..5d929873f18d 100644
--- a/core/java/android/view/DisplayCutout.java
+++ b/core/java/android/view/DisplayCutout.java
-@@ -1055,11 +1055,19 @@ public final class DisplayCutout {
+@@ -1056,11 +1056,19 @@ public final class DisplayCutout {
public static DisplayCutout fromResourcesRectApproximation(Resources res,
String displayUniqueId, int physicalDisplayWidth, int physicalDisplayHeight,
int displayWidth, int displayHeight) {
@@ -47,5 +47,5 @@ index 83a7b3f01a95..78c74ed51910 100644
/**
--
-2.37.1 (Apple Git-137.1)
+2.41.0
diff --git a/patches/trebledroid/platform_frameworks_base/0024-backlight-Fix-backlight-control-on-Galaxy-S9.patch b/patches/trebledroid/platform_frameworks_base/0023-backlight-Fix-backlight-control-on-Galaxy-S9.patch
similarity index 97%
rename from patches/trebledroid/platform_frameworks_base/0024-backlight-Fix-backlight-control-on-Galaxy-S9.patch
rename to patches/trebledroid/platform_frameworks_base/0023-backlight-Fix-backlight-control-on-Galaxy-S9.patch
index f1763c3..49ea468 100644
--- a/patches/trebledroid/platform_frameworks_base/0024-backlight-Fix-backlight-control-on-Galaxy-S9.patch
+++ b/patches/trebledroid/platform_frameworks_base/0023-backlight-Fix-backlight-control-on-Galaxy-S9.patch
@@ -1,7 +1,7 @@
-From 6922485d1c72e1e6880e74e0235a26801cdc6e81 Mon Sep 17 00:00:00 2001
+From c7bc4ae2f25a8f5791491b88f505a995d42d1e67 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson
Date: Sat, 24 Mar 2018 08:01:48 +0100
-Subject: [PATCH 24/43] backlight: Fix backlight control on Galaxy S9(+)
+Subject: [PATCH 23/48] backlight: Fix backlight control on Galaxy S9(+)
Change-Id: I1fbbb47939c377597ef8ad6b88b2acea5f4acaa6
@@ -117,5 +117,5 @@ index 91f14de040fe..8fa9c4f3a698 100644
color = 0xff000000 | (color << 16) | (color << 8) | color;
setLightLocked(color, LIGHT_FLASH_NONE, 0, 0, brightnessMode);
--
-2.37.1 (Apple Git-137.1)
+2.41.0
diff --git a/patches/trebledroid/platform_frameworks_base/0025-Revert-Switch-long-press-power-behavior-in-AOSP.patch b/patches/trebledroid/platform_frameworks_base/0024-Revert-Switch-long-press-power-behavior-in-AOSP.patch
similarity index 83%
rename from patches/trebledroid/platform_frameworks_base/0025-Revert-Switch-long-press-power-behavior-in-AOSP.patch
rename to patches/trebledroid/platform_frameworks_base/0024-Revert-Switch-long-press-power-behavior-in-AOSP.patch
index b9586b7..3a97847 100644
--- a/patches/trebledroid/platform_frameworks_base/0025-Revert-Switch-long-press-power-behavior-in-AOSP.patch
+++ b/patches/trebledroid/platform_frameworks_base/0024-Revert-Switch-long-press-power-behavior-in-AOSP.patch
@@ -1,7 +1,7 @@
-From c49bcfa54a0098351ab25f5aa4956b63d3b91d9b Mon Sep 17 00:00:00 2001
+From addf98c0dadde97ada6473442380a3c0f8209757 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan
Date: Sat, 4 Sep 2021 08:26:30 +0000
-Subject: [PATCH 25/43] Revert "Switch long-press power behavior in AOSP."
+Subject: [PATCH 24/48] Revert "Switch long-press power behavior in AOSP."
This reverts commit 803c77a0a24624111944832098c6f65158051dc4.
---
@@ -9,10 +9,10 @@ This reverts commit 803c77a0a24624111944832098c6f65158051dc4.
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
-index 2772ebd88a59..6ba1571f681d 100644
+index ba3c4573c64d..df7aa4cca38b 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
-@@ -1082,7 +1082,7 @@
+@@ -1092,7 +1092,7 @@
4 - Go to voice assist
5 - Go to assistant (Settings.Secure.ASSISTANT)
-->
@@ -21,7 +21,7 @@ index 2772ebd88a59..6ba1571f681d 100644
500
-@@ -1114,7 +1114,7 @@
+@@ -1124,7 +1124,7 @@
1 - Mute toggle
2 - Global actions menu
-->
@@ -31,5 +31,5 @@ index 2772ebd88a59..6ba1571f681d 100644
-
-- 280
-+ 70
-
-
-
---
-2.37.1 (Apple Git-137.1)
-
diff --git a/patches/trebledroid/platform_frameworks_base/0028-Set-old-fingerprint-sensors-to-security-strong.patch b/patches/trebledroid/platform_frameworks_base/0028-Set-old-fingerprint-sensors-to-security-strong.patch
new file mode 100644
index 0000000..a7c11aa
--- /dev/null
+++ b/patches/trebledroid/platform_frameworks_base/0028-Set-old-fingerprint-sensors-to-security-strong.patch
@@ -0,0 +1,37 @@
+From b19ee3c31124c3fe4eebce39174f5b52e6399891 Mon Sep 17 00:00:00 2001
+From: Pierre-Hugues Husson
+Date: Sat, 3 Dec 2022 17:13:24 -0500
+Subject: [PATCH 28/48] Set old fingerprint sensors to security "strong"
+
+This allows removing config_biometric_sensors from overlays, which led
+to Pixels not booting, because they are using AIDL biometric sensor, and
+despite its name, config_biometric_sensors is HIDL-specific
+---
+ .../core/java/com/android/server/biometrics/AuthService.java | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/services/core/java/com/android/server/biometrics/AuthService.java b/services/core/java/com/android/server/biometrics/AuthService.java
+index 4538cad513d6..bc741a5e2396 100644
+--- a/services/core/java/com/android/server/biometrics/AuthService.java
++++ b/services/core/java/com/android/server/biometrics/AuthService.java
+@@ -653,7 +653,7 @@ public class AuthService extends SystemService {
+ final int firstApiLevel = SystemProperties.getInt(SYSPROP_FIRST_API_LEVEL, 0);
+ final int apiLevel = SystemProperties.getInt(SYSPROP_API_LEVEL, firstApiLevel);
+ String[] configStrings = mInjector.getConfiguration(getContext());
+- if (configStrings.length == 0 && apiLevel == Build.VERSION_CODES.R) {
++ if (configStrings.length == 0 && apiLevel <= Build.VERSION_CODES.R) {
+ // For backwards compatibility with R where biometrics could work without being
+ // configured in config_biometric_sensors. In the absence of a vendor provided
+ // configuration, we assume the weakest biometric strength (i.e. convenience).
+@@ -688,7 +688,7 @@ public class AuthService extends SystemService {
+ if (pm.hasSystemFeature(PackageManager.FEATURE_FACE)) {
+ modalities.add(String.valueOf(BiometricAuthenticator.TYPE_FACE));
+ }
+- final String strength = String.valueOf(Authenticators.BIOMETRIC_CONVENIENCE);
++ final String strength = String.valueOf(Authenticators.BIOMETRIC_STRONG);
+ final String[] configStrings = new String[modalities.size()];
+ for (int i = 0; i < modalities.size(); ++i) {
+ final String id = String.valueOf(i);
+--
+2.41.0
+
diff --git a/patches/trebledroid/platform_frameworks_base/0032-Call-Samsung-s-ISehSysInputDev-to-report-screen-stat.patch b/patches/trebledroid/platform_frameworks_base/0029-Call-Samsung-s-ISehSysInputDev-to-report-screen-stat.patch
similarity index 88%
rename from patches/trebledroid/platform_frameworks_base/0032-Call-Samsung-s-ISehSysInputDev-to-report-screen-stat.patch
rename to patches/trebledroid/platform_frameworks_base/0029-Call-Samsung-s-ISehSysInputDev-to-report-screen-stat.patch
index 3bb60be..cd0d146 100644
--- a/patches/trebledroid/platform_frameworks_base/0032-Call-Samsung-s-ISehSysInputDev-to-report-screen-stat.patch
+++ b/patches/trebledroid/platform_frameworks_base/0029-Call-Samsung-s-ISehSysInputDev-to-report-screen-stat.patch
@@ -1,7 +1,7 @@
-From 338ae129dbf680fb9496b5f8cb38c705ee91bf97 Mon Sep 17 00:00:00 2001
+From bb19ced1875dde1828e6307c32cdc01435c86ed9 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson
Date: Wed, 14 Dec 2022 17:21:00 -0500
-Subject: [PATCH 32/43] Call Samsung's ISehSysInputDev to report screen state
+Subject: [PATCH 29/48] Call Samsung's ISehSysInputDev to report screen state
to touchscreen driver
This fixes touchscreen not waking up on Galaxy F23
@@ -11,19 +11,19 @@ This fixes touchscreen not waking up on Galaxy F23
2 files changed, 33 insertions(+)
diff --git a/services/core/Android.bp b/services/core/Android.bp
-index 89c8ca567dd9..34a4579855ef 100644
+index f8d19ec9903d..735959270c11 100644
--- a/services/core/Android.bp
+++ b/services/core/Android.bp
-@@ -173,6 +173,7 @@ java_library_static {
- "overlayable_policy_aidl-java",
- "SurfaceFlingerProperties",
+@@ -186,6 +186,7 @@ java_library_static {
"com.android.sysprop.watchdog",
+ "ImmutabilityAnnotation",
+ "securebox",
+ "vendor.samsung.hardware.sysinput-V1.2-java", // HIDL
],
javac_shard_size: 50,
- }
+ javacflags: [
diff --git a/services/core/java/com/android/server/display/LocalDisplayAdapter.java b/services/core/java/com/android/server/display/LocalDisplayAdapter.java
-index 58a182a61e44..84c3982458ff 100644
+index c7c0fab6140d..537027f2d77f 100644
--- a/services/core/java/com/android/server/display/LocalDisplayAdapter.java
+++ b/services/core/java/com/android/server/display/LocalDisplayAdapter.java
@@ -33,6 +33,7 @@ import android.os.Trace;
@@ -34,7 +34,7 @@ index 58a182a61e44..84c3982458ff 100644
import android.util.SparseArray;
import android.view.Display;
import android.view.DisplayAddress;
-@@ -48,6 +49,8 @@ import com.android.server.LocalServices;
+@@ -51,6 +52,8 @@ import com.android.server.display.mode.DisplayModeDirector;
import com.android.server.lights.LightsManager;
import com.android.server.lights.LogicalLight;
@@ -43,7 +43,7 @@ index 58a182a61e44..84c3982458ff 100644
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
-@@ -228,6 +231,8 @@ final class LocalDisplayAdapter extends DisplayAdapter {
+@@ -234,6 +237,8 @@ final class LocalDisplayAdapter extends DisplayAdapter {
private DisplayEventReceiver.FrameRateOverride[] mFrameRateOverrides =
new DisplayEventReceiver.FrameRateOverride[0];
@@ -52,7 +52,7 @@ index 58a182a61e44..84c3982458ff 100644
LocalDisplayDevice(IBinder displayToken, long physicalDisplayId,
SurfaceControl.StaticDisplayInfo staticDisplayInfo,
-@@ -815,17 +820,44 @@ final class LocalDisplayAdapter extends DisplayAdapter {
+@@ -821,17 +826,44 @@ final class LocalDisplayAdapter extends DisplayAdapter {
}
mSidekickActive = false;
}
@@ -98,5 +98,5 @@ index 58a182a61e44..84c3982458ff 100644
// have a sidekick available, tell it now that it can take control.
if (Display.isSuspendedState(state) && state != Display.STATE_OFF
--
-2.37.1 (Apple Git-137.1)
+2.41.0
diff --git a/patches/trebledroid/platform_frameworks_base/0029-Dynamically-resize-boot-animation-to-match-screen-si.patch b/patches/trebledroid/platform_frameworks_base/0029-Dynamically-resize-boot-animation-to-match-screen-si.patch
deleted file mode 100644
index d4a149a..0000000
--- a/patches/trebledroid/platform_frameworks_base/0029-Dynamically-resize-boot-animation-to-match-screen-si.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From d4b448b197dc80f3f4ced843b718501ec5de8753 Mon Sep 17 00:00:00 2001
-From: Pierre-Hugues Husson
-Date: Mon, 20 Dec 2021 15:01:41 -0500
-Subject: [PATCH 29/43] Dynamically resize boot animation to match screen size
-
-Change-Id: I54e49fc6b8c670103852e212d1416e27ff976205
----
- cmds/bootanimation/BootAnimation.cpp | 20 ++++++++++++++++++++
- 1 file changed, 20 insertions(+)
-
-diff --git a/cmds/bootanimation/BootAnimation.cpp b/cmds/bootanimation/BootAnimation.cpp
-index 53a84bd1b21e..327d12f6d299 100644
---- a/cmds/bootanimation/BootAnimation.cpp
-+++ b/cmds/bootanimation/BootAnimation.cpp
-@@ -583,6 +583,26 @@ status_t BootAnimation::readyToRun() {
- mFlingerSurface = s;
- mTargetInset = -1;
-
-+ SLOGE("Got screen size %d, animation size %d", mWidth, mAnimation->width);
-+ int origWidth = mAnimation->width;
-+ if ( mAnimation->width*2 < mWidth ) {
-+ SLOGE("Making animation bigger");
-+ mAnimation->width *= 2;
-+ mAnimation->height *= 2;
-+ } else if ( mWidth < mAnimation->width ) {
-+ SLOGE("Making animation smaller");
-+ mAnimation->width /= 2;
-+ mAnimation->height /= 2;
-+ }
-+ for (Animation::Part& part : mAnimation->parts) {
-+ for(auto& frame: part.frames) {
-+ if(frame.trimWidth == origWidth && frame.trimX == 0 && frame.trimY == 0) {
-+ frame.trimWidth = mAnimation->width;
-+ frame.trimHeight = mAnimation->height;
-+ }
-+ }
-+ }
-+
- // Rotate the boot animation according to the value specified in the sysprop
- // ro.bootanim.set_orientation_. Four values are supported: ORIENTATION_0,
- // ORIENTATION_90, ORIENTATION_180 and ORIENTATION_270.
---
-2.37.1 (Apple Git-137.1)
-
diff --git a/patches/trebledroid/platform_frameworks_base/0038-Try-catch-around-constrainNitsAndBacklightArrays-and.patch b/patches/trebledroid/platform_frameworks_base/0030-Try-catch-around-constrainNitsAndBacklightArrays-and.patch
similarity index 93%
rename from patches/trebledroid/platform_frameworks_base/0038-Try-catch-around-constrainNitsAndBacklightArrays-and.patch
rename to patches/trebledroid/platform_frameworks_base/0030-Try-catch-around-constrainNitsAndBacklightArrays-and.patch
index f800d24..30d1c96 100644
--- a/patches/trebledroid/platform_frameworks_base/0038-Try-catch-around-constrainNitsAndBacklightArrays-and.patch
+++ b/patches/trebledroid/platform_frameworks_base/0030-Try-catch-around-constrainNitsAndBacklightArrays-and.patch
@@ -1,7 +1,7 @@
-From cf0dbc86dfebeca58b9fe08b16b154331a0d307a Mon Sep 17 00:00:00 2001
+From 55b87f76601e0ad7cde57384878394336bef3e47 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson
Date: Fri, 2 Jun 2023 19:19:31 -0400
-Subject: [PATCH 38/43] Try catch around constrainNitsAndBacklightArrays, and
+Subject: [PATCH 30/48] Try catch around constrainNitsAndBacklightArrays, and
falls back to dumb curve. It crashes on Xperia 1 IV.
---
@@ -9,10 +9,10 @@ Subject: [PATCH 38/43] Try catch around constrainNitsAndBacklightArrays, and
1 file changed, 32 insertions(+), 26 deletions(-)
diff --git a/services/core/java/com/android/server/display/DisplayDeviceConfig.java b/services/core/java/com/android/server/display/DisplayDeviceConfig.java
-index 44150f8f68d0..d9ec994e58de 100644
+index 3af484071e43..0f91fce1b076 100644
--- a/services/core/java/com/android/server/display/DisplayDeviceConfig.java
+++ b/services/core/java/com/android/server/display/DisplayDeviceConfig.java
-@@ -1709,37 +1709,43 @@ public class DisplayDeviceConfig {
+@@ -1826,37 +1826,43 @@ public class DisplayDeviceConfig {
return;
}
@@ -83,5 +83,5 @@ index 44150f8f68d0..d9ec994e58de 100644
private Spline loadSdrHdrRatioMap(HighBrightnessMode hbmConfig) {
--
-2.37.1 (Apple Git-137.1)
+2.41.0
diff --git a/patches/trebledroid/platform_frameworks_base/0031-Add-Mediatek-power-hints-on-touch.patch b/patches/trebledroid/platform_frameworks_base/0031-Add-Mediatek-power-hints-on-touch.patch
new file mode 100644
index 0000000..6d260b9
--- /dev/null
+++ b/patches/trebledroid/platform_frameworks_base/0031-Add-Mediatek-power-hints-on-touch.patch
@@ -0,0 +1,127 @@
+From 6516617268c788a4322fd770575d65ace9f9adff Mon Sep 17 00:00:00 2001
+From: Pierre-Hugues Husson
+Date: Sat, 17 Jun 2023 08:31:55 -0400
+Subject: [PATCH 31/48] Add Mediatek power hints on touch
+
+Mediatek has multiple HALs (which existed concurrently), so it is a bit
+of a mess.
+From what I can tell, mOldMtkPerf is used on Android 10 vendors, while
+mMtkPerf is used on Android 11/12 vendors.
+If anyone has an Android 9 vendor and want to take a look, I think it
+would be something like this:
+vendor.mediatek.hardware.power.V2_0.IPower.powerHint()
+
+On some devices, sending the touch boost isn't very helpful. Our guess
+is that Android 12 rendering got a lot heavier, and then touch boost is
+not enough. So, we add a property to /cheat/ and report a bigger boost:
+APP_ROTATE.
+On the few devices we've seen, touch boost only boosts scheduler, while
+app rotate will also for cpu min frequency.
+Experimentally using this app rotate boost indeed makes the device much
+smoother.
+
+Change-Id: I9f1eac5a20b98920a5d0c8204fe4d165ba069f5a
+---
+ services/core/Android.bp | 4 +-
+ .../com/android/server/wm/DisplayPolicy.java | 49 +++++++++++++++++++
+ 2 files changed, 52 insertions(+), 1 deletion(-)
+
+diff --git a/services/core/Android.bp b/services/core/Android.bp
+index 735959270c11..05782235ea1c 100644
+--- a/services/core/Android.bp
++++ b/services/core/Android.bp
+@@ -186,7 +186,9 @@ java_library_static {
+ "com.android.sysprop.watchdog",
+ "ImmutabilityAnnotation",
+ "securebox",
+- "vendor.samsung.hardware.sysinput-V1.2-java", // HIDL
++ // HIDL
++ "vendor.mediatek.hardware.mtkpower-V1.1-java",
++ "vendor.samsung.hardware.sysinput-V1.2-java",
+ ],
+ javac_shard_size: 50,
+ javacflags: [
+diff --git a/services/core/java/com/android/server/wm/DisplayPolicy.java b/services/core/java/com/android/server/wm/DisplayPolicy.java
+index f075fc9f4ed3..cbe811b78b1d 100644
+--- a/services/core/java/com/android/server/wm/DisplayPolicy.java
++++ b/services/core/java/com/android/server/wm/DisplayPolicy.java
+@@ -227,6 +227,9 @@ public class DisplayPolicy {
+ */
+ private boolean mRemoteInsetsControllerControlsSystemBars;
+
++ private vendor.mediatek.hardware.mtkpower.V1_1.IMtkPerf mMtkPerf;
++ private vendor.mediatek.hardware.mtkpower.V1_0.IMtkPower mOldMtkPerf;
++
+ StatusBarManagerInternal getStatusBarManagerInternal() {
+ synchronized (mServiceAcquireLock) {
+ if (mStatusBarManagerInternal == null) {
+@@ -463,6 +466,19 @@ public class DisplayPolicy {
+ mScreenOnEarly = true;
+ mScreenOnFully = true;
+ }
++ try {
++ mMtkPerf = vendor.mediatek.hardware.mtkpower.V1_1.IMtkPerf.getService();
++ } catch(Throwable t) {
++ android.util.Log.d("PHH-Power", "Retrieving mtkpower 1.0", t);
++ mMtkPerf = null;
++ }
++
++ try {
++ mOldMtkPerf = vendor.mediatek.hardware.mtkpower.V1_0.IMtkPower.getService();
++ } catch(Throwable t) {
++ android.util.Log.d("PHH-Power", "Retrieving mtkpower 1.0", t);
++ mOldMtkPerf = null;
++ }
+
+ if (mPerf != null) {
+ SCROLL_BOOST_SS_ENABLE = Boolean.parseBoolean(mPerf.perfGetProp("vendor.perf.gestureflingboost.enable", "false"));
+@@ -553,6 +569,17 @@ public class DisplayPolicy {
+ mService.mPowerManagerInternal.setPowerBoost(
+ Boost.INTERACTION, duration);
+ }
++ if(mOldMtkPerf != null) {
++ try {
++ android.util.Log.d("PHH-Power", "mtk1 fling power hint");
++ int hint = 36; // MTKPOWER_HINT_APP_TOUCH
++ if("rotate".equals(SystemProperties.get("persist.sys.phh.touch_hint")))
++ hint = 35; // MTKPOWER_HINT_APP_ROTATE
++ mOldMtkPerf.mtkPowerHint(hint, duration);
++ } catch(Throwable t) {
++ android.util.Log.d("PHH-Power", "Failed sending touch power hint", t);
++ }
++ }
+ }
+
+ @Override
+@@ -571,6 +598,28 @@ public class DisplayPolicy {
+ if (listener != null) {
+ listener.onTouchStart();
+ }
++ if(mMtkPerf != null) {
++ try {
++ android.util.Log.d("PHH-Power", "mtk power hint");
++ int hint = 25; //MTKPOWER_HINT_APP_TOUCH
++ if("rotate".equals(SystemProperties.get("persist.sys.phh.touch_hint")))
++ hint = 24; // MTKPOWER_HINT_APP_ROTATE
++ mMtkPerf.perfCusLockHint(hint, 1000);
++ } catch(Throwable t) {
++ android.util.Log.d("PHH-Power", "Failed sending touch power hint", t);
++ }
++ }
++ if(mOldMtkPerf != null) {
++ try {
++ android.util.Log.d("PHH-Power", "mtk1 power hint");
++ int hint = 36; // MTKPOWER_HINT_APP_TOUCH
++ if("rotate".equals(SystemProperties.get("persist.sys.phh.touch_hint")))
++ hint = 35; // MTKPOWER_HINT_APP_ROTATE
++ mOldMtkPerf.mtkPowerHint(hint, 1000);
++ } catch(Throwable t) {
++ android.util.Log.d("PHH-Power", "Failed sending touch power hint", t);
++ }
++ }
+ }
+
+ @Override
+--
+2.41.0
+
diff --git a/patches/trebledroid/platform_frameworks_base/0031-Set-old-fingerprint-sensors-to-security-strong.patch b/patches/trebledroid/platform_frameworks_base/0031-Set-old-fingerprint-sensors-to-security-strong.patch
deleted file mode 100644
index 1d29cdf..0000000
--- a/patches/trebledroid/platform_frameworks_base/0031-Set-old-fingerprint-sensors-to-security-strong.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 43923b01b5d931a967bd8d01406f1e426ae42908 Mon Sep 17 00:00:00 2001
-From: Pierre-Hugues Husson
-Date: Sat, 3 Dec 2022 17:13:24 -0500
-Subject: [PATCH 31/43] Set old fingerprint sensors to security "strong"
-
-This allows removing config_biometric_sensors from overlays, which led
-to Pixels not booting, because they are using AIDL biometric sensor, and
-despite its name, config_biometric_sensors is HIDL-specific
----
- .../core/java/com/android/server/biometrics/AuthService.java | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/services/core/java/com/android/server/biometrics/AuthService.java b/services/core/java/com/android/server/biometrics/AuthService.java
-index bc550d311370..2fad2bd10832 100644
---- a/services/core/java/com/android/server/biometrics/AuthService.java
-+++ b/services/core/java/com/android/server/biometrics/AuthService.java
-@@ -666,7 +666,7 @@ public class AuthService extends SystemService {
- if (pm.hasSystemFeature(PackageManager.FEATURE_FACE)) {
- modalities.add(String.valueOf(BiometricAuthenticator.TYPE_FACE));
- }
-- final String strength = String.valueOf(Authenticators.BIOMETRIC_CONVENIENCE);
-+ final String strength = String.valueOf(Authenticators.BIOMETRIC_STRONG);
- final String[] configStrings = new String[modalities.size()];
- for (int i = 0; i < modalities.size(); ++i) {
- final String id = String.valueOf(i);
---
-2.37.1 (Apple Git-137.1)
-
diff --git a/patches/trebledroid/platform_frameworks_base/0040-Detect-Moto-dynamic-hardware-feature.patch b/patches/trebledroid/platform_frameworks_base/0032-Detect-Moto-dynamic-hardware-feature.patch
similarity index 79%
rename from patches/trebledroid/platform_frameworks_base/0040-Detect-Moto-dynamic-hardware-feature.patch
rename to patches/trebledroid/platform_frameworks_base/0032-Detect-Moto-dynamic-hardware-feature.patch
index 65b599f..15e2f46 100644
--- a/patches/trebledroid/platform_frameworks_base/0040-Detect-Moto-dynamic-hardware-feature.patch
+++ b/patches/trebledroid/platform_frameworks_base/0032-Detect-Moto-dynamic-hardware-feature.patch
@@ -1,7 +1,7 @@
-From 50b12aa10d3d3c0b44aea2adb95f0659234f32bb Mon Sep 17 00:00:00 2001
+From af0691a0ee846ab5185bbb09d01d2334f97478d1 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson
Date: Wed, 5 Jul 2023 10:50:36 -0400
-Subject: [PATCH 40/43] Detect Moto dynamic hardware feature
+Subject: [PATCH 32/48] Detect Moto dynamic hardware feature
Moto added a custom node in sysconfig XMLs:
@@ -13,11 +13,11 @@ NFC-less variants
.../java/com/android/server/SystemConfig.java | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
-diff --git a/core/java/com/android/server/SystemConfig.java b/core/java/com/android/server/SystemConfig.java
-index 00b01051adae..ffcc75e63d66 100644
---- a/core/java/com/android/server/SystemConfig.java
-+++ b/core/java/com/android/server/SystemConfig.java
-@@ -979,6 +979,25 @@ public class SystemConfig {
+diff --git a/services/core/java/com/android/server/SystemConfig.java b/services/core/java/com/android/server/SystemConfig.java
+index 7fae31c0bb4b..6da8e9397829 100644
+--- a/services/core/java/com/android/server/SystemConfig.java
++++ b/services/core/java/com/android/server/SystemConfig.java
+@@ -939,6 +939,25 @@ public class SystemConfig {
}
XmlUtils.skipCurrentTag(parser);
} break;
@@ -44,5 +44,5 @@ index 00b01051adae..ffcc75e63d66 100644
if (allowOverrideAppRestrictions) {
String pkgname = parser.getAttributeValue(null, "package");
--
-2.37.1 (Apple Git-137.1)
+2.41.0
diff --git a/patches/trebledroid/platform_frameworks_base/0033-Fixup-of-c50777-original-commit-only-cares-about-R-v.patch b/patches/trebledroid/platform_frameworks_base/0033-Fixup-of-c50777-original-commit-only-cares-about-R-v.patch
deleted file mode 100644
index 4db2ac1..0000000
--- a/patches/trebledroid/platform_frameworks_base/0033-Fixup-of-c50777-original-commit-only-cares-about-R-v.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From 7cac91bc9725fb4481ff612440f28c43b907b8a0 Mon Sep 17 00:00:00 2001
-From: Pierre-Hugues Husson
-Date: Thu, 15 Dec 2022 15:54:50 -0500
-Subject: [PATCH 33/43] Fixup of c50777 -- original commit only cares about R
- vendors, but not about older ones. Apply that on older ones as well
-
----
- .../core/java/com/android/server/biometrics/AuthService.java | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/services/core/java/com/android/server/biometrics/AuthService.java b/services/core/java/com/android/server/biometrics/AuthService.java
-index 2fad2bd10832..6fbc3c66c1bc 100644
---- a/services/core/java/com/android/server/biometrics/AuthService.java
-+++ b/services/core/java/com/android/server/biometrics/AuthService.java
-@@ -631,7 +631,7 @@ public class AuthService extends SystemService {
- final int firstApiLevel = SystemProperties.getInt(SYSPROP_FIRST_API_LEVEL, 0);
- final int apiLevel = SystemProperties.getInt(SYSPROP_API_LEVEL, firstApiLevel);
- String[] configStrings = mInjector.getConfiguration(getContext());
-- if (configStrings.length == 0 && apiLevel == Build.VERSION_CODES.R) {
-+ if (configStrings.length == 0 && apiLevel <= Build.VERSION_CODES.R) {
- // For backwards compatibility with R where biometrics could work without being
- // configured in config_biometric_sensors. In the absence of a vendor provided
- // configuration, we assume the weakest biometric strength (i.e. convenience).
---
-2.37.1 (Apple Git-137.1)
-
diff --git a/patches/trebledroid/platform_frameworks_base/0033-Restore-getSimStateForSlotIndex-in-SubscriptionManag.patch b/patches/trebledroid/platform_frameworks_base/0033-Restore-getSimStateForSlotIndex-in-SubscriptionManag.patch
new file mode 100644
index 0000000..788662f
--- /dev/null
+++ b/patches/trebledroid/platform_frameworks_base/0033-Restore-getSimStateForSlotIndex-in-SubscriptionManag.patch
@@ -0,0 +1,40 @@
+From 03c56dc1946943243dca427d0919c0566e4d45f1 Mon Sep 17 00:00:00 2001
+From: Andy CrossGate Yan
+Date: Wed, 2 Aug 2023 20:59:53 +0800
+Subject: [PATCH 33/48] Restore getSimStateForSlotIndex in SubscriptionManager
+
+MTK IMS still needs it here
+
+Change-Id: I41bac57c68055f369232359a464642daab94403b
+---
+ .../android/telephony/SubscriptionManager.java | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+diff --git a/telephony/java/android/telephony/SubscriptionManager.java b/telephony/java/android/telephony/SubscriptionManager.java
+index 64e43568e4d6..cfb4f12815a2 100644
+--- a/telephony/java/android/telephony/SubscriptionManager.java
++++ b/telephony/java/android/telephony/SubscriptionManager.java
+@@ -2549,6 +2549,20 @@ public class SubscriptionManager {
+ return TelephonyManager.getDefault().isNetworkRoaming(subId);
+ }
+
++ /**
++ * Returns a constant indicating the state of sim for the slot index.
++ *
++ * @param slotIndex Logical SIM slot index.
++ *
++ * @see TelephonyManager.SimState
++ *
++ * @hide
++ */
++ @TelephonyManager.SimState
++ public static int getSimStateForSlotIndex(int slotIndex) {
++ return TelephonyManager.getSimStateForSlotIndex(slotIndex);
++ }
++
+ /**
+ * Set a field in the subscription database. Note not all fields are supported.
+ *
+--
+2.41.0
+
diff --git a/patches/trebledroid/platform_frameworks_base/0034-Add-runWithCleanCallingIdentity-variant-with-both-ex.patch b/patches/trebledroid/platform_frameworks_base/0034-Add-runWithCleanCallingIdentity-variant-with-both-ex.patch
new file mode 100644
index 0000000..9f7dc60
--- /dev/null
+++ b/patches/trebledroid/platform_frameworks_base/0034-Add-runWithCleanCallingIdentity-variant-with-both-ex.patch
@@ -0,0 +1,72 @@
+From bc106a356ecc2606dbf111ffd1bb7d74cd854eaf Mon Sep 17 00:00:00 2001
+From: Andy CrossGate Yan
+Date: Sat, 12 Aug 2023 20:11:17 +0800
+Subject: [PATCH 34/48] Add runWithCleanCallingIdentity variant with both
+ executor and return value
+
+This complements the fixup to ImsPhoneCallTracker (in fw/o/t) for U
+
+Change-Id: If444290787025e130dce4bdeaf92372ae32793fe
+---
+ .../telephony/util/TelephonyUtils.java | 32 ++++++++++++++++++-
+ 1 file changed, 31 insertions(+), 1 deletion(-)
+
+diff --git a/telephony/common/com/android/internal/telephony/util/TelephonyUtils.java b/telephony/common/com/android/internal/telephony/util/TelephonyUtils.java
+index 9a8c9655375d..454080144d35 100644
+--- a/telephony/common/com/android/internal/telephony/util/TelephonyUtils.java
++++ b/telephony/common/com/android/internal/telephony/util/TelephonyUtils.java
+@@ -42,7 +42,9 @@ import com.android.internal.telephony.ITelephony;
+ import java.io.PrintWriter;
+ import java.util.Collections;
+ import java.util.List;
++import java.util.concurrent.CompletableFuture;
+ import java.util.concurrent.CountDownLatch;
++import java.util.concurrent.ExecutionException;
+ import java.util.concurrent.Executor;
+ import java.util.concurrent.TimeUnit;
+ import java.util.function.Supplier;
+@@ -151,6 +153,34 @@ public final class TelephonyUtils {
+ }
+ }
+
++ /**
++ * Convenience method for running the provided action in the provided
++ * executor enclosed in
++ * {@link Binder#clearCallingIdentity}/{@link Binder#restoreCallingIdentity} and return
++ * the result.
++ *
++ * Any exception thrown by the given action will need to be handled by caller.
++ *
++ */
++ public static T runWithCleanCallingIdentity(
++ @NonNull Supplier action, @NonNull Executor executor) {
++ if (action != null) {
++ if (executor != null) {
++ try {
++ return CompletableFuture.supplyAsync(
++ () -> runWithCleanCallingIdentity(action), executor).get();
++ } catch (ExecutionException | InterruptedException e) {
++ Log.w(LOG_TAG, "TelephonyUtils : runWithCleanCallingIdentity exception: "
++ + e.getMessage());
++ return null;
++ }
++ } else {
++ return runWithCleanCallingIdentity(action);
++ }
++ }
++ return null;
++ }
++
+ /**
+ * Filter values in bundle to only basic types.
+ */
+@@ -319,4 +349,4 @@ public final class TelephonyUtils {
+ return false;
+
+ }
+-}
+\ No newline at end of file
++}
+--
+2.41.0
+
diff --git a/patches/trebledroid/platform_frameworks_base/0035-Always-add-HIDL-fingerprint-config-Galaxy-A53-is-mis.patch b/patches/trebledroid/platform_frameworks_base/0035-Always-add-HIDL-fingerprint-config-Galaxy-A53-is-mis.patch
deleted file mode 100644
index e59663d..0000000
--- a/patches/trebledroid/platform_frameworks_base/0035-Always-add-HIDL-fingerprint-config-Galaxy-A53-is-mis.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From f99b222124cac13535f6f2b97d5bde5131d2231e Mon Sep 17 00:00:00 2001
-From: Pierre-Hugues Husson
-Date: Tue, 3 Jan 2023 17:59:00 -0500
-Subject: [PATCH 35/43] Always add HIDL fingerprint config (Galaxy A53 is
- missing it on A12 vendor) -- but first enumerate AIDL
-
----
- .../core/java/com/android/server/biometrics/AuthService.java | 4 ++--
- .../biometrics/sensors/fingerprint/FingerprintService.java | 3 ++-
- 2 files changed, 4 insertions(+), 3 deletions(-)
-
-diff --git a/services/core/java/com/android/server/biometrics/AuthService.java b/services/core/java/com/android/server/biometrics/AuthService.java
-index 748152aa7c97..b47b47c41f76 100644
---- a/services/core/java/com/android/server/biometrics/AuthService.java
-+++ b/services/core/java/com/android/server/biometrics/AuthService.java
-@@ -650,11 +650,11 @@ public class AuthService extends SystemService {
- final int firstApiLevel = SystemProperties.getInt(SYSPROP_FIRST_API_LEVEL, 0);
- final int apiLevel = SystemProperties.getInt(SYSPROP_API_LEVEL, firstApiLevel);
- String[] configStrings = mInjector.getConfiguration(getContext());
-- if (configStrings.length == 0 && apiLevel <= Build.VERSION_CODES.R) {
-+ if (configStrings.length == 0) {
- // For backwards compatibility with R where biometrics could work without being
- // configured in config_biometric_sensors. In the absence of a vendor provided
- // configuration, we assume the weakest biometric strength (i.e. convenience).
-- Slog.w(TAG, "Found R vendor partition without config_biometric_sensors");
-+ Slog.w(TAG, "Found vendor partition without config_biometric_sensors");
- configStrings = generateRSdkCompatibleConfiguration();
- }
- hidlConfigs = new SensorConfig[configStrings.length];
-diff --git a/services/core/java/com/android/server/biometrics/sensors/fingerprint/FingerprintService.java b/services/core/java/com/android/server/biometrics/sensors/fingerprint/FingerprintService.java
-index d55dd8ab85f8..7d537425e6d2 100644
---- a/services/core/java/com/android/server/biometrics/sensors/fingerprint/FingerprintService.java
-+++ b/services/core/java/com/android/server/biometrics/sensors/fingerprint/FingerprintService.java
-@@ -899,8 +899,9 @@ public class FingerprintService extends SystemService {
- final Handler handler = new Handler(thread.getLooper());
-
- handler.post(() -> {
-- addHidlProviders(hidlSensors);
- addAidlProviders();
-+ if(mServiceProviders.isEmpty())
-+ addHidlProviders(hidlSensors);
-
- final IBiometricService biometricService = IBiometricService.Stub.asInterface(
- ServiceManager.getService(Context.BIOMETRIC_SERVICE));
---
-2.37.1 (Apple Git-137.1)
-
diff --git a/patches/trebledroid/platform_frameworks_base/0035-Catch-NPE-in-SystemUI.patch b/patches/trebledroid/platform_frameworks_base/0035-Catch-NPE-in-SystemUI.patch
new file mode 100644
index 0000000..8e1c0f0
--- /dev/null
+++ b/patches/trebledroid/platform_frameworks_base/0035-Catch-NPE-in-SystemUI.patch
@@ -0,0 +1,31 @@
+From 64bfcd16eb1d2f8203329170e7d4a0a2482e304e Mon Sep 17 00:00:00 2001
+From: Pierre-Hugues Husson
+Date: Fri, 6 Oct 2023 10:57:13 -0400
+Subject: [PATCH 35/48] Catch NPE in SystemUI
+
+No idea why it triggers, but it crashes SystemUI on boot for my TV
+device
+---
+ .../com/android/systemui/keyguard/KeyguardViewMediator.java | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
+index 1a06b0184bc5..8535a27c8be5 100644
+--- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
++++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
+@@ -3323,7 +3323,11 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
+ Trace.beginSection("KeyguardViewMediator#handleMotifyStartedWakingUp");
+ synchronized (KeyguardViewMediator.this) {
+ if (DEBUG) Log.d(TAG, "handleNotifyWakingUp");
+- mKeyguardViewControllerLazy.get().onStartedWakingUp();
++ try {
++ mKeyguardViewControllerLazy.get().onStartedWakingUp();
++ } catch(Throwable t) {
++ android.util.Log.e("PHH", "handleNotifyStartedWakingUp crashed bip", t);
++ }
+ }
+ Trace.endSection();
+ }
+--
+2.41.0
+
diff --git a/patches/trebledroid/platform_frameworks_base/0005-Add-support-for-app-signature-spoofing.patch b/patches/trebledroid/platform_frameworks_base/0036-Add-support-for-app-signature-spoofing.patch
similarity index 84%
rename from patches/trebledroid/platform_frameworks_base/0005-Add-support-for-app-signature-spoofing.patch
rename to patches/trebledroid/platform_frameworks_base/0036-Add-support-for-app-signature-spoofing.patch
index e1cdd70..f4f47e1 100644
--- a/patches/trebledroid/platform_frameworks_base/0005-Add-support-for-app-signature-spoofing.patch
+++ b/patches/trebledroid/platform_frameworks_base/0036-Add-support-for-app-signature-spoofing.patch
@@ -1,7 +1,7 @@
-From a5b515f026f69cee024ca5dba997b90be8b7c8de Mon Sep 17 00:00:00 2001
+From 438bcd37ae70ffd6ad14dbe89124b748ed9f0b2a Mon Sep 17 00:00:00 2001
From: Danny Lin
Date: Sat, 16 Oct 2021 05:27:57 -0700
-Subject: [PATCH 05/43] Add support for app signature spoofing
+Subject: [PATCH 36/48] Add support for app signature spoofing
This is needed by microG GmsCore to pretend to be the official Google
Play Services package, because client apps check the package signature
@@ -38,18 +38,18 @@ Change-Id: Ied7d6ce0b83a2d2345c3abba0429998d86494a88
4 files changed, 56 insertions(+), 3 deletions(-)
diff --git a/core/api/current.txt b/core/api/current.txt
-index 7100bf9265e5..d75bb4a65c62 100644
+index 2406d7466998..73a062c46adf 100644
--- a/core/api/current.txt
+++ b/core/api/current.txt
-@@ -87,6 +87,7 @@ package android {
- field public static final String DUMP = "android.permission.DUMP";
+@@ -95,6 +95,7 @@ package android {
+ field public static final String EXECUTE_APP_ACTION = "android.permission.EXECUTE_APP_ACTION";
field public static final String EXPAND_STATUS_BAR = "android.permission.EXPAND_STATUS_BAR";
field public static final String FACTORY_TEST = "android.permission.FACTORY_TEST";
+ field public static final String FAKE_PACKAGE_SIGNATURE = "android.permission.FAKE_PACKAGE_SIGNATURE";
field public static final String FOREGROUND_SERVICE = "android.permission.FOREGROUND_SERVICE";
- field public static final String GET_ACCOUNTS = "android.permission.GET_ACCOUNTS";
- field public static final String GET_ACCOUNTS_PRIVILEGED = "android.permission.GET_ACCOUNTS_PRIVILEGED";
-@@ -222,6 +223,7 @@ package android {
+ field public static final String FOREGROUND_SERVICE_CAMERA = "android.permission.FOREGROUND_SERVICE_CAMERA";
+ field public static final String FOREGROUND_SERVICE_CONNECTED_DEVICE = "android.permission.FOREGROUND_SERVICE_CONNECTED_DEVICE";
+@@ -326,6 +327,7 @@ package android {
field public static final String CALL_LOG = "android.permission-group.CALL_LOG";
field public static final String CAMERA = "android.permission-group.CAMERA";
field public static final String CONTACTS = "android.permission-group.CONTACTS";
@@ -58,10 +58,10 @@ index 7100bf9265e5..d75bb4a65c62 100644
field public static final String MICROPHONE = "android.permission-group.MICROPHONE";
field public static final String NEARBY_DEVICES = "android.permission-group.NEARBY_DEVICES";
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
-index 0e95e30a99b8..a456ac6b7129 100644
+index 2f9f6ae3f3c4..c4cde374ce58 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
-@@ -3569,6 +3569,21 @@
+@@ -4251,6 +4251,21 @@
android:description="@string/permdesc_getPackageSize"
android:protectionLevel="normal" />
@@ -84,10 +84,10 @@ index 0e95e30a99b8..a456ac6b7129 100644
{@link android.content.pm.PackageManager#addPackageToPreferred}
for details. -->
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
-index 1106628f779f..008522048e4c 100644
+index c06b197033da..e1d97c2534a8 100644
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
-@@ -982,6 +982,18 @@
+@@ -991,6 +991,18 @@
@@ -107,10 +107,10 @@ index 1106628f779f..008522048e4c 100644
disable or modify status bar
diff --git a/services/core/java/com/android/server/pm/ComputerEngine.java b/services/core/java/com/android/server/pm/ComputerEngine.java
-index 46b7460dff1b..40549962436f 100644
+index 78f1fa60b69f..fb2f7da97cda 100644
--- a/services/core/java/com/android/server/pm/ComputerEngine.java
+++ b/services/core/java/com/android/server/pm/ComputerEngine.java
-@@ -1603,6 +1603,29 @@ public class ComputerEngine implements Computer {
+@@ -1450,6 +1450,29 @@ public class ComputerEngine implements Computer {
return result;
}
@@ -140,24 +140,24 @@ index 46b7460dff1b..40549962436f 100644
public final PackageInfo generatePackageInfo(PackageStateInternal ps,
@PackageManager.PackageInfoFlagsBits long flags, int userId) {
if (!mUserManager.exists(userId)) return null;
-@@ -1632,13 +1655,14 @@ public class ComputerEngine implements Computer {
- final int[] gids = (flags & PackageManager.GET_GIDS) == 0 ? EMPTY_INT_ARRAY
- : mPermissionManager.getGidsForUid(UserHandle.getUid(userId, ps.getAppId()));
+@@ -1483,13 +1506,14 @@ public class ComputerEngine implements Computer {
+ || ArrayUtils.isEmpty(p.getPermissions())) ? Collections.emptySet()
+ : mPermissionManager.getInstalledPermissions(ps.getPackageName());
// Compute granted permissions only if package has requested permissions
-- final Set permissions = ((flags & PackageManager.GET_PERMISSIONS) == 0
-+ final Set permissions = (((flags & PackageManager.GET_PERMISSIONS) == 0
+- final Set grantedPermissions = ((flags & PackageManager.GET_PERMISSIONS) == 0
++ final Set grantedPermissions = (((flags & PackageManager.GET_PERMISSIONS) == 0
+ && !requestsFakeSignature(p))
|| ArrayUtils.isEmpty(p.getRequestedPermissions())) ? Collections.emptySet()
: mPermissionManager.getGrantedPermissions(ps.getPackageName(), userId);
- PackageInfo packageInfo = PackageInfoUtils.generate(p, gids, flags,
+ PackageInfo packageInfo = mayFakeSignature(p, PackageInfoUtils.generate(p, gids, flags,
- state.getFirstInstallTime(), ps.getLastUpdateTime(), permissions, state, userId,
-- ps);
-+ ps), permissions);
+ state.getFirstInstallTimeMillis(), ps.getLastUpdateTime(), installedPermissions,
+- grantedPermissions, state, userId, ps);
++ grantedPermissions, state, userId, ps), grantedPermissions);
if (packageInfo == null) {
return null;
--
-2.37.1 (Apple Git-137.1)
+2.41.0
diff --git a/patches/trebledroid/platform_frameworks_base/0036-SystemUI-Implement-alternate-brightness-path-for-FOD.patch b/patches/trebledroid/platform_frameworks_base/0036-SystemUI-Implement-alternate-brightness-path-for-FOD.patch
deleted file mode 100644
index 3d92ad1..0000000
--- a/patches/trebledroid/platform_frameworks_base/0036-SystemUI-Implement-alternate-brightness-path-for-FOD.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From 748b7025becfd1407806dace3d4ded14cad7ccab Mon Sep 17 00:00:00 2001
-From: ItsLynix <71310187+ItsLynix@users.noreply.github.com>
-Date: Sat, 28 Jan 2023 10:25:16 +0100
-Subject: [PATCH 36/43] SystemUI: Implement alternate brightness path for FOD
-
----
- .../com/android/systemui/biometrics/UdfpsView.kt | 15 +++++++++++++--
- 1 file changed, 13 insertions(+), 2 deletions(-)
-
-diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt
-index cdaad81b9222..6cc9ab3da570 100644
---- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt
-+++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt
-@@ -228,8 +228,19 @@ Log.d("PHH", "Surface destroyed!")
- mySurfaceView.setVisibility(VISIBLE)
- Log.d("PHH", "setting surface visible!")
-
-- val brightness = File("/sys/class/backlight/panel0-backlight/brightness").readText().toDouble()
-- val maxBrightness = File("/sys/class/backlight/panel0-backlight/max_brightness").readText().toDouble()
-+ val brightnessFile = File("/sys/class/backlight/panel/brightness")
-+ val maxBrightnessFile = File("/sys/class/backlight/panel/max_brightness")
-+
-+ var brightness: Double = 0.0
-+ var maxBrightness: Double = 0.0
-+
-+ if (brightnessFile.exists() && maxBrightnessFile.exists()) {
-+ brightness = brightnessFile.readText().toDouble()
-+ maxBrightness = maxBrightnessFile.readText().toDouble()
-+ } else {
-+ brightness = File("/sys/class/backlight/panel0-backlight/brightness").readText().toDouble()
-+ maxBrightness = File("/sys/class/backlight/panel0-backlight/max_brightness").readText().toDouble()
-+ }
-
- // Assume HBM is max brightness
- val dim = 1.0 - Math.pow( (brightness / maxBrightness), 1/2.3);
---
-2.37.1 (Apple Git-137.1)
-
diff --git a/patches/trebledroid/platform_frameworks_base/0026-Once-we-integrate-Samsung-Power-hal-in-libpowermanag.patch b/patches/trebledroid/platform_frameworks_base/0037-Once-we-integrate-Samsung-Power-hal-in-libpowermanag.patch
similarity index 74%
rename from patches/trebledroid/platform_frameworks_base/0026-Once-we-integrate-Samsung-Power-hal-in-libpowermanag.patch
rename to patches/trebledroid/platform_frameworks_base/0037-Once-we-integrate-Samsung-Power-hal-in-libpowermanag.patch
index ff19a79..a632aad 100644
--- a/patches/trebledroid/platform_frameworks_base/0026-Once-we-integrate-Samsung-Power-hal-in-libpowermanag.patch
+++ b/patches/trebledroid/platform_frameworks_base/0037-Once-we-integrate-Samsung-Power-hal-in-libpowermanag.patch
@@ -1,7 +1,7 @@
-From 72ed1b74f4b64bbfe5bcaccf38070ac3caa03386 Mon Sep 17 00:00:00 2001
+From 5d2b0f97fc722b3759db9fc5a84c70ce04882d72 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson
Date: Mon, 27 Dec 2021 17:57:11 -0500
-Subject: [PATCH 26/43] Once we integrate Samsung Power hal in libpowermanager,
+Subject: [PATCH 37/48] Once we integrate Samsung Power hal in libpowermanager,
libpowermanager and its deps require linking against
vendor.samsung.hardware.miscpower@2.0
@@ -11,10 +11,10 @@ Change-Id: I9084f64e505009abe9420d28b44199605cee52d8
1 file changed, 1 insertion(+)
diff --git a/services/core/jni/Android.bp b/services/core/jni/Android.bp
-index 1fc974ebc56f..c73b29739cbf 100644
+index ea0da6918ecc..ccd13526cb16 100644
--- a/services/core/jni/Android.bp
+++ b/services/core/jni/Android.bp
-@@ -188,6 +188,7 @@ cc_defaults {
+@@ -203,6 +203,7 @@ cc_defaults {
"service.incremental",
"vendor.samsung.hardware.light@2.0",
"vendor.samsung.hardware.light@3.0",
@@ -23,5 +23,5 @@ index 1fc974ebc56f..c73b29739cbf 100644
static_libs: [
--
-2.37.1 (Apple Git-137.1)
+2.41.0
diff --git a/patches/trebledroid/platform_frameworks_base/0037-bootanimation-Fix-bootanimation-when-using-mask-shin.patch b/patches/trebledroid/platform_frameworks_base/0037-bootanimation-Fix-bootanimation-when-using-mask-shin.patch
deleted file mode 100644
index c9a2eac..0000000
--- a/patches/trebledroid/platform_frameworks_base/0037-bootanimation-Fix-bootanimation-when-using-mask-shin.patch
+++ /dev/null
@@ -1,65 +0,0 @@
-From a828a37ac19766e78573fbaffaf6e2895834d3e4 Mon Sep 17 00:00:00 2001
-From: Pierre-Hugues Husson
-Date: Wed, 10 May 2023 11:28:27 -0400
-Subject: [PATCH 37/43] bootanimation: Fix bootanimation when using mask+shine
- rather than animation
-
-This was broken by the commit that automatically resizes animations
-
-Fixes: e27e0e177fe88584a280e0f7f624c249623efea1
----
- cmds/bootanimation/BootAnimation.cpp | 38 +++++++++++++++-------------
- 1 file changed, 20 insertions(+), 18 deletions(-)
-
-diff --git a/cmds/bootanimation/BootAnimation.cpp b/cmds/bootanimation/BootAnimation.cpp
-index 327d12f6d299..2449b27aae3d 100644
---- a/cmds/bootanimation/BootAnimation.cpp
-+++ b/cmds/bootanimation/BootAnimation.cpp
-@@ -583,24 +583,26 @@ status_t BootAnimation::readyToRun() {
- mFlingerSurface = s;
- mTargetInset = -1;
-
-- SLOGE("Got screen size %d, animation size %d", mWidth, mAnimation->width);
-- int origWidth = mAnimation->width;
-- if ( mAnimation->width*2 < mWidth ) {
-- SLOGE("Making animation bigger");
-- mAnimation->width *= 2;
-- mAnimation->height *= 2;
-- } else if ( mWidth < mAnimation->width ) {
-- SLOGE("Making animation smaller");
-- mAnimation->width /= 2;
-- mAnimation->height /= 2;
-- }
-- for (Animation::Part& part : mAnimation->parts) {
-- for(auto& frame: part.frames) {
-- if(frame.trimWidth == origWidth && frame.trimX == 0 && frame.trimY == 0) {
-- frame.trimWidth = mAnimation->width;
-- frame.trimHeight = mAnimation->height;
-- }
-- }
-+ if ( mAnimation != nullptr ) {
-+ SLOGE("Got screen size %d, animation size %d", mWidth, mAnimation->width);
-+ int origWidth = mAnimation->width;
-+ if ( mAnimation->width*2 < mWidth ) {
-+ SLOGE("Making animation bigger");
-+ mAnimation->width *= 2;
-+ mAnimation->height *= 2;
-+ } else if ( mWidth < mAnimation->width ) {
-+ SLOGE("Making animation smaller");
-+ mAnimation->width /= 2;
-+ mAnimation->height /= 2;
-+ }
-+ for (Animation::Part& part : mAnimation->parts) {
-+ for(auto& frame: part.frames) {
-+ if(frame.trimWidth == origWidth && frame.trimX == 0 && frame.trimY == 0) {
-+ frame.trimWidth = mAnimation->width;
-+ frame.trimHeight = mAnimation->height;
-+ }
-+ }
-+ }
- }
-
- // Rotate the boot animation according to the value specified in the sysprop
---
-2.37.1 (Apple Git-137.1)
-
diff --git a/patches/trebledroid/platform_frameworks_base/0034-FOD-support-for-Asus-ZF8-and-Samsung-devices.patch b/patches/trebledroid/platform_frameworks_base/0038-FOD-support-for-Asus-Samsung-and-recent-Xiaomi-devic.patch
similarity index 69%
rename from patches/trebledroid/platform_frameworks_base/0034-FOD-support-for-Asus-ZF8-and-Samsung-devices.patch
rename to patches/trebledroid/platform_frameworks_base/0038-FOD-support-for-Asus-Samsung-and-recent-Xiaomi-devic.patch
index 4b14272..a89b1ba 100644
--- a/patches/trebledroid/platform_frameworks_base/0034-FOD-support-for-Asus-ZF8-and-Samsung-devices.patch
+++ b/patches/trebledroid/platform_frameworks_base/0038-FOD-support-for-Asus-Samsung-and-recent-Xiaomi-devic.patch
@@ -1,50 +1,42 @@
-From 90efb0b2c0accdce2775ff853faeddd22491542a Mon Sep 17 00:00:00 2001
+From 0feda8f70f10d74ac1d954ed01d0d64c8bd08300 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson
Date: Sun, 18 Dec 2022 18:20:40 -0500
-Subject: [PATCH 34/43] FOD support for Asus ZF8 and Samsung devices
+Subject: [PATCH 38/48] FOD support for Asus, Samsung and recent Xiaomi devices
Thanks Asus for providing a free device to make this support
And thanks @davigamer987 for donating enough to get a Samsung FOD device
to make this
+
+Co-authored-by: jgudec
+Change-Id: Ibd0f9ea8fba584a38c060fd9271549a5e106b4eb
---
- packages/SystemUI/Android.bp | 1 +
- packages/SystemUI/res/values/config.xml | 2 +-
+ packages/SystemUI/Android.bp | 3 +
.../biometrics/UdfpsControllerOverlay.kt | 7 +-
- .../android/systemui/biometrics/UdfpsView.kt | 138 ++++++++++
- services/core/Android.bp | 7 +-
- .../server/biometrics/AuthService.java | 238 +++++++++++++++++-
- 6 files changed, 388 insertions(+), 5 deletions(-)
+ .../android/systemui/biometrics/UdfpsView.kt | 191 ++++++++++++
+ services/core/Android.bp | 5 +
+ .../server/biometrics/AuthService.java | 290 +++++++++++++++++-
+ .../fingerprint/FingerprintService.java | 3 +-
+ 6 files changed, 493 insertions(+), 6 deletions(-)
diff --git a/packages/SystemUI/Android.bp b/packages/SystemUI/Android.bp
-index ed62c5f012bc..dc2244c94080 100644
+index 7df3dfb89d96..7f77e39041d1 100644
--- a/packages/SystemUI/Android.bp
+++ b/packages/SystemUI/Android.bp
-@@ -177,6 +177,7 @@ android_library {
+@@ -197,6 +197,9 @@ android_library {
"lottie",
"LowLightDreamLib",
"motion_tool_lib",
+ "vendor.goodix.hardware.biometrics.fingerprint-V2.1-java",
++ "vendor.xiaomi.hw.touchfeature-V1.0-java",
++ "vendor.xiaomi.hardware.fingerprintextension-V1.0-java"
],
manifest: "AndroidManifest.xml",
-diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml
-index cd56541c55ff..9440510edb4c 100644
---- a/packages/SystemUI/res/values/config.xml
-+++ b/packages/SystemUI/res/values/config.xml
-@@ -585,7 +585,7 @@
-
-
-
-- 70
-+ 50
-
-
-
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsControllerOverlay.kt b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsControllerOverlay.kt
-index b6b5d26b398c..88c2976d81ab 100644
+index cabe9008ab47..826804492bc7 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsControllerOverlay.kt
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsControllerOverlay.kt
-@@ -120,7 +120,9 @@ class UdfpsControllerOverlay @JvmOverloads constructor(
+@@ -124,7 +124,9 @@ class UdfpsControllerOverlay @JvmOverloads constructor(
gravity = android.view.Gravity.TOP or android.view.Gravity.LEFT
layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS
flags = (Utils.FINGERPRINT_OVERLAY_LAYOUT_PARAM_FLAGS or
@@ -55,7 +47,7 @@ index b6b5d26b398c..88c2976d81ab 100644
privateFlags = WindowManager.LayoutParams.PRIVATE_FLAG_TRUSTED_OVERLAY
// Avoid announcing window title.
accessibilityTitle = " "
-@@ -189,6 +191,9 @@ class UdfpsControllerOverlay @JvmOverloads constructor(
+@@ -185,6 +187,9 @@ class UdfpsControllerOverlay @JvmOverloads constructor(
windowManager.addView(this, coreLayoutParams.updateDimensions(animation))
sensorRect = sensorBounds
touchExplorationEnabled = accessibilityManager.isTouchExplorationEnabled
@@ -66,10 +58,10 @@ index b6b5d26b398c..88c2976d81ab 100644
if (accessibilityManager.isTouchExplorationEnabled) {
setOnHoverListener { v, event -> onTouch(v, event, true) }
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt
-index e61c614f0292..cdaad81b9222 100644
+index 06dee7a2b9f6..bfc875290216 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt
-@@ -19,18 +19,27 @@ import android.content.Context
+@@ -19,16 +19,30 @@ import android.content.Context
import android.graphics.Canvas
import android.graphics.Color
import android.graphics.Paint
@@ -85,19 +77,22 @@ index e61c614f0292..cdaad81b9222 100644
+import android.view.SurfaceView
+import android.view.ViewGroup
import android.widget.FrameLayout
+ import com.android.settingslib.udfps.UdfpsOverlayParams
import com.android.systemui.R
import com.android.systemui.doze.DozeReceiver
+import java.io.File
+
+import vendor.goodix.hardware.biometrics.fingerprint.V2_1.IGoodixFingerprintDaemon
++
++import vendor.xiaomi.hw.touchfeature.V1_0.ITouchFeature
++import vendor.xiaomi.hardware.fingerprintextension.V1_0.IXiaomiFingerprint
++
++import android.os.Handler
++import android.os.HandlerThread
private const val TAG = "UdfpsView"
-+
- /**
- * The main view group containing all UDFPS animations.
- */
-@@ -38,6 +47,54 @@ class UdfpsView(
+@@ -39,6 +53,54 @@ class UdfpsView(
context: Context,
attrs: AttributeSet?
) : FrameLayout(context, attrs), DozeReceiver {
@@ -126,8 +121,8 @@ index e61c614f0292..cdaad81b9222 100644
+ var canvas: Canvas? = null
+ try {
+ canvas = p0.lockCanvas();
-+Log.d("PHH", "Surface dimensions ${canvas.getWidth()*1.0f} ${canvas.getHeight()*1.0f}")
-+ canvas.drawOval(RectF(0.0f, 0.0f, canvas.getWidth()*1.0f, canvas.getHeight()*1.0f), paint);
++ Log.d("PHH", "Surface dimensions ${canvas.getWidth()*1.0f} ${canvas.getHeight()*1.0f}")
++ canvas.drawOval(RectF(overlayParams.sensorBounds), paint);
+ } finally {
+ // Make sure the surface is never left in a bad state.
+ if (canvas != null) {
@@ -139,11 +134,11 @@ index e61c614f0292..cdaad81b9222 100644
+ }
+
+ override fun surfaceChanged(p0: SurfaceHolder, p1: Int, p2: Int, p3: Int) {
-+Log.d("PHH", "Got surface size $p1 $p2 $p3")
++ Log.d("PHH", "Got surface size $p1 $p2 $p3")
+ }
+
+ override fun surfaceDestroyed(p0: SurfaceHolder) {
-+Log.d("PHH", "Surface destroyed!")
++ Log.d("PHH", "Surface destroyed!")
+ }
+ })
+ mySurfaceView.holder.setFormat(PixelFormat.RGBA_8888)
@@ -152,7 +147,7 @@ index e61c614f0292..cdaad81b9222 100644
// Use expanded overlay when feature flag is true, set by UdfpsViewController
var useExpandedOverlay: Boolean = false
-@@ -66,6 +123,8 @@ class UdfpsView(
+@@ -67,6 +129,8 @@ class UdfpsView(
/** Parameters that affect the position and size of the overlay. */
var overlayParams = UdfpsOverlayParams()
@@ -161,7 +156,7 @@ index e61c614f0292..cdaad81b9222 100644
/** Debug message. */
var debugMessage: String? = null
set(value) {
-@@ -146,15 +205,94 @@ class UdfpsView(
+@@ -147,15 +211,142 @@ class UdfpsView(
!(animationViewController?.shouldPauseAuth() ?: false)
}
@@ -179,6 +174,12 @@ index e61c614f0292..cdaad81b9222 100644
+ var samsungActualMaskBrightness = "/sys/class/lcd/panel/actual_mask_brightness"
+ val hasSamsungMask = File(samsungActualMaskBrightness).exists()
+ var fodFileObserver: FileObserver? = null
++
++ val xiaomiDispParam = "/sys/class/mi_display/disp-DSI-0/disp_param"
++ var hasXiaomiLhbm = File(xiaomiDispParam).exists()
++
++ private val handlerThread = HandlerThread("UDFPS").also { it.start() }
++ val myHandler = Handler(handlerThread.looper)
+
fun configureDisplay(onDisplayConfigured: Runnable) {
isDisplayConfigured = true
@@ -188,8 +189,19 @@ index e61c614f0292..cdaad81b9222 100644
+ mySurfaceView.setVisibility(VISIBLE)
+ Log.d("PHH", "setting surface visible!")
+
-+ val brightness = File("/sys/class/backlight/panel0-backlight/brightness").readText().toDouble()
-+ val maxBrightness = File("/sys/class/backlight/panel0-backlight/max_brightness").readText().toDouble()
++ val brightnessFile = File("/sys/class/backlight/panel/brightness")
++ val maxBrightnessFile = File("/sys/class/backlight/panel/max_brightness")
++
++ var brightness: Double = 0.0
++ var maxBrightness: Double = 0.0
++
++ if (brightnessFile.exists() && maxBrightnessFile.exists()) {
++ brightness = brightnessFile.readText().toDouble()
++ maxBrightness = maxBrightnessFile.readText().toDouble()
++ } else {
++ brightness = File("/sys/class/backlight/panel0-backlight/brightness").readText().toDouble()
++ maxBrightness = File("/sys/class/backlight/panel0-backlight/max_brightness").readText().toDouble()
++ }
+
+ // Assume HBM is max brightness
+ val dim = 1.0 - Math.pow( (brightness / maxBrightness), 1/2.3);
@@ -203,6 +215,34 @@ index e61c614f0292..cdaad81b9222 100644
+
+ if(android.os.SystemProperties.get("ro.vendor.build.fingerprint").contains("ASUS")) {
+ goodixCmd(200001)
++ }
++
++ if(hasXiaomiLhbm){
++ Log.d("PHH-Enroll", "Xiaomi scenario in UdfpsView reached!")
++ mySurfaceView.setVisibility(INVISIBLE)
++
++ IXiaomiFingerprint.getService().extCmd(android.os.SystemProperties.getInt("persist.phh.xiaomi.fod.enrollment.id", 4), 1);
++ var res = ITouchFeature.getService().setTouchMode(0, 10, 1);
++ if(res != 0){
++ Log.d("PHH-Enroll", "SetTouchMode 10,1 was NOT executed successfully. Res is " + res)
++ }
++
++ myHandler.postDelayed({
++ var ret200 = ITouchFeature.getService().setTouchMode(0, 10, 1);
++
++ if(ret200 != 0){
++ Log.d("PHH-Enroll", "myHandler.postDelayed 200ms -SetTouchMode was NOT executed successfully. Ret is " + ret200)
++ }
++
++ myHandler.postDelayed({
++ Log.d("PHH-Enroll", "myHandler.postDelayed 600ms - line prior to setTouchMode 10,0")
++ var ret600 = ITouchFeature.getService().setTouchMode(0, 10, 0);
++
++ if(ret600 != 0){
++ Log.d("PHH-Enroll", "myHandler.postDelayed 600ms -SetTouchMode 10,0 was NOT executed successfully. Ret is " + ret600)
++ }
++ }, 600)
++ }, 200)
+ }
}
@@ -245,6 +285,9 @@ index e61c614f0292..cdaad81b9222 100644
+ }
+ };
+ fodFileObserver?.startWatching();
++ } else if(hasXiaomiLhbm) {
++ IXiaomiFingerprint.getService().extCmd(android.os.SystemProperties.getInt("persist.phh.xiaomi.fod.enrollment.id", 4), 0);
++ ITouchFeature.getService().setTouchMode(0, 10, 0);
+ } else {
+ dimUpdate(0.0f)
+ }
@@ -257,34 +300,33 @@ index e61c614f0292..cdaad81b9222 100644
}
}
diff --git a/services/core/Android.bp b/services/core/Android.bp
-index 34a4579855ef..604e1be0f03f 100644
+index 05782235ea1c..18a9fe12ecb7 100644
--- a/services/core/Android.bp
+++ b/services/core/Android.bp
-@@ -173,7 +173,12 @@ java_library_static {
- "overlayable_policy_aidl-java",
- "SurfaceFlingerProperties",
- "com.android.sysprop.watchdog",
-- "vendor.samsung.hardware.sysinput-V1.2-java", // HIDL
-+ // HIDL
-+ "vendor.samsung.hardware.sysinput-V1.2-java",
+@@ -189,6 +189,11 @@ java_library_static {
+ // HIDL
+ "vendor.mediatek.hardware.mtkpower-V1.1-java",
+ "vendor.samsung.hardware.sysinput-V1.2-java",
+ "vendor.goodix.hardware.biometrics.fingerprint-V2.1-java",
+ "vendor.samsung.hardware.biometrics.fingerprint-V3.0-java",
+ "vendor.oplus.hardware.biometrics.fingerprint-V2.1-java",
+ "vendor.oppo.hardware.biometrics.fingerprint-V2.1-java",
++ "vendor.xiaomi.hardware.fingerprintextension-V1.0-java",
],
javac_shard_size: 50,
- }
+ javacflags: [
diff --git a/services/core/java/com/android/server/biometrics/AuthService.java b/services/core/java/com/android/server/biometrics/AuthService.java
-index 6fbc3c66c1bc..748152aa7c97 100644
+index bc741a5e2396..add882656713 100644
--- a/services/core/java/com/android/server/biometrics/AuthService.java
+++ b/services/core/java/com/android/server/biometrics/AuthService.java
-@@ -75,6 +75,22 @@ import java.util.ArrayList;
+@@ -76,6 +76,25 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
+import android.hardware.display.DisplayManager;
+
+import android.graphics.Point;
++import android.text.TextUtils;
+import android.util.DisplayMetrics;
+import java.io.BufferedReader;
+import java.io.File;
@@ -297,21 +339,39 @@ index 6fbc3c66c1bc..748152aa7c97 100644
+import vendor.samsung.hardware.biometrics.fingerprint.V3_0.ISehBiometricsFingerprint;
+import vendor.goodix.hardware.biometrics.fingerprint.V2_1.IGoodixFingerprintDaemon;
+import vendor.samsung.hardware.sysinput.V1_0.ISehSysInputDev;
++
++import vendor.xiaomi.hardware.fingerprintextension.V1_0.IXiaomiFingerprint;
+
/**
* System service that provides an interface for authenticating with biometrics and
* PIN/pattern/password to BiometricPrompt and lock screen.
-@@ -93,6 +109,9 @@ public class AuthService extends SystemService {
+@@ -94,6 +113,11 @@ public class AuthService extends SystemService {
@VisibleForTesting
final IAuthService.Stub mImpl;
+ private FileObserver fodFileObserver = null;
+ private ISehBiometricsFingerprint mSamsungFingerprint = null;
++
++ private IXiaomiFingerprint mXiaomiFingerprint = null;
+
/**
* Class for injecting dependencies into AuthService.
* TODO(b/141025588): Replace with a dependency injection framework (e.g. Guice, Dagger).
-@@ -650,6 +669,72 @@ public class AuthService extends SystemService {
+@@ -653,11 +677,11 @@ public class AuthService extends SystemService {
+ final int firstApiLevel = SystemProperties.getInt(SYSPROP_FIRST_API_LEVEL, 0);
+ final int apiLevel = SystemProperties.getInt(SYSPROP_API_LEVEL, firstApiLevel);
+ String[] configStrings = mInjector.getConfiguration(getContext());
+- if (configStrings.length == 0 && apiLevel <= Build.VERSION_CODES.R) {
++ if (configStrings.length == 0) {
+ // For backwards compatibility with R where biometrics could work without being
+ // configured in config_biometric_sensors. In the absence of a vendor provided
+ // configuration, we assume the weakest biometric strength (i.e. convenience).
+- Slog.w(TAG, "Found R vendor partition without config_biometric_sensors");
++ Slog.w(TAG, "Found vendor partition without config_biometric_sensors");
+ configStrings = generateRSdkCompatibleConfiguration();
+ }
+ hidlConfigs = new SensorConfig[configStrings.length];
+@@ -672,6 +696,102 @@ public class AuthService extends SystemService {
registerAuthenticators(hidlConfigs);
mInjector.publishBinderService(this, mImpl);
@@ -321,6 +381,12 @@ index 6fbc3c66c1bc..748152aa7c97 100644
+ } catch(Exception e) {
+ android.util.Log.e("PHH", "Failed getting Samsung fingerprint HAL", e);
+ }
++ try {
++ mXiaomiFingerprint = IXiaomiFingerprint.getService();
++ android.util.Log.e("PHH", "Got xiaomi fingerprint HAL");
++ } catch(Exception e) {
++ android.util.Log.e("PHH", "Failed getting xiaomi fingerprint HAL", e);
++ }
+ if(samsungHasCmd("fod_enable") && mSamsungFingerprint != null) {
+ samsungCmd("fod_enable,1,1,0");
+ String actualMaskBrightnessPath = "/sys/class/lcd/panel/actual_mask_brightness";
@@ -381,10 +447,34 @@ index 6fbc3c66c1bc..748152aa7c97 100644
+ fodFileObserver.startWatching();
+ }
+
++ String xiaomiFodPressedStatusPath = "/sys/class/touch/touch_dev/fod_press_status";
++ if(new File(xiaomiFodPressedStatusPath).exists() && mXiaomiFingerprint != null) {
++ fodFileObserver = new FileObserver(xiaomiFodPressedStatusPath, FileObserver.MODIFY) {
++ @Override
++ public void onEvent(int event, String path) {
++ String isFodPressed = readFile(xiaomiFodPressedStatusPath);
++ Slog.d("PHH-Enroll", "Fod pressed status: " + isFodPressed);
++ Slog.d("PHH-Enroll", "Within xiaomi scenario for FOD");
++
++ try {
++ if("0".equals(isFodPressed)) {
++ Slog.d("PHH-Enroll", "Fod un-pressed!");
++ mXiaomiFingerprint.extCmd(android.os.SystemProperties.getInt("phh.xiaomi.fod.enrollment.id", 4), 0);
++ } else if("1".equals(isFodPressed)) {
++ Slog.d("PHH-Enroll", "Fod pressed!");
++ mXiaomiFingerprint.extCmd(android.os.SystemProperties.getInt("phh.xiaomi.fod.enrollment.id", 4), 1);
++ }
++ } catch(Exception e) {
++ Slog.d("PHH-Enroll", "Failed Xiaomi async extcmd", e);
++ }
++ }
++ };
++ fodFileObserver.startWatching();
++ }
}
/**
-@@ -773,14 +858,100 @@ public class AuthService extends SystemService {
+@@ -795,14 +915,113 @@ public class AuthService extends SystemService {
? modality : (modality & ~BiometricAuthenticator.TYPE_CREDENTIAL);
}
@@ -466,6 +556,19 @@ index 6fbc3c66c1bc..748152aa7c97 100644
+ return udfpsProps;
+ }
+
++ String fpLocation = android.os.SystemProperties.get("persist.vendor.sys.fp.fod.location.X_Y");
++ if(!TextUtils.isEmpty(fpLocation) && fpLocation.contains(",")) {
++ int[] udfpsProps = new int[3];
++ String[] coordinates = fpLocation.split(",");
++ udfpsProps[0] = displayRealSize.x/2;
++ udfpsProps[1] = Integer.parseInt(coordinates[1]) + 100;
++
++ String[] widthHeight = android.os.SystemProperties.get("persist.vendor.sys.fp.fod.size.width_height").split(",");
++
++ udfpsProps[2] = (Integer.parseInt(widthHeight[0]) /2);
++ return udfpsProps;
++ }
++
+ return new int[0];
+ }
@@ -487,12 +590,12 @@ index 6fbc3c66c1bc..748152aa7c97 100644
// config_is_powerbutton_fps indicates whether device has a power button fingerprint sensor.
final boolean isPowerbuttonFps = getContext().getResources().getBoolean(
-@@ -842,4 +1013,67 @@ public class AuthService extends SystemService {
+@@ -864,4 +1083,67 @@ public class AuthService extends SystemService {
componentInfo, resetLockoutRequiresHardwareAuthToken,
resetLockoutRequiresChallenge);
}
+
-+ private static boolean samsungHasCmd(String cmd) {
++ private static boolean samsungHasCmd(String cmd) {
+ try {
+ File f = new File("/sys/devices/virtual/sec/tsp/cmd_list");
+ if(!f.exists()) return false;
@@ -555,6 +658,27 @@ index 6fbc3c66c1bc..748152aa7c97 100644
+ }
+ }
}
+diff --git a/services/core/java/com/android/server/biometrics/sensors/fingerprint/FingerprintService.java b/services/core/java/com/android/server/biometrics/sensors/fingerprint/FingerprintService.java
+index ece35c522ec7..8c20b9e1bf40 100644
+--- a/services/core/java/com/android/server/biometrics/sensors/fingerprint/FingerprintService.java
++++ b/services/core/java/com/android/server/biometrics/sensors/fingerprint/FingerprintService.java
+@@ -873,7 +873,6 @@ public class FingerprintService extends SystemService {
+
+ mRegistry.registerAll(() -> {
+ final List providers = new ArrayList<>();
+- providers.addAll(getHidlProviders(hidlSensors));
+ List aidlSensors = new ArrayList<>();
+ final String[] instances = mAidlInstanceNameSupplier.get();
+ if (instances != null) {
+@@ -881,6 +880,8 @@ public class FingerprintService extends SystemService {
+ }
+ providers.addAll(getAidlProviders(
+ Utils.filterAvailableHalInstances(getContext(), aidlSensors)));
++ if (providers.isEmpty())
++ providers.addAll(getHidlProviders(hidlSensors));
+ return providers;
+ });
+ }
--
-2.37.1 (Apple Git-137.1)
+2.41.0
diff --git a/patches/trebledroid/platform_frameworks_base/0039-Add-Mediatek-power-hints-on-touch.patch b/patches/trebledroid/platform_frameworks_base/0039-Add-Mediatek-power-hints-on-touch.patch
deleted file mode 100644
index c6b3950..0000000
--- a/patches/trebledroid/platform_frameworks_base/0039-Add-Mediatek-power-hints-on-touch.patch
+++ /dev/null
@@ -1,123 +0,0 @@
-From bba79d2a5d20f8ec210d832d08bfec69128eed70 Mon Sep 17 00:00:00 2001
-From: Pierre-Hugues Husson
-Date: Sat, 17 Jun 2023 08:31:55 -0400
-Subject: [PATCH 39/43] Add Mediatek power hints on touch
-
-Mediatek has multiple HALs (which existed concurrently), so it is a bit
-of a mess.
-From what I can tell, mOldMtkPerf is used on Android 10 vendors, while
-mMtkPerf is used on Android 11/12 vendors.
-If anyone has an Android 9 vendor and want to take a look, I think it
-would be something like this:
-vendor.mediatek.hardware.power.V2_0.IPower.powerHint()
-
-On some devices, sending the touch boost isn't very helpful. Our guess
-is that Android 12 rendering got a lot heavier, and then touch boost is
-not enough. So, we add a property to /cheat/ and report a bigger boost:
-APP_ROTATE.
-On the few devices we've seen, touch boost only boosts scheduler, while
-app rotate will also for cpu min frequency.
-Experimentally using this app rotate boost indeed makes the device much
-smoother.
----
- services/core/Android.bp | 1 +
- .../com/android/server/wm/DisplayPolicy.java | 50 +++++++++++++++++++
- 2 files changed, 51 insertions(+)
-
-diff --git a/services/core/Android.bp b/services/core/Android.bp
-index 604e1be0f03f..145a74a43464 100644
---- a/services/core/Android.bp
-+++ b/services/core/Android.bp
-@@ -174,6 +174,7 @@ java_library_static {
- "SurfaceFlingerProperties",
- "com.android.sysprop.watchdog",
- // HIDL
-+ "vendor.mediatek.hardware.mtkpower-V1.1-java",
- "vendor.samsung.hardware.sysinput-V1.2-java",
- "vendor.goodix.hardware.biometrics.fingerprint-V2.1-java",
- "vendor.samsung.hardware.biometrics.fingerprint-V3.0-java",
-diff --git a/services/core/java/com/android/server/wm/DisplayPolicy.java b/services/core/java/com/android/server/wm/DisplayPolicy.java
-index 7df69d6bf35e..c0e6372f51fb 100644
---- a/services/core/java/com/android/server/wm/DisplayPolicy.java
-+++ b/services/core/java/com/android/server/wm/DisplayPolicy.java
-@@ -237,6 +237,9 @@ public class DisplayPolicy {
- private boolean mCanSystemBarsBeShownByUser;
- private boolean mNavButtonForcedVisible;
-
-+ private vendor.mediatek.hardware.mtkpower.V1_1.IMtkPerf mMtkPerf;
-+ private vendor.mediatek.hardware.mtkpower.V1_0.IMtkPower mOldMtkPerf;
-+
- StatusBarManagerInternal getStatusBarManagerInternal() {
- synchronized (mServiceAcquireLock) {
- if (mStatusBarManagerInternal == null) {
-@@ -500,6 +503,20 @@ public class DisplayPolicy {
- mScreenOnEarly = true;
- mScreenOnFully = true;
- }
-+ try {
-+ mMtkPerf = vendor.mediatek.hardware.mtkpower.V1_1.IMtkPerf.getService();
-+ } catch(Throwable t) {
-+ android.util.Log.d("PHH-Power", "Retrieving mtkpower 1.0", t);
-+ mMtkPerf = null;
-+ }
-+
-+ try {
-+ mOldMtkPerf = vendor.mediatek.hardware.mtkpower.V1_0.IMtkPower.getService();
-+ } catch(Throwable t) {
-+ android.util.Log.d("PHH-Power", "Retrieving mtkpower 1.0", t);
-+ mOldMtkPerf = null;
-+ }
-+
-
- if (mPerf != null) {
- SCROLL_BOOST_SS_ENABLE = Boolean.parseBoolean(mPerf.perfGetProp("vendor.perf.gestureflingboost.enable", "true"));
-@@ -585,6 +602,17 @@ public class DisplayPolicy {
- mService.mPowerManagerInternal.setPowerBoost(
- Boost.INTERACTION, duration);
- }
-+ if(mOldMtkPerf != null) {
-+ try {
-+ android.util.Log.d("PHH-Power", "mtk1 fling power hint");
-+ int hint = 36; // MTKPOWER_HINT_APP_TOUCH
-+ if("rotate".equals(SystemProperties.get("persist.sys.phh.touch_hint")))
-+ hint = 35; // MTKPOWER_HINT_APP_ROTATE
-+ mOldMtkPerf.mtkPowerHint(hint, duration);
-+ } catch(Throwable t) {
-+ android.util.Log.d("PHH-Power", "Failed sending touch power hint", t);
-+ }
-+ }
- }
-
- @Override
-@@ -702,6 +730,28 @@ public class DisplayPolicy {
- mPerfBoostFling.perfLockRelease();
- mIsPerfBoostFlingAcquired = false;
- }
-+ if(mMtkPerf != null) {
-+ try {
-+ android.util.Log.d("PHH-Power", "mtk power hint");
-+ int hint = 25; //MTKPOWER_HINT_APP_TOUCH
-+ if("rotate".equals(SystemProperties.get("persist.sys.phh.touch_hint")))
-+ hint = 24; // MTKPOWER_HINT_APP_ROTATE
-+ mMtkPerf.perfCusLockHint(hint, 1000);
-+ } catch(Throwable t) {
-+ android.util.Log.d("PHH-Power", "Failed sending touch power hint", t);
-+ }
-+ }
-+ if(mOldMtkPerf != null) {
-+ try {
-+ android.util.Log.d("PHH-Power", "mtk1 power hint");
-+ int hint = 36; // MTKPOWER_HINT_APP_TOUCH
-+ if("rotate".equals(SystemProperties.get("persist.sys.phh.touch_hint")))
-+ hint = 35; // MTKPOWER_HINT_APP_ROTATE
-+ mOldMtkPerf.mtkPowerHint(hint, 1000);
-+ } catch(Throwable t) {
-+ android.util.Log.d("PHH-Power", "Failed sending touch power hint", t);
-+ }
-+ }
- }
-
- @Override
---
-2.37.1 (Apple Git-137.1)
-
diff --git a/patches/trebledroid/platform_frameworks_base/0042-SystemUI-Add-MTK-s-brightness-path-for-FOD.patch b/patches/trebledroid/platform_frameworks_base/0039-SystemUI-Add-MTK-s-brightness-path-for-FOD.patch
similarity index 89%
rename from patches/trebledroid/platform_frameworks_base/0042-SystemUI-Add-MTK-s-brightness-path-for-FOD.patch
rename to patches/trebledroid/platform_frameworks_base/0039-SystemUI-Add-MTK-s-brightness-path-for-FOD.patch
index 17df0ee..df5ad37 100644
--- a/patches/trebledroid/platform_frameworks_base/0042-SystemUI-Add-MTK-s-brightness-path-for-FOD.patch
+++ b/patches/trebledroid/platform_frameworks_base/0039-SystemUI-Add-MTK-s-brightness-path-for-FOD.patch
@@ -1,7 +1,7 @@
-From 6759d9df6620d9476665ca26fad159ee456ef40a Mon Sep 17 00:00:00 2001
+From 9690a49536c299f41526ada92d5ce3fbd2989d26 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan
Date: Sun, 15 Oct 2023 11:21:58 +0800
-Subject: [PATCH 42/43] SystemUI: Add MTK's brightness path for FOD
+Subject: [PATCH 39/48] SystemUI: Add MTK's brightness path for FOD
Rewrote the part for easier extension
@@ -11,10 +11,10 @@ Change-Id: Ifec88c625210301b5d1146bba0275cd9699243e8
1 file changed, 22 insertions(+), 8 deletions(-)
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt
-index 8ab00fc34f0d..e43650d9d3f9 100644
+index bfc875290216..f03642f47d02 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt
-@@ -34,6 +34,7 @@ import android.widget.FrameLayout
+@@ -35,6 +35,7 @@ import com.android.settingslib.udfps.UdfpsOverlayParams
import com.android.systemui.R
import com.android.systemui.doze.DozeReceiver
import java.io.File
@@ -22,7 +22,7 @@ index 8ab00fc34f0d..e43650d9d3f9 100644
import vendor.goodix.hardware.biometrics.fingerprint.V2_1.IGoodixFingerprintDaemon
-@@ -240,18 +241,31 @@ Log.d("PHH", "Surface destroyed!")
+@@ -240,18 +241,31 @@ class UdfpsView(
mySurfaceView.setVisibility(VISIBLE)
Log.d("PHH", "setting surface visible!")
@@ -63,5 +63,5 @@ index 8ab00fc34f0d..e43650d9d3f9 100644
// Assume HBM is max brightness
--
-2.37.1 (Apple Git-137.1)
+2.41.0
diff --git a/patches/trebledroid/platform_frameworks_base/0043-Fix-brightness-slider-curve-for-some-devices.patch b/patches/trebledroid/platform_frameworks_base/0040-Fix-brightness-slider-curve-for-some-devices.patch
similarity index 70%
rename from patches/trebledroid/platform_frameworks_base/0043-Fix-brightness-slider-curve-for-some-devices.patch
rename to patches/trebledroid/platform_frameworks_base/0040-Fix-brightness-slider-curve-for-some-devices.patch
index a042530..e2a9eba 100644
--- a/patches/trebledroid/platform_frameworks_base/0043-Fix-brightness-slider-curve-for-some-devices.patch
+++ b/patches/trebledroid/platform_frameworks_base/0040-Fix-brightness-slider-curve-for-some-devices.patch
@@ -1,18 +1,18 @@
-From 28ae381f6d02d65a9ccacfd569470e13fce39482 Mon Sep 17 00:00:00 2001
+From a63f3424f687c213ebde2227570d0f5319fa06d9 Mon Sep 17 00:00:00 2001
From: ChonDoit
Date: Thu, 24 Aug 2023 15:58:15 -0300
-Subject: [PATCH 43/43] Fix brightness slider curve for some devices
+Subject: [PATCH 40/48] Fix brightness slider curve for some devices
Some devices report max brightness as 2047 or 4095
---
.../settingslib/display/BrightnessUtils.java | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
-diff --git a/packages/SettingsLib/src/com/android/settingslib/display/BrightnessUtils.java b/packages/SettingsLib/src/com/android/settingslib/display/BrightnessUtils.java
-index 4f86afaa995c..c31a1bff8240 100644
---- a/packages/SettingsLib/src/com/android/settingslib/display/BrightnessUtils.java
-+++ b/packages/SettingsLib/src/com/android/settingslib/display/BrightnessUtils.java
-@@ -16,12 +16,17 @@
+diff --git a/packages/SettingsLib/DisplayUtils/src/com/android/settingslib/display/BrightnessUtils.java b/packages/SettingsLib/DisplayUtils/src/com/android/settingslib/display/BrightnessUtils.java
+index 66ed10433459..f6820b4436fc 100644
+--- a/packages/SettingsLib/DisplayUtils/src/com/android/settingslib/display/BrightnessUtils.java
++++ b/packages/SettingsLib/DisplayUtils/src/com/android/settingslib/display/BrightnessUtils.java
+@@ -16,13 +16,18 @@
package com.android.settingslib.display;
@@ -21,6 +21,7 @@ index 4f86afaa995c..c31a1bff8240 100644
+import com.android.internal.display.BrightnessSynchronizer;
+
+ /** Utility methods for calculating the display brightness. */
public class BrightnessUtils {
+ public static final boolean LowGammaBrightness = Boolean.parseBoolean(SystemProperties.get("persist.sys.phh.low_gamma_brightness", "false"));
@@ -31,7 +32,7 @@ index 4f86afaa995c..c31a1bff8240 100644
// Hybrid Log Gamma constant values
private static final float R = 0.5f;
-@@ -87,9 +92,8 @@ public class BrightnessUtils {
+@@ -88,9 +93,8 @@ public class BrightnessUtils {
// it shouldn't be out of bounds.
final float normalizedRet = MathUtils.constrain(ret, 0, 12);
@@ -43,7 +44,7 @@ index 4f86afaa995c..c31a1bff8240 100644
}
/**
-@@ -136,6 +140,7 @@ public class BrightnessUtils {
+@@ -137,6 +141,7 @@ public class BrightnessUtils {
ret = A * MathUtils.log(normalizedVal - B) + C;
}
@@ -53,5 +54,5 @@ index 4f86afaa995c..c31a1bff8240 100644
}
}
--
-2.37.1 (Apple Git-137.1)
+2.41.0
diff --git a/patches/trebledroid/platform_frameworks_base/0041-Add-initial-Xiaomi-FOD-implementation-for-recent-Xia.patch b/patches/trebledroid/platform_frameworks_base/0041-Add-initial-Xiaomi-FOD-implementation-for-recent-Xia.patch
deleted file mode 100644
index 22d7bf7..0000000
--- a/patches/trebledroid/platform_frameworks_base/0041-Add-initial-Xiaomi-FOD-implementation-for-recent-Xia.patch
+++ /dev/null
@@ -1,209 +0,0 @@
-From 462e013f76732e022826c83c122ce32f2dd6089c Mon Sep 17 00:00:00 2001
-From: jgudec
-Date: Fri, 18 Aug 2023 08:41:49 +0100
-Subject: [PATCH 41/43] Add initial Xiaomi FOD implementation for recent Xiaomi
- devices
-
-Huge thanks to phhusson for the help and guidance.
----
- packages/SystemUI/Android.bp | 2 +
- .../android/systemui/biometrics/UdfpsView.kt | 43 +++++++++++++++++
- services/core/Android.bp | 1 +
- .../server/biometrics/AuthService.java | 46 +++++++++++++++++++
- 4 files changed, 92 insertions(+)
-
-diff --git a/packages/SystemUI/Android.bp b/packages/SystemUI/Android.bp
-index dc2244c94080..8927c967c7d0 100644
---- a/packages/SystemUI/Android.bp
-+++ b/packages/SystemUI/Android.bp
-@@ -178,6 +178,8 @@ android_library {
- "LowLightDreamLib",
- "motion_tool_lib",
- "vendor.goodix.hardware.biometrics.fingerprint-V2.1-java",
-+ "vendor.xiaomi.hw.touchfeature-V1.0-java",
-+ "vendor.xiaomi.hardware.fingerprintextension-V1.0-java"
- ],
- manifest: "AndroidManifest.xml",
-
-diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt
-index 6cc9ab3da570..8ab00fc34f0d 100644
---- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt
-+++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt
-@@ -37,6 +37,12 @@ import java.io.File
-
- import vendor.goodix.hardware.biometrics.fingerprint.V2_1.IGoodixFingerprintDaemon
-
-+import vendor.xiaomi.hw.touchfeature.V1_0.ITouchFeature
-+import vendor.xiaomi.hardware.fingerprintextension.V1_0.IXiaomiFingerprint
-+
-+import android.os.Handler
-+import android.os.HandlerThread
-+
- private const val TAG = "UdfpsView"
-
-
-@@ -220,6 +226,12 @@ Log.d("PHH", "Surface destroyed!")
- val hasSamsungMask = File(samsungActualMaskBrightness).exists()
- var fodFileObserver: FileObserver? = null
-
-+ val xiaomiDispParam = "/sys/class/mi_display/disp-DSI-0/disp_param"
-+ var hasXiaomiLhbm = File(xiaomiDispParam).exists()
-+
-+ private val handlerThread = HandlerThread("UDFPS").also { it.start() }
-+ val myHandler = Handler(handlerThread.looper)
-+
- fun configureDisplay(onDisplayConfigured: Runnable) {
- isDisplayConfigured = true
- animationViewController?.onDisplayConfiguring()
-@@ -255,6 +267,34 @@ Log.d("PHH", "Surface destroyed!")
- if(android.os.SystemProperties.get("ro.vendor.build.fingerprint").contains("ASUS")) {
- goodixCmd(200001)
- }
-+
-+ if(hasXiaomiLhbm){
-+ Log.d("PHH-Enroll", "Xiaomi scenario in UdfpsView reached!")
-+ mySurfaceView.setVisibility(INVISIBLE)
-+
-+ IXiaomiFingerprint.getService().extCmd(android.os.SystemProperties.getInt("persist.phh.xiaomi.fod.enrollment.id", 4), 1);
-+ var res = ITouchFeature.getService().setTouchMode(0, 10, 1);
-+ if(res != 0){
-+ Log.d("PHH-Enroll", "SetTouchMode 10,1 was NOT executed successfully. Res is " + res)
-+ }
-+
-+ myHandler.postDelayed({
-+ var ret200 = ITouchFeature.getService().setTouchMode(0, 10, 1);
-+
-+ if(ret200 != 0){
-+ Log.d("PHH-Enroll", "myHandler.postDelayed 200ms -SetTouchMode was NOT executed successfully. Ret is " + ret200)
-+ }
-+
-+ myHandler.postDelayed({
-+ Log.d("PHH-Enroll", "myHandler.postDelayed 600ms - line prior to setTouchMode 10,0")
-+ var ret600 = ITouchFeature.getService().setTouchMode(0, 10, 0);
-+
-+ if(ret600 != 0){
-+ Log.d("PHH-Enroll", "myHandler.postDelayed 600ms -SetTouchMode 10,0 was NOT executed successfully. Ret is " + ret600)
-+ }
-+ }, 600)
-+ }, 200)
-+ }
- }
-
- fun unconfigureDisplay() {
-@@ -296,6 +336,9 @@ Log.d("PHH", "Surface destroyed!")
- }
- };
- fodFileObserver?.startWatching();
-+ } else if(hasXiaomiLhbm) {
-+ IXiaomiFingerprint.getService().extCmd(android.os.SystemProperties.getInt("persist.phh.xiaomi.fod.enrollment.id", 4), 0);
-+ ITouchFeature.getService().setTouchMode(0, 10, 0);
- } else {
- dimUpdate(0.0f)
- }
-diff --git a/services/core/Android.bp b/services/core/Android.bp
-index 145a74a43464..b99d95713731 100644
---- a/services/core/Android.bp
-+++ b/services/core/Android.bp
-@@ -180,6 +180,7 @@ java_library_static {
- "vendor.samsung.hardware.biometrics.fingerprint-V3.0-java",
- "vendor.oplus.hardware.biometrics.fingerprint-V2.1-java",
- "vendor.oppo.hardware.biometrics.fingerprint-V2.1-java",
-+ "vendor.xiaomi.hardware.fingerprintextension-V1.0-java",
- ],
- javac_shard_size: 50,
- }
-diff --git a/services/core/java/com/android/server/biometrics/AuthService.java b/services/core/java/com/android/server/biometrics/AuthService.java
-index b47b47c41f76..696d5b42cd46 100644
---- a/services/core/java/com/android/server/biometrics/AuthService.java
-+++ b/services/core/java/com/android/server/biometrics/AuthService.java
-@@ -64,6 +64,7 @@ import android.os.ServiceManager;
- import android.os.SystemProperties;
- import android.os.UserHandle;
- import android.provider.Settings;
-+import android.text.TextUtils;
- import android.util.Slog;
-
- import com.android.internal.R;
-@@ -91,6 +92,7 @@ import vendor.samsung.hardware.biometrics.fingerprint.V3_0.ISehBiometricsFingerp
- import vendor.goodix.hardware.biometrics.fingerprint.V2_1.IGoodixFingerprintDaemon;
- import vendor.samsung.hardware.sysinput.V1_0.ISehSysInputDev;
-
-+import vendor.xiaomi.hardware.fingerprintextension.V1_0.IXiaomiFingerprint;
- /**
- * System service that provides an interface for authenticating with biometrics and
- * PIN/pattern/password to BiometricPrompt and lock screen.
-@@ -112,6 +114,7 @@ public class AuthService extends SystemService {
- private FileObserver fodFileObserver = null;
- private ISehBiometricsFingerprint mSamsungFingerprint = null;
-
-+ private IXiaomiFingerprint mXiaomiFingerprint = null;
- /**
- * Class for injecting dependencies into AuthService.
- * TODO(b/141025588): Replace with a dependency injection framework (e.g. Guice, Dagger).
-@@ -675,6 +678,12 @@ public class AuthService extends SystemService {
- } catch(Exception e) {
- android.util.Log.e("PHH", "Failed getting Samsung fingerprint HAL", e);
- }
-+ try {
-+ mXiaomiFingerprint = IXiaomiFingerprint.getService();
-+ android.util.Log.e("PHH", "Got xiaomi fingerprint HAL");
-+ } catch(Exception e) {
-+ android.util.Log.e("PHH", "Failed getting xiaomi fingerprint HAL", e);
-+ }
- if(samsungHasCmd("fod_enable") && mSamsungFingerprint != null) {
- samsungCmd("fod_enable,1,1,0");
- String actualMaskBrightnessPath = "/sys/class/lcd/panel/actual_mask_brightness";
-@@ -735,6 +744,31 @@ public class AuthService extends SystemService {
- fodFileObserver.startWatching();
- }
-
-+ String xiaomiFodPressedStatusPath = "/sys/class/touch/touch_dev/fod_press_status";
-+ if(new File(xiaomiFodPressedStatusPath).exists() && mXiaomiFingerprint != null) {
-+ fodFileObserver = new FileObserver(xiaomiFodPressedStatusPath, FileObserver.MODIFY) {
-+ @Override
-+ public void onEvent(int event, String path) {
-+ String isFodPressed = readFile(xiaomiFodPressedStatusPath);
-+ Slog.d("PHH-Enroll", "Fod pressed status: " + isFodPressed);
-+ Slog.d("PHH-Enroll", "Within xiaomi scenario for FOD");
-+
-+ try {
-+ if("0".equals(isFodPressed)) {
-+ Slog.d("PHH-Enroll", "Fod un-pressed!");
-+ mXiaomiFingerprint.extCmd(android.os.SystemProperties.getInt("phh.xiaomi.fod.enrollment.id", 4), 0);
-+ } else if("1".equals(isFodPressed)) {
-+ Slog.d("PHH-Enroll", "Fod pressed!");
-+ mXiaomiFingerprint.extCmd(android.os.SystemProperties.getInt("phh.xiaomi.fod.enrollment.id", 4), 1);
-+ }
-+ } catch(Exception e) {
-+ Slog.d("PHH-Enroll", "Failed Xiaomi async extcmd", e);
-+ }
-+ }
-+ };
-+ fodFileObserver.startWatching();
-+ }
-+
- }
-
- /**
-@@ -936,6 +970,18 @@ public class AuthService extends SystemService {
- return udfpsProps;
- }
-
-+ if(!TextUtils.isEmpty(android.os.SystemProperties.get("persist.vendor.sys.fp.fod.location.X_Y"))) {
-+ int[] udfpsProps = new int[3];
-+ String[] coordinates = android.os.SystemProperties.get("persist.vendor.sys.fp.fod.location.X_Y").split(",");
-+ udfpsProps[0] = displayRealSize.x/2;
-+ udfpsProps[1] = Integer.parseInt(coordinates[1]) + 100;
-+
-+ String[] widthHeight = android.os.SystemProperties.get("persist.vendor.sys.fp.fod.size.width_height").split(",");
-+
-+ udfpsProps[2] = (Integer.parseInt(widthHeight[0]) /2);
-+ return udfpsProps;
-+ }
-+
- return new int[0];
- }
-
---
-2.37.1 (Apple Git-137.1)
-
diff --git a/patches/trebledroid/platform_frameworks_base/0041-Ignore-cgroup-creation-errors.patch b/patches/trebledroid/platform_frameworks_base/0041-Ignore-cgroup-creation-errors.patch
new file mode 100644
index 0000000..002b9e1
--- /dev/null
+++ b/patches/trebledroid/platform_frameworks_base/0041-Ignore-cgroup-creation-errors.patch
@@ -0,0 +1,54 @@
+From 2ef9deabd14b99ff6998e2d9073bac3855f7d104 Mon Sep 17 00:00:00 2001
+From: Pierre-Hugues Husson
+Date: Wed, 18 Oct 2023 16:53:40 -0400
+Subject: [PATCH 41/48] Ignore cgroup creation errors
+
+For old kernels who don't have those modern cgroups
+---
+ core/jni/com_android_internal_os_Zygote.cpp | 3 +++
+ services/core/java/com/android/server/am/ProcessList.java | 5 -----
+ 2 files changed, 3 insertions(+), 5 deletions(-)
+
+diff --git a/core/jni/com_android_internal_os_Zygote.cpp b/core/jni/com_android_internal_os_Zygote.cpp
+index ce806a0fcc08..bac0c8315f26 100644
+--- a/core/jni/com_android_internal_os_Zygote.cpp
++++ b/core/jni/com_android_internal_os_Zygote.cpp
+@@ -1805,6 +1805,8 @@ static void SpecializeCommon(JNIEnv* env, uid_t uid, gid_t gid, jintArray gids,
+ if (!is_system_server && getuid() == 0) {
+ const int rc = createProcessGroup(uid, getpid());
+ if (rc != 0) {
++ ALOGE("createProcessGroup(%d, %d) failed: %s", uid, /* pid= */ 0, strerror(-rc));
++#if 0
+ if (rc == -ESRCH) {
+ // If process is dead, treat this as a non-fatal error
+ ALOGE("createProcessGroup(%d, %d) failed: %s", uid, /* pid= */ 0, strerror(-rc));
+@@ -1814,6 +1816,7 @@ static void SpecializeCommon(JNIEnv* env, uid_t uid, gid_t gid, jintArray gids,
+ : CREATE_ERROR("createProcessGroup(%d, %d) failed: %s", uid,
+ /* pid= */ 0, strerror(-rc)));
+ }
++#endif
+ }
+ }
+
+diff --git a/services/core/java/com/android/server/am/ProcessList.java b/services/core/java/com/android/server/am/ProcessList.java
+index e08b33178e6f..b0331e9a3b48 100644
+--- a/services/core/java/com/android/server/am/ProcessList.java
++++ b/services/core/java/com/android/server/am/ProcessList.java
+@@ -2438,14 +2438,9 @@ public final class ProcessList {
+ // If we're not told to skip the process group creation, go create it.
+ final int res = Process.createProcessGroup(uid, startResult.pid);
+ if (res < 0) {
+- if (res == -OsConstants.ESRCH) {
+ Slog.e(ActivityManagerService.TAG,
+ "Unable to create process group for "
+ + app.processName + " (" + startResult.pid + ")");
+- } else {
+- throw new AssertionError("Unable to create process group for "
+- + app.processName + " (" + startResult.pid + ")");
+- }
+ } else {
+ app.mProcessGroupCreated = true;
+ }
+--
+2.41.0
+
diff --git a/patches/trebledroid/platform_frameworks_base/0042-Samsung-tablets-use-SW_MACHINE_COVER-rather-than-SW_.patch b/patches/trebledroid/platform_frameworks_base/0042-Samsung-tablets-use-SW_MACHINE_COVER-rather-than-SW_.patch
new file mode 100644
index 0000000..3e11442
--- /dev/null
+++ b/patches/trebledroid/platform_frameworks_base/0042-Samsung-tablets-use-SW_MACHINE_COVER-rather-than-SW_.patch
@@ -0,0 +1,87 @@
+From a93cb82fcc8c19a367a7b754565e755b0941ba27 Mon Sep 17 00:00:00 2001
+From: Pierre-Hugues Husson
+Date: Wed, 18 Oct 2023 16:57:34 -0400
+Subject: [PATCH 42/48] Samsung tablets use SW_MACHINE_COVER rather than SW_LID
+
+So check whether SW_MACHINE_COVER is declared, then use it
+Otherwise stick to SW_LID
+
+Should fix https://github.com/phhusson/treble_experimentations/issues/2572
+---
+ .../server/input/InputManagerService.java | 25 ++++++++++++++++---
+ 1 file changed, 21 insertions(+), 4 deletions(-)
+
+diff --git a/services/core/java/com/android/server/input/InputManagerService.java b/services/core/java/com/android/server/input/InputManagerService.java
+index 4cb22dbcf308..60d956cc0ba1 100644
+--- a/services/core/java/com/android/server/input/InputManagerService.java
++++ b/services/core/java/com/android/server/input/InputManagerService.java
+@@ -372,6 +372,9 @@ public class InputManagerService extends IInputManager.Stub
+ /** Switch code: Microphone. When set, the mic is muted. */
+ public static final int SW_MUTE_DEVICE = 0x0e;
+
++ /** Switch code: Cover. When set, the cover is closed. */
++ public static final int SW_MACHINE_COVER = 0x10;
++
+ public static final int SW_LID_BIT = 1 << SW_LID;
+ public static final int SW_TABLET_MODE_BIT = 1 << SW_TABLET_MODE;
+ public static final int SW_KEYPAD_SLIDE_BIT = 1 << SW_KEYPAD_SLIDE;
+@@ -383,6 +386,8 @@ public class InputManagerService extends IInputManager.Stub
+ SW_HEADPHONE_INSERT_BIT | SW_MICROPHONE_INSERT_BIT | SW_JACK_PHYSICAL_INSERT_BIT | SW_LINEOUT_INSERT_BIT;
+ public static final int SW_CAMERA_LENS_COVER_BIT = 1 << SW_CAMERA_LENS_COVER;
+ public static final int SW_MUTE_DEVICE_BIT = 1 << SW_MUTE_DEVICE;
++ public static final int SW_MACHINE_COVER_BIT = 1 << SW_MACHINE_COVER;
++ private int mSwForLid = SW_LID;
+
+ private final String mVelocityTrackerStrategy;
+
+@@ -473,6 +478,16 @@ public class InputManagerService extends IInputManager.Stub
+ mWiredAccessoryCallbacks = callbacks;
+ }
+
++ private void checkForSwMachineCover() {
++ int machineCoverState = getSwitchState(-1 /* deviceId */, InputDevice.SOURCE_ANY, SW_MACHINE_COVER);
++ if (machineCoverState != KEY_STATE_UNKNOWN) {
++ android.util.Log.e("PHH", "Found a SW_MACHINE_COVER. Use this instead of SW_LID");
++ mSwForLid = SW_MACHINE_COVER;
++ } else {
++ android.util.Log.e("PHH", "Not found a SW_MACHINE_COVER");
++ }
++ }
++
+ void registerLidSwitchCallbackInternal(@NonNull LidSwitchCallback callback) {
+ synchronized (mLidSwitchLock) {
+ mLidSwitchCallbacks.add(callback);
+@@ -481,7 +496,8 @@ public class InputManagerService extends IInputManager.Stub
+ // state will be reported as KEY_STATE_UNKNOWN. The callback will be triggered in
+ // systemRunning().
+ if (mSystemReady) {
+- boolean lidOpen = getSwitchState(-1 /* deviceId */, InputDevice.SOURCE_ANY, SW_LID)
++ checkForSwMachineCover();
++ boolean lidOpen = getSwitchState(-1 /* deviceId */, InputDevice.SOURCE_ANY, mSwForLid)
+ == KEY_STATE_UP;
+ callback.notifyLidSwitchChanged(0 /* whenNanos */, lidOpen);
+ }
+@@ -517,7 +533,8 @@ public class InputManagerService extends IInputManager.Stub
+
+ // Send the initial lid switch state to any callback registered before the system was
+ // ready.
+- int switchState = getSwitchState(-1 /* deviceId */, InputDevice.SOURCE_ANY, SW_LID);
++ checkForSwMachineCover();
++ int switchState = getSwitchState(-1 /* deviceId */, InputDevice.SOURCE_ANY, mSwForLid);
+ for (int i = 0; i < mLidSwitchCallbacks.size(); i++) {
+ LidSwitchCallback callback = mLidSwitchCallbacks.get(i);
+ callback.notifyLidSwitchChanged(0 /* whenNanos */, switchState == KEY_STATE_UP);
+@@ -2311,8 +2328,8 @@ public class InputManagerService extends IInputManager.Stub
+ + ", mask=" + Integer.toHexString(switchMask));
+ }
+
+- if ((switchMask & SW_LID_BIT) != 0) {
+- final boolean lidOpen = ((switchValues & SW_LID_BIT) == 0);
++ if ((switchMask & (1 << mSwForLid)) != 0) {
++ final boolean lidOpen = ((switchValues & (1 << mSwForLid)) == 0);
+ synchronized (mLidSwitchLock) {
+ if (mSystemReady) {
+ for (int i = 0; i < mLidSwitchCallbacks.size(); i++) {
+--
+2.41.0
+
diff --git a/patches/trebledroid/platform_frameworks_base/0043-Revert-Removed-IWLAN-legacy-mode-support.patch b/patches/trebledroid/platform_frameworks_base/0043-Revert-Removed-IWLAN-legacy-mode-support.patch
new file mode 100644
index 0000000..0cb545c
--- /dev/null
+++ b/patches/trebledroid/platform_frameworks_base/0043-Revert-Removed-IWLAN-legacy-mode-support.patch
@@ -0,0 +1,82 @@
+From deb991a2c2e39aa09577ec0169143980f21fa402 Mon Sep 17 00:00:00 2001
+From: Alberto Ponces
+Date: Fri, 20 Oct 2023 09:26:19 +0000
+Subject: [PATCH 43/48] Revert "Removed IWLAN legacy mode support"
+
+This reverts commit 2832dee607ab33eee688abea206f4adfcfc896f1.
+---
+ .../java/android/telephony/ServiceState.java | 30 ++++++++++++-------
+ 1 file changed, 20 insertions(+), 10 deletions(-)
+
+diff --git a/telephony/java/android/telephony/ServiceState.java b/telephony/java/android/telephony/ServiceState.java
+index 523d0b0e55f4..96387a489dcc 100644
+--- a/telephony/java/android/telephony/ServiceState.java
++++ b/telephony/java/android/telephony/ServiceState.java
+@@ -1213,8 +1213,13 @@ public class ServiceState implements Parcelable {
+
+ /**
+ * Initialize the service state. Set everything to the default value.
++ *
++ * @param legacyMode {@code true} if the device is on IWLAN legacy mode, where IWLAN is
++ * considered as a RAT on WWAN {@link NetworkRegistrationInfo}. {@code false} if the device
++ * is on AP-assisted mode, where IWLAN should be reported through WLAN.
++ * {@link NetworkRegistrationInfo}.
+ */
+- private void init() {
++ private void init(boolean legacyMode) {
+ if (DBG) Rlog.d(LOG_TAG, "init");
+ mVoiceRegState = STATE_OUT_OF_SERVICE;
+ mDataRegState = STATE_OUT_OF_SERVICE;
+@@ -1246,11 +1251,13 @@ public class ServiceState implements Parcelable {
+ .setTransportType(AccessNetworkConstants.TRANSPORT_TYPE_WWAN)
+ .setRegistrationState(NetworkRegistrationInfo.REGISTRATION_STATE_UNKNOWN)
+ .build());
+- addNetworkRegistrationInfo(new NetworkRegistrationInfo.Builder()
+- .setDomain(NetworkRegistrationInfo.DOMAIN_PS)
+- .setTransportType(AccessNetworkConstants.TRANSPORT_TYPE_WLAN)
+- .setRegistrationState(NetworkRegistrationInfo.REGISTRATION_STATE_UNKNOWN)
+- .build());
++ if (!legacyMode) {
++ addNetworkRegistrationInfo(new NetworkRegistrationInfo.Builder()
++ .setDomain(NetworkRegistrationInfo.DOMAIN_PS)
++ .setTransportType(AccessNetworkConstants.TRANSPORT_TYPE_WLAN)
++ .setRegistrationState(NetworkRegistrationInfo.REGISTRATION_STATE_UNKNOWN)
++ .build());
++ }
+ }
+ mOperatorAlphaLongRaw = null;
+ mOperatorAlphaShortRaw = null;
+@@ -1259,11 +1266,11 @@ public class ServiceState implements Parcelable {
+ }
+
+ public void setStateOutOfService() {
+- init();
++ init(true);
+ }
+
+ public void setStateOff() {
+- init();
++ init(true);
+ mVoiceRegState = STATE_POWER_OFF;
+ mDataRegState = STATE_POWER_OFF;
+ }
+@@ -1271,11 +1278,14 @@ public class ServiceState implements Parcelable {
+ /**
+ * Set the service state to out-of-service
+ *
++ * @param legacyMode {@code true} if the device is on IWLAN legacy mode, where IWLAN is
++ * considered as a RAT on WWAN {@link NetworkRegistrationInfo}. {@code false} if the device
++ * is on AP-assisted mode, where IWLAN should be reported through WLAN.
+ * @param powerOff {@code true} if this is a power off case (i.e. Airplane mode on).
+ * @hide
+ */
+- public void setOutOfService(boolean powerOff) {
+- init();
++ public void setOutOfService(boolean legacyMode, boolean powerOff) {
++ init(legacyMode);
+ if (powerOff) {
+ mVoiceRegState = STATE_POWER_OFF;
+ mDataRegState = STATE_POWER_OFF;
+--
+2.41.0
+
diff --git a/patches/trebledroid/platform_frameworks_base/0044-add-nubia-red-magic-6-series-udfps-fod.patch b/patches/trebledroid/platform_frameworks_base/0044-add-nubia-red-magic-6-series-udfps-fod.patch
new file mode 100644
index 0000000..a745d2c
--- /dev/null
+++ b/patches/trebledroid/platform_frameworks_base/0044-add-nubia-red-magic-6-series-udfps-fod.patch
@@ -0,0 +1,176 @@
+From f9e9192bd2d662cae1bb7df3e0d3ecde98bfa121 Mon Sep 17 00:00:00 2001
+From: Huy Hoang <38396158+boydaihungst@users.noreply.github.com>
+Date: Sat, 14 Oct 2023 12:44:36 +0700
+Subject: [PATCH 44/48] add: nubia red magic 6 series udfps/fod
+
+---
+ packages/SystemUI/Android.bp | 3 +-
+ .../systemui/biometrics/UdfpsController.java | 56 +++++++++++++++++++
+ .../android/systemui/biometrics/UdfpsView.kt | 14 +++++
+ 3 files changed, 72 insertions(+), 1 deletion(-)
+
+diff --git a/packages/SystemUI/Android.bp b/packages/SystemUI/Android.bp
+index 7f77e39041d1..5d7b5494d7fd 100644
+--- a/packages/SystemUI/Android.bp
++++ b/packages/SystemUI/Android.bp
+@@ -199,7 +199,8 @@ android_library {
+ "motion_tool_lib",
+ "vendor.goodix.hardware.biometrics.fingerprint-V2.1-java",
+ "vendor.xiaomi.hw.touchfeature-V1.0-java",
+- "vendor.xiaomi.hardware.fingerprintextension-V1.0-java"
++ "vendor.xiaomi.hardware.fingerprintextension-V1.0-java",
++ "vendor.nubia.ifaa-V1.0-java",
+ ],
+ manifest: "AndroidManifest.xml",
+
+diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java
+index 6cce2b705a6a..8bb18106eb16 100644
+--- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java
++++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java
+@@ -47,6 +47,7 @@ import android.os.Handler;
+ import android.os.PowerManager;
+ import android.os.Process;
+ import android.os.Trace;
++import android.os.SystemProperties;
+ import android.os.VibrationAttributes;
+ import android.os.VibrationEffect;
+ import android.util.BoostFramework;
+@@ -111,9 +112,13 @@ import java.util.HashSet;
+ import java.util.Optional;
+ import java.util.Set;
+ import java.util.concurrent.Executor;
++import java.io.File;
++import java.io.FileWriter;
++import java.io.IOException;
+
+ import javax.inject.Inject;
+ import javax.inject.Provider;
++import vendor.nubia.ifaa.V1_0.IIfaa;
+
+ /**
+ * Shows and hides the under-display fingerprint sensor (UDFPS) overlay, handles UDFPS touch events,
+@@ -249,6 +254,46 @@ public class UdfpsController implements DozeReceiver, Dumpable {
+ mScreenOn = false;
+ }
+ };
++ // Nubia 6 series fingerprint control command
++ // cmd = 13 -> finger down
++ // cmd = 14 -> after UI ready
++ // cmd = 15 -> finger up
++ public byte[] processCmd(int cmd, int param1, int param2, byte[] send_buf, int length) {
++ try {
++ if (cmd == 999) {
++ Log.d(TAG, "processCmd: 999");
++ return null;
++ }
++ ArrayList sendList = new ArrayList<>();
++ if (send_buf != null) {
++ for (byte b : send_buf) {
++ sendList.add(Byte.valueOf(b));
++ }
++ }
++ if (send_buf == null) {
++ Log.d(TAG, "FingerprintService send_buf = " + send_buf);
++ }
++ IIfaa iIfaaDaemon = IIfaa.getService();
++ if (iIfaaDaemon == null) {
++ Log.d(TAG, "processCmd: no iIfaaDaemon!");
++ return null;
++ }
++ ArrayList resultList = iIfaaDaemon.processCmd(cmd, param1, param2, sendList, length);
++ int n = resultList.size();
++ Log.d(TAG, "FingerprintService result length n = " + n);
++ if (n == 0) {
++ return null;
++ }
++ byte[] result = new byte[n];
++ for (int i = 0; i < n; i++) {
++ result[i] = resultList.get(i).byteValue();
++ }
++ return result;
++ } catch (Exception e) {
++ e.printStackTrace();
++ return null;
++ }
++ };
+
+ @Override
+ public void dump(@NonNull PrintWriter pw, @NonNull String[] args) {
+@@ -1202,10 +1247,17 @@ public class UdfpsController implements DozeReceiver, Dumpable {
+ view.configureDisplay(() -> dispatchOnUiReady(requestId));
+ }
+ }
++ if(SystemProperties.get("ro.vendor.build.fingerprint").contains("nubia/NX669")) {
++ processCmd(13, 0, 0, new byte[0], 0);
++ }
+
+ for (Callback cb : mCallbacks) {
+ cb.onFingerDown();
+ }
++ if(SystemProperties.get("ro.vendor.build.fingerprint").contains("nubia/NX669")) {
++ processCmd(14, 0, 0, new byte[0], 0);
++ }
++
+ }
+
+ private void onFingerUp(long requestId, @NonNull UdfpsView view) {
+@@ -1256,6 +1308,10 @@ public class UdfpsController implements DozeReceiver, Dumpable {
+ mFingerprintManager.onPointerUp(requestId, mSensorProps.sensorId);
+ }
+ }
++ if(SystemProperties.get("ro.vendor.build.fingerprint").contains("nubia/NX669")) {
++ processCmd(15, 0, 0, new byte[0], 0);
++ }
++
+ for (Callback cb : mCallbacks) {
+ cb.onFingerUp();
+ }
+diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt
+index f03642f47d02..f86e8436b608 100644
+--- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt
++++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt
+@@ -45,6 +45,8 @@ import vendor.xiaomi.hardware.fingerprintextension.V1_0.IXiaomiFingerprint
+ import android.os.Handler
+ import android.os.HandlerThread
+
++import vendor.nubia.ifaa.V1_0.IIfaa
++
+ private const val TAG = "UdfpsView"
+
+ /**
+@@ -233,6 +235,10 @@ class UdfpsView(
+ private val handlerThread = HandlerThread("UDFPS").also { it.start() }
+ val myHandler = Handler(handlerThread.looper)
+
++ // This file contain current hbm value
++ val nubiaHbmState = "/sys/kernel/lcd_enhance/hbm_state"
++ var hasNubiaHbm = File(nubiaHbmState).exists()
++
+ fun configureDisplay(onDisplayConfigured: Runnable) {
+ isDisplayConfigured = true
+ animationViewController?.onDisplayConfiguring()
+@@ -309,6 +315,11 @@ class UdfpsView(
+ }, 600)
+ }, 200)
+ }
++ if(hasNubiaHbm) {
++ Log.d("PHH-Enroll", "Nubia scenario in UdfpsView reached!")
++ File(nubiaHbmState).writeText("4095")
++ }
++
+ }
+
+ fun unconfigureDisplay() {
+@@ -353,6 +364,9 @@ class UdfpsView(
+ } else if(hasXiaomiLhbm) {
+ IXiaomiFingerprint.getService().extCmd(android.os.SystemProperties.getInt("persist.phh.xiaomi.fod.enrollment.id", 4), 0);
+ ITouchFeature.getService().setTouchMode(0, 10, 0);
++ } else if(hasNubiaHbm) {
++ Log.d("PHH-Enroll", "Nubia Restore brightness")
++ File(nubiaHbmState).writeText(File("/sys/class/backlight/panel0-backlight/brightness").readText())
+ } else {
+ dimUpdate(0.0f)
+ }
+--
+2.41.0
+
diff --git a/patches/trebledroid/platform_frameworks_base/0045-UDFPS-Don-t-crash-if-we-can-t-compute-a-dim.-Just-do.patch b/patches/trebledroid/platform_frameworks_base/0045-UDFPS-Don-t-crash-if-we-can-t-compute-a-dim.-Just-do.patch
new file mode 100644
index 0000000..32ab348
--- /dev/null
+++ b/patches/trebledroid/platform_frameworks_base/0045-UDFPS-Don-t-crash-if-we-can-t-compute-a-dim.-Just-do.patch
@@ -0,0 +1,34 @@
+From 44fec0e5a59f623dfb75873c412b3627541127ba Mon Sep 17 00:00:00 2001
+From: Pierre-Hugues Husson
+Date: Wed, 25 Oct 2023 07:30:10 -0400
+Subject: [PATCH 45/48] UDFPS: Don't crash if we can't compute a dim. Just
+ don't dim.
+
+---
+ .../src/com/android/systemui/biometrics/UdfpsView.kt | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt
+index f86e8436b608..4377dd7e70a7 100644
+--- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt
++++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt
+@@ -270,12 +270,13 @@ class UdfpsView(
+ }
+ }
+
+- if (!bmFilesExist) {
+- throw FileNotFoundException("No brightness files under expected paths")
++ val dim = if (bmFilesExist) {
++ 1.0 - Math.pow( (brightness / maxBrightness), 1/2.3);
++ } else {
++ 0.0
+ }
+
+ // Assume HBM is max brightness
+- val dim = 1.0 - Math.pow( (brightness / maxBrightness), 1/2.3);
+ Log.d("PHH-Enroll", "Brightness is $brightness / $maxBrightness, setting dim to $dim")
+ if (hasAsusGhbm) {
+ dimUpdate(dim.toFloat())
+--
+2.41.0
+
diff --git a/patches/trebledroid/platform_frameworks_base/0046-UDFPS-Don-t-crash-if-we-can-t-find-UDFPS-props.patch b/patches/trebledroid/platform_frameworks_base/0046-UDFPS-Don-t-crash-if-we-can-t-find-UDFPS-props.patch
new file mode 100644
index 0000000..80aee13
--- /dev/null
+++ b/patches/trebledroid/platform_frameworks_base/0046-UDFPS-Don-t-crash-if-we-can-t-find-UDFPS-props.patch
@@ -0,0 +1,31 @@
+From d9f3af841e7c0601955c9e67d4f5ea4434e65a21 Mon Sep 17 00:00:00 2001
+From: Pierre-Hugues Husson
+Date: Wed, 25 Oct 2023 07:30:45 -0400
+Subject: [PATCH 46/48] UDFPS Don't crash if we can't find UDFPS props
+
+---
+ .../java/com/android/server/biometrics/AuthService.java | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/services/core/java/com/android/server/biometrics/AuthService.java b/services/core/java/com/android/server/biometrics/AuthService.java
+index add882656713..26ca8c9940f5 100644
+--- a/services/core/java/com/android/server/biometrics/AuthService.java
++++ b/services/core/java/com/android/server/biometrics/AuthService.java
+@@ -1016,7 +1016,13 @@ public class AuthService extends SystemService {
+ com.android.internal.R.array.config_udfps_sensor_props);
+
+ boolean isUdfps = !ArrayUtils.isEmpty(udfpsProps);
+- if(!isUdfps) udfpsProps = dynamicUdfpsProps();
++ if(!isUdfps) {
++ try {
++ udfpsProps = dynamicUdfpsProps();
++ } catch(Throwable t) {
++ Slog.e("PHH-Enroll", "Failed generating UDFPS props");
++ }
++ }
+ isUdfps = !ArrayUtils.isEmpty(udfpsProps);
+
+ if(udfpsProps.length > 0) {
+--
+2.41.0
+
diff --git a/patches/trebledroid/platform_frameworks_base/0047-Add-a-prop-to-use-linear-backlight-control.patch b/patches/trebledroid/platform_frameworks_base/0047-Add-a-prop-to-use-linear-backlight-control.patch
new file mode 100644
index 0000000..2c20404
--- /dev/null
+++ b/patches/trebledroid/platform_frameworks_base/0047-Add-a-prop-to-use-linear-backlight-control.patch
@@ -0,0 +1,42 @@
+From 1c91b13322ada0c46cfd5616ac1427c2a21e5e34 Mon Sep 17 00:00:00 2001
+From: Pierre-Hugues Husson
+Date: Mon, 30 Oct 2023 19:25:27 -0400
+Subject: [PATCH 47/48] Add a prop to use linear backlight control
+
+---
+ .../settings/brightness/BrightnessController.java | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/packages/SystemUI/src/com/android/systemui/settings/brightness/BrightnessController.java b/packages/SystemUI/src/com/android/systemui/settings/brightness/BrightnessController.java
+index fb9f814f3f71..28cda2c4f01b 100644
+--- a/packages/SystemUI/src/com/android/systemui/settings/brightness/BrightnessController.java
++++ b/packages/SystemUI/src/com/android/systemui/settings/brightness/BrightnessController.java
+@@ -367,9 +367,15 @@ public class BrightnessController implements ToggleSlider.Listener, MirroredBrig
+ : MetricsEvent.ACTION_BRIGHTNESS;
+ minBacklight = mBrightnessMin;
+ maxBacklight = mBrightnessMax;
+- final float valFloat = MathUtils.min(
++ float valFloat = MathUtils.min(
+ convertGammaToLinearFloat(value, minBacklight, maxBacklight),
+ maxBacklight);
++ if (android.os.SystemProperties.getBoolean("persist.sys.phh.linear_brightness", false)) {
++ android.util.Log.e("PHH", "Linear brightness val " + value + " from " + minBacklight + " to " + maxBacklight + " makes " + valFloat);
++ valFloat = value / 65536.0f;
++ }
++ final float finalValFloat = valFloat;
++
+ if (stopTracking) {
+ // TODO(brightnessfloat): change to use float value instead.
+ MetricsLogger.action(mContext, metric,
+@@ -385,7 +391,7 @@ public class BrightnessController implements ToggleSlider.Listener, MirroredBrig
+ if (!tracking) {
+ AsyncTask.execute(new Runnable() {
+ public void run() {
+- mDisplayManager.setBrightness(mDisplayId, valFloat);
++ mDisplayManager.setBrightness(mDisplayId, finalValFloat);
+ }
+ });
+ }
+--
+2.41.0
+
diff --git a/patches/trebledroid/platform_frameworks_base/0048-Blind-shot-at-adding-Samsung-AIDL-Fingerprint-suppor.patch b/patches/trebledroid/platform_frameworks_base/0048-Blind-shot-at-adding-Samsung-AIDL-Fingerprint-suppor.patch
new file mode 100644
index 0000000..6b2da3a
--- /dev/null
+++ b/patches/trebledroid/platform_frameworks_base/0048-Blind-shot-at-adding-Samsung-AIDL-Fingerprint-suppor.patch
@@ -0,0 +1,92 @@
+From 7fcca720d817556967fa45db1852cafe04051740 Mon Sep 17 00:00:00 2001
+From: Pierre-Hugues Husson
+Date: Mon, 30 Oct 2023 19:26:10 -0400
+Subject: [PATCH 48/48] Blind shot at adding Samsung AIDL Fingerprint support
+
+---
+ services/core/Android.bp | 1 +
+ .../server/biometrics/AuthService.java | 22 ++++++++++++++++++-
+ 2 files changed, 22 insertions(+), 1 deletion(-)
+
+diff --git a/services/core/Android.bp b/services/core/Android.bp
+index 18a9fe12ecb7..c59993d2766c 100644
+--- a/services/core/Android.bp
++++ b/services/core/Android.bp
+@@ -194,6 +194,7 @@ java_library_static {
+ "vendor.oplus.hardware.biometrics.fingerprint-V2.1-java",
+ "vendor.oppo.hardware.biometrics.fingerprint-V2.1-java",
+ "vendor.xiaomi.hardware.fingerprintextension-V1.0-java",
++ "vendor.samsung.hardware.biometrics.fingerprint-V1-java",
+ ],
+ javac_shard_size: 50,
+ javacflags: [
+diff --git a/services/core/java/com/android/server/biometrics/AuthService.java b/services/core/java/com/android/server/biometrics/AuthService.java
+index 26ca8c9940f5..07c2e63919b2 100644
+--- a/services/core/java/com/android/server/biometrics/AuthService.java
++++ b/services/core/java/com/android/server/biometrics/AuthService.java
+@@ -94,6 +94,8 @@ import vendor.goodix.hardware.biometrics.fingerprint.V2_1.IGoodixFingerprintDaem
+ import vendor.samsung.hardware.sysinput.V1_0.ISehSysInputDev;
+
+ import vendor.xiaomi.hardware.fingerprintextension.V1_0.IXiaomiFingerprint;
++import vendor.samsung.hardware.biometrics.fingerprint.ISehFingerprint;
++import vendor.samsung.hardware.biometrics.fingerprint.SehResult;
+
+ /**
+ * System service that provides an interface for authenticating with biometrics and
+@@ -115,6 +117,7 @@ public class AuthService extends SystemService {
+
+ private FileObserver fodFileObserver = null;
+ private ISehBiometricsFingerprint mSamsungFingerprint = null;
++ private ISehFingerprint mSamsungFingerprintAidl = null;
+
+ private IXiaomiFingerprint mXiaomiFingerprint = null;
+
+@@ -702,13 +705,22 @@ public class AuthService extends SystemService {
+ } catch(Exception e) {
+ android.util.Log.e("PHH", "Failed getting Samsung fingerprint HAL", e);
+ }
++ try {
++ //mSamsungFingerprintAidl = ISehFingerprint.getService();
++ mSamsungFingerprintAidl = ISehFingerprint.Stub.asInterface(
++ ServiceManager.waitForDeclaredService(
++ ISehFingerprint.DESCRIPTOR + "/default"));
++ android.util.Log.e("PHH", "Got samsung fingerprint AIDL HAL");
++ } catch(Exception e) {
++ android.util.Log.e("PHH", "Failed getting Samsung fingerprint AIDL HAL", e);
++ }
+ try {
+ mXiaomiFingerprint = IXiaomiFingerprint.getService();
+ android.util.Log.e("PHH", "Got xiaomi fingerprint HAL");
+ } catch(Exception e) {
+ android.util.Log.e("PHH", "Failed getting xiaomi fingerprint HAL", e);
+ }
+- if(samsungHasCmd("fod_enable") && mSamsungFingerprint != null) {
++ if(samsungHasCmd("fod_enable") && (mSamsungFingerprint != null || mSamsungFingerprintAidl != null)) {
+ samsungCmd("fod_enable,1,1,0");
+ String actualMaskBrightnessPath = "/sys/class/lcd/panel/actual_mask_brightness";
+ android.util.Log.e("PHH-Enroll", "Reading actual brightness file gives " + readFile(actualMaskBrightnessPath));
+@@ -719,6 +731,11 @@ public class AuthService extends SystemService {
+ try {
+ mSamsungFingerprint = ISehBiometricsFingerprint.getService();
+ } catch(Exception e) {}
++ try {
++ mSamsungFingerprintAidl = ISehFingerprint.Stub.asInterface(
++ ServiceManager.waitForDeclaredService(
++ ISehFingerprint.DESCRIPTOR + "/default"));
++ } catch(Exception e) {}
+ Slog.d("PHH-Enroll", "New actual mask brightness is " + actualMask);
+ try {
+ int eventReq = 0;
+@@ -731,6 +748,9 @@ public class AuthService extends SystemService {
+ mSamsungFingerprint.sehRequest(22 /* SEM_FINGER_STATE */, eventReq, new java.util.ArrayList(),
+ (int retval, java.util.ArrayList out) -> {} );
+ }
++ if(mSamsungFingerprintAidl != null) {
++ SehResult ret = mSamsungFingerprintAidl.sehRequest(0 /*sensorId*/, 22 /* SEM_FINGER_STATE */, eventReq, new byte[0]);
++ }
+ } catch(Exception e) {
+ Slog.d("PHH-Enroll", "Failed setting samsung event for mask observer", e);
+ }
+--
+2.41.0
+
diff --git a/patches/trebledroid/platform_frameworks_libs_net/0001-Restore-back-the-behavior-of-isValid-It-is-legal-to-.patch b/patches/trebledroid/platform_frameworks_libs_net/0001-Restore-back-the-behavior-of-isValid-It-is-legal-to-.patch
deleted file mode 100644
index 127861e..0000000
--- a/patches/trebledroid/platform_frameworks_libs_net/0001-Restore-back-the-behavior-of-isValid-It-is-legal-to-.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From d66a62317bf5b3eb67b4c0a904377e5ec8c8088b Mon Sep 17 00:00:00 2001
-From: Pierre-Hugues Husson
-Date: Wed, 26 Oct 2022 18:02:18 -0400
-Subject: [PATCH] Restore back the behavior of isValid(): It is legal to have
- non-working BpfMap. Dont abort a whole process (system_server...) just
- because we cant access bpf map. Also add isOk to include the additional
- checks for newer kernel versions
-
-Change-Id: Ie7815c186400614f0c6b483c04aa8971af348380
----
- common/native/bpf_headers/include/bpf/BpfMap.h | 13 ++++++++-----
- 1 file changed, 8 insertions(+), 5 deletions(-)
-
-diff --git a/common/native/bpf_headers/include/bpf/BpfMap.h b/common/native/bpf_headers/include/bpf/BpfMap.h
-index 2bee2ee4..9e8a7836 100644
---- a/common/native/bpf_headers/include/bpf/BpfMap.h
-+++ b/common/native/bpf_headers/include/bpf/BpfMap.h
-@@ -50,14 +50,17 @@ class BpfMap {
- // flag must be within BPF_OBJ_FLAG_MASK, ie. 0, BPF_F_RDONLY, BPF_F_WRONLY
- BpfMap(const char* pathname, uint32_t flags) {
- mMapFd.reset(mapRetrieve(pathname, flags));
-- if (mMapFd < 0) abort();
-- if (isAtLeastKernelVersion(4, 14, 0)) {
-- if (bpfGetFdKeySize(mMapFd) != sizeof(Key)) abort();
-- if (bpfGetFdValueSize(mMapFd) != sizeof(Value)) abort();
-- }
- }
-
- public:
-+ bool isOk() {
-+ if (mMapFd < 0) return false;
-+ if (isAtLeastKernelVersion(4, 14, 0)) {
-+ if (bpfGetFdKeySize(mMapFd) != sizeof(Key)) return false;
-+ if (bpfGetFdValueSize(mMapFd) != sizeof(Value)) return false;
-+ }
-+ return true;
-+ }
- explicit BpfMap(const char* pathname) : BpfMap(pathname, 0) {}
-
- BpfMap(bpf_map_type map_type, uint32_t max_entries, uint32_t map_flags = 0) {
---
-2.25.1
-
diff --git a/patches/trebledroid/platform_frameworks_native/0001-On-Samsung-we-need-to-send-a-hack-message-to-HAL-to-.patch b/patches/trebledroid/platform_frameworks_native/0001-On-Samsung-we-need-to-send-a-hack-message-to-HAL-to-.patch
index fc8350e..461c9c8 100644
--- a/patches/trebledroid/platform_frameworks_native/0001-On-Samsung-we-need-to-send-a-hack-message-to-HAL-to-.patch
+++ b/patches/trebledroid/platform_frameworks_native/0001-On-Samsung-we-need-to-send-a-hack-message-to-HAL-to-.patch
@@ -1,8 +1,8 @@
-From a05e7866b74891933d1c5d244b00029ee0a5fbe3 Mon Sep 17 00:00:00 2001
+From aebe42c92ee6101179d0f53216db245575eff123 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson
Date: Wed, 14 Aug 2019 23:37:10 +0200
-Subject: [PATCH 01/10] On Samsung, we need to send a hack-message to HAL to
- get all Sensors
+Subject: [PATCH 1/8] On Samsung, we need to send a hack-message to HAL to get
+ all Sensors
Change-Id: Id6a1fa48340de61c418493668e9abd22c2599376
---
@@ -10,7 +10,7 @@ Change-Id: Id6a1fa48340de61c418493668e9abd22c2599376
1 file changed, 3 insertions(+)
diff --git a/services/sensorservice/SensorDevice.cpp b/services/sensorservice/SensorDevice.cpp
-index de050e02d0..3daeece62b 100644
+index 10ca990f87..e603f6d404 100644
--- a/services/sensorservice/SensorDevice.cpp
+++ b/services/sensorservice/SensorDevice.cpp
@@ -38,6 +38,7 @@
@@ -19,9 +19,9 @@ index de050e02d0..3daeece62b 100644
+#include
using namespace android::hardware::sensors;
- using android::hardware::Return;
using android::util::ProtoOutputStream;
-@@ -77,6 +78,8 @@ SensorDevice::SensorDevice() {
+
+@@ -76,6 +77,8 @@ SensorDevice::SensorDevice() {
}
void SensorDevice::initializeSensorList() {
diff --git a/patches/trebledroid/platform_frameworks_native/0002-Matching-an-input-with-a-display-uses-uniqueId.patch b/patches/trebledroid/platform_frameworks_native/0002-Matching-an-input-with-a-display-uses-uniqueId.patch
index 93f5012..995f669 100644
--- a/patches/trebledroid/platform_frameworks_native/0002-Matching-an-input-with-a-display-uses-uniqueId.patch
+++ b/patches/trebledroid/platform_frameworks_native/0002-Matching-an-input-with-a-display-uses-uniqueId.patch
@@ -1,7 +1,7 @@
-From a7cbe8cc5d115838fee3eaa3bb22abb58cd03b75 Mon Sep 17 00:00:00 2001
+From 384d42fd907cc47e6bb057aee4021a888663b89e Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson
Date: Thu, 22 Oct 2020 23:22:46 +0200
-Subject: [PATCH 02/10] Matching an input with a display uses uniqueId
+Subject: [PATCH 2/8] Matching an input with a display uses uniqueId
Not all devices have a `location`, notably bluetooth devices.
However, we might still want to associate them with a screen,
@@ -15,10 +15,10 @@ Change-Id: Ifcbc8329d54386f58e013270d9888316c0f516b6
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/services/inputflinger/reader/InputDevice.cpp b/services/inputflinger/reader/InputDevice.cpp
-index 989700f6cf..e45222103b 100644
+index 0a64a1c4a8..425091805b 100644
--- a/services/inputflinger/reader/InputDevice.cpp
+++ b/services/inputflinger/reader/InputDevice.cpp
-@@ -309,7 +309,10 @@ void InputDevice::configure(nsecs_t when, const InputReaderConfiguration* config
+@@ -264,7 +264,10 @@ std::list InputDevice::configure(nsecs_t when,
mAssociatedDisplayUniqueId = std::nullopt;
mAssociatedViewport = std::nullopt;
// Find the display port that corresponds to the current input port.
@@ -28,8 +28,8 @@ index 989700f6cf..e45222103b 100644
+ inputPort = mIdentifier.uniqueId;
+ }
if (!inputPort.empty()) {
- const std::unordered_map& ports = config->portAssociations;
- const auto& displayPort = ports.find(inputPort);
+ const std::unordered_map& ports =
+ readerConfig.portAssociations;
--
2.25.1
diff --git a/patches/trebledroid/platform_frameworks_native/0003-unshared_oob-didn-t-exist-in-O-P-so-detect-its-suppo.patch b/patches/trebledroid/platform_frameworks_native/0003-unshared_oob-didn-t-exist-in-O-P-so-detect-its-suppo.patch
index d87b9a8..8ffd4ec 100644
--- a/patches/trebledroid/platform_frameworks_native/0003-unshared_oob-didn-t-exist-in-O-P-so-detect-its-suppo.patch
+++ b/patches/trebledroid/platform_frameworks_native/0003-unshared_oob-didn-t-exist-in-O-P-so-detect-its-suppo.patch
@@ -1,8 +1,8 @@
-From 5326cafc09d407c5eef4c6bad2d27468afb8bf18 Mon Sep 17 00:00:00 2001
+From 88885ee67a4b6d37e1607b25f3c17ecab04772eb Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson
Date: Tue, 5 Jan 2021 23:44:00 +0100
-Subject: [PATCH 03/10] unshared_oob didn't exist in O/P, so detect its
- supported based on vndk version
+Subject: [PATCH 3/8] unshared_oob didn't exist in O/P, so detect its supported
+ based on vndk version
---
cmds/installd/migrate_legacy_obb_data.sh | 2 +-
diff --git a/patches/trebledroid/platform_frameworks_native/0004-Remove-Samsung-system-permission-on-sensors.patch b/patches/trebledroid/platform_frameworks_native/0004-Remove-Samsung-system-permission-on-sensors.patch
index 6a65b76..b16030d 100644
--- a/patches/trebledroid/platform_frameworks_native/0004-Remove-Samsung-system-permission-on-sensors.patch
+++ b/patches/trebledroid/platform_frameworks_native/0004-Remove-Samsung-system-permission-on-sensors.patch
@@ -1,7 +1,7 @@
-From 189acf03a98cc75f2560faa61e5b202a1fbbae27 Mon Sep 17 00:00:00 2001
+From 37956832948b4a3dad64aa06d1c155a5418145fa Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson
Date: Wed, 31 Mar 2021 23:36:03 +0200
-Subject: [PATCH 04/10] Remove Samsung system permission on sensors
+Subject: [PATCH 4/8] Remove Samsung system permission on sensors
---
libs/sensor/Sensor.cpp | 1 +
@@ -9,10 +9,10 @@ Subject: [PATCH 04/10] Remove Samsung system permission on sensors
2 files changed, 2 insertions(+)
diff --git a/libs/sensor/Sensor.cpp b/libs/sensor/Sensor.cpp
-index b865c4d5d6..56dc219f33 100644
+index b6ea77deb5..91807a8a53 100644
--- a/libs/sensor/Sensor.cpp
+++ b/libs/sensor/Sensor.cpp
-@@ -433,6 +433,7 @@ const String8& Sensor::getStringType() const {
+@@ -429,6 +429,7 @@ const String8& Sensor::getStringType() const {
}
const String8& Sensor::getRequiredPermission() const {
diff --git a/patches/trebledroid/platform_frameworks_native/0005-Mark-accelerometer-input-as-sensor-exclusively-if-th.patch b/patches/trebledroid/platform_frameworks_native/0005-Mark-accelerometer-input-as-sensor-exclusively-if-th.patch
index 685263e..9bc24d8 100644
--- a/patches/trebledroid/platform_frameworks_native/0005-Mark-accelerometer-input-as-sensor-exclusively-if-th.patch
+++ b/patches/trebledroid/platform_frameworks_native/0005-Mark-accelerometer-input-as-sensor-exclusively-if-th.patch
@@ -1,7 +1,7 @@
-From cd3a75cd1efea5defcfb9c349b5328182b34dc4d Mon Sep 17 00:00:00 2001
+From f4ecf382a6a93dc0e970c499a12c15647cc74d24 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson
Date: Sun, 12 Dec 2021 08:45:36 -0500
-Subject: [PATCH 05/10] Mark accelerometer input as sensor exclusively if there
+Subject: [PATCH 5/8] Mark accelerometer input as sensor exclusively if there
are ABS axis
The reason this is needed is that on -fucked up- Xiami Mi A2 Lite and
@@ -15,10 +15,10 @@ Change-Id: I491ab89724c908ef09a23a6427d24a8889bf806a
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/services/inputflinger/reader/EventHub.cpp b/services/inputflinger/reader/EventHub.cpp
-index d6a6bd214e..febce0ae6b 100644
+index 0354164155..f0fcd56540 100644
--- a/services/inputflinger/reader/EventHub.cpp
+++ b/services/inputflinger/reader/EventHub.cpp
-@@ -2124,7 +2124,13 @@ void EventHub::openDeviceLocked(const std::string& devicePath) {
+@@ -2341,7 +2341,13 @@ void EventHub::openDeviceLocked(const std::string& devicePath) {
// Check whether this device is an accelerometer.
if (device->propBitmask.test(INPUT_PROP_ACCELEROMETER)) {
diff --git a/patches/trebledroid/platform_frameworks_native/0008-MIUI13-devices-hide-their-vibrator-HAL-behind-non-de.patch b/patches/trebledroid/platform_frameworks_native/0006-MIUI13-devices-hide-their-vibrator-HAL-behind-non-de.patch
similarity index 86%
rename from patches/trebledroid/platform_frameworks_native/0008-MIUI13-devices-hide-their-vibrator-HAL-behind-non-de.patch
rename to patches/trebledroid/platform_frameworks_native/0006-MIUI13-devices-hide-their-vibrator-HAL-behind-non-de.patch
index 0502b2c..379b9ed 100644
--- a/patches/trebledroid/platform_frameworks_native/0008-MIUI13-devices-hide-their-vibrator-HAL-behind-non-de.patch
+++ b/patches/trebledroid/platform_frameworks_native/0006-MIUI13-devices-hide-their-vibrator-HAL-behind-non-de.patch
@@ -1,8 +1,8 @@
-From 3f457addf69b543f40bc9ba1567f679d0257321e Mon Sep 17 00:00:00 2001
+From 39d7a358622fc48f3eb66be6ee0d4d49da8cebd6 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson
Date: Fri, 25 Mar 2022 05:37:56 -0400
-Subject: [PATCH 08/10] MIUI13 devices hide their vibrator HAL behind
- non-default name: "vibratorfeature"
+Subject: [PATCH 6/8] MIUI13 devices hide their vibrator HAL behind non-default
+ name: "vibratorfeature"
---
services/vibratorservice/VibratorHalController.cpp | 6 ++++++
diff --git a/patches/trebledroid/platform_frameworks_native/0007-Fix-loading-power-hidl-v1.0.patch b/patches/trebledroid/platform_frameworks_native/0007-Fix-loading-power-hidl-v1.0.patch
deleted file mode 100644
index 9a27258..0000000
--- a/patches/trebledroid/platform_frameworks_native/0007-Fix-loading-power-hidl-v1.0.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From f96b8fab171c56dc6b28673c057010db96f9ce63 Mon Sep 17 00:00:00 2001
-From: Pierre-Hugues Husson
-Date: Wed, 12 Jan 2022 04:07:34 -0500
-Subject: [PATCH 07/10] Fix loading power hidl v1.0
-
-Change-Id: Ife20a98d2a11c79c7b42f359f30c28e2dede1f25
----
- services/powermanager/PowerHalLoader.cpp | 5 +++--
- 1 file changed, 3 insertions(+), 2 deletions(-)
-
-diff --git a/services/powermanager/PowerHalLoader.cpp b/services/powermanager/PowerHalLoader.cpp
-index 9b20e67f7a..cd7f2312e2 100644
---- a/services/powermanager/PowerHalLoader.cpp
-+++ b/services/powermanager/PowerHalLoader.cpp
-@@ -93,10 +93,11 @@ sp PowerHalLoader::lo
- }
-
- sp PowerHalLoader::loadHidlV1_0Locked() {
-- static bool gHalExists = true;
-+ static bool gSecHalExists = true;
- static auto loadFnSec = []() { return V1_0::IPower::getService("power"); };
-- auto hal = loadHal(gHalExists, gHalHidlV1_0, loadFnSec, "HIDL v1.0");
-+ auto hal = loadHal(gSecHalExists, gHalHidlV1_0, loadFnSec, "HIDL v1.0");
-
-+ static bool gHalExists = true;
- static auto loadFn = []() { return V1_0::IPower::getService(); };
- if(hal == nullptr)
- hal = loadHal(gHalExists, gHalHidlV1_0, loadFn, "HIDL v1.0");
---
-2.25.1
-
diff --git a/patches/trebledroid/platform_frameworks_native/0006-powermanager-Add-support-Samsung-miscpower-HAL.patch b/patches/trebledroid/platform_frameworks_native/0007-powermanager-Add-support-Samsung-miscpower-HAL.patch
similarity index 72%
rename from patches/trebledroid/platform_frameworks_native/0006-powermanager-Add-support-Samsung-miscpower-HAL.patch
rename to patches/trebledroid/platform_frameworks_native/0007-powermanager-Add-support-Samsung-miscpower-HAL.patch
index 2f42828..0c7b53f 100644
--- a/patches/trebledroid/platform_frameworks_native/0006-powermanager-Add-support-Samsung-miscpower-HAL.patch
+++ b/patches/trebledroid/platform_frameworks_native/0007-powermanager-Add-support-Samsung-miscpower-HAL.patch
@@ -1,7 +1,7 @@
-From 6da8eb767e170c16c671aad62bc71ba310efd295 Mon Sep 17 00:00:00 2001
+From c017671a27c9c1290c1a46b24790b8454a2c9a03 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson
Date: Mon, 27 Dec 2021 18:00:43 -0500
-Subject: [PATCH 06/10] powermanager: Add support Samsung miscpower HAL
+Subject: [PATCH 7/8] powermanager: Add support Samsung miscpower HAL
Several various configurations need to be supported:
- Android Pie vendors have a android.hardware.power HIDL default + "miscpower"
@@ -17,55 +17,56 @@ Only tested configuration ATM is the latest one
Change-Id: I182a91ccb0a89f9d0d7d41f36eccab218b553bbc
---
- include/powermanager/PowerHalLoader.h | 3 +
- include/powermanager/PowerHalWrapper.h | 36 +++++++++-
- services/powermanager/Android.bp | 1 +
- services/powermanager/PowerHalController.cpp | 7 +-
- services/powermanager/PowerHalLoader.cpp | 17 ++++-
- services/powermanager/PowerHalWrapper.cpp | 70 ++++++++++++++++++++
- 6 files changed, 131 insertions(+), 3 deletions(-)
+ include/powermanager/PowerHalLoader.h | 3 +
+ include/powermanager/PowerHalWrapper.h | 35 +++++++++-
+ services/powermanager/Android.bp | 2 +
+ services/powermanager/PowerHalController.cpp | 16 +++--
+ services/powermanager/PowerHalLoader.cpp | 17 ++++-
+ services/powermanager/PowerHalWrapper.cpp | 70 +++++++++++++++++++
+ .../CompositionEngine/Android.bp | 1 +
+ 7 files changed, 138 insertions(+), 6 deletions(-)
diff --git a/include/powermanager/PowerHalLoader.h b/include/powermanager/PowerHalLoader.h
-index ed6f6f35f5..53ecdd7e98 100644
+index e0384f31db..944c225ef8 100644
--- a/include/powermanager/PowerHalLoader.h
+++ b/include/powermanager/PowerHalLoader.h
-@@ -20,6 +20,7 @@
- #include
- #include
+@@ -22,6 +22,7 @@
+ #include
+ #include
#include
+#include
namespace android {
-@@ -32,12 +33,14 @@ public:
- static sp loadAidl();
- static sp loadHidlV1_0();
+@@ -36,6 +37,7 @@ public:
static sp loadHidlV1_1();
+ static sp loadHidlV1_2();
+ static sp loadHidlV1_3();
+ static sp loadHidlSeh();
private:
static std::mutex gHalMutex;
- static sp gHalAidl GUARDED_BY(gHalMutex);
- static sp gHalHidlV1_0 GUARDED_BY(gHalMutex);
+@@ -44,6 +46,7 @@ private:
static sp gHalHidlV1_1 GUARDED_BY(gHalMutex);
+ static sp gHalHidlV1_2 GUARDED_BY(gHalMutex);
+ static sp gHalHidlV1_3 GUARDED_BY(gHalMutex);
+ static sp gHalHidlSeh GUARDED_BY(gHalMutex);
static sp loadHidlV1_0Locked()
EXCLUSIVE_LOCKS_REQUIRED(gHalMutex);
diff --git a/include/powermanager/PowerHalWrapper.h b/include/powermanager/PowerHalWrapper.h
-index dfb0ff59a0..9ad805dfcd 100644
+index 8028aa86e1..fc3385fbe3 100644
--- a/include/powermanager/PowerHalWrapper.h
+++ b/include/powermanager/PowerHalWrapper.h
-@@ -23,6 +23,8 @@
+@@ -25,6 +25,7 @@
#include
#include
#include
+#include