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

Commit 059918fa authored by sanketk's avatar sanketk Committed by Steve Kondik
Browse files

base: Change mobile provision checking to 3 times' HTTP connection

For mobile provisioning checking, somehow server is unreachable.
There is more than 10 TCP packets sending out without any TCP ACK
in 1 minutes. It will trigger data stall detection and finally
will cause radio reset happened after several iterations.

This fix will change mobile provisioning checking to only use HTTP
connection for at most 3 times. It will be finished in shorter time
and less than 10 TCP SYNC packets are sent. Hence even server is
unreachable, it will not trigger data stall detection.

CRs-Fixed: 715233
Change-Id: I01a76214b801415969436fee33fdb2c40dcf5793
parent a261f5d6
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -4337,8 +4337,9 @@ public class ConnectivityService extends IConnectivityManager.Stub {
        // adb shell setprop persist.checkmp.testfailures 1 to enable testing failures
        private static boolean mTestingFailures;

        // Choosing 4 loops as half of them will use HTTPS and the other half HTTP
        private static final int MAX_LOOPS = 4;
        // Choosing 3 loops use HTTP as HTTPS will last longer time if server is
        // unreachable. Keep same behavior with QcConnectivityService.
        private static final int MAX_LOOPS = 3;

        // Number of milli-seconds to complete all of the retires
        public static final int MAX_TIMEOUT_MS =  60000;
@@ -4625,7 +4626,7 @@ public class ConnectivityService extends IConnectivityManager.Stub {
                            // CMP_RESULT_CODE_NO_TCP_CONNECTION. We could change this, but by
                            // having http second we will be using logic used for some time.
                            URL newUrl;
                            String scheme = (addrTried <= (MAX_LOOPS/2)) ? "https" : "http";
                            String scheme = "http";
                            newUrl = new URL(scheme, hostAddr.getHostAddress(),
                                        orgUri.getPath());
                            log("isMobileOk: newUrl=" + newUrl);