diff --git a/media/java/android/media/MediaRouter2.java b/media/java/android/media/MediaRouter2.java index 02fa0401e5862..1f6855a4ae8e7 100644 --- a/media/java/android/media/MediaRouter2.java +++ b/media/java/android/media/MediaRouter2.java @@ -194,6 +194,14 @@ public final class MediaRouter2 { /** * Starts scanning remote routes. + *

+ * Route discovery can happen even when the {@link #startScan()} is not called. + * This is because the scanning could be started before by other apps. + * Therefore, calling this method after calling {@link #stopScan()} does not necessarily mean + * that the routes found before are removed and added again. + *

+ * Use {@link RouteCallback} to get the route related events. + *

* Note that calling start/stopScan is applied to all system routers in the same process. * * @see #stopScan() @@ -208,6 +216,15 @@ public final class MediaRouter2 { /** * Stops scanning remote routes to reduce resource consumption. + *

+ * Route discovery can be continued even after this method is called. + * This is because the scanning is only turned off when all the apps stop scanning. + * Therefore, calling this method does not necessarily mean the routes are removed. + * Also, for the same reason it does not mean that {@link RouteCallback#onRoutesAdded(List)} + * is not called afterwards. + *

+ * Use {@link RouteCallback} to get the route related events. + *

* Note that calling start/stopScan is applied to all system routers in the same process. * * @see #startScan() diff --git a/media/java/android/media/MediaRouter2Manager.java b/media/java/android/media/MediaRouter2Manager.java index 6fefbe15abaee..758a8130a62e8 100644 --- a/media/java/android/media/MediaRouter2Manager.java +++ b/media/java/android/media/MediaRouter2Manager.java @@ -148,6 +148,14 @@ public final class MediaRouter2Manager { /** * Starts scanning remote routes. + *

+ * Route discovery can happen even when the {@link #startScan()} is not called. + * This is because the scanning could be started before by other apps. + * Therefore, calling this method after calling {@link #stopScan()} does not necessarily mean + * that the routes found before are removed and added again. + *

+ * Use {@link Callback} to get the route related events. + *

* @see #stopScan() */ public void startScan() { @@ -163,6 +171,15 @@ public final class MediaRouter2Manager { /** * Stops scanning remote routes to reduce resource consumption. + *

+ * Route discovery can be continued even after this method is called. + * This is because the scanning is only turned off when all the apps stop scanning. + * Therefore, calling this method does not necessarily mean the routes are removed. + * Also, for the same reason it does not mean that {@link Callback#onRoutesAdded(List)} + * is not called afterwards. + *

+ * Use {@link Callback} to get the route related events. + * * @see #startScan() */ public void stopScan() {