13957091ba8f08c02b5e781098cb955a5f697a1ffJae Seo/*
23957091ba8f08c02b5e781098cb955a5f697a1ffJae Seo * Copyright (C) 2014 The Android Open Source Project
33957091ba8f08c02b5e781098cb955a5f697a1ffJae Seo *
43957091ba8f08c02b5e781098cb955a5f697a1ffJae Seo * Licensed under the Apache License, Version 2.0 (the "License");
53957091ba8f08c02b5e781098cb955a5f697a1ffJae Seo * you may not use this file except in compliance with the License.
63957091ba8f08c02b5e781098cb955a5f697a1ffJae Seo * You may obtain a copy of the License at
73957091ba8f08c02b5e781098cb955a5f697a1ffJae Seo *
83957091ba8f08c02b5e781098cb955a5f697a1ffJae Seo *      http://www.apache.org/licenses/LICENSE-2.0
93957091ba8f08c02b5e781098cb955a5f697a1ffJae Seo *
103957091ba8f08c02b5e781098cb955a5f697a1ffJae Seo * Unless required by applicable law or agreed to in writing, software
113957091ba8f08c02b5e781098cb955a5f697a1ffJae Seo * distributed under the License is distributed on an "AS IS" BASIS,
123957091ba8f08c02b5e781098cb955a5f697a1ffJae Seo * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
133957091ba8f08c02b5e781098cb955a5f697a1ffJae Seo * See the License for the specific language governing permissions and
143957091ba8f08c02b5e781098cb955a5f697a1ffJae Seo * limitations under the License.
153957091ba8f08c02b5e781098cb955a5f697a1ffJae Seo */
163957091ba8f08c02b5e781098cb955a5f697a1ffJae Seo
17d5cc4a281e7ce29d1e8687ff3394b57a3a549260Jae Seopackage android.media.tv;
183957091ba8f08c02b5e781098cb955a5f697a1ffJae Seo
199a22f0f0a631849d9c622c642d3ab0395f77584bYoungsang Choimport android.graphics.Rect;
204b34cc77630112d00e9a87498d05f5f8803a9ff6Jae Seoimport android.media.PlaybackParams;
211f213914c45c23c653f721690da2ce0718e63139Dongwon Kangimport android.media.tv.TvTrackInfo;
223957091ba8f08c02b5e781098cb955a5f697a1ffJae Seoimport android.net.Uri;
23a759b111a1c9cb00284038f8a1554bf29709b952Jae Seoimport android.os.Bundle;
243957091ba8f08c02b5e781098cb955a5f697a1ffJae Seoimport android.view.Surface;
253957091ba8f08c02b5e781098cb955a5f697a1ffJae Seo
263957091ba8f08c02b5e781098cb955a5f697a1ffJae Seo/**
273957091ba8f08c02b5e781098cb955a5f697a1ffJae Seo * Sub-interface of ITvInputService which is created per session and has its own context.
283957091ba8f08c02b5e781098cb955a5f697a1ffJae Seo * @hide
293957091ba8f08c02b5e781098cb955a5f697a1ffJae Seo */
303957091ba8f08c02b5e781098cb955a5f697a1ffJae Seooneway interface ITvInputSession {
313957091ba8f08c02b5e781098cb955a5f697a1ffJae Seo    void release();
323957091ba8f08c02b5e781098cb955a5f697a1ffJae Seo
3315c56aac985bc8d75f38fb4ecb92dda12d2ca06cJi-Hwan Lee    void setMain(boolean isMain);
343957091ba8f08c02b5e781098cb955a5f697a1ffJae Seo    void setSurface(in Surface surface);
35e821d711db1799dc51661a3ed6188f3cd942bae7Youngsang Cho    void dispatchSurfaceChanged(int format, int width, int height);
363957091ba8f08c02b5e781098cb955a5f697a1ffJae Seo    // TODO: Remove this once it becomes irrelevant for applications to handle audio focus. The plan
373957091ba8f08c02b5e781098cb955a5f697a1ffJae Seo    // is to introduce some new concepts that will solve a number of problems in audio policy today.
383957091ba8f08c02b5e781098cb955a5f697a1ffJae Seo    void setVolume(float volume);
391a6b25eabcc1fb66e6e8d76f91fd413e18b793a9Sungsoo Lim    void tune(in Uri channelUri, in Bundle params);
402c1c31c7ae9bd972b974a5cc2d8b0942746af612Jae Seo    void setCaptionEnabled(boolean enabled);
4110d285ac06b3d3060c7d90d3dc196d4ac8367467Jae Seo    void selectTrack(int type, in String trackId);
429a22f0f0a631849d9c622c642d3ab0395f77584bYoungsang Cho
43a759b111a1c9cb00284038f8a1554bf29709b952Jae Seo    void appPrivateCommand(in String action, in Bundle data);
44a759b111a1c9cb00284038f8a1554bf29709b952Jae Seo
459a22f0f0a631849d9c622c642d3ab0395f77584bYoungsang Cho    void createOverlayView(in IBinder windowToken, in Rect frame);
469a22f0f0a631849d9c622c642d3ab0395f77584bYoungsang Cho    void relayoutOverlayView(in Rect frame);
479a22f0f0a631849d9c622c642d3ab0395f77584bYoungsang Cho    void removeOverlayView();
48903d6b72cd572665309633e925485464d08bb25aJaewan Kim
49a90338396c90f19b062b696cdb1ffcb8600755b2Jae Seo    void unblockContent(in String unblockedRating);
506f0240cf63fe62b0af2c7d5112f9881d1e167bfcDongwon Kang
51a826d0172aae5e91d633ffe606059a2355fbf7e5Jae Seo    void timeShiftPlay(in Uri recordedProgramUri);
526f0240cf63fe62b0af2c7d5112f9881d1e167bfcDongwon Kang    void timeShiftPause();
536f0240cf63fe62b0af2c7d5112f9881d1e167bfcDongwon Kang    void timeShiftResume();
546f0240cf63fe62b0af2c7d5112f9881d1e167bfcDongwon Kang    void timeShiftSeekTo(long timeMs);
554b34cc77630112d00e9a87498d05f5f8803a9ff6Jae Seo    void timeShiftSetPlaybackParams(in PlaybackParams params);
56465f0d6aa36f2f1db88603aa487bcba9f5af068dJae Seo    void timeShiftEnablePositionTracking(boolean enable);
57a826d0172aae5e91d633ffe606059a2355fbf7e5Jae Seo
58a826d0172aae5e91d633ffe606059a2355fbf7e5Jae Seo    // For the recording session
590cb5244e52590214ddc16dd5fc1030b5baf04726Dongwon Kang    void startRecording(in Uri programUri);
60a826d0172aae5e91d633ffe606059a2355fbf7e5Jae Seo    void stopRecording();
613957091ba8f08c02b5e781098cb955a5f697a1ffJae Seo}
62