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.graphics.Rect; 20 import android.media.AudioPresentation; 21 import android.media.PlaybackParams; 22 import android.media.tv.AdBuffer; 23 import android.media.tv.AdRequest; 24 import android.media.tv.BroadcastInfoRequest; 25 import android.media.tv.TvTrackInfo; 26 import android.net.Uri; 27 import android.os.Bundle; 28 import android.view.Surface; 29 30 /** 31 * Sub-interface of ITvInputService which is created per session and has its own context. 32 * @hide 33 */ 34 oneway interface ITvInputSession { release()35 void release(); 36 setMain(boolean isMain)37 void setMain(boolean isMain); setSurface(in Surface surface)38 void setSurface(in Surface surface); dispatchSurfaceChanged(int format, int width, int height)39 void dispatchSurfaceChanged(int format, int width, int height); 40 // TODO: Remove this once it becomes irrelevant for applications to handle audio focus. The plan 41 // is to introduce some new concepts that will solve a number of problems in audio policy today. setVolume(float volume)42 void setVolume(float volume); tune(in Uri channelUri, in Bundle params)43 void tune(in Uri channelUri, in Bundle params); setCaptionEnabled(boolean enabled)44 void setCaptionEnabled(boolean enabled); selectAudioPresentation(int presentationId, int programId)45 void selectAudioPresentation(int presentationId, int programId); selectTrack(int type, in String trackId)46 void selectTrack(int type, in String trackId); 47 setInteractiveAppNotificationEnabled(boolean enable)48 void setInteractiveAppNotificationEnabled(boolean enable); 49 appPrivateCommand(in String action, in Bundle data)50 void appPrivateCommand(in String action, in Bundle data); 51 createOverlayView(in IBinder windowToken, in Rect frame)52 void createOverlayView(in IBinder windowToken, in Rect frame); relayoutOverlayView(in Rect frame)53 void relayoutOverlayView(in Rect frame); removeOverlayView()54 void removeOverlayView(); 55 unblockContent(in String unblockedRating)56 void unblockContent(in String unblockedRating); 57 timeShiftPlay(in Uri recordedProgramUri)58 void timeShiftPlay(in Uri recordedProgramUri); timeShiftPause()59 void timeShiftPause(); timeShiftResume()60 void timeShiftResume(); timeShiftSeekTo(long timeMs)61 void timeShiftSeekTo(long timeMs); timeShiftSetPlaybackParams(in PlaybackParams params)62 void timeShiftSetPlaybackParams(in PlaybackParams params); timeShiftSetMode(int mode)63 void timeShiftSetMode(int mode); timeShiftEnablePositionTracking(boolean enable)64 void timeShiftEnablePositionTracking(boolean enable); 65 66 // For the recording session startRecording(in Uri programUri, in Bundle params)67 void startRecording(in Uri programUri, in Bundle params); stopRecording()68 void stopRecording(); pauseRecording(in Bundle params)69 void pauseRecording(in Bundle params); resumeRecording(in Bundle params)70 void resumeRecording(in Bundle params); 71 72 // For broadcast info requestBroadcastInfo(in BroadcastInfoRequest request)73 void requestBroadcastInfo(in BroadcastInfoRequest request); removeBroadcastInfo(int id)74 void removeBroadcastInfo(int id); 75 76 // For ad request requestAd(in AdRequest request)77 void requestAd(in AdRequest request); notifyAdBufferReady(in AdBuffer buffer)78 void notifyAdBufferReady(in AdBuffer buffer); 79 80 // For TV messages notifyTvMessage(int type, in Bundle data)81 void notifyTvMessage(int type, in Bundle data); setTvMessageEnabled(int type, boolean enabled)82 void setTvMessageEnabled(int type, boolean enabled); 83 } 84