From fcf8e12239e689ac917836379fb4f489a0f16f32 Mon Sep 17 00:00:00 2001 From: Oliver Woodman Date: Mon, 7 Feb 2022 22:21:48 +0000 Subject: [PATCH] Improve MediaRouter Javadoc The MediaRouter Javadoc currently advises developers to use MediaRouter2. The MediaRouter2 Javadoc further advises developers to use AndroidX MediaRouter. This change directs develeopers directly from MediaRouter to AndroidX. Test: Javadoc only Change-Id: Ia90e2e2799cc167f87349f907ae9621443d57bb3 --- media/java/android/media/MediaRouter.java | 16 ++++++++-------- media/java/android/media/MediaRouter2.java | 10 +++++----- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/media/java/android/media/MediaRouter.java b/media/java/android/media/MediaRouter.java index 13c1498604ba7..7d57734defc55 100644 --- a/media/java/android/media/MediaRouter.java +++ b/media/java/android/media/MediaRouter.java @@ -60,21 +60,21 @@ import java.util.Objects; import java.util.concurrent.CopyOnWriteArrayList; /** - * MediaRouter allows applications to control the routing of media channels + * This API is not recommended for new applications. Use the + * AndroidX + * Media Router + * Library for consistent behavior across all devices. + * + *

MediaRouter allows applications to control the routing of media channels * and streams from the current device to external speakers and destination devices. * *

A MediaRouter is retrieved through {@link Context#getSystemService(String) * Context.getSystemService()} of a {@link Context#MEDIA_ROUTER_SERVICE * Context.MEDIA_ROUTER_SERVICE}. * - *

The media router API is not thread-safe; all interactions with it must be - * done from the main thread of the process.

- * - *

- * We recommend using {@link android.media.MediaRouter2} APIs for new applications. - *

+ *

This API is not thread-safe; all interactions with it must be done from the main thread of the + * process. */ -//TODO: Link androidx.media2.MediaRouter when we are ready. @SystemService(Context.MEDIA_ROUTER_SERVICE) public class MediaRouter { private static final String TAG = "MediaRouter"; diff --git a/media/java/android/media/MediaRouter2.java b/media/java/android/media/MediaRouter2.java index b485eb51380d3..c97c841e6a96d 100644 --- a/media/java/android/media/MediaRouter2.java +++ b/media/java/android/media/MediaRouter2.java @@ -52,13 +52,13 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; /** - * This API is not generally intended for third party application developers. - * Use the AndroidX - Media Router + * This API is not generally intended for third party application developers. Use the + * AndroidX + * Media Router * Library for consistent behavior across all devices. * - * Media Router 2 allows applications to control the routing of media channels - * and streams from the current device to remote speakers and devices. + *

MediaRouter2 allows applications to control the routing of media channels and streams from + * the current device to remote speakers and devices. */ // TODO(b/157873330): Add method names at the beginning of log messages. (e.g. selectRoute) // Not only MediaRouter2, but also to service / manager / provider.