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

Commit abebf6df authored by Youngsang Cho's avatar Youngsang Cho
Browse files

TIF: Change the parameter of TvInputInfo.loadLabel/Icon

Labels and icons will be extracted from URI in the future.
To acheive it, we need Context rather than PackageManager.

Bug: 16166859
Change-Id: I20f0506fba5876a6cf21b70e44bb3a2265f723d7
parent 2bb7e341
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -16491,8 +16491,8 @@ 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 android.graphics.drawable.Drawable loadIcon(android.content.Context);
    method public java.lang.CharSequence loadLabel(android.content.Context);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final java.lang.String EXTRA_SERVICE_NAME = "serviceName";
    field public static final int TYPE_HDMI = 1; // 0x1
+6 −6
Original line number Diff line number Diff line
@@ -219,24 +219,24 @@ public final class TvInputInfo implements Parcelable {
    /**
     * Loads the user-displayed label for this TV input service.
     *
     * @param pm Supplies a PackageManager used to load the TV input's resources.
     * @param context Supplies a {@link Context} used to load the label.
     * @return a CharSequence containing the TV input's label. If the TV input does not have
     *         a label, its name is returned.
     */
    public CharSequence loadLabel(PackageManager pm) {
        return mService.loadLabel(pm);
    public CharSequence loadLabel(Context context) {
        return mService.loadLabel(context.getPackageManager());
    }

    /**
     * Loads the user-displayed icon for this TV input service.
     *
     * @param pm Supplies a PackageManager used to load the TV input's resources.
     * @param context Supplies a {@link Context} used to load the icon.
     * @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);
    public Drawable loadIcon(Context context) {
        return mService.serviceInfo.loadIcon(context.getPackageManager());
    }

    @Override