Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a5f41cd3 authored by Adam Mills's avatar Adam Mills Committed by Marvin W.
Browse files

Add CastMediaControlIntent::isCategoryForCast

parent ccb9ae4e
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -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.