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

Commit a6064642 authored by Amy Zhang's avatar Amy Zhang
Browse files

Add two extended Frontend Scan Message in Tuner 1.1

Test: make -j44 dist
Bug: 158818695
Change-Id: I7049201778798a60482f1ecaf471986e93f7309a
parent db6b4cae
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -6282,7 +6282,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
@@ -1047,6 +1047,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
@@ -6222,7 +6222,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);