From f2508a0413ae4641add992ff5ab15ebc436a8fbf Mon Sep 17 00:00:00 2001 From: Bishoy Gendy Date: Tue, 24 Jan 2023 16:01:19 +0000 Subject: [PATCH] Add more details in the javadocs for new visibility apis. - Describe the expected behaviour when calling setVisibilityPublic and setVisibilityRestricted on {MediaRoute2Info.Builder}. Bug: 266564463 Test: NA as it's just changes in javadocs. Change-Id: I2bd699b9cfbb8973770898e54f4db7645af3d99b --- media/java/android/media/MediaRoute2Info.java | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/media/java/android/media/MediaRoute2Info.java b/media/java/android/media/MediaRoute2Info.java index 1022d930906d4..28496f1358908 100644 --- a/media/java/android/media/MediaRoute2Info.java +++ b/media/java/android/media/MediaRoute2Info.java @@ -1086,8 +1086,16 @@ public final class MediaRoute2Info implements Parcelable { } /** - * Sets the visibility of this route to public. This is the default - * visibility for routes that are public to all other apps. + * Sets the visibility of this route to public. + * + *

By default, unless you call {@link #setVisibilityRestricted}, the new route will be + * public. + * + *

Public routes are visible to any application with a matching {@link + * RouteDiscoveryPreference#getPreferredFeatures feature}. + * + *

Calls to this method override previous calls to {@link #setVisibilityPublic} and + * {@link #setVisibilityRestricted}. */ @NonNull public Builder setVisibilityPublic() { @@ -1097,8 +1105,16 @@ public final class MediaRoute2Info implements Parcelable { } /** - * Sets the visibility of this route to restricted. This means that the - * route is only visible to a set of package name. + * Sets the visibility of this route to restricted. + * + *

Routes with restricted visibility are only visible to its publisher application and + * applications whose package name is included in the provided {@code allowedPackages} set + * with a matching {@link RouteDiscoveryPreference#getPreferredFeatures feature}. + * + *

Calls to this method override previous calls to {@link #setVisibilityPublic} and + * {@link #setVisibilityRestricted}. + * + * @see #setVisibilityPublic * @param allowedPackages set of package names which are allowed to see this route. */ @NonNull