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

Commit 2f7b7fce authored by Chienyuan Huang's avatar Chienyuan Huang
Browse files

Align value range of set/get confidence level

Bug: 322979029
Bug: 317683528
Test: atest DistanceMeasurementResultTest
Change-Id: Idee22a13c2a598443d3889ce25b2f492c0c7872c
parent 23b35a6c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1336,7 +1336,7 @@ package android.bluetooth.le {
    method @NonNull public android.bluetooth.le.DistanceMeasurementResult build();
    method @NonNull public android.bluetooth.le.DistanceMeasurementResult.Builder setAltitudeAngle(@FloatRange(from=-90.0, to=90.0) double);
    method @NonNull public android.bluetooth.le.DistanceMeasurementResult.Builder setAzimuthAngle(@FloatRange(from=0.0, to=360.0) double);
    method @FlaggedApi("com.android.bluetooth.flags.channel_sounding") @NonNull public android.bluetooth.le.DistanceMeasurementResult.Builder setConfidenceLevel(@FloatRange(from=0.0, to=100.0) double);
    method @FlaggedApi("com.android.bluetooth.flags.channel_sounding") @NonNull public android.bluetooth.le.DistanceMeasurementResult.Builder setConfidenceLevel(@FloatRange(from=0.0, to=1.0) double);
    method @FlaggedApi("com.android.bluetooth.flags.channel_sounding") @NonNull public android.bluetooth.le.DistanceMeasurementResult.Builder setDelaySpreadMeters(double);
    method @FlaggedApi("com.android.bluetooth.flags.channel_sounding") @NonNull public android.bluetooth.le.DistanceMeasurementResult.Builder setDetectedAttackLevel(int);
    method @NonNull public android.bluetooth.le.DistanceMeasurementResult.Builder setErrorAltitudeAngle(@FloatRange(from=0.0, to=180.0) double);
+3 −3
Original line number Diff line number Diff line
@@ -524,7 +524,7 @@ public final class DistanceMeasurementResult implements Parcelable {
        /**
         * Set the confidence of estimated distance.
         *
         * @param confidenceLevel a normalized value from 0.0 (low confidence) to 100.0 (high
         * @param confidenceLevel a normalized value from 0.0 (low confidence) to 1.0 (high
         *     confidence) representing the confidence of estimated distance
         * @throws IllegalArgumentException if value is invalid
         * @hide
@@ -533,8 +533,8 @@ public final class DistanceMeasurementResult implements Parcelable {
        @SystemApi
        @NonNull
        public Builder setConfidenceLevel(
                @FloatRange(from = 0.0, to = 100.0) double confidenceLevel) {
            if (confidenceLevel > 100.0 || confidenceLevel < 0.0) {
                @FloatRange(from = 0.0, to = 1.0) double confidenceLevel) {
            if (confidenceLevel > 1.0 || confidenceLevel < 0.0) {
                throw new IllegalArgumentException(
                        "error confidenceLevel must be in the range from 0.0 to 100.0 : "
                                + confidenceLevel);