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

Commit 5507bd76 authored by Jae Seo's avatar Jae Seo
Browse files

TIF: Add buildInputId()

A recent change mandated that we should provide "input ID" instead of
ComponentName when building URIs for channels/programs while there is no
direct way to get one to use with. This CL added a method to build an ID
from a ComponentName.

Change-Id: Ia7f868cf241bb44ca0d4f689dc15326ce6944468
parent 54a46349
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -16466,6 +16466,7 @@ package android.media.tv {
    method public static final android.net.Uri buildChannelUri(long);
    method public static final android.net.Uri buildChannelsUriForInput(java.lang.String);
    method public static final android.net.Uri buildChannelsUriForInput(java.lang.String, boolean);
    method public static final java.lang.String buildInputId(android.content.ComponentName);
    method public static final android.net.Uri buildProgramUri(long);
    method public static final android.net.Uri buildProgramsUriForChannel(long);
    method public static final android.net.Uri buildProgramsUriForChannel(android.net.Uri);
+14 −2
Original line number Diff line number Diff line
@@ -16,9 +16,9 @@

package android.media.tv;

import android.content.ComponentName;
import android.content.ContentResolver;
import android.content.ContentUris;
import android.media.tv.TvContract.Programs;
import android.net.Uri;
import android.provider.BaseColumns;
import android.util.ArraySet;
@@ -87,6 +87,16 @@ public final class TvContract {
     */
    public static final String PARAM_CANONICAL_GENRE = "canonical_genre";

    /**
     * Builds an ID that uniquely identifies a TV input service.
     *
     * @param name The {@link ComponentName} of the TV input service to build ID for.
     * @return the ID for the given TV input service.
     */
    public static final String buildInputId(ComponentName name) {
        return name.flattenToShortString();
    }

    /**
     * Builds a URI that points to a specific channel.
     *
@@ -475,7 +485,9 @@ public final class TvContract {
        }

        /**
         * The ID of the TV input that provides this TV channel.
         * The ID of the TV input service that provides this TV channel.
         * <p>
         * Use {@link #buildInputId} to build the ID.
         * <p>
         * This is a required field.
         * </p><p>