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

package android.hardware.contexthub@1.2;

import @1.0::IContexthubCallback;

interface IContexthubCallback extends @1.0::IContexthubCallback {
    /**
     * This callback is passed by the Contexthub service to the HAL
     * implementation to allow the HAL to send asynchronous messages back
     * to the service and registered clients of the ContextHub service.
     *
     * @param msg             message that should be delivered to host app
     *                        clients
     * @param msgContentPerms list of Android permissions that cover the
     *                        contents of the message being sent from the app.
     *                        This is different from the permissions stored
     *                        inside of ContextHubMsg in that these must be a
     *                        subset of those permissions and are meant to
     *                        assist in properly attributing the message
     *                        contents when delivering to a ContextHub service
     *                        client.
     */
    handleClientMsg_1_2(ContextHubMsg msg, vec<string> msgContentPerms);

    /**
     * This callback is passed by the Contexthub service to the HAL
     * implementation to allow the HAL to send information about the
     * currently loaded and active nanoapps on the hub.
     *
     * @param appInfo vector of HubAppinfo structure for each nanoApp
     *                on the hub that can be enabled, disabled and
     *                unloaded by the service. Any nanoApps that cannot
     *                be controlled by the service must not be reported.
     *                All nanoApps that can be controlled by the service
     *                must be reported.
     */
    handleAppsInfo_1_2(vec<HubAppInfo> appInfo);
};
