From ec1862bc5b6a7871f983a6d3b063d184bcf5c05b Mon Sep 17 00:00:00 2001 From: Talmid of Levi Date: Fri, 15 Dec 2023 16:15:40 -0500 Subject: [PATCH] Delete patches_treble_td/platform_frameworks_av/0022-Add-a-prop-to-change-Samsung-flash-strength.patch --- ...rop-to-change-Samsung-flash-strength.patch | 57 ------------------- 1 file changed, 57 deletions(-) delete mode 100644 patches_treble_td/platform_frameworks_av/0022-Add-a-prop-to-change-Samsung-flash-strength.patch diff --git a/patches_treble_td/platform_frameworks_av/0022-Add-a-prop-to-change-Samsung-flash-strength.patch b/patches_treble_td/platform_frameworks_av/0022-Add-a-prop-to-change-Samsung-flash-strength.patch deleted file mode 100644 index 4c3b850..0000000 --- a/patches_treble_td/platform_frameworks_av/0022-Add-a-prop-to-change-Samsung-flash-strength.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 0fa119c66801a5e2a0fce1055bfbc261d65c00fb Mon Sep 17 00:00:00 2001 -From: Pierre-Hugues Husson -Date: Sat, 16 Apr 2022 14:30:14 -0400 -Subject: [PATCH 22/27] 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(-) - -diff --git a/services/camera/libcameraservice/Android.bp b/services/camera/libcameraservice/Android.bp -index 1faeb60ba7..8c588065cf 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", - "vendor.samsung.hardware.camera.provider@3.0", - "vendor.samsung.hardware.camera.provider@4.0", -+ "vendor.samsung.hardware.camera.device@5.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 ---- a/services/camera/libcameraservice/common/hidl/HidlProviderInfo.cpp -+++ b/services/camera/libcameraservice/common/hidl/HidlProviderInfo.cpp -@@ -29,6 +29,7 @@ - #include - #include - #include -+#include - - namespace { - const bool kEnableLazyHal(property_get_bool("ro.camera.enableLazyHal", false)); -@@ -781,7 +782,18 @@ HidlProviderInfo::HidlDeviceInfo3::HidlDeviceInfo3( - status_t HidlProviderInfo::HidlDeviceInfo3::setTorchMode(bool enabled) { - using hardware::camera::common::V1_0::TorchMode; - const sp interface = startDeviceInterface(); -- Status s = interface->setTorchMode(enabled ? TorchMode::ON : TorchMode::OFF); -+ int32_t flashStrength = property_get_int32("persist.sys.phh.flash_strength", 1); -+ -+ auto sehCast = vendor::samsung::hardware::camera::device::V5_0::ISehCameraDevice::castFrom(interface); -+ android::sp 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.34.1 -