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

Commit c9cb1b6b authored by Shuzhen Wang's avatar Shuzhen Wang Committed by Android (Google) Code Review
Browse files

Merge "Camera: Separate out framework only metadata tags" into main

parents 713d77a2 7172024f
Loading
Loading
Loading
Loading
+42 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2024 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include <array>
#pragma once

/**
 * ! Do not edit this file directly !
 *
 * Generated automatically from fwk_only_metadata_tags.mako. To be included in libcameraservice
 * only by Camera3Device.cpp.
 */

namespace android {

/**
 * Framework only CaptureRequest keys. To be used for filtering out keys in CaptureRequest
 * before sending to the HAL.
 */
constexpr std::array kFwkOnlyMetadataKeys = {
        ANDROID_CONTROL_AF_REGIONS_SET,
        ANDROID_CONTROL_AE_REGIONS_SET,
        ANDROID_CONTROL_AWB_REGIONS_SET,
        ANDROID_CONTROL_ZOOM_METHOD,
        ANDROID_SCALER_CROP_REGION_SET,
        ANDROID_EXTENSION_STRENGTH,
};

} //namespace android
+2 −7
Original line number Diff line number Diff line
@@ -61,6 +61,7 @@
#include <com_android_window_flags.h>

#include "CameraService.h"
#include "FwkOnlyMetadataTags.h"
#include "aidl/android/hardware/graphics/common/Dataspace.h"
#include "aidl/AidlUtils.h"
#include "device3/Camera3Device.h"
@@ -3797,18 +3798,12 @@ bool Camera3Device::RequestThread::threadLoop() {
}

status_t Camera3Device::removeFwkOnlyKeys(CameraMetadata *request) {
    static const std::array<uint32_t, 5> kFwkOnlyKeys = {
            ANDROID_CONTROL_AF_REGIONS_SET,
            ANDROID_CONTROL_AE_REGIONS_SET,
            ANDROID_CONTROL_AWB_REGIONS_SET,
            ANDROID_SCALER_CROP_REGION_SET,
            ANDROID_CONTROL_ZOOM_METHOD};
    if (request == nullptr) {
        ALOGE("%s request metadata nullptr", __FUNCTION__);
        return BAD_VALUE;
    }
    status_t res = OK;
    for (const auto &key : kFwkOnlyKeys) {
    for (const auto &key : kFwkOnlyMetadataKeys) {
        if (request->exists(key)) {
            res = request->erase(key);
            if (res != OK) {