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

Commit 796691e3 authored by Jae Seo's avatar Jae Seo Committed by Android (Google) Code Review
Browse files

Merge "Add an API to get TV input icon"

parents 659e0e1d cca74c1b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -15885,6 +15885,7 @@ package android.media.tv {
    method public android.content.Intent getIntentForSetupActivity();
    method public android.content.pm.ServiceInfo getServiceInfo();
    method public int getType();
    method public android.graphics.drawable.Drawable loadIcon(android.content.pm.PackageManager);
    method public java.lang.CharSequence loadLabel(android.content.pm.PackageManager);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final java.lang.String EXTRA_SERVICE_NAME = "serviceName";
+13 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ import android.content.pm.ServiceInfo;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.content.res.XmlResourceParser;
import android.graphics.drawable.Drawable;
import android.os.Parcel;
import android.os.Parcelable;
import android.text.TextUtils;
@@ -223,6 +224,18 @@ public final class TvInputInfo implements Parcelable {
        return mService.loadLabel(pm);
    }

    /**
     * Loads the user-displayed icon for this TV input service.
     *
     * @param pm Supplies a PackageManager used to load the TV input's resources.
     * @return a Drawable containing the TV input's icon. If the TV input does not have
     *         an icon, application icon is returned. If it's unavailable too, system default is
     *         returned.
     */
    public Drawable loadIcon(PackageManager pm) {
        return mService.serviceInfo.loadIcon(pm);
    }

    @Override
    public int describeContents() {
        return 0;