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

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

Merge "Fix API compatibility for onTrackSelected" into main

parents 22239ed8 5b4e9ea4
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -873,6 +873,9 @@ public abstract class TvInteractiveAppService extends Service {

        /**
         * Called when the corresponding TV input selected to a track.
         *
         * If the track is deselected and no track is currently selected,
         * trackId is an empty string.
         */
        public void onTrackSelected(@TvTrackInfo.Type int type, @NonNull String trackId) {
        }
@@ -1845,6 +1848,10 @@ public abstract class TvInteractiveAppService extends Service {
            if (DEBUG) {
                Log.d(TAG, "notifyTrackSelected (type=" + type + "trackId=" + trackId + ")");
            }
            // TvInputService accepts a Null String, but onTrackSelected expects NonNull.
            if (trackId == null) {
                trackId = "";
            }
            onTrackSelected(type, trackId);
        }