From a5f41cd3e5e4a4948d62f910bb27344544e736e8 Mon Sep 17 00:00:00 2001 From: Adam Mills Date: Fri, 6 Jul 2018 20:03:09 -0400 Subject: [PATCH] Add CastMediaControlIntent::isCategoryForCast --- .../android/gms/cast/CastMediaControlIntent.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/play-services-cast-api/src/main/java/com/google/android/gms/cast/CastMediaControlIntent.java b/play-services-cast-api/src/main/java/com/google/android/gms/cast/CastMediaControlIntent.java index bcdf3da1..ca3a2871 100644 --- a/play-services-cast-api/src/main/java/com/google/android/gms/cast/CastMediaControlIntent.java +++ b/play-services-cast-api/src/main/java/com/google/android/gms/cast/CastMediaControlIntent.java @@ -88,6 +88,18 @@ public final class CastMediaControlIntent { return CATEGORY_CAST + "/" + applicationId; } + /** + * Returns true if the given category is a custom control category for cast devices, specific to an application ID. + * + * @param applicationId The application ID of the receiver application. + */ + public static boolean isCategoryForCast(String category) { + if (category == null) { + return false; + } + return category.startsWith(CATEGORY_CAST + "/"); + } + /** * Returns a custom control category for discovering Cast devices meeting both application ID and namespace * restrictions. See {@link #categoryForCast(Collection)} and {@link #categoryForCast(String)} for more details.