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

Commit 55f933f7 authored by Wonsik Kim's avatar Wonsik Kim Committed by Android (Google) Code Review
Browse files

Merge "Make TvInputs aware of whether it's hardware-based or not" into lmp-preview-dev

parents f43cea00 af743eea
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -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
@@ -15908,9 +15908,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 {
+14 −0
Original line number Diff line number Diff line
@@ -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>
+1 −0
Original line number Diff line number Diff line
@@ -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
+34 −0
Original line number Diff line number Diff line
@@ -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.
     *