summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2020-03-06 04:42:22 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2020-03-06 04:42:22 +0000
commit22d090cb4c33082ce8d8447752d09a80939aed16 (patch)
tree115d66fd8fe6618ad23ea3646f55c6534b1818df
parent24cfad9c2c7231079be357d581cf689776b39697 (diff)
parentbe1c41196f1655b6246cbadb06dc6a66dc2a2d94 (diff)
Merge "Filter changes according to API review" into rvc-dev
-rwxr-xr-xapi/system-current.txt1
-rw-r--r--media/java/android/media/tv/tuner/filter/Filter.java12
2 files changed, 10 insertions, 3 deletions
diff --git a/api/system-current.txt b/api/system-current.txt
index 764709aad946..6ae731c4325b 100755
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -5077,6 +5077,7 @@ package android.media.tv.tuner.filter {
field public static final int TYPE_MMTP = 2; // 0x2
field public static final int TYPE_TLV = 8; // 0x8
field public static final int TYPE_TS = 1; // 0x1
+ field public static final int TYPE_UNDEFINED = 0; // 0x0
}
public interface FilterCallback {
diff --git a/media/java/android/media/tv/tuner/filter/Filter.java b/media/java/android/media/tv/tuner/filter/Filter.java
index cfb943b10d17..52bdb595050e 100644
--- a/media/java/android/media/tv/tuner/filter/Filter.java
+++ b/media/java/android/media/tv/tuner/filter/Filter.java
@@ -45,6 +45,10 @@ public class Filter implements AutoCloseable {
public @interface Type {}
/**
+ * Undefined filter type.
+ */
+ public static final int TYPE_UNDEFINED = 0;
+ /**
* TS filter type.
*/
public static final int TYPE_TS = Constants.DemuxFilterMainType.TS;
@@ -248,7 +252,6 @@ public class Filter implements AutoCloseable {
/**
* Gets the filter Id.
*/
- @Result
public int getId() {
return nativeGetId();
}
@@ -273,6 +276,8 @@ public class Filter implements AutoCloseable {
/**
* Starts filtering data.
*
+ * <p>Does nothing if the filter is already started.
+ *
* @return result status of the operation.
*/
@Result
@@ -284,6 +289,8 @@ public class Filter implements AutoCloseable {
/**
* Stops filtering data.
*
+ * <p>Does nothing if the filter is stopped or not started.
+ *
* @return result status of the operation.
*/
@Result
@@ -312,14 +319,13 @@ public class Filter implements AutoCloseable {
* @param size the maximum number of bytes to read.
* @return the number of bytes read.
*/
- @Result
public int read(@NonNull byte[] buffer, @BytesLong long offset, @BytesLong long size) {
size = Math.min(size, buffer.length - offset);
return nativeRead(buffer, offset, size);
}
/**
- * Releases the Filter instance.
+ * Stops filtering data and releases the Filter instance.
*/
@Override
public void close() {