diff options
| -rwxr-xr-x | media/java/android/media/tv/interactive/TvInteractiveAppService.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/media/java/android/media/tv/interactive/TvInteractiveAppService.java b/media/java/android/media/tv/interactive/TvInteractiveAppService.java index eba26d470737..f332f8102013 100755 --- a/media/java/android/media/tv/interactive/TvInteractiveAppService.java +++ b/media/java/android/media/tv/interactive/TvInteractiveAppService.java @@ -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); } |