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

Commit 126c345b authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Use score tolerance when switch back" into main

parents 52aa07e3 4aac3bd2
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -776,14 +776,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.
@@ -800,8 +804,8 @@ public class AutoDataSwitchController extends Handler {
                }
            }

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