Delete patches_treble_td/platform_frameworks_av/0022-Add-a-prop-to-change-Samsung-flash-strength.patch
This commit is contained in:
parent
f85f2186f9
commit
ec1862bc5b
@ -1,57 +0,0 @@
|
|||||||
From 0fa119c66801a5e2a0fce1055bfbc261d65c00fb Mon Sep 17 00:00:00 2001
|
|
||||||
From: Pierre-Hugues Husson <phh@phh.me>
|
|
||||||
Date: Sat, 16 Apr 2022 14:30:14 -0400
|
|
||||||
Subject: [PATCH 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 <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>
|
|
||||||
|
|
||||||
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<hardware::camera::device::V3_2::ICameraDevice> interface = startDeviceInterface();
|
|
||||||
- Status s = interface->setTorchMode(enabled ? TorchMode::ON : TorchMode::OFF);
|
|
||||||
+ int32_t flashStrength = property_get_int32("persist.sys.phh.flash_strength", 1);
|
|
||||||
+
|
|
||||||
+ auto sehCast = vendor::samsung::hardware::camera::device::V5_0::ISehCameraDevice::castFrom(interface);
|
|
||||||
+ android::sp<vendor::samsung::hardware::camera::device::V5_0::ISehCameraDevice> seh = sehCast;
|
|
||||||
+
|
|
||||||
+ 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
|
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user