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

Commit 7a3428a4 authored by Amy Zhang's avatar Amy Zhang
Browse files

Add IntRange for getEndFrequency in FrontendSettings

Test: make -j44 dist
Bug: 171281832
Change-Id: Ia90c60f6a20b3eeb62680f7e2e7c462cba6bb9ee
parent 6e59ac63
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -6064,7 +6064,7 @@ package android.media.tv.tuner.frontend {
  }
  public abstract class FrontendSettings {
    method public int getEndFrequency();
    method @IntRange(from=1) public int getEndFrequency();
    method public int getFrequency();
    method public int getFrontendSpectralInversion();
    method public abstract int getType();
+1 −1
Original line number Diff line number Diff line
@@ -6004,7 +6004,7 @@ package android.media.tv.tuner.frontend {
  }
  public abstract class FrontendSettings {
    method public int getEndFrequency();
    method @IntRange(from=1) public int getEndFrequency();
    method public int getFrequency();
    method public int getFrontendSpectralInversion();
    method public abstract int getType();
+5 −0
Original line number Diff line number Diff line
@@ -302,6 +302,7 @@ public abstract class FrontendSettings {
     *
     * @return the end frequency in Hz.
     */
    @IntRange(from = 1)
    public int getEndFrequency() {
        return mEndFrequency;
    }
@@ -341,11 +342,15 @@ public abstract class FrontendSettings {
     *
     * @param endFrequency the end frequency used during blind scan. The default value is
     * {@link android.media.tv.tuner.Tuner#INVALID_FRONTEND_SETTING_FREQUENCY}.
     * @throws IllegalArgumentException if the {@code endFrequency} is not greater than 0.
     */
    @IntRange(from = 1)
    public void setEndFrequency(int endFrequency) {
        if (TunerVersionChecker.checkHigherOrEqualVersionTo(
                TunerVersionChecker.TUNER_VERSION_1_1, "setEndFrequency")) {
            if (endFrequency < 1) {
                throw new IllegalArgumentException("endFrequency must be greater than 0");
            }
            mEndFrequency = endFrequency;
        }
    }