• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.content.ComponentName;
20 import android.content.Intent;
21 import android.graphics.Rect;
22 import android.media.PlaybackParams;
23 import android.media.tv.AdRequest;
24 import android.media.tv.BroadcastInfoRequest;
25 import android.media.tv.DvbDeviceInfo;
26 import android.media.tv.ITvInputClient;
27 import android.media.tv.ITvInputHardware;
28 import android.media.tv.ITvInputHardwareCallback;
29 import android.media.tv.ITvInputManagerCallback;
30 import android.media.tv.TunedInfo;
31 import android.media.tv.TvContentRatingSystemInfo;
32 import android.media.tv.TvInputHardwareInfo;
33 import android.media.tv.TvInputInfo;
34 import android.media.tv.TvStreamConfig;
35 import android.media.tv.TvTrackInfo;
36 import android.net.Uri;
37 import android.os.Bundle;
38 import android.os.ParcelFileDescriptor;
39 import android.view.Surface;
40 
41 /**
42  * Interface to the TV input manager service.
43  * @hide
44  */
45 interface ITvInputManager {
getTvInputList(int userId)46     List<TvInputInfo> getTvInputList(int userId);
getTvInputInfo(in String inputId, int userId)47     TvInputInfo getTvInputInfo(in String inputId, int userId);
updateTvInputInfo(in TvInputInfo inputInfo, int userId)48     void updateTvInputInfo(in TvInputInfo inputInfo, int userId);
getTvInputState(in String inputId, int userId)49     int getTvInputState(in String inputId, int userId);
getAvailableExtensionInterfaceNames(in String inputId, int userId)50     List<String> getAvailableExtensionInterfaceNames(in String inputId, int userId);
getExtensionInterface(in String inputId, in String name, int userId)51     IBinder getExtensionInterface(in String inputId, in String name, int userId);
52 
getTvContentRatingSystemList(int userId)53     List<TvContentRatingSystemInfo> getTvContentRatingSystemList(int userId);
54 
registerCallback(in ITvInputManagerCallback callback, int userId)55     void registerCallback(in ITvInputManagerCallback callback, int userId);
unregisterCallback(in ITvInputManagerCallback callback, int userId)56     void unregisterCallback(in ITvInputManagerCallback callback, int userId);
57 
isParentalControlsEnabled(int userId)58     boolean isParentalControlsEnabled(int userId);
setParentalControlsEnabled(boolean enabled, int userId)59     void setParentalControlsEnabled(boolean enabled, int userId);
isRatingBlocked(in String rating, int userId)60     boolean isRatingBlocked(in String rating, int userId);
getBlockedRatings(int userId)61     List<String> getBlockedRatings(int userId);
addBlockedRating(in String rating, int userId)62     void addBlockedRating(in String rating, int userId);
removeBlockedRating(in String rating, int userId)63     void removeBlockedRating(in String rating, int userId);
64 
createSession(in ITvInputClient client, in String inputId, boolean isRecordingSession, int seq, int userId)65     void createSession(in ITvInputClient client, in String inputId, boolean isRecordingSession,
66             int seq, int userId);
releaseSession(in IBinder sessionToken, int userId)67     void releaseSession(in IBinder sessionToken, int userId);
getClientPid(in String sessionId)68     int getClientPid(in String sessionId);
getClientPriority(int useCase, in String sessionId)69     int getClientPriority(int useCase, in String sessionId);
70 
setMainSession(in IBinder sessionToken, int userId)71     void setMainSession(in IBinder sessionToken, int userId);
setSurface(in IBinder sessionToken, in Surface surface, int userId)72     void setSurface(in IBinder sessionToken, in Surface surface, int userId);
dispatchSurfaceChanged(in IBinder sessionToken, int format, int width, int height, int userId)73     void dispatchSurfaceChanged(in IBinder sessionToken, int format, int width, int height,
74             int userId);
setVolume(in IBinder sessionToken, float volume, int userId)75     void setVolume(in IBinder sessionToken, float volume, int userId);
tune(in IBinder sessionToken, in Uri channelUri, in Bundle params, int userId)76     void tune(in IBinder sessionToken, in Uri channelUri, in Bundle params, int userId);
setCaptionEnabled(in IBinder sessionToken, boolean enabled, int userId)77     void setCaptionEnabled(in IBinder sessionToken, boolean enabled, int userId);
selectTrack(in IBinder sessionToken, int type, in String trackId, int userId)78     void selectTrack(in IBinder sessionToken, int type, in String trackId, int userId);
79 
setInteractiveAppNotificationEnabled(in IBinder sessionToken, boolean enabled, int userId)80     void setInteractiveAppNotificationEnabled(in IBinder sessionToken, boolean enabled, int userId);
81 
sendAppPrivateCommand(in IBinder sessionToken, in String action, in Bundle data, int userId)82     void sendAppPrivateCommand(in IBinder sessionToken, in String action, in Bundle data,
83             int userId);
84 
createOverlayView(in IBinder sessionToken, in IBinder windowToken, in Rect frame, int userId)85     void createOverlayView(in IBinder sessionToken, in IBinder windowToken, in Rect frame,
86             int userId);
relayoutOverlayView(in IBinder sessionToken, in Rect frame, int userId)87     void relayoutOverlayView(in IBinder sessionToken, in Rect frame, int userId);
removeOverlayView(in IBinder sessionToken, int userId)88     void removeOverlayView(in IBinder sessionToken, int userId);
89 
unblockContent(in IBinder sessionToken, in String unblockedRating, int userId)90     void unblockContent(in IBinder sessionToken, in String unblockedRating, int userId);
91 
timeShiftPlay(in IBinder sessionToken, in Uri recordedProgramUri, int userId)92     void timeShiftPlay(in IBinder sessionToken, in Uri recordedProgramUri, int userId);
timeShiftPause(in IBinder sessionToken, int userId)93     void timeShiftPause(in IBinder sessionToken, int userId);
timeShiftResume(in IBinder sessionToken, int userId)94     void timeShiftResume(in IBinder sessionToken, int userId);
timeShiftSeekTo(in IBinder sessionToken, long timeMs, int userId)95     void timeShiftSeekTo(in IBinder sessionToken, long timeMs, int userId);
timeShiftSetPlaybackParams(in IBinder sessionToken, in PlaybackParams params, int userId)96     void timeShiftSetPlaybackParams(in IBinder sessionToken, in PlaybackParams params, int userId);
timeShiftEnablePositionTracking(in IBinder sessionToken, boolean enable, int userId)97     void timeShiftEnablePositionTracking(in IBinder sessionToken, boolean enable, int userId);
98 
getCurrentTunedInfos(int userId)99     List<TunedInfo> getCurrentTunedInfos(int userId);
100 
101     // For the recording session
startRecording(in IBinder sessionToken, in Uri programUri, in Bundle params, int userId)102     void startRecording(in IBinder sessionToken, in Uri programUri, in Bundle params, int userId);
stopRecording(in IBinder sessionToken, int userId)103     void stopRecording(in IBinder sessionToken, int userId);
pauseRecording(in IBinder sessionToken, in Bundle params, int userId)104     void pauseRecording(in IBinder sessionToken, in Bundle params, int userId);
resumeRecording(in IBinder sessionToken, in Bundle params, int userId)105     void resumeRecording(in IBinder sessionToken, in Bundle params, int userId);
106 
107     // For broadcast info
requestBroadcastInfo(in IBinder sessionToken, in BroadcastInfoRequest request, int userId)108     void requestBroadcastInfo(in IBinder sessionToken, in BroadcastInfoRequest request, int userId);
removeBroadcastInfo(in IBinder sessionToken, int id, int userId)109     void removeBroadcastInfo(in IBinder sessionToken, int id, int userId);
110 
111     // For ad request
requestAd(in IBinder sessionToken, in AdRequest request, int userId)112     void requestAd(in IBinder sessionToken, in AdRequest request, int userId);
113 
114     // For TV input hardware binding
getHardwareList()115     List<TvInputHardwareInfo> getHardwareList();
acquireTvInputHardware(int deviceId, in ITvInputHardwareCallback callback, in TvInputInfo info, int userId, String tvInputSessionId, int priorityHint)116     ITvInputHardware acquireTvInputHardware(int deviceId, in ITvInputHardwareCallback callback,
117             in TvInputInfo info, int userId, String tvInputSessionId, int priorityHint);
releaseTvInputHardware(int deviceId, in ITvInputHardware hardware, int userId)118     void releaseTvInputHardware(int deviceId, in ITvInputHardware hardware, int userId);
119 
120     // For TV input capturing
getAvailableTvStreamConfigList(in String inputId, int userId)121     List<TvStreamConfig> getAvailableTvStreamConfigList(in String inputId, int userId);
captureFrame(in String inputId, in Surface surface, in TvStreamConfig config, int userId)122     boolean captureFrame(in String inputId, in Surface surface, in TvStreamConfig config,
123             int userId);
isSingleSessionActive(int userId)124     boolean isSingleSessionActive(int userId);
125 
126     // For DVB device binding
getDvbDeviceList()127     List<DvbDeviceInfo> getDvbDeviceList();
openDvbDevice(in DvbDeviceInfo info, int device)128     ParcelFileDescriptor openDvbDevice(in DvbDeviceInfo info, int device);
129 
130     // For preview channels and programs
sendTvInputNotifyIntent(in Intent intent, int userId)131     void sendTvInputNotifyIntent(in Intent intent, int userId);
requestChannelBrowsable(in Uri channelUri, int userId)132     void requestChannelBrowsable(in Uri channelUri, int userId);
133 
134     // For CTS purpose only. Add/remove a TvInputHardware device
addHardwareDevice(in int deviceId)135     void addHardwareDevice(in int deviceId);
removeHardwareDevice(in int deviceId)136     void removeHardwareDevice(in int deviceId);
137 }
138