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

Commit 4aac3bd2 authored by Ling Ma's avatar Ling Ma
Browse files

Use score tolerance when switch back

Before the change, switch back if the DDS' score is equal or higher than
the current backup SIM.

After the change, switch back if the DDS's score is equal or high than
the current backup SIM's score minus the tolerance, making the switch
mechanism symmetric.

Fix: 406432368
Test: basic voice call + data browsing
Flag: EXEMPT bugfix

Change-Id: Ibcd89b44d1e089fe29b7b834a8c833e35f3789ee
parent e1db9bd7
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -767,14 +767,18 @@ public class AutoDataSwitchController extends Handler {
                                    .getRatSignalScore();
                            int currentScore = mPhonesSignalStatus[preferredPhoneId]
                                    .getRatSignalScore();
                            if (defaultScore >= currentScore) {
                            if ((currentScore - defaultScore) <= mScoreTolerance) {
                                debugMessage
                                        .append(", back to default for higher or equal score ")
                                        .append(", back to default for score ")
                                        .append(defaultScore).append(" versus current ")
                                        .append(currentScore);
                                backToDefault = true;
                                switchType = STABILITY_CHECK_PERFORMANCE_SWITCH;
                                needValidation = mRequirePingTestBeforeSwitch;
                            } else {
                                debugMessage.append(", default's score ").append(defaultScore)
                                        .append(" doesn't justify the switch given the current ")
                                        .append(currentScore);
                            }
                        } else {
                            // Only OOS/in service switch is enabled, switch back.
@@ -791,8 +795,8 @@ public class AutoDataSwitchController extends Handler {
                }
            }

            if (backToDefault) {
            log(debugMessage.toString());
            if (backToDefault) {
                mSelectedTargetPhoneId = defaultDataPhoneId;
                startStabilityCheck(DEFAULT_PHONE_INDEX, switchType, needValidation);
            } else {