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

Commit a0e22be7 authored by Amy Zhang's avatar Amy Zhang Committed by Android (Google) Code Review
Browse files

Merge "Add two extended Frontend Scan Message in Tuner 1.1"

parents cfa32e13 a6064642
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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);
+14 −0
Original line number Diff line number Diff line
@@ -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.
     *
+12 −0
Original line number Diff line number Diff line
@@ -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);
    }
}
+2 −0
Original line number Diff line number Diff line
@@ -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);