diff options
| -rw-r--r-- | api/current.txt | 7 | ||||
| -rw-r--r-- | core/res/res/values/attrs.xml | 14 | ||||
| -rw-r--r-- | core/res/res/values/public.xml | 1 | ||||
| -rw-r--r-- | media/java/android/media/tv/TvInputInfo.java | 34 |
4 files changed, 55 insertions, 1 deletions
diff --git a/api/current.txt b/api/current.txt index bb7e57d9fb0e..9995b36eeeef 100644 --- a/api/current.txt +++ b/api/current.txt @@ -705,7 +705,6 @@ package android { field public static final int l_resource_pad23 = 16843770; // 0x10103fa field public static final int l_resource_pad24 = 16843769; // 0x10103f9 field public static final int l_resource_pad25 = 16843768; // 0x10103f8 - field public static final int l_resource_pad26 = 16843767; // 0x10103f7 field public static final int l_resource_pad3 = 16843790; // 0x101040e field public static final int l_resource_pad4 = 16843789; // 0x101040d field public static final int l_resource_pad5 = 16843788; // 0x101040c @@ -1247,6 +1246,7 @@ package android { field public static final int trimPathEnd = 16843813; // 0x1010425 field public static final int trimPathOffset = 16843814; // 0x1010426 field public static final int trimPathStart = 16843812; // 0x1010424 + field public static final int tvInputType = 16843767; // 0x10103f7 field public static final int type = 16843169; // 0x10101a1 field public static final int typeface = 16842902; // 0x1010096 field public static final int uiOptions = 16843672; // 0x1010398 @@ -15928,9 +15928,14 @@ package android.media.tv { method public android.content.Intent getIntentForSettingsActivity(); method public android.content.Intent getIntentForSetupActivity(); method public android.content.pm.ServiceInfo getServiceInfo(); + method public int getType(); 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"; + field public static final int TYPE_HDMI = 1; // 0x1 + field public static final int TYPE_PASSTHROUGH = 3; // 0x3 + field public static final int TYPE_TUNER = 2; // 0x2 + field public static final int TYPE_VIRTUAL = 0; // 0x0 } public final class TvInputManager { diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml index f642d01e8020..4fa04a910d69 100644 --- a/core/res/res/values/attrs.xml +++ b/core/res/res/values/attrs.xml @@ -6722,5 +6722,19 @@ <!-- Component name of an activity that allows the user to modify the settings for this service. --> <attr name="settingsActivity" /> + <!-- Type of this service. --> + <attr name="tvInputType"> + <!-- Should be in sync with constant values defined in + {@link android.media.tv.TvInputInfo}. --> + + <!-- Virtual input (default) --> + <enum name="virtual" value="0" /> + <!-- HDMI --> + <enum name="hdmi" value="1" /> + <!-- Built-in tuner --> + <enum name="tuner" value="2" /> + <!-- Pass-through --> + <enum name="passthrough" value="3" /> + </attr> </declare-styleable> </resources> diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml index 33bdf58167eb..b3e111b4abee 100644 --- a/core/res/res/values/public.xml +++ b/core/res/res/values/public.xml @@ -2097,6 +2097,7 @@ <public type="attr" name="isGame" id="0x10103f4" /> <public type="attr" name="allowEmbedded" id="0x10103f5" /> <public type="attr" name="setupActivity" id="0x10103f6"/> + <public type="attr" name="tvInputType" id="0x10103f7"/> <!-- =============================================================== Resources added in version 21 of the platform diff --git a/media/java/android/media/tv/TvInputInfo.java b/media/java/android/media/tv/TvInputInfo.java index 9525c081bec6..868c5bf09081 100644 --- a/media/java/android/media/tv/TvInputInfo.java +++ b/media/java/android/media/tv/TvInputInfo.java @@ -46,6 +46,27 @@ public final class TvInputInfo implements Parcelable { private static final String TAG = "TvInputInfo"; /** + * TV input type: the TV input service is not handling input from hardware. For example, + * services showing streaming from the internet falls into this type. + */ + public static final int TYPE_VIRTUAL = 0; + + // Should be in sync with hardware/libhardware/include/hardware/tv_input.h + + /** + * TV input type: the TV input service is HDMI. (e.g. HDMI 1) + */ + public static final int TYPE_HDMI = 1; + /** + * TV input type: the TV input service is a tuner. (e.g. terrestrial tuner) + */ + public static final int TYPE_TUNER = 2; + /** + * TV input type: the TV input service is stateless pass-through. (e.g. RGB, composite, etc.) + */ + public static final int TYPE_PASSTHROUGH = 3; + + /** * The name of the TV input service to provide to the setup activity and settings activity. */ public static final String EXTRA_SERVICE_NAME = "serviceName"; @@ -58,6 +79,7 @@ public final class TvInputInfo implements Parcelable { // Attributes from XML meta data. private String mSetupActivity; private String mSettingsActivity; + private int mType; /** * Create a new instance of the TvInputInfo class, @@ -105,6 +127,11 @@ public final class TvInputInfo implements Parcelable { Log.d(TAG, "Settings activity loaded. [" + input.mSettingsActivity + "] for " + si.name); } + input.mType = sa.getInt( + com.android.internal.R.styleable.TvInputService_tvInputType, TYPE_VIRTUAL); + if (DEBUG) { + Log.d(TAG, "Type loaded. [" + input.mType + "] for " + si.name); + } sa.recycle(); return input; @@ -179,6 +206,13 @@ public final class TvInputInfo implements Parcelable { } /** + * Returns the type of this TV input service. + */ + public int getType() { + return mType; + } + + /** * Loads the user-displayed label for this TV input service. * * @param pm Supplies a PackageManager used to load the TV input's resources. |