Loading media/java/android/media/tv/ITvInputManager.aidl +3 −0 Original line number Diff line number Diff line Loading @@ -149,4 +149,7 @@ interface ITvInputManager { // For CTS purpose only. Add/remove a TvInputHardware device void addHardwareDevice(in int deviceId); void removeHardwareDevice(in int deviceId); // For freezing video playback void setVideoFrozen(in IBinder sessionToken, boolean isFrozen, int userId); } media/java/android/media/tv/ITvInputSession.aidl +3 −0 Original line number Diff line number Diff line Loading @@ -83,4 +83,7 @@ oneway interface ITvInputSession { // For TV messages void notifyTvMessage(int type, in Bundle data); void setTvMessageEnabled(int type, boolean enabled); // For freezing video void setVideoFrozen(boolean isFrozen); } media/java/android/media/tv/ITvInputSessionWrapper.java +10 −0 Original line number Diff line number Diff line Loading @@ -81,6 +81,7 @@ public class ITvInputSessionWrapper extends ITvInputSession.Stub implements Hand private static final int DO_NOTIFY_TV_MESSAGE = 32; private static final int DO_STOP_PLAYBACK = 33; private static final int DO_START_PLAYBACK = 34; private static final int DO_SET_VIDEO_FROZEN = 35; private final boolean mIsRecordingSession; private final HandlerCaller mCaller; Loading Loading @@ -296,6 +297,10 @@ public class ITvInputSessionWrapper extends ITvInputSession.Stub implements Hand mTvInputSessionImpl.startPlayback(); break; } case DO_SET_VIDEO_FROZEN: { mTvInputSessionImpl.setVideoFrozen((Boolean) msg.obj); break; } default: { Log.w(TAG, "Unhandled message code: " + msg.what); break; Loading Loading @@ -482,6 +487,11 @@ public class ITvInputSessionWrapper extends ITvInputSession.Stub implements Hand mCaller.executeOrSendMessage(mCaller.obtainMessageO(DO_NOTIFY_AD_BUFFER, buffer)); } @Override public void setVideoFrozen(boolean isFrozen) { mCaller.executeOrSendMessage(mCaller.obtainMessageO(DO_SET_VIDEO_FROZEN, isFrozen)); } @Override public void notifyTvMessage(int type, Bundle data) { mCaller.executeOrSendMessage(mCaller.obtainMessageOO(DO_NOTIFY_TV_MESSAGE, type, data)); Loading media/java/android/media/tv/TvInputManager.java +12 −0 Original line number Diff line number Diff line Loading @@ -3334,6 +3334,18 @@ public final class TvInputManager { } } void setVideoFrozen(boolean isFrozen) { if (mToken == null) { Log.w(TAG, "The session has been already released"); return; } try { mService.setVideoFrozen(mToken, isFrozen, mUserId); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Sends TV messages to the service for testing purposes */ Loading media/java/android/media/tv/TvInputService.java +18 −0 Original line number Diff line number Diff line Loading @@ -1557,6 +1557,17 @@ public abstract class TvInputService extends Service { public void onStartPlayback() { } /** * Called when a request to freeze the video is received from the TV app. The audio should * continue playback while the video is frozen. * * <p> This should freeze the video to the last frame when the state is set to {@code true}. * @param isFrozen whether or not the video should be frozen. * @hide */ public void onSetVideoFrozen(boolean isFrozen) { } /** * Called when the application requests to play a given recorded TV program. * Loading Loading @@ -2033,6 +2044,13 @@ public abstract class TvInputService extends Service { onStartPlayback(); } /** * Calls {@link #onSetVideoFrozen(boolean)}. */ void setVideoFrozen(boolean isFrozen) { onSetVideoFrozen(isFrozen); } /** * Calls {@link #onTimeShiftPlay(Uri)}. */ Loading Loading
media/java/android/media/tv/ITvInputManager.aidl +3 −0 Original line number Diff line number Diff line Loading @@ -149,4 +149,7 @@ interface ITvInputManager { // For CTS purpose only. Add/remove a TvInputHardware device void addHardwareDevice(in int deviceId); void removeHardwareDevice(in int deviceId); // For freezing video playback void setVideoFrozen(in IBinder sessionToken, boolean isFrozen, int userId); }
media/java/android/media/tv/ITvInputSession.aidl +3 −0 Original line number Diff line number Diff line Loading @@ -83,4 +83,7 @@ oneway interface ITvInputSession { // For TV messages void notifyTvMessage(int type, in Bundle data); void setTvMessageEnabled(int type, boolean enabled); // For freezing video void setVideoFrozen(boolean isFrozen); }
media/java/android/media/tv/ITvInputSessionWrapper.java +10 −0 Original line number Diff line number Diff line Loading @@ -81,6 +81,7 @@ public class ITvInputSessionWrapper extends ITvInputSession.Stub implements Hand private static final int DO_NOTIFY_TV_MESSAGE = 32; private static final int DO_STOP_PLAYBACK = 33; private static final int DO_START_PLAYBACK = 34; private static final int DO_SET_VIDEO_FROZEN = 35; private final boolean mIsRecordingSession; private final HandlerCaller mCaller; Loading Loading @@ -296,6 +297,10 @@ public class ITvInputSessionWrapper extends ITvInputSession.Stub implements Hand mTvInputSessionImpl.startPlayback(); break; } case DO_SET_VIDEO_FROZEN: { mTvInputSessionImpl.setVideoFrozen((Boolean) msg.obj); break; } default: { Log.w(TAG, "Unhandled message code: " + msg.what); break; Loading Loading @@ -482,6 +487,11 @@ public class ITvInputSessionWrapper extends ITvInputSession.Stub implements Hand mCaller.executeOrSendMessage(mCaller.obtainMessageO(DO_NOTIFY_AD_BUFFER, buffer)); } @Override public void setVideoFrozen(boolean isFrozen) { mCaller.executeOrSendMessage(mCaller.obtainMessageO(DO_SET_VIDEO_FROZEN, isFrozen)); } @Override public void notifyTvMessage(int type, Bundle data) { mCaller.executeOrSendMessage(mCaller.obtainMessageOO(DO_NOTIFY_TV_MESSAGE, type, data)); Loading
media/java/android/media/tv/TvInputManager.java +12 −0 Original line number Diff line number Diff line Loading @@ -3334,6 +3334,18 @@ public final class TvInputManager { } } void setVideoFrozen(boolean isFrozen) { if (mToken == null) { Log.w(TAG, "The session has been already released"); return; } try { mService.setVideoFrozen(mToken, isFrozen, mUserId); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Sends TV messages to the service for testing purposes */ Loading
media/java/android/media/tv/TvInputService.java +18 −0 Original line number Diff line number Diff line Loading @@ -1557,6 +1557,17 @@ public abstract class TvInputService extends Service { public void onStartPlayback() { } /** * Called when a request to freeze the video is received from the TV app. The audio should * continue playback while the video is frozen. * * <p> This should freeze the video to the last frame when the state is set to {@code true}. * @param isFrozen whether or not the video should be frozen. * @hide */ public void onSetVideoFrozen(boolean isFrozen) { } /** * Called when the application requests to play a given recorded TV program. * Loading Loading @@ -2033,6 +2044,13 @@ public abstract class TvInputService extends Service { onStartPlayback(); } /** * Calls {@link #onSetVideoFrozen(boolean)}. */ void setVideoFrozen(boolean isFrozen) { onSetVideoFrozen(isFrozen); } /** * Calls {@link #onTimeShiftPlay(Uri)}. */ Loading