summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Conrad Chen <conradchen@google.com> 2017-03-16 00:16:06 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2017-03-16 00:16:15 +0000
commit287a68e62af9e4278dd5270c70fa62b146f7bccc (patch)
treeaf7f39ad87422a3f563fd726c87e4b287a88d09d
parent32eb4602c1024e355141f0b21817bb3144c315b5 (diff)
parent3f547dcce2493831ed97cdb6e3ea7dfc9089529b (diff)
Merge "Deprecate settingsActivity field in TvInputService"
-rw-r--r--api/current.txt2
-rw-r--r--api/system-current.txt2
-rw-r--r--api/test-current.txt2
-rw-r--r--core/res/res/values/attrs.xml4
-rw-r--r--media/java/android/media/tv/TvInputInfo.java25
5 files changed, 13 insertions, 22 deletions
diff --git a/api/current.txt b/api/current.txt
index 53b099a27d49..477e346b26a3 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -24653,7 +24653,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();
diff --git a/api/system-current.txt b/api/system-current.txt
index 45bc8e8df8c2..04dc632313e3 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -26653,7 +26653,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;
diff --git a/api/test-current.txt b/api/test-current.txt
index 670712185c0e..6962c45b26f6 100644
--- a/api/test-current.txt
+++ b/api/test-current.txt
@@ -24754,7 +24754,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();
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index b44ebece6a62..4432e3c90f1a 100644
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -8380,7 +8380,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
diff --git a/media/java/android/media/tv/TvInputInfo.java b/media/java/android/media/tv/TvInputInfo.java
index 35988d40fe5d..a292b8e4f81e 100644
--- a/media/java/android/media/tv/TvInputInfo.java
+++ b/media/java/android/media/tv/TvInputInfo.java
@@ -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);