Skip to content

Commit

Permalink
Syncing up PHH v413 patches
Browse files Browse the repository at this point in the history
Signed-off-by: xiaoleGun <[email protected]>
  • Loading branch information
xiaoleGun committed May 6, 2022
1 parent 9a33ebc commit d718f75
Show file tree
Hide file tree
Showing 59 changed files with 349 additions and 92 deletions.
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ BUILD_DATE="$(date +%Y%m%d)"
WITHOUT_CHECK_API=true
BL=$PWD/treble_build_miku
BD=$HOME/builds
VERSION="0.3.0"
VERSION="0.3.1"

if [ ! -d .repo ]
then
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 916800d4b0051a5782daf64bc346a4cceace0005 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <[email protected]>
Date: Mon, 5 Aug 2019 18:09:50 +0200
Subject: [PATCH 01/21] Fix BT in-call on CAF devices
Subject: [PATCH 01/23] Fix BT in-call on CAF devices

See https://github.com/phhusson/treble_experimentations/issues/374

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 0d24da4471c956c2914563145b36079fa3a60c43 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <[email protected]>
Date: Tue, 1 Oct 2019 13:35:49 +0200
Subject: [PATCH 02/21] Add (partial, cam id is hardcoded) support for Asus ZF6
Subject: [PATCH 02/23] Add (partial, cam id is hardcoded) support for Asus ZF6
motor camera

Change-Id: Iea6e1370780a1d16f728748d1d948d092532d8fe
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From c58a31446818ebb902773b2ab08df003d0e475d6 Mon Sep 17 00:00:00 2001
From: Peter Cai <[email protected]>
Date: Thu, 23 Jan 2020 11:13:43 +0800
Subject: [PATCH 03/21] audiopolicy: try again with trimmed audio port name if
Subject: [PATCH 03/23] audiopolicy: try again with trimmed audio port name if
not found

* In Spreadtrum BSP, some audio routes may contain ports with extra
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 824d82434aaecbc2715c972087f2069e6eebe87c Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <[email protected]>
Date: Mon, 13 Apr 2020 21:01:16 +0200
Subject: [PATCH 04/21] There are three SCO devices. Fallback from one to the
Subject: [PATCH 04/23] There are three SCO devices. Fallback from one to the
others if needed

Change-Id: I414dcb6b154855c00cb8520b23dc1069827864b2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From dc55498f4d76231da48425f8566ab7146f4c3b08 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <[email protected]>
Date: Thu, 14 May 2020 19:54:55 +0200
Subject: [PATCH 05/21] Add persist.sys.phh.samsung.camera_ids property to
Subject: [PATCH 05/23] Add persist.sys.phh.samsung.camera_ids property to
access hidden Samsung cameras

Change-Id: I2c7bf535272acc28ed2277e96c78ddd28a0b4593
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 32be1cfcf302656f199cae844b6f6319c2466d7e Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <[email protected]>
Date: Tue, 19 May 2020 14:01:14 +0200
Subject: [PATCH 06/21] Add a property to force camera timestamp source
Subject: [PATCH 06/23] 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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 0892e7af02bdc826c2ce3d7deb86da9d2505bc6d Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <[email protected]>
Date: Tue, 24 Apr 2018 00:14:28 +0200
Subject: [PATCH 07/21] FIH devices: Fix "Earpiece" audio output
Subject: [PATCH 07/23] 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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 3b80a0a038a30e2ab40baa8c08524e3a2fd07cfa Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <[email protected]>
Date: Sat, 12 Sep 2020 12:32:50 +0200
Subject: [PATCH 08/21] [audiopolicy] No longer make re-assigning legacy audio
Subject: [PATCH 08/23] [audiopolicy] No longer make re-assigning legacy audio
groups fatal. Mi9 declares AUDIO_STREAM_PATCH and AUDIO_STREAM_REROUTING
which is defined by framework too

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 9c109da3fe56548fdbde82ea0dc835daae688936 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <[email protected]>
Date: Mon, 25 May 2020 21:26:54 +0200
Subject: [PATCH 09/21] Add persist.sys.phh.disable_a2dp_offload property to
Subject: [PATCH 09/23] Add persist.sys.phh.disable_a2dp_offload property to
force a2dp offload

Change-Id: Id474540c33c594cc4010a1a398d82bff8aadaeea
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From c89845b906de7deb6d83537467738546c7180c68 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <[email protected]>
Date: Mon, 21 Dec 2020 20:19:11 +0100
Subject: [PATCH 10/21] Make camera IDs filter-out optional
Subject: [PATCH 10/23] 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 0f58fd9defa9741053b713c565d2a1daac5761da Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <[email protected]>
Date: Sat, 13 Mar 2021 14:20:03 -0500
Subject: [PATCH 11/21] Support Samsung R multi-cams
Subject: [PATCH 11/23] Support Samsung R multi-cams

Change-Id: If46f385e8dd16185cbf37ab083e6a1242e1d1555
---
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From df8e477da0e65c955287d42922b8164b1280b5fa Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <[email protected]>
Date: Tue, 23 Mar 2021 00:16:42 +0100
Subject: [PATCH 12/21] [audiopolicy] Don't crash on unknown audio devices
Subject: [PATCH 12/23] [audiopolicy] Don't crash on unknown audio devices

Change-Id: I2df8d88f742da6a84aa8888cdf19de25444de919
---
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 5d57fe1f7b8674d218fa4da2ae26bafaf7a35997 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <[email protected]>
Date: Sun, 28 Mar 2021 14:47:52 +0200
Subject: [PATCH 13/21] Reenable STRATEGY_ROUTING. This is a leftover of tries
Subject: [PATCH 13/23] Reenable STRATEGY_ROUTING. This is a leftover of tries
of 587b198, wrongly commited in 20f869

---
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 27b4d05e1f48fc403cbe9fb836f12da6aab19a95 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <[email protected]>
Date: Sun, 28 Mar 2021 14:48:49 +0200
Subject: [PATCH 14/21] Use a fake volume policy when none has been found
Subject: [PATCH 14/23] 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From b9ea32b141dae4c7f225737443a5cb41a6a9faaf Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <[email protected]>
Date: Sun, 28 Mar 2021 18:54:47 +0200
Subject: [PATCH 15/21] Not all sources in a route are valid. Dont ignore the
Subject: [PATCH 15/23] Not all sources in a route are valid. Dont ignore the
whole route because of one broken source

Change-Id: If8a51740e71bef3a4738262ad7b43a337b0ec36d
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 5a737734728a01ac529e944b9cf3468c2a705a51 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <[email protected]>
Date: Sat, 7 Aug 2021 11:11:39 +0200
Subject: [PATCH 16/21] When aux cameras are enabled, ignore "system only"
Subject: [PATCH 16/23] When aux cameras are enabled, ignore "system only"
camera flag (it shouldnt be q security issue since secure cameras are listed
otherwise)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From dfc16f14f7fbc0bcf939c8109575c7a490e21328 Mon Sep 17 00:00:00 2001
From: Peter Cai <[email protected]>
Date: Tue, 19 Oct 2021 21:16:55 -0400
Subject: [PATCH 17/21] APM: Restore R and Q behavior respectively for
Subject: [PATCH 17/23] APM: Restore R and Q behavior respectively for
telephony audio

This conditionally reverts part of 51c9cc (S) and afd4ce (R) when the
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 72af9dcd6308a431ca446b05c51f12aa5f3fe519 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <[email protected]>
Date: Mon, 11 Oct 2021 16:10:42 -0400
Subject: [PATCH 18/21] Revert "Remove support for audio HAL V2 from the
Subject: [PATCH 18/23] Revert "Remove support for audio HAL V2 from the
framework"

This reverts commit cbf517f837f7bf8a59f3ff8aa1e0e3e19612e251.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 82cda3c120bd077967a25ebfa763058b0a26e311 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <[email protected]>
Date: Sun, 30 Jan 2022 07:40:19 -0500
Subject: [PATCH 19/21] Fix parsing audio hal 7.0 audio policies
Subject: [PATCH 19/23] 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"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 800291258096c3c24bfdc305b78c7dcf4b2749f7 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <[email protected]>
Date: Sat, 12 Mar 2022 18:07:43 -0500
Subject: [PATCH 20/21] fixup! Not all sources in a route are valid. Dont
Subject: [PATCH 20/23] fixup! Not all sources in a route are valid. Dont
ignore the whole route because of one broken source

---
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 44d39de1cfc88d0d1340cb18a2892af5247f321d Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <[email protected]>
Date: Tue, 5 Apr 2022 15:07:37 -0400
Subject: [PATCH 21/21] Next level of force disable a2dp offload: erase all
Subject: [PATCH 21/23] Next level of force disable a2dp offload: erase all
modules related to a2dp, and include our own

---
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
From 1bdf994a30913b300dafc07050b9e3c89e14d7e6 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <[email protected]>
Date: Sat, 16 Apr 2022 14:30:14 -0400
Subject: [PATCH 22/23] Add a prop to change Samsung flash strength

---
services/camera/libcameraservice/Android.bp | 1 +
.../common/CameraProviderManager.cpp | 14 +++++++++++++-
2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/services/camera/libcameraservice/Android.bp b/services/camera/libcameraservice/Android.bp
index a2a2ad623e..b616f8207f 100644
--- a/services/camera/libcameraservice/Android.bp
+++ b/services/camera/libcameraservice/Android.bp
@@ -156,6 +156,7 @@ cc_library_shared {
"[email protected]",
"[email protected]",
"[email protected]",
+ "[email protected]",
"media_permission-aidl-cpp",
],

diff --git a/services/camera/libcameraservice/common/CameraProviderManager.cpp b/services/camera/libcameraservice/common/CameraProviderManager.cpp
index 3d969845fd..19f217711c 100644
--- a/services/camera/libcameraservice/common/CameraProviderManager.cpp
+++ b/services/camera/libcameraservice/common/CameraProviderManager.cpp
@@ -23,6 +23,7 @@
#include <android/hardware/camera/device/3.7/ICameraDevice.h>
#include <vendor/samsung/hardware/camera/provider/3.0/ISehCameraProvider.h>
#include <vendor/samsung/hardware/camera/provider/4.0/ISehCameraProvider.h>
+#include <vendor/samsung/hardware/camera/device/5.0/ISehCameraDevice.h>

#include <algorithm>
#include <chrono>
@@ -2278,7 +2279,18 @@ sp<InterfaceT> CameraProviderManager::ProviderInfo::DeviceInfo::startDeviceInter
template<class InterfaceT>
status_t CameraProviderManager::ProviderInfo::DeviceInfo::setTorchMode(InterfaceT& interface,
bool enabled) {
- Status s = interface->setTorchMode(enabled ? TorchMode::ON : TorchMode::OFF);
+ int32_t flashStrength = property_get_int32("persist.sys.phh.flash_strength", 1);
+
+ auto sehCast = vendor::samsung::hardware::camera::device::V5_0::ISehCameraDevice::castFrom(interface);
+ android::sp<vendor::samsung::hardware::camera::device::V5_0::ISehCameraDevice> seh = sehCast;
+
+ Status s;
+ if(seh != nullptr) {
+ s = seh->sehSetTorchModeStrength(enabled ? TorchMode::ON : TorchMode::OFF, flashStrength);
+ } else {
+ s = interface->setTorchMode(enabled ? TorchMode::ON : TorchMode::OFF);
+ }
+
return mapToStatusT(s);
}

--
2.25.1

Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
From 1a91caed21cabac752cbf65f9b80ee04b5cb10cd Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <[email protected]>
Date: Mon, 2 May 2022 17:37:09 -0400
Subject: [PATCH 23/23] Support variable flash strength on samsung hal 4.0

---
services/camera/libcameraservice/Android.bp | 1 +
.../libcameraservice/common/CameraProviderManager.cpp | 6 ++++++
2 files changed, 7 insertions(+)

diff --git a/services/camera/libcameraservice/Android.bp b/services/camera/libcameraservice/Android.bp
index b616f8207f..3b99e643e5 100644
--- a/services/camera/libcameraservice/Android.bp
+++ b/services/camera/libcameraservice/Android.bp
@@ -157,6 +157,7 @@ cc_library_shared {
"[email protected]",
"[email protected]",
"[email protected]",
+ "[email protected]",
"media_permission-aidl-cpp",
],

diff --git a/services/camera/libcameraservice/common/CameraProviderManager.cpp b/services/camera/libcameraservice/common/CameraProviderManager.cpp
index 19f217711c..f6d8e276ee 100644
--- a/services/camera/libcameraservice/common/CameraProviderManager.cpp
+++ b/services/camera/libcameraservice/common/CameraProviderManager.cpp
@@ -24,6 +24,7 @@
#include <vendor/samsung/hardware/camera/provider/3.0/ISehCameraProvider.h>
#include <vendor/samsung/hardware/camera/provider/4.0/ISehCameraProvider.h>
#include <vendor/samsung/hardware/camera/device/5.0/ISehCameraDevice.h>
+#include <vendor/samsung/hardware/camera/device/4.0/ISehCameraDevice.h>

#include <algorithm>
#include <chrono>
@@ -2284,9 +2285,14 @@ status_t CameraProviderManager::ProviderInfo::DeviceInfo::setTorchMode(Interface
auto sehCast = vendor::samsung::hardware::camera::device::V5_0::ISehCameraDevice::castFrom(interface);
android::sp<vendor::samsung::hardware::camera::device::V5_0::ISehCameraDevice> seh = sehCast;

+ auto sehCast2 = vendor::samsung::hardware::camera::device::V4_0::ISehCameraDevice::castFrom(interface);
+ android::sp<vendor::samsung::hardware::camera::device::V4_0::ISehCameraDevice> seh2 = sehCast2;
+
Status s;
if(seh != nullptr) {
s = seh->sehSetTorchModeStrength(enabled ? TorchMode::ON : TorchMode::OFF, flashStrength);
+ } else if(seh2 != nullptr) {
+ s = seh2->sehSetTorchModeStrength(enabled ? TorchMode::ON : TorchMode::OFF, flashStrength);
} else {
s = interface->setTorchMode(enabled ? TorchMode::ON : TorchMode::OFF);
}
--
2.25.1

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 355d858a0fd153174f7cb455e2b4d71cf281bdc2 Mon Sep 17 00:00:00 2001
From 4bfb5a9f63233628d831922167a31863199e026f Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <[email protected]>
Date: Tue, 5 Oct 2021 17:59:16 -0400
Subject: [PATCH 01/31] Fallback to stupid autobrightness if brightness values
Subject: [PATCH 01/33] Fallback to stupid autobrightness if brightness values
are broken

This is needed because of:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 9bc107ee34c7c8344c7457745563bdc469577932 Mon Sep 17 00:00:00 2001
From c1ae967a3f4dfa98d092b022f12019ccc0215e3f Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <[email protected]>
Date: Tue, 28 Nov 2017 18:28:04 +0100
Subject: [PATCH 02/31] Relax requirement for visible flag to sdcards
Subject: [PATCH 02/33] 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)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From f4ba9da5d8cb0c539d4e8ef209de82a33fc658e8 Mon Sep 17 00:00:00 2001
From 7f5ca15c709a3f65aa7570c250073f407d57822d Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <[email protected]>
Date: Thu, 17 May 2018 20:28:35 +0200
Subject: [PATCH 03/31] Don't crash if there is IR HAL is not declared
Subject: [PATCH 03/33] Don't crash if there is IR HAL is not declared

Change-Id: I3afded27441bbee8244d5fda544b3e6d1238dc1b
---
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From b5c3cf536b951182784a1a6b55d6e84ca2e8c057 Mon Sep 17 00:00:00 2001
From 002c33f4df78ef7ce20c5a0db5623ad9a7506820 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <[email protected]>
Date: Mon, 6 Aug 2018 12:49:00 +0200
Subject: [PATCH 04/31] Show APN Settings for CDMA carriers
Subject: [PATCH 04/33] Show APN Settings for CDMA carriers

---
telephony/java/android/telephony/CarrierConfigManager.java | 2 +-
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 78a35ef7f5faebe19e4032c20c0e473155070194 Mon Sep 17 00:00:00 2001
From 75a4b7a4e2ee5cafaafec3ac196e44844371d8ba Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <[email protected]>
Date: Thu, 8 Nov 2018 23:04:03 +0100
Subject: [PATCH 05/31] Re-order services so that it works even without qtaguid
Subject: [PATCH 05/33] Re-order services so that it works even without qtaguid

Change-Id: I0c0f527b3ae151d45c68f7ac6c205da3f34e74df
---
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 867f4bb8c91d70957b2c47fc670ca5f24bdcb58b Mon Sep 17 00:00:00 2001
From 825a9326749a609860c2312dd9de6afa5dcc2da4 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <[email protected]>
Date: Sun, 24 Mar 2019 23:05:14 +0100
Subject: [PATCH 06/31] Support samsung Pie and Q light hal
Subject: [PATCH 06/33] Support samsung Pie and Q light hal

Change-Id: I01f94acd7d0672733e48854d80368f9ac6f861c6
---
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 77b91a3653b5fd82d3cc892e440c73b0287bebee Mon Sep 17 00:00:00 2001
From 23263ec24e6566c222ab75f31a51fac5805e11f5 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <[email protected]>
Date: Mon, 12 Aug 2019 23:08:26 +0200
Subject: [PATCH 07/31] Add support for samsung touch, physical and hover
Subject: [PATCH 07/33] Add support for samsung touch, physical and hover
proximity sensor as fallback to real proximity sensor

Change-Id: I7a0f8b4665c802140d19197d850b77b2a7ac1865
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From eeb5dbb4faddde5ae72e84192e967b5507ae85f0 Mon Sep 17 00:00:00 2001
From 599c13a40b83eeed3ad13372ad22c0852811b6d8 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <[email protected]>
Date: Sun, 5 Apr 2020 16:32:46 +0200
Subject: [PATCH 08/31] Always allow overriding the number of work profiles
Subject: [PATCH 08/33] Always allow overriding the number of work profiles

Change-Id: I6eb09aa71663c6fbe7563e3038bffcabdba0ff6a
---
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From b7e49f7494e477f013c49c84dee80debe63b9918 Mon Sep 17 00:00:00 2001
From 2862e025e37ddede66a19585e312e6fb2f658ac5 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <[email protected]>
Date: Sat, 6 Jun 2020 18:21:56 +0200
Subject: [PATCH 09/31] HOME deserves to wake-up devices just as well as back
Subject: [PATCH 09/33] HOME deserves to wake-up devices just as well as back
and menu

Change-Id: Ia562bafd8c620d00c17e8eb338e4701c6c4a3c3a
Expand Down
Loading

0 comments on commit d718f75

Please sign in to comment.