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

Commit 0d857467 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Return a collection in getAllAtsc3PlpInfo()"

parents eeea7407 beab1f68
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -7952,7 +7952,7 @@ package android.media.tv.tuner.frontend {
  public class FrontendStatus {
    method public int getAgc();
    method @NonNull public android.media.tv.tuner.frontend.Atsc3PlpInfo[] getAllAtsc3PlpInfo();
    method @NonNull public java.util.List<android.media.tv.tuner.frontend.Atsc3PlpInfo> getAllAtsc3PlpInfo();
    method @NonNull public android.media.tv.tuner.frontend.FrontendStatus.Atsc3PlpTuningInfo[] getAtsc3PlpTuningInfo();
    method public int getBandwidth();
    method public int getBer();
+17 −10
Original line number Diff line number Diff line
@@ -25,6 +25,9 @@ import android.media.tv.tuner.Lnb;
import android.media.tv.tuner.TunerVersionChecker;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

/**
 * A Frontend Status class that contains the metrics of the active frontend.
@@ -1086,22 +1089,26 @@ public class FrontendStatus {
    }

    /**
     * Gets an array of all PLPs information of ATSC3 frontend, which includes both tuned and not
     * Gets a list of all PLPs information of ATSC3 frontend, which includes both tuned and not
     * tuned PLPs for currently watching service.
     *
     * <p>This query is only supported by Tuner HAL 2.0 or higher. Unsupported version or if HAL
     * doesn't return all PLPs information will throw IllegalStateException. Use
     * {@link TunerVersionChecker#getTunerVersion()} to check the version.
     * <p>This query is only supported by Tuner HAL 2.0 or higher. Unsupported version will throw
     * UnsupportedOperationException. Use {@link TunerVersionChecker#getTunerVersion()} to check
     * the version.
     *
     * @return a list of all PLPs information. It is empty if HAL doesn't return all PLPs
     *         information status.
     */
    @SuppressLint("ArrayReturn")
    @NonNull
    public Atsc3PlpInfo[] getAllAtsc3PlpInfo() {
        TunerVersionChecker.checkHigherOrEqualVersionTo(
                TunerVersionChecker.TUNER_VERSION_2_0, "Atsc3PlpInfo all status");
    public List<Atsc3PlpInfo> getAllAtsc3PlpInfo() {
        if (!TunerVersionChecker.checkHigherOrEqualVersionTo(
                    TunerVersionChecker.TUNER_VERSION_2_0, "Atsc3PlpInfo all status")) {
            throw new UnsupportedOperationException("Atsc3PlpInfo all status is empty");
        }
        if (mAllPlpInfo == null) {
            throw new IllegalStateException("Atsc3PlpInfo all status is empty");
            return Collections.EMPTY_LIST;
        }
        return mAllPlpInfo;
        return Arrays.asList(mAllPlpInfo);
    }

    /**