summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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/TvInputManager.java19
-rw-r--r--media/java/android/media/tv/TvInputService.java25
6 files changed, 20 insertions, 34 deletions
diff --git a/api/current.txt b/api/current.txt
index 5df8750fcb7c..558a627492ac 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -23021,6 +23021,7 @@ package android.media.tv {
method public boolean isRatingBlocked(android.media.tv.TvContentRating);
method public void registerCallback(android.media.tv.TvInputManager.TvInputCallback, android.os.Handler);
method public void unregisterCallback(android.media.tv.TvInputManager.TvInputCallback);
+ method public void updateTvInputInfo(android.media.tv.TvInputInfo);
field public static final java.lang.String ACTION_BLOCKED_RATINGS_CHANGED = "android.media.tv.action.BLOCKED_RATINGS_CHANGED";
field public static final java.lang.String ACTION_PARENTAL_CONTROLS_ENABLED_CHANGED = "android.media.tv.action.PARENTAL_CONTROLS_ENABLED_CHANGED";
field public static final java.lang.String ACTION_QUERY_CONTENT_RATING_SYSTEMS = "android.media.tv.action.QUERY_CONTENT_RATING_SYSTEMS";
@@ -23058,7 +23059,6 @@ package android.media.tv {
method public final android.os.IBinder onBind(android.content.Intent);
method public android.media.tv.TvInputService.RecordingSession onCreateRecordingSession(java.lang.String);
method public abstract android.media.tv.TvInputService.Session onCreateSession(java.lang.String);
- method public static final void updateTvInputInfo(android.content.Context, android.media.tv.TvInputInfo);
field public static final java.lang.String SERVICE_INTERFACE = "android.media.tv.TvInputService";
field public static final java.lang.String SERVICE_META_DATA = "android.media.tv.input";
}
diff --git a/api/system-current.txt b/api/system-current.txt
index acb699d26a05..1dbbdf30a353 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -24707,6 +24707,7 @@ package android.media.tv {
method public void removeBlockedRating(android.media.tv.TvContentRating);
method public void setParentalControlsEnabled(boolean);
method public void unregisterCallback(android.media.tv.TvInputManager.TvInputCallback);
+ method public void updateTvInputInfo(android.media.tv.TvInputInfo);
field public static final java.lang.String ACTION_BLOCKED_RATINGS_CHANGED = "android.media.tv.action.BLOCKED_RATINGS_CHANGED";
field public static final java.lang.String ACTION_PARENTAL_CONTROLS_ENABLED_CHANGED = "android.media.tv.action.PARENTAL_CONTROLS_ENABLED_CHANGED";
field public static final java.lang.String ACTION_QUERY_CONTENT_RATING_SYSTEMS = "android.media.tv.action.QUERY_CONTENT_RATING_SYSTEMS";
@@ -24761,7 +24762,6 @@ package android.media.tv {
method public java.lang.String onHardwareRemoved(android.media.tv.TvInputHardwareInfo);
method public android.media.tv.TvInputInfo onHdmiDeviceAdded(android.hardware.hdmi.HdmiDeviceInfo);
method public java.lang.String onHdmiDeviceRemoved(android.hardware.hdmi.HdmiDeviceInfo);
- method public static final void updateTvInputInfo(android.content.Context, android.media.tv.TvInputInfo);
field public static final java.lang.String SERVICE_INTERFACE = "android.media.tv.TvInputService";
field public static final java.lang.String SERVICE_META_DATA = "android.media.tv.input";
}
diff --git a/api/test-current.txt b/api/test-current.txt
index e4b11bd2d4b5..a4d63eab02f7 100644
--- a/api/test-current.txt
+++ b/api/test-current.txt
@@ -23089,6 +23089,7 @@ package android.media.tv {
method public boolean isRatingBlocked(android.media.tv.TvContentRating);
method public void registerCallback(android.media.tv.TvInputManager.TvInputCallback, android.os.Handler);
method public void unregisterCallback(android.media.tv.TvInputManager.TvInputCallback);
+ method public void updateTvInputInfo(android.media.tv.TvInputInfo);
field public static final java.lang.String ACTION_BLOCKED_RATINGS_CHANGED = "android.media.tv.action.BLOCKED_RATINGS_CHANGED";
field public static final java.lang.String ACTION_PARENTAL_CONTROLS_ENABLED_CHANGED = "android.media.tv.action.PARENTAL_CONTROLS_ENABLED_CHANGED";
field public static final java.lang.String ACTION_QUERY_CONTENT_RATING_SYSTEMS = "android.media.tv.action.QUERY_CONTENT_RATING_SYSTEMS";
@@ -23126,7 +23127,6 @@ package android.media.tv {
method public final android.os.IBinder onBind(android.content.Intent);
method public android.media.tv.TvInputService.RecordingSession onCreateRecordingSession(java.lang.String);
method public abstract android.media.tv.TvInputService.Session onCreateSession(java.lang.String);
- method public static final void updateTvInputInfo(android.content.Context, android.media.tv.TvInputInfo);
field public static final java.lang.String SERVICE_INTERFACE = "android.media.tv.TvInputService";
field public static final java.lang.String SERVICE_META_DATA = "android.media.tv.input";
}
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index 85e0b88bd937..a3e601956971 100644
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -8083,11 +8083,11 @@ i
<attr name="settingsActivity" />
<!-- Attribute whether the TV input service can record programs. This value can be changed
at runtime by calling
- {@link android.media.tv.TvInputService#updateTvInputInfo(android.content.Context, android.media.tv.TvInputInfo)}. -->
+ {@link android.media.tv.TvInputManager#updateTvInputInfo(android.media.tv.TvInputInfo)}. -->
<attr name="canRecord" format="boolean" />
<!-- The number of tuners that the TV input service is associated with. This value can be
changed at runtime by calling
- {@link android.media.tv.TvInputService#updateTvInputInfo(android.content.Context, android.media.tv.TvInputInfo)}. -->
+ {@link android.media.tv.TvInputManager#updateTvInputInfo(android.media.tv.TvInputInfo)}. -->
<attr name="tunerCount" format="integer" />
</declare-styleable>
diff --git a/media/java/android/media/tv/TvInputManager.java b/media/java/android/media/tv/TvInputManager.java
index bfd938e4bfbd..5c9d2b230abc 100644
--- a/media/java/android/media/tv/TvInputManager.java
+++ b/media/java/android/media/tv/TvInputManager.java
@@ -191,7 +191,9 @@ public final class TvInputManager {
/**
* Error for {@link TvInputService.RecordingSession#notifyError(int)} and
* {@link TvRecordingClient.RecordingCallback#onError(int)}: The requested operation cannot be
- * completed due to a problem that does not fit under any other error codes.
+ * completed due to a problem that does not fit under any other error codes, or the error code
+ * for the problem is defined on the higher version than application's
+ * <code>android:targetSdkVersion</code>.
*/
public static final int RECORDING_ERROR_UNKNOWN = 0;
@@ -1181,14 +1183,23 @@ public final class TvInputManager {
}
/**
- * Updates information about an existing TV input.
+ * Updates the <code>TvInputInfo</code> for an existing TV input. A TV input service
+ * implementation may call this method to pass the application and system an up-to-date
+ * <code>TvInputInfo</code> object that describes itself.
*
- * <p>This is called internally only by {@link TvInputService}.
+ * <p>The system automatically creates a <code>TvInputInfo</code> object for each TV input,
+ * based on the information collected from the <code>AndroidManifest.xml</code>, thus it is not
+ * necessary to call this method unless such information has changed dynamically.
+ * Use {@link TvInputInfo.Builder} to build a new <code>TvInputInfo</code> object.
+ *
+ * <p>Attempting to change information about a TV input that the calling package does not own
+ * does nothing.
*
* @param inputInfo The <code>TvInputInfo</code> object that contains new information.
* @throws IllegalArgumentException if the argument is {@code null}.
+ * @see TvInputCallback#onTvInputInfoUpdated(TvInputInfo)
*/
- void updateTvInputInfo(@NonNull TvInputInfo inputInfo) {
+ public void updateTvInputInfo(@NonNull TvInputInfo inputInfo) {
Preconditions.checkNotNull(inputInfo);
try {
mService.updateTvInputInfo(inputInfo, mUserId);
diff --git a/media/java/android/media/tv/TvInputService.java b/media/java/android/media/tv/TvInputService.java
index 21211d74b246..7ae8da091adb 100644
--- a/media/java/android/media/tv/TvInputService.java
+++ b/media/java/android/media/tv/TvInputService.java
@@ -256,31 +256,6 @@ public abstract class TvInputService extends Service {
return null;
}
- /**
- * Updates the <code>TvInputInfo</code> for an existing TV input. A TV input service
- * implementation may call this method to pass the application and system an up-to-date
- * <code>TvInputInfo</code> object that describes itself.
- *
- * <p>The system automatically creates a <code>TvInputInfo</code> object for each TV input,
- * based on the information collected from the <code>AndroidManifest.xml</code>, thus it is not
- * necessary to call this method unless such information has changed dynamically.
- * Use {@link TvInputInfo.Builder} to build a new <code>TvInputInfo</code> object.
- *
- * <p>Attempting to change information about a TV input that the calling package does not own
- * does nothing.
- *
- * @param context The application context.
- * @param inputInfo The <code>TvInputInfo</code> object that contains new information.
- * @see TvInputManager.TvInputCallback#onTvInputInfoUpdated(TvInputInfo)
- */
- public static final void updateTvInputInfo(Context context, TvInputInfo inputInfo) {
- TvInputManager manager = (TvInputManager) context.getSystemService(
- Context.TV_INPUT_SERVICE);
- if (manager != null) {
- manager.updateTvInputInfo(inputInfo);
- }
- }
-
private boolean isPassthroughInput(String inputId) {
if (mTvInputManager == null) {
mTvInputManager = (TvInputManager) getSystemService(Context.TV_INPUT_SERVICE);