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

Commit 3f547dcc authored by Conrad Chen's avatar Conrad Chen
Browse files

Deprecate settingsActivity field in TvInputService

Test: build
Bug: 27325064
Change-Id: Ieb38cc06f49b3944387ba4bbb11b953e35f06d89
parent 54eb1d49
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -24212,7 +24212,7 @@ package android.media.tv {
  public final class TvInputInfo implements android.os.Parcelable {
    method public boolean canRecord();
    method public android.content.Intent createSettingsIntent();
    method public deprecated android.content.Intent createSettingsIntent();
    method public android.content.Intent createSetupIntent();
    method public int describeContents();
    method public android.os.Bundle getExtras();
+1 −1
Original line number Diff line number Diff line
@@ -26094,7 +26094,7 @@ package android.media.tv {
  public final class TvInputInfo implements android.os.Parcelable {
    method public boolean canRecord();
    method public android.content.Intent createSettingsIntent();
    method public deprecated android.content.Intent createSettingsIntent();
    method public android.content.Intent createSetupIntent();
    method public static deprecated android.media.tv.TvInputInfo createTvInputInfo(android.content.Context, android.content.pm.ResolveInfo, android.hardware.hdmi.HdmiDeviceInfo, java.lang.String, java.lang.String, android.net.Uri) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
    method public static deprecated android.media.tv.TvInputInfo createTvInputInfo(android.content.Context, android.content.pm.ResolveInfo, android.hardware.hdmi.HdmiDeviceInfo, java.lang.String, int, android.graphics.drawable.Icon) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
+1 −1
Original line number Diff line number Diff line
@@ -24308,7 +24308,7 @@ package android.media.tv {
  public final class TvInputInfo implements android.os.Parcelable {
    method public boolean canRecord();
    method public android.content.Intent createSettingsIntent();
    method public deprecated android.content.Intent createSettingsIntent();
    method public android.content.Intent createSetupIntent();
    method public int describeContents();
    method public android.os.Bundle getExtras();
+3 −1
Original line number Diff line number Diff line
@@ -8338,7 +8338,9 @@
        <!-- Component name of an activity that allows the user to set up this service. -->
        <attr name="setupActivity" format="string" />
        <!-- Component name of an activity that allows the user to modify the settings for this
             service. -->
             service.
             {@deprecated This value is deprecated and not used by the framework starting from API
                         level 26. Use setupActivity instead.} -->
        <attr name="settingsActivity" />
        <!-- Attribute whether the TV input service can record programs. This value can be changed
             at runtime by calling
+7 −18
Original line number Diff line number Diff line
@@ -138,7 +138,6 @@ public final class TvInputInfo implements Parcelable {

    // Attributes from XML meta data.
    private final String mSetupActivity;
    private final String mSettingsActivity;
    private final boolean mCanRecord;
    private final int mTunerCount;

@@ -259,9 +258,8 @@ public final class TvInputInfo implements Parcelable {

    private TvInputInfo(ResolveInfo service, String id, int type, boolean isHardwareInput,
            CharSequence label, int labelResId, Icon icon, Icon iconStandby, Icon iconDisconnected,
            String setupActivity, String settingsActivity, boolean canRecord, int tunerCount,
            HdmiDeviceInfo hdmiDeviceInfo, boolean isConnectedToHdmiSwitch, String parentId,
            Bundle extras) {
            String setupActivity, boolean canRecord, int tunerCount, HdmiDeviceInfo hdmiDeviceInfo,
            boolean isConnectedToHdmiSwitch, String parentId, Bundle extras) {
        mService = service;
        mId = id;
        mType = type;
@@ -272,7 +270,6 @@ public final class TvInputInfo implements Parcelable {
        mIconStandby = iconStandby;
        mIconDisconnected = iconDisconnected;
        mSetupActivity = setupActivity;
        mSettingsActivity = settingsActivity;
        mCanRecord = canRecord;
        mTunerCount = tunerCount;
        mHdmiDeviceInfo = hdmiDeviceInfo;
@@ -340,14 +337,12 @@ public final class TvInputInfo implements Parcelable {

    /**
     * Returns an intent to start the settings activity for this TV input.
     *
     * @deprecated Use {@link #createSetupIntent()} instead. Settings activity is deprecated.
     *             Use setup activity instead to provide settings.
     */
    @Deprecated
    public Intent createSettingsIntent() {
        if (!TextUtils.isEmpty(mSettingsActivity)) {
            Intent intent = new Intent(Intent.ACTION_MAIN);
            intent.setClassName(mService.serviceInfo.packageName, mSettingsActivity);
            intent.putExtra(EXTRA_INPUT_ID, getId());
            return intent;
        }
        return null;
    }

@@ -554,7 +549,6 @@ public final class TvInputInfo implements Parcelable {
                && Objects.equals(mIconStandby, obj.mIconStandby)
                && Objects.equals(mIconDisconnected, obj.mIconDisconnected)
                && TextUtils.equals(mSetupActivity, obj.mSetupActivity)
                && TextUtils.equals(mSettingsActivity, obj.mSettingsActivity)
                && mCanRecord == obj.mCanRecord
                && mTunerCount == obj.mTunerCount
                && Objects.equals(mHdmiDeviceInfo, obj.mHdmiDeviceInfo)
@@ -589,7 +583,6 @@ public final class TvInputInfo implements Parcelable {
        dest.writeParcelable(mIconStandby, flags);
        dest.writeParcelable(mIconDisconnected, flags);
        dest.writeString(mSetupActivity);
        dest.writeString(mSettingsActivity);
        dest.writeByte(mCanRecord ? (byte) 1 : 0);
        dest.writeInt(mTunerCount);
        dest.writeParcelable(mHdmiDeviceInfo, flags);
@@ -631,7 +624,6 @@ public final class TvInputInfo implements Parcelable {
        mIconStandby = in.readParcelable(null);
        mIconDisconnected = in.readParcelable(null);
        mSetupActivity = in.readString();
        mSettingsActivity = in.readString();
        mCanRecord = in.readByte() == 1;
        mTunerCount = in.readInt();
        mHdmiDeviceInfo = in.readParcelable(null);
@@ -678,7 +670,6 @@ public final class TvInputInfo implements Parcelable {
        private Icon mIconStandby;
        private Icon mIconDisconnected;
        private String mSetupActivity;
        private String mSettingsActivity;
        private Boolean mCanRecord;
        private Integer mTunerCount;
        private TvInputHardwareInfo mTvInputHardwareInfo;
@@ -906,7 +897,7 @@ public final class TvInputInfo implements Parcelable {
            }
            parseServiceMetadata(type);
            return new TvInputInfo(mResolveInfo, id, type, isHardwareInput, mLabel, mLabelResId,
                    mIcon, mIconStandby, mIconDisconnected, mSetupActivity, mSettingsActivity,
                    mIcon, mIconStandby, mIconDisconnected, mSetupActivity,
                    mCanRecord == null ? false : mCanRecord, mTunerCount == null ? 0 : mTunerCount,
                    mHdmiDeviceInfo, isConnectedToHdmiSwitch, mParentId, mExtras);
        }
@@ -961,8 +952,6 @@ public final class TvInputInfo implements Parcelable {
                if (inputType == TYPE_TUNER && TextUtils.isEmpty(mSetupActivity)) {
                    throw new IllegalStateException("Setup activity not found for " + si.name);
                }
                mSettingsActivity = sa.getString(
                        com.android.internal.R.styleable.TvInputService_settingsActivity);
                if (mCanRecord == null) {
                    mCanRecord = sa.getBoolean(
                            com.android.internal.R.styleable.TvInputService_canRecord, false);