diff --git a/api/system-current.txt b/api/system-current.txt index d1ceed6b3f701..ff84613dd75eb 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -6309,7 +6309,9 @@ package android.media.tv.tuner.frontend { method public void onHierarchyReported(int); method public void onInputStreamIdsReported(@NonNull int[]); method public void onLocked(); + method public default void onModulationReported(int); method public void onPlpIdsReported(@NonNull int[]); + method public default void onPriorityReported(boolean); method public void onProgress(@IntRange(from=0, to=100) int); method public void onScanStopped(); method public void onSignalTypeReported(int); diff --git a/media/java/android/media/tv/tuner/Tuner.java b/media/java/android/media/tv/tuner/Tuner.java index aedf5d5ae0bb5..1881e38a50100 100644 --- a/media/java/android/media/tv/tuner/Tuner.java +++ b/media/java/android/media/tv/tuner/Tuner.java @@ -1048,6 +1048,20 @@ public class Tuner implements AutoCloseable { } } + private void onModulationReported(int modulation) { + if (mScanCallbackExecutor != null && mScanCallback != null) { + mScanCallbackExecutor.execute( + () -> mScanCallback.onModulationReported(modulation)); + } + } + + private void onPriorityReported(boolean isHighPriority) { + if (mScanCallbackExecutor != null && mScanCallback != null) { + mScanCallbackExecutor.execute( + () -> mScanCallback.onPriorityReported(isHighPriority)); + } + } + /** * Opens a filter object based on the given types and buffer size. * diff --git a/media/java/android/media/tv/tuner/frontend/ScanCallback.java b/media/java/android/media/tv/tuner/frontend/ScanCallback.java index b0491fdbde1ab..c1400c8f6842f 100644 --- a/media/java/android/media/tv/tuner/frontend/ScanCallback.java +++ b/media/java/android/media/tv/tuner/frontend/ScanCallback.java @@ -19,6 +19,7 @@ package android.media.tv.tuner.frontend; import android.annotation.IntRange; import android.annotation.NonNull; import android.annotation.SystemApi; +import android.util.Log; /** * Scan callback. @@ -27,6 +28,8 @@ import android.annotation.SystemApi; */ @SystemApi public interface ScanCallback { + /** @hide **/ + String TAG = "ScanCallback"; /** Scan locked the signal. */ void onLocked(); @@ -70,4 +73,13 @@ public interface ScanCallback { /** Frontend signal type. */ void onSignalTypeReported(@AnalogFrontendSettings.SignalType int signalType); + /** Frontend modulation reported. */ + default void onModulationReported(@FrontendStatus.FrontendModulation int modulation) { + Log.d(TAG, "Received modulation scan message"); + } + + /** Frontend scan message priority reported. */ + default void onPriorityReported(boolean isHighPriority) { + Log.d(TAG, "Received priority scan message: isHighPriority=" + isHighPriority); + } } diff --git a/non-updatable-api/system-current.txt b/non-updatable-api/system-current.txt index 869c637be46be..93fdfba276dbd 100644 --- a/non-updatable-api/system-current.txt +++ b/non-updatable-api/system-current.txt @@ -6249,7 +6249,9 @@ package android.media.tv.tuner.frontend { method public void onHierarchyReported(int); method public void onInputStreamIdsReported(@NonNull int[]); method public void onLocked(); + method public default void onModulationReported(int); method public void onPlpIdsReported(@NonNull int[]); + method public default void onPriorityReported(boolean); method public void onProgress(@IntRange(from=0, to=100) int); method public void onScanStopped(); method public void onSignalTypeReported(int);