1 /*
2  * Copyright (C) 2023 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package android.media.tv.ad;
18 
19 import android.graphics.Rect;
20 import android.media.tv.TvTrackInfo;
21 import android.media.tv.ad.ITvAdClient;
22 import android.media.tv.ad.ITvAdManagerCallback;
23 import android.media.tv.ad.TvAdServiceInfo;
24 import android.net.Uri;
25 import android.os.Bundle;
26 import android.view.Surface;
27 
28 /**
29  * Interface to the TV AD service.
30  * @hide
31  */
32 interface ITvAdManager {
getTvAdServiceList(int userId)33     List<TvAdServiceInfo> getTvAdServiceList(int userId);
sendAppLinkCommand(String serviceId, in Bundle command, int userId)34     void sendAppLinkCommand(String serviceId, in Bundle command, int userId);
createSession( in ITvAdClient client, in String serviceId, in String type, int seq, int userId)35     void createSession(
36             in ITvAdClient client, in String serviceId, in String type, int seq, int userId);
releaseSession(in IBinder sessionToken, int userId)37     void releaseSession(in IBinder sessionToken, int userId);
startAdService(in IBinder sessionToken, int userId)38     void startAdService(in IBinder sessionToken, int userId);
stopAdService(in IBinder sessionToken, int userId)39     void stopAdService(in IBinder sessionToken, int userId);
resetAdService(in IBinder sessionToken, int userId)40     void resetAdService(in IBinder sessionToken, int userId);
setSurface(in IBinder sessionToken, in Surface surface, int userId)41     void setSurface(in IBinder sessionToken, in Surface surface, int userId);
dispatchSurfaceChanged(in IBinder sessionToken, int format, int width, int height, int userId)42     void dispatchSurfaceChanged(in IBinder sessionToken, int format, int width, int height,
43             int userId);
44 
sendCurrentVideoBounds(in IBinder sessionToken, in Rect bounds, int userId)45     void sendCurrentVideoBounds(in IBinder sessionToken, in Rect bounds, int userId);
sendCurrentChannelUri(in IBinder sessionToken, in Uri channelUri, int userId)46     void sendCurrentChannelUri(in IBinder sessionToken, in Uri channelUri, int userId);
sendTrackInfoList(in IBinder sessionToken, in List<TvTrackInfo> tracks, int userId)47     void sendTrackInfoList(in IBinder sessionToken, in List<TvTrackInfo> tracks, int userId);
sendCurrentTvInputId(in IBinder sessionToken, in String inputId, int userId)48     void sendCurrentTvInputId(in IBinder sessionToken, in String inputId, int userId);
sendSigningResult(in IBinder sessionToken, in String signingId, in byte[] result, int userId)49     void sendSigningResult(in IBinder sessionToken, in String signingId, in byte[] result,
50             int userId);
51 
notifyError(in IBinder sessionToken, in String errMsg, in Bundle params, int userId)52     void notifyError(in IBinder sessionToken, in String errMsg, in Bundle params, int userId);
notifyTvMessage(in IBinder sessionToken, in int type, in Bundle data, int userId)53     void notifyTvMessage(in IBinder sessionToken, in int type, in Bundle data, int userId);
54 
registerCallback(in ITvAdManagerCallback callback, int userId)55     void registerCallback(in ITvAdManagerCallback callback, int userId);
unregisterCallback(in ITvAdManagerCallback callback, int userId)56     void unregisterCallback(in ITvAdManagerCallback callback, int userId);
57 
createMediaView(in IBinder sessionToken, in IBinder windowToken, in Rect frame, int userId)58     void createMediaView(in IBinder sessionToken, in IBinder windowToken, in Rect frame,
59             int userId);
relayoutMediaView(in IBinder sessionToken, in Rect frame, int userId)60     void relayoutMediaView(in IBinder sessionToken, in Rect frame, int userId);
removeMediaView(in IBinder sessionToken, int userId)61     void removeMediaView(in IBinder sessionToken, int userId);
62 
notifyTvInputSessionData( in IBinder sessionToken, in String type, in Bundle data, int userId)63     void notifyTvInputSessionData(
64             in IBinder sessionToken, in String type, in Bundle data, int userId);
65 }
66