Make TvInputs aware of whether it's hardware-based or not

Bug: 15326724
Change-Id: I1f418150ba29ee50afc50a811198115fdc6f9c42
This commit is contained in:
Wonsik Kim
2014-05-30 02:22:15 +09:00
parent ceb997bae0
commit af743eeaec
4 changed files with 55 additions and 1 deletions

View File

@@ -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 {

View File

@@ -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>

View File

@@ -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

View File

@@ -45,6 +45,27 @@ public final class TvInputInfo implements Parcelable {
private static final boolean DEBUG = false;
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.
*/
@@ -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;
@@ -178,6 +205,13 @@ public final class TvInputInfo implements Parcelable {
return null;
}
/**
* Returns the type of this TV input service.
*/
public int getType() {
return mType;
}
/**
* Loads the user-displayed label for this TV input service.
*