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

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

Merge "Add notifyTvMessage command in TIS" into udc-dev

parents 318e63f0 85837c3b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -27436,6 +27436,7 @@ package android.media.tv {
    method public boolean onTrackballEvent(android.view.MotionEvent);
    method public abstract boolean onTune(android.net.Uri);
    method public boolean onTune(android.net.Uri, android.os.Bundle);
    method public void onTvMessage(@NonNull String, @NonNull android.os.Bundle);
    method public void onUnblockContent(android.media.tv.TvContentRating);
    method public void setOverlayViewEnabled(boolean);
  }
+4 −0
Original line number Diff line number Diff line
@@ -1922,6 +1922,10 @@ package android.media.tv {
    method public void removeHardwareDevice(int);
  }

  public class TvView extends android.view.ViewGroup {
    method public void notifyTvMessage(@NonNull String, @NonNull android.os.Bundle);
  }

}

package android.media.tv.tuner {
+3 −0
Original line number Diff line number Diff line
@@ -118,6 +118,9 @@ interface ITvInputManager {
    void requestAd(in IBinder sessionToken, in AdRequest request, int userId);
    void notifyAdBuffer(in IBinder sessionToken, in AdBuffer buffer, int userId);

    // For TV Message
    void notifyTvMessage(in IBinder sessionToken, in String type, in Bundle data, int userId);

    // For TV input hardware binding
    List<TvInputHardwareInfo> getHardwareList();
    ITvInputHardware acquireTvInputHardware(int deviceId, in ITvInputHardwareCallback callback,
+3 −0
Original line number Diff line number Diff line
@@ -76,4 +76,7 @@ oneway interface ITvInputSession {
    // For ad request
    void requestAd(in AdRequest request);
    void notifyAdBuffer(in AdBuffer buffer);

    // For TV messages
    void notifyTvMessage(in String type, in Bundle data);
}
+11 −0
Original line number Diff line number Diff line
@@ -78,6 +78,7 @@ public class ITvInputSessionWrapper extends ITvInputSession.Stub implements Hand
    private static final int DO_SELECT_AUDIO_PRESENTATION = 29;
    private static final int DO_TIME_SHIFT_SET_MODE = 30;
    private static final int DO_SET_TV_MESSAGE_ENABLED = 31;
    private static final int DO_NOTIFY_TV_MESSAGE = 32;

    private final boolean mIsRecordingSession;
    private final HandlerCaller mCaller;
@@ -277,6 +278,11 @@ public class ITvInputSessionWrapper extends ITvInputSession.Stub implements Hand
                mTvInputSessionImpl.notifyAdBuffer((AdBuffer) msg.obj);
                break;
            }
            case DO_NOTIFY_TV_MESSAGE: {
                SomeArgs args = (SomeArgs) msg.obj;
                mTvInputSessionImpl.onTvMessageReceived((String) args.arg1, (Bundle) args.arg2);
                break;
            }
            default: {
                Log.w(TAG, "Unhandled message code: " + msg.what);
                break;
@@ -463,6 +469,11 @@ public class ITvInputSessionWrapper extends ITvInputSession.Stub implements Hand
        mCaller.executeOrSendMessage(mCaller.obtainMessageO(DO_NOTIFY_AD_BUFFER, buffer));
    }

    @Override
    public void notifyTvMessage(String type, Bundle data) {
        mCaller.executeOrSendMessage(mCaller.obtainMessageOO(DO_NOTIFY_TV_MESSAGE, type, data));
    }

    private final class TvInputEventReceiver extends InputEventReceiver {
        TvInputEventReceiver(InputChannel inputChannel, Looper looper) {
            super(inputChannel, looper);
Loading