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);
onContentAllowed()44     void onContentAllowed();
onContentBlocked(in String rating)45     void onContentBlocked(in String rating);
onLayoutSurface(int left, int top, int right, int bottom)46     void onLayoutSurface(int left, int top, int right, int bottom);
onTimeShiftStatusChanged(int status)47     void onTimeShiftStatusChanged(int status);
onTimeShiftStartPositionChanged(long timeMs)48     void onTimeShiftStartPositionChanged(long timeMs);
onTimeShiftCurrentPositionChanged(long timeMs)49     void onTimeShiftCurrentPositionChanged(long timeMs);
onAitInfoUpdated(in AitInfo aitInfo)50     void onAitInfoUpdated(in AitInfo aitInfo);
onSignalStrength(int strength)51     void onSignalStrength(int strength);
onCueingMessageAvailability(boolean available)52     void onCueingMessageAvailability(boolean available);
onTimeShiftMode(int mode)53     void onTimeShiftMode(int mode);
onAvailableSpeeds(in float[] speeds)54     void onAvailableSpeeds(in float[] speeds);
55 
56     // For the recording session
onTuned(in Uri channelUri)57     void onTuned(in Uri channelUri);
onRecordingStopped(in Uri recordedProgramUri)58     void onRecordingStopped(in Uri recordedProgramUri);
onError(int error)59     void onError(int error);
60 
61     // For broadcast info
onBroadcastInfoResponse(in BroadcastInfoResponse response)62     void onBroadcastInfoResponse(in BroadcastInfoResponse response);
63 
64     // For ad response
onAdResponse(in AdResponse response)65     void onAdResponse(in AdResponse response);
onAdBufferConsumed(in AdBuffer buffer)66     void onAdBufferConsumed(in AdBuffer buffer);
67 
68     // For messages sent from the TV input
onTvMessage(int type, in Bundle data)69     void onTvMessage(int type, in Bundle data);
70 }
71