/*
 * Copyright (C) 2019 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.cas@1.2;

import @1.0::HidlCasSessionId;
import @1.1::ICas;
import ScramblingMode;
import SessionIntent;
import Status;

/**
 * ICas is the API to control the cas system and is accessible from both
 * Java and native level. It is used to manage sessions, provision/refresh
 * the cas system, and process the EMM/ECM messages. It also allows bi-directional,
 * scheme-specific communications between the client and the cas system.
 */
interface ICas extends @1.1::ICas {
    /**
     * Open a session to descramble one or more streams by specifying intention
     * and scrambling mode.
     *
     * @param intent the intention of the session to be opened.
     * @param mode the scrambling mode the session will use.
     * @return status the status of the call.
     * @return sessionId the id of the newly opened session.
     */
    openSession_1_2(SessionIntent intent, ScramblingMode mode)
        generates (Status status, HidlCasSessionId sessionId);
};
