summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorJaewan Kim <jaewan@google.com>2014-06-10 00:38:02 +0900
committerJaewan Kim <jaewan@google.com>2014-06-12 10:36:00 +0000
commitcca74c1b0d2660c5e143bf3b4eaa962a2c734e90 (patch)
tree200c44836208a0053df965307e0e824678357125 /media
parent04fcf1cabec82b7f2e349658ca764939f5641cc3 (diff)
downloadframeworks_base-cca74c1b0d2660c5e143bf3b4eaa962a2c734e90.zip
frameworks_base-cca74c1b0d2660c5e143bf3b4eaa962a2c734e90.tar.gz
frameworks_base-cca74c1b0d2660c5e143bf3b4eaa962a2c734e90.tar.bz2
Add an API to get TV input icon
Bug: 14423022 Change-Id: I7b3c0efadc8448cae56ef370611be8e09a301f42
Diffstat (limited to 'media')
-rw-r--r--media/java/android/media/tv/TvInputInfo.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/media/java/android/media/tv/TvInputInfo.java b/media/java/android/media/tv/TvInputInfo.java
index 868c5bf..7b8f2ec 100644
--- a/media/java/android/media/tv/TvInputInfo.java
+++ b/media/java/android/media/tv/TvInputInfo.java
@@ -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;