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.PlaybackParams;
21 import android.media.tv.TvTrackInfo;
22 import android.net.Uri;
23 import android.os.Bundle;
24 import android.view.Surface;
25 
26 /**
27  * Sub-interface of ITvInputService which is created per session and has its own context.
28  * @hide
29  */
30 oneway interface ITvInputSession {
release()31     void release();
32 
setMain(boolean isMain)33     void setMain(boolean isMain);
setSurface(in Surface surface)34     void setSurface(in Surface surface);
dispatchSurfaceChanged(int format, int width, int height)35     void dispatchSurfaceChanged(int format, int width, int height);
36     // TODO: Remove this once it becomes irrelevant for applications to handle audio focus. The plan
37     // is to introduce some new concepts that will solve a number of problems in audio policy today.
setVolume(float volume)38     void setVolume(float volume);
tune(in Uri channelUri, in Bundle params)39     void tune(in Uri channelUri, in Bundle params);
setCaptionEnabled(boolean enabled)40     void setCaptionEnabled(boolean enabled);
selectTrack(int type, in String trackId)41     void selectTrack(int type, in String trackId);
42 
appPrivateCommand(in String action, in Bundle data)43     void appPrivateCommand(in String action, in Bundle data);
44 
createOverlayView(in IBinder windowToken, in Rect frame)45     void createOverlayView(in IBinder windowToken, in Rect frame);
relayoutOverlayView(in Rect frame)46     void relayoutOverlayView(in Rect frame);
removeOverlayView()47     void removeOverlayView();
48 
unblockContent(in String unblockedRating)49     void unblockContent(in String unblockedRating);
50 
timeShiftPlay(in Uri recordedProgramUri)51     void timeShiftPlay(in Uri recordedProgramUri);
timeShiftPause()52     void timeShiftPause();
timeShiftResume()53     void timeShiftResume();
timeShiftSeekTo(long timeMs)54     void timeShiftSeekTo(long timeMs);
timeShiftSetPlaybackParams(in PlaybackParams params)55     void timeShiftSetPlaybackParams(in PlaybackParams params);
timeShiftEnablePositionTracking(boolean enable)56     void timeShiftEnablePositionTracking(boolean enable);
57 
58     // For the recording session
startRecording(in Uri programUri)59     void startRecording(in Uri programUri);
stopRecording()60     void stopRecording();
61 }
62