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

Commit 1427fe5f authored by Rambo Wang's avatar Rambo Wang Committed by Automerger Merge Worker
Browse files

Merge "Rename SignalThresholdInfo.Builder#setThresholdUnlimited" am:...

Merge "Rename SignalThresholdInfo.Builder#setThresholdUnlimited" am: 31083c40 am: 54a0c76e am: 35fbb8cb am: 374b512c

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1566912

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ieb66ae436d4d4aaf2143c922c4372c3e1e5ab5c8
parents 00f83da3 374b512c
Loading
Loading
Loading
Loading
+11 −13
Original line number Original line Diff line number Diff line
@@ -402,29 +402,27 @@ public final class SignalThresholdInfo implements Parcelable {
         * @see #getThresholds() for more details on signal strength thresholds
         * @see #getThresholds() for more details on signal strength thresholds
         */
         */
        public @NonNull Builder setThresholds(@NonNull int[] thresholds) {
        public @NonNull Builder setThresholds(@NonNull int[] thresholds) {
            Objects.requireNonNull(thresholds, "thresholds must not be null");
            return setThresholds(thresholds, false /*isSystem*/);
            if (thresholds.length < MINIMUM_NUMBER_OF_THRESHOLDS_ALLOWED
                    || thresholds.length > MAXIMUM_NUMBER_OF_THRESHOLDS_ALLOWED) {
                throw new IllegalArgumentException(
                        "thresholds length must between " + MINIMUM_NUMBER_OF_THRESHOLDS_ALLOWED
                                + " and " + MAXIMUM_NUMBER_OF_THRESHOLDS_ALLOWED);
            }
            mThresholds = thresholds.clone();
            Arrays.sort(mThresholds);
            return this;
        }
        }


        /**
        /**
         * Set the signal strength thresholds for the corresponding signal measurement type without
         * Set the signal strength thresholds for the corresponding signal measurement type.
         * the length limitation.
         *
         *
         * @param thresholds array of integer as the signal threshold values
         * @param thresholds array of integer as the signal threshold values
         * @param isSystem true is the caller is system which does not have restrictions on
         *        the length of thresholds array.
         * @return the builder to facilitate the chaining
         * @return the builder to facilitate the chaining
         *
         *
         * @hide
         * @hide
         */
         */
        public @NonNull Builder setThresholdsUnlimited(@NonNull int[] thresholds) {
        public @NonNull Builder setThresholds(@NonNull int[] thresholds, boolean isSystem) {
            Objects.requireNonNull(thresholds, "thresholds must not be null");
            Objects.requireNonNull(thresholds, "thresholds must not be null");
            if (!isSystem && (thresholds.length < MINIMUM_NUMBER_OF_THRESHOLDS_ALLOWED
                    || thresholds.length > MAXIMUM_NUMBER_OF_THRESHOLDS_ALLOWED)) {
                throw new IllegalArgumentException(
                        "thresholds length must between " + MINIMUM_NUMBER_OF_THRESHOLDS_ALLOWED
                                + " and " + MAXIMUM_NUMBER_OF_THRESHOLDS_ALLOWED);
            }
            mThresholds = thresholds.clone();
            mThresholds = thresholds.clone();
            Arrays.sort(mThresholds);
            Arrays.sort(mThresholds);
            return this;
            return this;