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

Commit aedf0479 authored by Chiachang Wang's avatar Chiachang Wang Committed by Lorenzo Colitti
Browse files

Re-notify if the network goes to PARTIAL.

If NetworkMonitor detects partial connectivity before
EVENT_PROMPT_UNVALIDATED arrives, show the partial
connectivity notification immediately. Re-notify
partial connectivity silently if no internet
notification already there.

Bug: 130683832
Bug: 130766237
Test: atest com.android.server.ConnectivityServiceTest
Change-Id: I7d4eddc643ec795c3961097dc1bdd314d168f6c7
parent 95ae9c0b
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -2661,6 +2661,17 @@ public class ConnectivityService extends IConnectivityManager.Stub
                            NetworkAgent.CMD_REPORT_NETWORK_STATUS,
                            (valid ? NetworkAgent.VALID_NETWORK : NetworkAgent.INVALID_NETWORK),
                            0, redirectUrlBundle);

                    // If NetworkMonitor detects partial connectivity before
                    // EVENT_PROMPT_UNVALIDATED arrives, show the partial connectivity notification
                    // immediately. Re-notify partial connectivity silently if no internet
                    // notification already there.
                    if (!wasPartial && nai.partialConnectivity) {
                        // Remove delayed message if there is a pending message.
                        mHandler.removeMessages(EVENT_PROMPT_UNVALIDATED, nai.network);
                        handlePromptUnvalidated(nai.network);
                    }

                    if (wasValidated && !nai.lastValidated) {
                        handleNetworkUnvalidated(nai);
                    }