diff --git a/core/api/current.txt b/core/api/current.txt index fd417c833d16f..83511a39a8db8 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -26763,6 +26763,7 @@ package android.media.tv { method public void notifyTimeShiftStatusChanged(int); method public void notifyTrackSelected(int, String); method public void notifyTracksChanged(java.util.List); + method public void notifyTuned(@NonNull android.net.Uri); method public void notifyVideoAvailable(); method public void notifyVideoUnavailable(int); method public void onAppPrivateCommand(@NonNull String, android.os.Bundle); @@ -26975,7 +26976,10 @@ package android.media.tv.interactive { public abstract static class TvInteractiveAppService.Session implements android.view.KeyEvent.Callback { ctor public TvInteractiveAppService.Session(@NonNull android.content.Context); method public void layoutSurface(int, int, int, int); + method public final void notifyBiInteractiveAppCreated(@NonNull android.net.Uri, @Nullable String); method public void notifySessionStateChanged(int, int); + method public void onCreateBiInteractiveApp(@NonNull android.net.Uri, @Nullable android.os.Bundle); + method public void onDestroyBiInteractiveApp(@NonNull String); method public boolean onKeyDown(int, @NonNull android.view.KeyEvent); method public boolean onKeyLongPress(int, @NonNull android.view.KeyEvent); method public boolean onKeyMultiple(int, int, @NonNull android.view.KeyEvent); @@ -26984,6 +26988,7 @@ package android.media.tv.interactive { method public void onStartInteractiveApp(); method public void onStopInteractiveApp(); method public void onSurfaceChanged(int, int, int); + method public void onTuned(@NonNull android.net.Uri); } public class TvInteractiveAppView extends android.view.ViewGroup { @@ -26991,6 +26996,8 @@ package android.media.tv.interactive { ctor public TvInteractiveAppView(@NonNull android.content.Context, @Nullable android.util.AttributeSet); ctor public TvInteractiveAppView(@NonNull android.content.Context, @Nullable android.util.AttributeSet, int); method public void clearCallback(); + method public void createBiInteractiveApp(@NonNull android.net.Uri, @Nullable android.os.Bundle); + method public void destroyBiInteractiveApp(@NonNull String); method public void prepareInteractiveApp(@NonNull String, int); method public void setCallback(@NonNull java.util.concurrent.Executor, @NonNull android.media.tv.interactive.TvInteractiveAppView.TvInteractiveAppCallback); method public int setTvView(@Nullable android.media.tv.TvView); @@ -27000,6 +27007,7 @@ package android.media.tv.interactive { public abstract static class TvInteractiveAppView.TvInteractiveAppCallback { ctor public TvInteractiveAppView.TvInteractiveAppCallback(); + method public void onBiInteractiveAppCreated(@NonNull String, @NonNull android.net.Uri, @Nullable String); method public void onStateChanged(@NonNull String, int, int); } diff --git a/media/java/android/media/tv/TvInputService.java b/media/java/android/media/tv/TvInputService.java index c72e97d7761ba..1a9cab01f902f 100755 --- a/media/java/android/media/tv/TvInputService.java +++ b/media/java/android/media/tv/TvInputService.java @@ -592,7 +592,11 @@ public abstract class TvInputService extends Service { }); } - /** @hide */ + /** + * Informs the application that this session has been tuned to the given channel. + * + * @param channelUri The URI of the tuned channel. + */ public void notifyTuned(@NonNull Uri channelUri) { executeOrPostRunnableOnMainThread(new Runnable() { @MainThread diff --git a/media/java/android/media/tv/interactive/TvInteractiveAppService.java b/media/java/android/media/tv/interactive/TvInteractiveAppService.java index c1433b655639d..afa1ff7a36413 100755 --- a/media/java/android/media/tv/interactive/TvInteractiveAppService.java +++ b/media/java/android/media/tv/interactive/TvInteractiveAppService.java @@ -360,8 +360,11 @@ public abstract class TvInteractiveAppService extends Service { /** * Creates broadcast-independent(BI) interactive application. * + *

The implementation should call {@link #notifyBiInteractiveAppCreated(Uri, String)}, + * no matter if it's created successfully or not. + * + * @see #notifyBiInteractiveAppCreated(Uri, String) * @see #onDestroyBiInteractiveApp(String) - * @hide */ public void onCreateBiInteractiveApp(@NonNull Uri biIAppUri, @Nullable Bundle params) { } @@ -371,10 +374,9 @@ public abstract class TvInteractiveAppService extends Service { * Destroys broadcast-independent(BI) interactive application. * * @param biIAppId the BI interactive app ID from - * {@link #createBiInteractiveApp(Uri, Bundle)} + * {@link #onCreateBiInteractiveApp(Uri, Bundle)}} * * @see #onCreateBiInteractiveApp(Uri, Bundle) - * @hide */ public void onDestroyBiInteractiveApp(@NonNull String biIAppId) { } @@ -483,7 +485,8 @@ public abstract class TvInteractiveAppService extends Service { /** * Called when the corresponding TV input tuned to a channel. - * @hide + * + * @param channelUri The tuned channel URI. */ public void onTuned(@NonNull Uri channelUri) { } @@ -1047,11 +1050,14 @@ public abstract class TvInteractiveAppService extends Service { /** * Notifies the broadcast-independent(BI) interactive application has been created. + * * @param biIAppId BI interactive app ID, which can be used to destroy the BI interactive - * app. - * @hide + * app. {@code null} if it's not created successfully. + * + * @see #onCreateBiInteractiveApp(Uri, Bundle) */ - public final void notifyBiInteractiveAppCreated(Uri biIAppUri, String biIAppId) { + public final void notifyBiInteractiveAppCreated( + @NonNull Uri biIAppUri, @Nullable String biIAppId) { executeOrPostRunnableOnMainThread(new Runnable() { @MainThread @Override diff --git a/media/java/android/media/tv/interactive/TvInteractiveAppView.java b/media/java/android/media/tv/interactive/TvInteractiveAppView.java index a2b9ed325896f..2922baeee32f3 100755 --- a/media/java/android/media/tv/interactive/TvInteractiveAppView.java +++ b/media/java/android/media/tv/interactive/TvInteractiveAppView.java @@ -522,8 +522,10 @@ public class TvInteractiveAppView extends ViewGroup { /** * Creates broadcast-independent(BI) interactive application. * - * @see #destroyBiInteractiveApp(String) - * @hide + *

{@link TvInteractiveAppCallback#onBiInteractiveAppCreated(String, Uri, String)} will be + * called for the result. + * + * @see TvInteractiveAppCallback#onBiInteractiveAppCreated(String, Uri, String) */ public void createBiInteractiveApp(@NonNull Uri biIAppUri, @Nullable Bundle params) { if (DEBUG) { @@ -540,7 +542,6 @@ public class TvInteractiveAppView extends ViewGroup { * @param biIAppId the BI interactive app ID from {@link #createBiInteractiveApp(Uri, Bundle)} * * @see #createBiInteractiveApp(Uri, Bundle) - * @hide */ public void destroyBiInteractiveApp(@NonNull String biIAppId) { if (DEBUG) { @@ -639,10 +640,12 @@ public class TvInteractiveAppView extends ViewGroup { * * @param iAppServiceId The ID of the TV interactive app service bound to this view. * @param biIAppUri URI associated this BI interactive app. This is the same URI in - * {@link Session#createBiInteractiveApp(Uri, Bundle)} + * {@link #createBiInteractiveApp(Uri, Bundle)} * @param biIAppId BI interactive app ID, which can be used to destroy the BI interactive - * app. - * @hide + * app. {@code null} if it's not created successfully. + * + * @see #createBiInteractiveApp(Uri, Bundle) + * @see #destroyBiInteractiveApp(String) */ public void onBiInteractiveAppCreated(@NonNull String iAppServiceId, @NonNull Uri biIAppUri, @Nullable String biIAppId) {