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

Commit 5b4e9ea4 authored by David Zhao's avatar David Zhao
Browse files

Fix API compatibility for onTrackSelected

Test: atest TvInteractiveAppService
Bug: 321908275
Change-Id: I01ee0606e1d4d15ecc73e1951e329aa9c16b1c86
parent f5d37c93
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);
        }