1
0
mirror of https://github.com/yurisieucuti/treble_evolution.git synced 2024-11-24 10:56:22 +00:00
treble_evolution/patches/trebledroid/platform_frameworks_av/0024-Include-Samsung-AIDL-camera-ids.patch
2024-03-10 06:48:11 +00:00

65 lines
2.5 KiB
Diff

From 9a88a1facccbeddec53756f4c1e962b504f3bb17 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Wed, 7 Feb 2024 05:06:32 -0500
Subject: [PATCH 24/25] Include Samsung AIDL camera ids
---
services/camera/libcameraservice/Android.bp | 1 +
.../common/aidl/AidlProviderInfo.cpp | 21 +++++++++++++++++++
2 files changed, 22 insertions(+)
diff --git a/services/camera/libcameraservice/Android.bp b/services/camera/libcameraservice/Android.bp
index 7ef870c1eb..43a1ebd8ee 100644
--- a/services/camera/libcameraservice/Android.bp
+++ b/services/camera/libcameraservice/Android.bp
@@ -179,6 +179,7 @@ cc_library_shared {
"vendor.samsung.hardware.camera.provider@4.0",
"vendor.samsung.hardware.camera.device@5.0",
"vendor.samsung.hardware.camera.device@4.0",
+ "vendor.samsung.hardware.camera.provider-V1-ndk",
"media_permission-aidl-cpp",
],
diff --git a/services/camera/libcameraservice/common/aidl/AidlProviderInfo.cpp b/services/camera/libcameraservice/common/aidl/AidlProviderInfo.cpp
index b18cbd41a4..9ea1bee67d 100644
--- a/services/camera/libcameraservice/common/aidl/AidlProviderInfo.cpp
+++ b/services/camera/libcameraservice/common/aidl/AidlProviderInfo.cpp
@@ -28,6 +28,8 @@
#include <utils/SessionConfigurationUtils.h>
#include <utils/Trace.h>
+#include <aidl/vendor/samsung/hardware/camera/provider/ISehCameraProvider.h>
+
namespace {
const bool kEnableLazyHal(property_get_bool("ro.camera.enableLazyHal", false));
} // anonymous namespace
@@ -155,6 +157,25 @@ status_t AidlProviderInfo::initializeAidlProvider(
return mapToStatusT(status);
}
+ if(true) {
+ AIBinder *ext;
+ auto spaibinder = interface->asBinder();
+
+ status_t ret = AIBinder_getExtension(spaibinder.get(), &ext);
+ ALOGE("Grabbing CameraProvider extension got %d", ret);
+ if (ret == android::OK) {
+ using aidl::vendor::samsung::hardware::camera::provider::ISehCameraProvider;
+ std::shared_ptr<ISehCameraProvider> provider = ISehCameraProvider::fromBinder(ndk::SpAIBinder(ext));
+ ALOGE("Trying to get ISehCameraProvider...");
+ if (provider != nullptr) {
+ ALOGE("Got it!");
+ if(property_get_bool("persist.sys.phh.samsung.camera_ids", false)) {
+ provider->getCameraIdListAll(&retDevices);
+ }
+ }
+ }
+ }
+
for (auto& name : retDevices) {
uint16_t major, minor;
std::string type, id;
--
2.25.1