From a27b8fb4296c1271ddf5916843ddffda6764e65f Mon Sep 17 00:00:00 2001 From: Jeff Brown Date: Thu, 9 May 2013 21:56:42 -0700 Subject: [PATCH] Add an API to determine if a route is connecting. Bug: 8175766 Change-Id: I54d5f31d4e7d79c471c0e1bbc438cd8ebb4f8a1e --- api/current.txt | 1 + media/java/android/media/MediaRouter.java | 14 +++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/api/current.txt b/api/current.txt index 1fb398e0e4be2..6b04262f95be3 100644 --- a/api/current.txt +++ b/api/current.txt @@ -12271,6 +12271,7 @@ package android.media { method public int getVolume(); method public int getVolumeHandling(); method public int getVolumeMax(); + method public boolean isConnecting(); method public boolean isEnabled(); method public void requestSetVolume(int); method public void requestUpdateVolume(int); diff --git a/media/java/android/media/MediaRouter.java b/media/java/android/media/MediaRouter.java index 9168d4633b2fd..990ce80a21b96 100644 --- a/media/java/android/media/MediaRouter.java +++ b/media/java/android/media/MediaRouter.java @@ -1354,12 +1354,24 @@ public class MediaRouter { } /** - * @return true if this route is enabled and may be selected + * Returns true if this route is enabled and may be selected. + * + * @return True if this route is enabled. */ public boolean isEnabled() { return mEnabled; } + /** + * Returns true if the route is in the process of connecting and is not + * yet ready for use. + * + * @return True if this route is in the process of connecting. + */ + public boolean isConnecting() { + return mStatusCode == STATUS_CONNECTING; + } + void setStatusInt(CharSequence status) { if (!status.equals(mStatus)) { mStatus = status;