diff --git a/core/api/system-current.txt b/core/api/system-current.txt index 37a53897eea51..ac6684cec0225 100644 --- a/core/api/system-current.txt +++ b/core/api/system-current.txt @@ -5438,6 +5438,10 @@ package android.media.tv.tuner.filter { method @NonNull public android.media.tv.tuner.filter.RecordSettings.Builder setTsIndexMask(int); } + public final class RestartEvent extends android.media.tv.tuner.filter.FilterEvent { + method public int getStartId(); + } + public final class ScramblingStatusEvent extends android.media.tv.tuner.filter.FilterEvent { method public int getScramblingStatus(); } diff --git a/media/java/android/media/tv/tuner/filter/RestartEvent.java b/media/java/android/media/tv/tuner/filter/RestartEvent.java new file mode 100644 index 0000000000000..45ab7d9da4cce --- /dev/null +++ b/media/java/android/media/tv/tuner/filter/RestartEvent.java @@ -0,0 +1,52 @@ +/* + * Copyright 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.media.tv.tuner.filter; + +import android.annotation.SystemApi; + +/** + * An Event that the client would reveice after stopping, reconfiguring and restarting a filter. + * + *
After stopping and restarting the filter, the client has to discard all coming events until + * it receive {@link RestartedEvent} to avoid using the events from the previous configuration. + * + *
Recofiguring must happen after stopping the filter. + * + * @hide + */ +@SystemApi +public final class RestartEvent extends FilterEvent { + private final int mStartId; + + // This constructor is used by JNI code only + private RestartEvent(int startId) { + mStartId = startId; + } + + /** + * Gets the start id. + * + *
An unique ID to mark the start point of receiving the valid filter events after + * reconfiguring. It must be sent at least once in the first event after the filter is + * restarted. + * + *
0 is reserved for the newly opened filter's first start. It's optional to be received.
+ */
+ public int getStartId() {
+ return mStartId;
+ }
+}
diff --git a/media/jni/android_media_tv_Tuner.cpp b/media/jni/android_media_tv_Tuner.cpp
index b9e78483a1885..b255a48d34d0e 100644
--- a/media/jni/android_media_tv_Tuner.cpp
+++ b/media/jni/android_media_tv_Tuner.cpp
@@ -714,6 +714,34 @@ jobjectArray FilterCallback::getTemiEvent(
return arr;
}
+jobjectArray FilterCallback::getScramblingStatusEvent(
+ jobjectArray& arr, const std::vector