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

Commit 73b2197a authored by Patrick Rohr's avatar Patrick Rohr
Browse files

Fix tuner filter delay API

Renamed delayCallbackUntilMillisElapsed to
delayCallbackForDurationMillis according to API feedback. Made parameter
more consistent with the method name.

Test: m && atest android.media.tv.tuner.cts.TunerTest
Bug: 213174673
Change-Id: I296c56078a4089d456c0a2359cacfd37d4922f7d
parent 5d98afc0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -7033,8 +7033,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 delayCallbackForDurationMillis(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();
+7 −7
Original line number Diff line number Diff line
@@ -623,21 +623,21 @@ public class Filter implements AutoCloseable {
     * <p>This functionality is only available in Tuner version 2.0 and higher and will otherwise
     * be a no-op. Use {@link TunerVersionChecker#getTunerVersion()} to get the version information.
     *
     * @param delayInMs specifies the duration of the delay in milliseconds.
     * @param durationInMs 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 delayCallbackUntilMillisElapsed(long delayInMs) {
    public int delayCallbackForDurationMillis(long durationInMs) {
        if (!TunerVersionChecker.checkHigherOrEqualVersionTo(
                  TunerVersionChecker.TUNER_VERSION_2_0, "setTimeDelayHint")) {
            return Tuner.RESULT_UNAVAILABLE;
        }

        if (delayInMs >= 0 && delayInMs <= Integer.MAX_VALUE) {
        if (durationInMs >= 0 && durationInMs <= Integer.MAX_VALUE) {
            synchronized (mLock) {
                return nativeSetTimeDelayHint((int) delayInMs);
                return nativeSetTimeDelayHint((int) durationInMs);
            }
        }
        return Tuner.RESULT_INVALID_ARGUMENT;
@@ -653,20 +653,20 @@ public class Filter implements AutoCloseable {
     * <p>This functionality is only available in Tuner version 2.0 and higher and will otherwise
     * be a no-op. Use {@link TunerVersionChecker#getTunerVersion()} to get the version information.
     *
     * @param delayInBytes specifies the duration of the delay in bytes.
     * @param bytesAccumulated specifies the delay condition 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 delayCallbackUntilBytesAccumulated(int delayInBytes) {
    public int delayCallbackUntilBytesAccumulated(int bytesAccumulated) {
        if (!TunerVersionChecker.checkHigherOrEqualVersionTo(
                  TunerVersionChecker.TUNER_VERSION_2_0, "setTimeDelayHint")) {
            return Tuner.RESULT_UNAVAILABLE;
        }

        synchronized (mLock) {
            return nativeSetDataSizeDelayHint(delayInBytes);
            return nativeSetDataSizeDelayHint(bytesAccumulated);
        }
    }
}