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

Commit ae6a7b3f authored by Rambo Wang's avatar Rambo Wang
Browse files

Reduce signal strength alignment hysteresis to half of system default

QNS requires less alignment for the carrier specified thresholds.
But we have to guarantee the system threshold not being impacted firstly.
Since the alignment for application's threshold applies to both directions,
half of the system default hysteresis for alignment is good enough
to make sure system thresholds is un-impacted while introducing no
additional gaps for QNS (and other requests).

Bug: 227932356
Test: atest SignalStrengthControllerTest
Change-Id: Ife582f46208df0bd6fb0a8c1196f83a203ba4e94
parent 6618cfa1
Loading
Loading
Loading
Loading
+9 −1
Original line number Original line Diff line number Diff line
@@ -77,6 +77,14 @@ public class SignalStrengthController extends Handler {
    private static final int REPORTING_HYSTERESIS_DB = 2;
    private static final int REPORTING_HYSTERESIS_DB = 2;
    /** Minimum time between unsolicited SignalStrength reports. */
    /** Minimum time between unsolicited SignalStrength reports. */
    private static final int REPORTING_HYSTERESIS_MILLIS = 3000;
    private static final int REPORTING_HYSTERESIS_MILLIS = 3000;
    /**
     * A threshold within which (inclusive) the application requested signal strength
     * thresholds will be aligned with threholds set in advance (by system or other apps).
     * Since the alignment applies to both directions, the value is set to halt of
     * REPORTING_HYSTERESIS_DB to respect it while without introducing additional gaps for
     * thresholds set by apps.
     */
    private static final int ALIGNMENT_HYSTERESIS_DB = 1;


    private static final int EVENT_SET_SIGNAL_STRENGTH_UPDATE_REQUEST       = 1;
    private static final int EVENT_SET_SIGNAL_STRENGTH_UPDATE_REQUEST       = 1;
    private static final int EVENT_CLEAR_SIGNAL_STRENGTH_UPDATE_REQUEST     = 2;
    private static final int EVENT_CLEAR_SIGNAL_STRENGTH_UPDATE_REQUEST     = 2;
@@ -548,7 +556,7 @@ public class SignalStrengthController extends Handler {
                            isEnabledForSystem && shouldHonorSystemThresholds()
                            isEnabledForSystem && shouldHonorSystemThresholds()
                                    ? signalThresholdInfo.getThresholds()
                                    ? signalThresholdInfo.getThresholds()
                                    : new int[]{},
                                    : new int[]{},
                            REPORTING_HYSTERESIS_DB);
                            ALIGNMENT_HYSTERESIS_DB);
            boolean isEnabledForAppRequest =
            boolean isEnabledForAppRequest =
                    shouldEnableSignalThresholdForAppRequest(
                    shouldEnableSignalThresholdForAppRequest(
                            ran,
                            ran,