Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8a322123 authored by Rucha Katakwar's avatar Rucha Katakwar
Browse files

Camera:Add gating for fixing up flash control keys.

Newly added manual flash strength level control keys should
only be fixed up when the flag camera_manual_flash_strength_control
is enabled.

Bug: 302872676

Test: Tested locally on Pixel fold device.
Change-Id: I8083697b63b096905085096c2ddfdc419a682b0b
parent 0a3b6f53
Loading
Loading
Loading
Loading
+10 −5
Original line number Original line Diff line number Diff line
@@ -17,6 +17,7 @@
#include "common/HalConversionsTemplated.h"
#include "common/HalConversionsTemplated.h"
#include "common/CameraProviderInfoTemplated.h"
#include "common/CameraProviderInfoTemplated.h"


#include <com_android_internal_camera_flags.h>
#include <cutils/properties.h>
#include <cutils/properties.h>


#include <aidlcommonsupport/NativeHandle.h>
#include <aidlcommonsupport/NativeHandle.h>
@@ -35,6 +36,7 @@ const bool kEnableLazyHal(property_get_bool("ro.camera.enableLazyHal", false));
namespace android {
namespace android {


namespace SessionConfigurationUtils = ::android::camera3::SessionConfigurationUtils;
namespace SessionConfigurationUtils = ::android::camera3::SessionConfigurationUtils;
namespace flags = com::android::internal::camera::flags;


using namespace aidl::android::hardware;
using namespace aidl::android::hardware;
using namespace hardware::camera;
using namespace hardware::camera;
@@ -494,12 +496,15 @@ AidlProviderInfo::AidlDeviceInfo3::AidlDeviceInfo3(
                __FUNCTION__, strerror(-res), res);
                __FUNCTION__, strerror(-res), res);
        return;
        return;
    }
    }
    if (flags::camera_manual_flash_strength_control()) {
        res = fixupManualFlashStrengthControlTags();
        res = fixupManualFlashStrengthControlTags();
        if (OK != res) {
        if (OK != res) {
            ALOGE("%s: Unable to fix up manual flash strength control tags: %s (%d)",
            ALOGE("%s: Unable to fix up manual flash strength control tags: %s (%d)",
                    __FUNCTION__, strerror(-res), res);
                    __FUNCTION__, strerror(-res), res);
            return;
            return;
        }
        }
    }

    auto stat = addDynamicDepthTags();
    auto stat = addDynamicDepthTags();
    if (OK != stat) {
    if (OK != stat) {
        ALOGE("%s: Failed appending dynamic depth tags: %s (%d)", __FUNCTION__, strerror(-stat),
        ALOGE("%s: Failed appending dynamic depth tags: %s (%d)", __FUNCTION__, strerror(-stat),
+9 −6
Original line number Original line Diff line number Diff line
@@ -17,6 +17,7 @@
#include "common/HalConversionsTemplated.h"
#include "common/HalConversionsTemplated.h"
#include "common/CameraProviderInfoTemplated.h"
#include "common/CameraProviderInfoTemplated.h"


#include <com_android_internal_camera_flags.h>
#include <cutils/properties.h>
#include <cutils/properties.h>


#include <android/hardware/ICameraService.h>
#include <android/hardware/ICameraService.h>
@@ -44,6 +45,7 @@ using hardware::camera2::utils::CameraIdAndSessionConfiguration;


using StatusListener = CameraProviderManager::StatusListener;
using StatusListener = CameraProviderManager::StatusListener;
using HalDeviceStatusType = android::hardware::camera::common::V1_0::CameraDeviceStatus;
using HalDeviceStatusType = android::hardware::camera::common::V1_0::CameraDeviceStatus;
namespace flags = com::android::internal::camera::flags;


using hardware::camera::provider::V2_5::DeviceState;
using hardware::camera::provider::V2_5::DeviceState;
using hardware::ICameraService;
using hardware::ICameraService;
@@ -613,13 +615,14 @@ HidlProviderInfo::HidlDeviceInfo3::HidlDeviceInfo3(
                __FUNCTION__, strerror(-res), res);
                __FUNCTION__, strerror(-res), res);
        return;
        return;
    }
    }

    if (flags::camera_manual_flash_strength_control()) {
        res = fixupManualFlashStrengthControlTags();
        res = fixupManualFlashStrengthControlTags();
        if (OK != res) {
        if (OK != res) {
            ALOGE("%s: Unable to fix up manual flash strength control tags: %s (%d)",
            ALOGE("%s: Unable to fix up manual flash strength control tags: %s (%d)",
                    __FUNCTION__, strerror(-res), res);
                    __FUNCTION__, strerror(-res), res);
            return;
            return;
        }
        }
    }


    auto stat = addDynamicDepthTags();
    auto stat = addDynamicDepthTags();
    if (OK != stat) {
    if (OK != stat) {