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

Commit cca74c1b authored by Jaewan Kim's avatar Jaewan Kim
Browse files

Add an API to get TV input icon

Bug: 14423022
Change-Id: I7b3c0efadc8448cae56ef370611be8e09a301f42
parent 04fcf1ca
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -15878,6 +15878,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;