1*4d7e907cSAndroid Build Coastguard Worker/* 2*4d7e907cSAndroid Build Coastguard Worker * Copyright (C) 2017 The Android Open Source Project 3*4d7e907cSAndroid Build Coastguard Worker * 4*4d7e907cSAndroid Build Coastguard Worker * Licensed under the Apache License, Version 2.0 (the "License"); 5*4d7e907cSAndroid Build Coastguard Worker * you may not use this file except in compliance with the License. 6*4d7e907cSAndroid Build Coastguard Worker * You may obtain a copy of the License at 7*4d7e907cSAndroid Build Coastguard Worker * 8*4d7e907cSAndroid Build Coastguard Worker * http://www.apache.org/licenses/LICENSE-2.0 9*4d7e907cSAndroid Build Coastguard Worker * 10*4d7e907cSAndroid Build Coastguard Worker * Unless required by applicable law or agreed to in writing, software 11*4d7e907cSAndroid Build Coastguard Worker * distributed under the License is distributed on an "AS IS" BASIS, 12*4d7e907cSAndroid Build Coastguard Worker * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13*4d7e907cSAndroid Build Coastguard Worker * See the License for the specific language governing permissions and 14*4d7e907cSAndroid Build Coastguard Worker * limitations under the License. 15*4d7e907cSAndroid Build Coastguard Worker */ 16*4d7e907cSAndroid Build Coastguard Workerpackage [email protected]; 17*4d7e907cSAndroid Build Coastguard Worker 18*4d7e907cSAndroid Build Coastguard Workerimport [email protected]::types; 19*4d7e907cSAndroid Build Coastguard Worker 20*4d7e907cSAndroid Build Coastguard Worker/** 21*4d7e907cSAndroid Build Coastguard Worker * ICas is the API to control the cas system and is accessible from both 22*4d7e907cSAndroid Build Coastguard Worker * Java and native level. It is used to manage sessions, provision/refresh 23*4d7e907cSAndroid Build Coastguard Worker * the cas system, and process the EMM/ECM messages. It also allows bi-directional, 24*4d7e907cSAndroid Build Coastguard Worker * scheme-specific communications between the client and the cas system. 25*4d7e907cSAndroid Build Coastguard Worker */ 26*4d7e907cSAndroid Build Coastguard Worker 27*4d7e907cSAndroid Build Coastguard Workerinterface ICas { 28*4d7e907cSAndroid Build Coastguard Worker /** 29*4d7e907cSAndroid Build Coastguard Worker * Provide the CA private data from a CA_descriptor in the conditional 30*4d7e907cSAndroid Build Coastguard Worker * access table to a CasPlugin. 31*4d7e907cSAndroid Build Coastguard Worker * 32*4d7e907cSAndroid Build Coastguard Worker * @param pvtData a byte array containing the private data, the format of 33*4d7e907cSAndroid Build Coastguard Worker * which is scheme-specific and opaque to the framework. 34*4d7e907cSAndroid Build Coastguard Worker * @return status the status of the call. 35*4d7e907cSAndroid Build Coastguard Worker */ 36*4d7e907cSAndroid Build Coastguard Worker setPrivateData(vec<uint8_t> pvtData) generates (Status status); 37*4d7e907cSAndroid Build Coastguard Worker 38*4d7e907cSAndroid Build Coastguard Worker /** 39*4d7e907cSAndroid Build Coastguard Worker * Open a session to descramble one or more streams scrambled by the 40*4d7e907cSAndroid Build Coastguard Worker * conditional access system. 41*4d7e907cSAndroid Build Coastguard Worker * 42*4d7e907cSAndroid Build Coastguard Worker * @return status the status of the call. 43*4d7e907cSAndroid Build Coastguard Worker * @return sessionId the id of the newly opened session. 44*4d7e907cSAndroid Build Coastguard Worker */ 45*4d7e907cSAndroid Build Coastguard Worker openSession() generates(Status status, HidlCasSessionId sessionId); 46*4d7e907cSAndroid Build Coastguard Worker 47*4d7e907cSAndroid Build Coastguard Worker /** 48*4d7e907cSAndroid Build Coastguard Worker * Close a session. 49*4d7e907cSAndroid Build Coastguard Worker * 50*4d7e907cSAndroid Build Coastguard Worker * @param sessionId the id of the session to be closed. 51*4d7e907cSAndroid Build Coastguard Worker * @return status the status of the call. 52*4d7e907cSAndroid Build Coastguard Worker */ 53*4d7e907cSAndroid Build Coastguard Worker closeSession(HidlCasSessionId sessionId) generates (Status status); 54*4d7e907cSAndroid Build Coastguard Worker 55*4d7e907cSAndroid Build Coastguard Worker /** 56*4d7e907cSAndroid Build Coastguard Worker * Provide the CA private data from a CA_descriptor in the program map 57*4d7e907cSAndroid Build Coastguard Worker * table to a session. 58*4d7e907cSAndroid Build Coastguard Worker * 59*4d7e907cSAndroid Build Coastguard Worker * @param sessionId the id of the session which the private data applies to. 60*4d7e907cSAndroid Build Coastguard Worker * @param pvtData a byte array containing the private data, the format of 61*4d7e907cSAndroid Build Coastguard Worker * which is scheme-specific and opaque to the framework. 62*4d7e907cSAndroid Build Coastguard Worker * @return status the status of the call. 63*4d7e907cSAndroid Build Coastguard Worker */ 64*4d7e907cSAndroid Build Coastguard Worker setSessionPrivateData(HidlCasSessionId sessionId, vec<uint8_t> pvtData) 65*4d7e907cSAndroid Build Coastguard Worker generates (Status status); 66*4d7e907cSAndroid Build Coastguard Worker 67*4d7e907cSAndroid Build Coastguard Worker /** 68*4d7e907cSAndroid Build Coastguard Worker * Process an ECM from the ECM stream for this session’s elementary stream. 69*4d7e907cSAndroid Build Coastguard Worker * 70*4d7e907cSAndroid Build Coastguard Worker * @param sessionId the id of the session which the ecm data applies to. 71*4d7e907cSAndroid Build Coastguard Worker * @param ecm a byte array containing the ecm data. 72*4d7e907cSAndroid Build Coastguard Worker * @return status the status of the call. 73*4d7e907cSAndroid Build Coastguard Worker */ 74*4d7e907cSAndroid Build Coastguard Worker processEcm(HidlCasSessionId sessionId, vec<uint8_t> ecm) 75*4d7e907cSAndroid Build Coastguard Worker generates (Status status); 76*4d7e907cSAndroid Build Coastguard Worker 77*4d7e907cSAndroid Build Coastguard Worker /** 78*4d7e907cSAndroid Build Coastguard Worker * Process an in-band EMM from the EMM stream. 79*4d7e907cSAndroid Build Coastguard Worker * 80*4d7e907cSAndroid Build Coastguard Worker * @param emm a byte array containing the emm data. 81*4d7e907cSAndroid Build Coastguard Worker * @return status the status of the call. 82*4d7e907cSAndroid Build Coastguard Worker */ 83*4d7e907cSAndroid Build Coastguard Worker processEmm(vec<uint8_t> emm) generates (Status status); 84*4d7e907cSAndroid Build Coastguard Worker 85*4d7e907cSAndroid Build Coastguard Worker /** 86*4d7e907cSAndroid Build Coastguard Worker * Send an scheme-specific event to the CasPlugin. 87*4d7e907cSAndroid Build Coastguard Worker * 88*4d7e907cSAndroid Build Coastguard Worker * @param event an integer denoting a scheme-specific event to be sent. 89*4d7e907cSAndroid Build Coastguard Worker * @param arg a scheme-specific integer argument for the event. 90*4d7e907cSAndroid Build Coastguard Worker * @param data a byte array containing scheme-specific data for the event. 91*4d7e907cSAndroid Build Coastguard Worker * @return status the status of the call. 92*4d7e907cSAndroid Build Coastguard Worker */ 93*4d7e907cSAndroid Build Coastguard Worker sendEvent(int32_t event, int32_t arg, vec<uint8_t> eventData) 94*4d7e907cSAndroid Build Coastguard Worker generates (Status status); 95*4d7e907cSAndroid Build Coastguard Worker 96*4d7e907cSAndroid Build Coastguard Worker /** 97*4d7e907cSAndroid Build Coastguard Worker * Initiate a provisioning operation for a CA system. 98*4d7e907cSAndroid Build Coastguard Worker * 99*4d7e907cSAndroid Build Coastguard Worker * @param provisionString string containing information needed for the 100*4d7e907cSAndroid Build Coastguard Worker * provisioning operation, the format of which is scheme and implementation 101*4d7e907cSAndroid Build Coastguard Worker * specific. 102*4d7e907cSAndroid Build Coastguard Worker * @return status the status of the call. 103*4d7e907cSAndroid Build Coastguard Worker */ 104*4d7e907cSAndroid Build Coastguard Worker provision(string provisionString) generates (Status status); 105*4d7e907cSAndroid Build Coastguard Worker 106*4d7e907cSAndroid Build Coastguard Worker /** 107*4d7e907cSAndroid Build Coastguard Worker * Notify the CA system to refresh entitlement keys. 108*4d7e907cSAndroid Build Coastguard Worker * 109*4d7e907cSAndroid Build Coastguard Worker * @param refreshType the type of the refreshment. 110*4d7e907cSAndroid Build Coastguard Worker * @param refreshData private data associated with the refreshment. 111*4d7e907cSAndroid Build Coastguard Worker * @return status the status of the call. 112*4d7e907cSAndroid Build Coastguard Worker */ 113*4d7e907cSAndroid Build Coastguard Worker refreshEntitlements(int32_t refreshType, vec<uint8_t> refreshData) 114*4d7e907cSAndroid Build Coastguard Worker generates (Status status); 115*4d7e907cSAndroid Build Coastguard Worker 116*4d7e907cSAndroid Build Coastguard Worker /** 117*4d7e907cSAndroid Build Coastguard Worker * Release the descrambler instance. 118*4d7e907cSAndroid Build Coastguard Worker * 119*4d7e907cSAndroid Build Coastguard Worker * @return status the status of the call. 120*4d7e907cSAndroid Build Coastguard Worker */ 121*4d7e907cSAndroid Build Coastguard Worker release() generates (Status status); 122*4d7e907cSAndroid Build Coastguard Worker}; 123