1 /*
2  * Copyright (C) 2014 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;
18 
19 import android.media.AudioPresentation;
20 import android.media.tv.AdBuffer;
21 import android.media.tv.AdResponse;
22 import android.media.tv.AitInfo;
23 import android.media.tv.BroadcastInfoResponse;
24 import android.media.tv.ITvInputSession;
25 import android.net.Uri;
26 import android.media.tv.TvTrackInfo;
27 import android.os.Bundle;
28 
29 /**
30  * Helper interface for ITvInputSession to allow the TV input to notify the system service when a
31  * new session has been created.
32  * @hide
33  */
34 oneway interface ITvInputSessionCallback {
onSessionCreated(ITvInputSession session, in IBinder hardwareSessionToken)35     void onSessionCreated(ITvInputSession session, in IBinder hardwareSessionToken);
onSessionEvent(in String name, in Bundle args)36     void onSessionEvent(in String name, in Bundle args);
onChannelRetuned(in Uri channelUri)37     void onChannelRetuned(in Uri channelUri);
onAudioPresentationsChanged(in List<AudioPresentation> tvAudioPresentations)38     void onAudioPresentationsChanged(in List<AudioPresentation> tvAudioPresentations);
onAudioPresentationSelected(int presentationId, int programId)39     void onAudioPresentationSelected(int presentationId, int programId);
onTracksChanged(in List<TvTrackInfo> tracks)40     void onTracksChanged(in List<TvTrackInfo> tracks);
onTrackSelected(int type, in String trackId)41     void onTrackSelected(int type, in String trackId);
onVideoAvailable()42     void onVideoAvailable();
onVideoUnavailable(int reason)43     void onVideoUnavailable(int reason);
onVideoFreezeUpdated(boolean isFrozen)44     void onVideoFreezeUpdated(boolean isFrozen);
onContentAllowed()45     void onContentAllowed();
onContentBlocked(in String rating)46     void onContentBlocked(in String rating);
onLayoutSurface(int left, int top, int right, int bottom)47     void onLayoutSurface(int left, int top, int right, int bottom);
onTimeShiftStatusChanged(int status)48     void onTimeShiftStatusChanged(int status);
onTimeShiftStartPositionChanged(long timeMs)49     void onTimeShiftStartPositionChanged(long timeMs);
onTimeShiftCurrentPositionChanged(long timeMs)50     void onTimeShiftCurrentPositionChanged(long timeMs);
onAitInfoUpdated(in AitInfo aitInfo)51     void onAitInfoUpdated(in AitInfo aitInfo);
onSignalStrength(int strength)52     void onSignalStrength(int strength);
onCueingMessageAvailability(boolean available)53     void onCueingMessageAvailability(boolean available);
onTimeShiftMode(int mode)54     void onTimeShiftMode(int mode);
onAvailableSpeeds(in float[] speeds)55     void onAvailableSpeeds(in float[] speeds);
56 
57     // For the recording session
onTuned(in Uri channelUri)58     void onTuned(in Uri channelUri);
onRecordingStopped(in Uri recordedProgramUri)59     void onRecordingStopped(in Uri recordedProgramUri);
onError(int error)60     void onError(int error);
61 
62     // For broadcast info
onBroadcastInfoResponse(in BroadcastInfoResponse response)63     void onBroadcastInfoResponse(in BroadcastInfoResponse response);
64 
65     // For ad response
onAdResponse(in AdResponse response)66     void onAdResponse(in AdResponse response);
onAdBufferConsumed(in AdBuffer buffer)67     void onAdBufferConsumed(in AdBuffer buffer);
68 
69     // For messages sent from the TV input
onTvMessage(int type, in Bundle data)70     void onTvMessage(int type, in Bundle data);
71 
onTvInputSessionData(in String type, in Bundle data)72     void onTvInputSessionData(in String type, in Bundle data);
73 }
74