Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9c5ce9d0 authored by David Zhao's avatar David Zhao Committed by Android (Google) Code Review
Browse files

Merge "Add notifyRecordingStopped API"

parents e709cb85 2f09f697
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -64,6 +64,7 @@ interface ITvInteractiveAppManager {
    void notifyContentBlocked(in IBinder sessionToken, in String rating, int userId);
    void notifySignalStrength(in IBinder sessionToken, int stength, int userId);
    void notifyRecordingStarted(in IBinder sessionToken, in String recordingId, int userId);
    void notifyRecordingStopped(in IBinder sessionToken, in String recordingId, int userId);
    void setSurface(in IBinder sessionToken, in Surface surface, int userId);
    void dispatchSurfaceChanged(in IBinder sessionToken, int format, int width, int height,
            int userId);
+1 −0
Original line number Diff line number Diff line
@@ -54,6 +54,7 @@ oneway interface ITvInteractiveAppSession {
    void notifyContentBlocked(in String rating);
    void notifySignalStrength(int strength);
    void notifyRecordingStarted(in String recordingId);
    void notifyRecordingStopped(in String recordingId);
    void setSurface(in Surface surface);
    void dispatchSurfaceChanged(int format, int width, int height);
    void notifyBroadcastInfoResponse(in BroadcastInfoResponse response);
+11 −0
Original line number Diff line number Diff line
@@ -82,6 +82,7 @@ public class ITvInteractiveAppSessionWrapper
    private static final int DO_RELAYOUT_MEDIA_VIEW = 28;
    private static final int DO_REMOVE_MEDIA_VIEW = 29;
    private static final int DO_NOTIFY_RECORDING_STARTED = 30;
    private static final int DO_NOTIFY_RECORDING_STOPPED = 31;

    private final HandlerCaller mCaller;
    private Session mSessionImpl;
@@ -169,6 +170,10 @@ public class ITvInteractiveAppSessionWrapper
                mSessionImpl.notifyRecordingStarted((String) msg.obj);
                break;
            }
            case DO_NOTIFY_RECORDING_STOPPED: {
                mSessionImpl.notifyRecordingStopped((String) msg.obj);
                break;
            }
            case DO_SEND_SIGNING_RESULT: {
                SomeArgs args = (SomeArgs) msg.obj;
                mSessionImpl.sendSigningResult((String) args.arg1, (byte[]) args.arg2);
@@ -391,6 +396,12 @@ public class ITvInteractiveAppSessionWrapper
                DO_NOTIFY_RECORDING_STARTED, recordingId));
    }

    @Override
    public void notifyRecordingStopped(String recordingId) {
        mCaller.executeOrSendMessage(mCaller.obtainMessageO(
                DO_NOTIFY_RECORDING_STOPPED, recordingId));
    }

    @Override
    public void setSurface(Surface surface) {
        mCaller.executeOrSendMessage(mCaller.obtainMessageO(DO_SET_SURFACE, surface));
+12 −0
Original line number Diff line number Diff line
@@ -1071,6 +1071,18 @@ public final class TvInteractiveAppManager {
            }
        }

        void notifyRecordingStopped(String recordingId) {
            if (mToken == null) {
                Log.w(TAG, "The session has been already released");
                return;
            }
            try {
                mService.notifyRecordingStopped(mToken, recordingId, mUserId);
            } catch (RemoteException e) {
                throw e.rethrowFromSystemServer();
            }
        }

        void sendSigningResult(@NonNull String signingId, @NonNull byte[] result) {
            if (mToken == null) {
                Log.w(TAG, "The session has been already released");
+20 −0
Original line number Diff line number Diff line
@@ -462,6 +462,16 @@ public abstract class TvInteractiveAppService extends Service {
        public void onRecordingStarted(@NonNull String recordingId) {
        }

        /**
         * Receives stopped recording's ID.
         *
         * @param recordingId The ID of the recording stopped
         * @hide
         */
        public void onRecordingStopped(@NonNull String recordingId) {
        }


        /**
         * Receives signing result.
         * @param signingId the ID to identify the request. It's the same as the corresponding ID in
@@ -1178,10 +1188,20 @@ public abstract class TvInteractiveAppService extends Service {
            onAdResponse(response);
        }

        /**
         * Calls {@link #onRecordingStarted(String)}.
         */
        void notifyRecordingStarted(String recordingId) {
            onRecordingStarted(recordingId);
        }

        /**
         * Calls {@link #onRecordingStopped(String)}.
         */
        void notifyRecordingStopped(String recordingId) {
            onRecordingStopped(recordingId);
        }

        /**
         * Notifies when the session state is changed.
         *
Loading