Address Tuner Filter Delay API review feedback

Bug: 213174673
Test: atest android.media.tv.tuner.cts.TunerTest
Change-Id: I601967d7c57f1026a518185ed35d4c25d56bebeb
This commit is contained in:
Patrick Rohr
2022-01-06 17:28:12 +01:00
parent e460207ece
commit 8d02071c98
2 changed files with 12 additions and 4 deletions

View File

@@ -6716,8 +6716,8 @@ package android.media.tv.tuner.filter {
method @Nullable public String acquireSharedFilterToken();
method public void close();
method public int configure(@NonNull android.media.tv.tuner.filter.FilterConfiguration);
method public int delayCallbackUntilBufferFilled(int);
method public int delayCallbackUntilTimeMillis(long);
method public int delayCallbackUntilBytesAccumulated(int);
method public int delayCallbackUntilMillisElapsed(long);
method public int flush();
method public void freeSharedFilterToken(@NonNull String);
method @Deprecated public int getId();

View File

@@ -612,8 +612,12 @@ public class Filter implements AutoCloseable {
* be a no-op. Use {@link TunerVersionChecker#getTunerVersion()} to get the version information.
*
* @param delayInMs specifies the duration of the delay in milliseconds.
* @return one of the following results: {@link Tuner#RESULT_SUCCESS},
* {@link Tuner#RESULT_UNAVAILABLE}, {@link Tuner#RESULT_NOT_INITIALIZED},
* {@link Tuner#RESULT_INVALID_STATE}, {@link Tuner#RESULT_INVALID_ARGUMENT},
* {@link Tuner#RESULT_OUT_OF_MEMORY}, or {@link Tuner#RESULT_UNKNOWN_ERROR}.
*/
public int delayCallbackUntilTimeMillis(long delayInMs) {
public int delayCallbackUntilMillisElapsed(long delayInMs) {
if (!TunerVersionChecker.checkHigherOrEqualVersionTo(
TunerVersionChecker.TUNER_VERSION_2_0, "setTimeDelayHint")) {
return Tuner.RESULT_UNAVAILABLE;
@@ -638,8 +642,12 @@ public class Filter implements AutoCloseable {
* be a no-op. Use {@link TunerVersionChecker#getTunerVersion()} to get the version information.
*
* @param delayInBytes specifies the duration of the delay in bytes.
* @return one of the following results: {@link Tuner#RESULT_SUCCESS},
* {@link Tuner#RESULT_UNAVAILABLE}, {@link Tuner#RESULT_NOT_INITIALIZED},
* {@link Tuner#RESULT_INVALID_STATE}, {@link Tuner#RESULT_INVALID_ARGUMENT},
* {@link Tuner#RESULT_OUT_OF_MEMORY}, or {@link Tuner#RESULT_UNKNOWN_ERROR}.
*/
public int delayCallbackUntilBufferFilled(int delayInBytes) {
public int delayCallbackUntilBytesAccumulated(int delayInBytes) {
if (!TunerVersionChecker.checkHigherOrEqualVersionTo(
TunerVersionChecker.TUNER_VERSION_2_0, "setTimeDelayHint")) {
return Tuner.RESULT_UNAVAILABLE;