From cf2151431fc074fc8579707f4ca796fe4083585a Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Sat, 21 Jun 2025 16:48:04 -0400 Subject: [PATCH 8/8] Tell Unihertz/Agold we are not a GSI. Fixes aux cam on Jelly Max Change-Id: I0feb30f978d4fd0b71c731dc3de70fda744099df --- services/camera/libcameraservice/Android.bp | 1 + .../common/aidl/AidlProviderInfo.cpp | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/services/camera/libcameraservice/Android.bp b/services/camera/libcameraservice/Android.bp index 0606d74..7b91ad6 100644 --- a/services/camera/libcameraservice/Android.bp +++ b/services/camera/libcameraservice/Android.bp @@ -113,6 +113,7 @@ cc_defaults { "android.hardware.camera.provider@2.6", "android.hardware.camera.provider@2.7", "android.hardware.camera.provider-V3-ndk", + "vendor.mediatek.hardware.agolddaemon-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 b9e8cdd..34059e1 100644 --- a/services/camera/libcameraservice/common/aidl/AidlProviderInfo.cpp +++ b/services/camera/libcameraservice/common/aidl/AidlProviderInfo.cpp @@ -34,6 +34,8 @@ #include #include +#include + namespace { const bool kEnableLazyHal(property_get_bool("ro.camera.enableLazyHal", false)); } // anonymous namespace @@ -159,6 +161,17 @@ status_t AidlProviderInfo::initializeAidlProvider( __FUNCTION__, mProviderName.c_str(), mDeviceState); notifyDeviceStateChange(currentDeviceState); + + if (true) { + auto svc = aidl::vendor::mediatek::hardware::agolddaemon::IAgoldDaemon::fromBinder( + ndk::SpAIBinder(AServiceManager_checkService("vendor.mediatek.hardware.agolddaemon.IAgoldDaemon/default"))); + + if (svc != nullptr) { + ALOGE("Got agold aidl hal"); + svc->setNotGsi("NotGsi"); + } + } + res = setUpVendorTags(); if (res != OK) { ALOGE("%s: Unable to set up vendor tags from provider '%s'", -- 2.48.1