mirror of
https://github.com/ponces/treble_aosp.git
synced 2024-11-22 05:26:14 +00:00
65 lines
2.6 KiB
Diff
65 lines
2.6 KiB
Diff
From ec6bbb73320d75ee88bf48db01398346e4674d78 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 23/24] 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 1e1423f42b..bfe9c8bbb5 100644
|
|
--- a/services/camera/libcameraservice/Android.bp
|
|
+++ b/services/camera/libcameraservice/Android.bp
|
|
@@ -111,6 +111,7 @@ cc_defaults {
|
|
"android.hardware.camera.provider-V3-ndk",
|
|
"vendor.samsung.hardware.camera.provider@3.0",
|
|
"vendor.samsung.hardware.camera.provider@4.0",
|
|
+ "vendor.samsung.hardware.camera.provider-V1-ndk",
|
|
"libaidlcommonsupport",
|
|
"libbinderthreadstateutils",
|
|
"libcameraservice_device_independent",
|
|
diff --git a/services/camera/libcameraservice/common/aidl/AidlProviderInfo.cpp b/services/camera/libcameraservice/common/aidl/AidlProviderInfo.cpp
|
|
index a721d287f4..1e16541ed6 100644
|
|
--- a/services/camera/libcameraservice/common/aidl/AidlProviderInfo.cpp
|
|
+++ b/services/camera/libcameraservice/common/aidl/AidlProviderInfo.cpp
|
|
@@ -30,6 +30,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
|
|
@@ -170,6 +172,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.34.1
|
|
|