/*
 * 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.
 */

syntax = "proto2";

package android.os.statsd.camera;

import "frameworks/proto_logging/stats/atom_field_options.proto";
import "frameworks/proto_logging/stats/atoms.proto";

option java_package = "com.android.server.camera";
option java_multiple_files = true;

extend Atom {
  optional CameraFeatureCombinationQueryEvent camera_feature_combination_query_event = 900 [(module) = "framework"];
}

/**
 * Information about camera feature combination queries.
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
 */
message CameraFeatureCombinationQueryEvent {
    optional int32 uid = 1 [(is_uid) = true];

    // Camera ID
    optional string camera_id = 2;

    // Type of feature combination queries
    enum QueryType {
        QUERY_FEATURE_COMBINATION = 0;
        QUERY_SESSION_CHARACTERISTICS = 1;
    }
    optional QueryType query_type = 3;

    // Bitmask enum for feature combination queries
    enum FeatureType {
        FEATURE_NONE = 0;
        FEATURE_60_FPS = 0x0001; // 1 << 0
        FEATURE_STABILIZATION = 0x0002; // 1 << 1
        FEATURE_HLG10 = 0x0004; // 1 << 2
        FEATURE_JPEG = 0x0008; // 1 << 3
        FEATURE_JPEG_R = 0x0010; // 1 << 4
        FEATURE_4K = 0x0020; // 1 << 5
    }
    optional int64 feature_combination_bitmap = 4;

    // Status code for feature combination query
    // The values matches the values in ICameraService.aidl
    enum StatusCode {
        OK = 0;
        ERROR_ILLEGAL_ARGUMENT = 3;
        ERROR_INVALID_OPERATION = 10;
    }
    optional StatusCode status_code = 5;
}
