From 36b71d1c5cbc52454c7f11a430e2feb4ad33caae Mon Sep 17 00:00:00 2001 From: Ian Baker Date: Tue, 4 Feb 2025 08:44:16 -0800 Subject: Update media2 session references to media3 in framework docs The androidx.media2 library is deprecated, and the source has been deleted. Also make the summary fragment of these docs more useful by moving the warning later in the docs. Bug: 324249307 Test: Presubmit (javadoc only change) Change-Id: Ib16ed3343fac426a857128d096d1e04a77f551e7 --- .../android/media/session/MediaSessionManager.java | 65 ++++++++++------------ 1 file changed, 30 insertions(+), 35 deletions(-) diff --git a/media/java/android/media/session/MediaSessionManager.java b/media/java/android/media/session/MediaSessionManager.java index 031c3fff1e8f..d174740fba6b 100644 --- a/media/java/android/media/session/MediaSessionManager.java +++ b/media/java/android/media/session/MediaSessionManager.java @@ -155,11 +155,6 @@ public final class MediaSessionManager { } /** - * This API is not generally intended for third party application developers. - * Use the AndroidX - * Media2 session - * Library for consistent behavior across all devices. - *

* Notifies that a new {@link MediaSession2} with type {@link Session2Token#TYPE_SESSION} is * created. *

@@ -283,16 +278,16 @@ public final class MediaSessionManager { } /** - * This API is not generally intended for third party application developers. - * Use the AndroidX - * Media2 session - * Library for consistent behavior across all devices. - *

* Gets a list of {@link Session2Token} with type {@link Session2Token#TYPE_SESSION} for the * current user. *

* Although this API can be used without any restriction, each session owners can accept or * reject your uses of {@link MediaSession2}. + *

+ * This API is not generally intended for third party application developers. Apps wanting media + * session functionality should use the + * AndroidX Media3 + * Session Library. * * @return A list of {@link Session2Token}. */ @@ -417,12 +412,12 @@ public final class MediaSessionManager { } /** - * This API is not generally intended for third party application developers. - * Use the AndroidX - * Media2 session - * Library for consistent behavior across all devices. - *

* Adds a listener to be notified when the {@link #getSession2Tokens()} changes. + *

+ * This API is not generally intended for third party application developers. Apps wanting media + * session functionality should use the + * AndroidX Media3 + * Session Library. * * @param listener The listener to add */ @@ -433,12 +428,12 @@ public final class MediaSessionManager { } /** - * This API is not generally intended for third party application developers. - * Use the AndroidX - * Media2 session - * Library for consistent behavior across all devices. - *

* Adds a listener to be notified when the {@link #getSession2Tokens()} changes. + *

+ * This API is not generally intended for third party application developers. Apps wanting media + * session functionality should use the + * AndroidX Media3 + * Session Library. * * @param listener The listener to add * @param handler The handler to call listener on. @@ -451,16 +446,16 @@ public final class MediaSessionManager { } /** - * This API is not generally intended for third party application developers. - * Use the AndroidX - * Media2 session - * Library for consistent behavior across all devices. - *

* Adds a listener to be notified when the {@link #getSession2Tokens()} changes. *

* The calling application needs to hold the * {@link android.Manifest.permission#INTERACT_ACROSS_USERS_FULL} permission in order to * add listeners for user ids that do not belong to current process. + *

+ * This API is not generally intended for third party application developers. Apps wanting media + * session functionality should use the + * AndroidX Media3 + * Session Library. * * @param userHandle The userHandle to listen for changes on * @param listener The listener to add @@ -496,12 +491,12 @@ public final class MediaSessionManager { } /** - * This API is not generally intended for third party application developers. - * Use the AndroidX - * Media2 session - * Library for consistent behavior across all devices. - *

* Removes the {@link OnSession2TokensChangedListener} to stop receiving session token updates. + *

+ * This API is not generally intended for third party application developers. Apps wanting media + * session functionality should use the + * AndroidX Media3 + * Session Library. * * @param listener The listener to remove. */ @@ -1061,13 +1056,13 @@ public final class MediaSessionManager { } /** - * This API is not generally intended for third party application developers. - * Use the AndroidX - * Media2 session - * Library for consistent behavior across all devices. - *

* Listens for changes to the {@link #getSession2Tokens()}. This can be added * using {@link #addOnSession2TokensChangedListener(OnSession2TokensChangedListener, Handler)}. + *

+ * This API is not generally intended for third party application developers. Apps wanting media + * session functionality should use the + * AndroidX Media3 + * Session Library. */ public interface OnSession2TokensChangedListener { /** -- cgit v1.2.3-59-g8ed1b