/*
 * Copyright (C) 2020 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 com.android.server.location;

import "frameworks/base/core/proto/android/hardware/location/context_hub_info.proto";
import "frameworks/base/core/proto/android/privacy.proto";

option java_multiple_files = true;

message ContextHubServiceProto {
    option (.android.msg_privacy).dest = DEST_AUTOMATIC;

    repeated .android.hardware.location.ContextHubInfoProto context_hub_info = 1;
    optional ClientManagerProto client_manager = 2;
}

message ClientManagerProto {
    option (.android.msg_privacy).dest = DEST_AUTOMATIC;

    message RegistrationRecord {
        option (.android.msg_privacy).dest = DEST_AUTOMATIC;

        optional int64 timestamp_ms = 1;
        optional int32 action = 2;
        // ClientBroker endpoint id, contexthub id and package name
        optional string broker = 3;
    }

    repeated ClientBrokerProto client_brokers = 1;
    repeated RegistrationRecord registration_records = 2;
}

message ClientBrokerProto {
    option (.android.msg_privacy).dest = DEST_AUTOMATIC;

    optional int32 endpoint_id = 1;
    optional int32 attached_context_hub_id = 2;
    optional string package = 3;
    optional int64 nano_app_id = 4;
    optional bool pending_intent_request_valid = 5;
    optional bool has_pending_intent = 6;
    optional bool pending_intent_cancelled = 7;
    optional bool registered = 8;

}
