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

Commit 56d4b744 authored by Jeff Brown's avatar Jeff Brown
Browse files

Add route description API.

Bug: 8175766
Change-Id: I65dbc10fc04f9ff8f6abc1bda23fbf5baa227737
parent c12783a9
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -12258,6 +12258,7 @@ package android.media {
  public static class MediaRouter.RouteInfo {
    method public android.media.MediaRouter.RouteCategory getCategory();
    method public java.lang.CharSequence getDescription();
    method public android.media.MediaRouter.RouteGroup getGroup();
    method public android.graphics.drawable.Drawable getIconDrawable();
    method public java.lang.CharSequence getName();
@@ -12296,6 +12297,7 @@ package android.media {
  public static class MediaRouter.UserRouteInfo extends android.media.MediaRouter.RouteInfo {
    method public android.media.RemoteControlClient getRemoteControlClient();
    method public void setDescription(java.lang.CharSequence);
    method public void setIconDrawable(android.graphics.drawable.Drawable);
    method public void setIconResource(int);
    method public void setName(java.lang.CharSequence);
+4 −1
Original line number Diff line number Diff line
@@ -3931,9 +3931,12 @@
    <!-- Name of the default audio route category. [CHAR LIMIT=50] -->
    <string name="default_audio_route_category_name">System</string>

    <!-- Default name of the bluetooth a2dp audio route. [CHAR LIMIT=50] -->
    <!-- Description of the bluetooth a2dp audio route. [CHAR LIMIT=50] -->
    <string name="bluetooth_a2dp_audio_route_name">Bluetooth audio</string>

    <!-- Description of a wireless display route. [CHAR LIMIT=50] -->
    <string name="wireless_display_route_description">Wireless display</string>

    <!-- "Done" button for MediaRouter chooser dialog when grouping routes. [CHAR LIMIT=NONE] -->
    <string name="media_route_chooser_grouping_done">Done</string>

+1 −0
Original line number Diff line number Diff line
@@ -884,6 +884,7 @@
  <java-symbol type="string" name="error_message_title" />
  <java-symbol type="string" name="action_bar_home_description_format" />
  <java-symbol type="string" name="action_bar_home_subtitle_description_format" />
  <java-symbol type="string" name="wireless_display_route_description" />

  <java-symbol type="plurals" name="abbrev_in_num_days" />
  <java-symbol type="plurals" name="abbrev_in_num_hours" />
+55 −7
Original line number Diff line number Diff line
@@ -186,6 +186,8 @@ public class MediaRouter {
                    if (sStatic.mBluetoothA2dpRoute == null) {
                        final RouteInfo info = new RouteInfo(sStatic.mSystemCategory);
                        info.mName = mCurAudioRoutesInfo.mBluetoothName;
                        info.mDescription = sStatic.mResources.getText(
                                com.android.internal.R.string.bluetooth_a2dp_audio_route_name);
                        info.mSupportedTypes = ROUTE_TYPE_LIVE_AUDIO;
                        sStatic.mBluetoothA2dpRoute = info;
                        addRouteStatic(sStatic.mBluetoothA2dpRoute);
@@ -933,6 +935,8 @@ public class MediaRouter {
        newRoute.mEnabled = available;

        newRoute.mName = display.getFriendlyDisplayName();
        newRoute.mDescription = sStatic.mResources.getText(
                com.android.internal.R.string.wireless_display_route_description);

        newRoute.mPresentationDisplay = choosePresentationDisplayForRoute(newRoute,
                sStatic.getAllPresentationDisplays());
@@ -1038,6 +1042,7 @@ public class MediaRouter {
    public static class RouteInfo {
        CharSequence mName;
        int mNameResId;
        CharSequence mDescription;
        private CharSequence mStatus;
        int mSupportedTypes;
        RouteGroup mGroup;
@@ -1097,7 +1102,13 @@ public class MediaRouter {
        }

        /**
         * @return The user-friendly name of a media route. This is the string presented
         * Gets the user-visible name of the route.
         * <p>
         * The route name identifies the destination represented by the route.
         * It may be a user-supplied name, an alias, or device serial number.
         * </p>
         *
         * @return The user-visible name of a media route.  This is the string presented
         * to users who may select this as the active route.
         */
        public CharSequence getName() {
@@ -1105,10 +1116,14 @@ public class MediaRouter {
        }

        /**
         * Return the properly localized/resource selected name of this route.
         * Return the properly localized/resource user-visible name of this route.
         * <p>
         * The route name identifies the destination represented by the route.
         * It may be a user-supplied name, an alias, or device serial number.
         * </p>
         *
         * @param context Context used to resolve the correct configuration to load
         * @return The user-friendly name of the media route. This is the string presented
         * @return The user-visible name of a media route.  This is the string presented
         * to users who may select this as the active route.
         */
        public CharSequence getName(Context context) {
@@ -1123,7 +1138,20 @@ public class MediaRouter {
        }

        /**
         * @return The user-friendly status for a media route. This may include a description
         * Gets the user-visible description of the route.
         * <p>
         * The route description describes the kind of destination represented by the route.
         * It may be a user-supplied string, a model number or brand of device.
         * </p>
         *
         * @return The description of the route, or null if none.
         */
        public CharSequence getDescription() {
            return mDescription;
        }

        /**
         * @return The user-visible status for a media route. This may include a description
         * of the currently playing media, if available.
         */
        public CharSequence getStatus() {
@@ -1407,6 +1435,7 @@ public class MediaRouter {
        public String toString() {
            String supportedTypes = typesToString(getSupportedTypes());
            return getClass().getSimpleName() + "{ name=" + getName() +
                    ", description=" + getDescription() +
                    ", status=" + getStatus() +
                    ", category=" + getCategory() +
                    ", supportedTypes=" + supportedTypes +
@@ -1442,6 +1471,11 @@ public class MediaRouter {
        
        /**
         * Set the user-visible name of this route.
         * <p>
         * The route name identifies the destination represented by the route.
         * It may be a user-supplied name, an alias, or device serial number.
         * </p>
         *
         * @param resId Resource ID of the name to display to the user to describe this route
         */
        public void setName(int resId) {
@@ -1450,6 +1484,20 @@ public class MediaRouter {
            routeUpdated();
        }

        /**
         * Set the user-visible description of this route.
         * <p>
         * The route description describes the kind of destination represented by the route.
         * It may be a user-supplied string, a model number or brand of device.
         * </p>
         *
         * @param description The description of the route, or null if none.
         */
        public void setDescription(CharSequence description) {
            mDescription = description;
            routeUpdated();
        }

        /**
         * Set the current user-visible status for this route.
         * @param status Status to display to the user to describe what the endpoint