summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Chiachang Wang <chiachangwang@google.com> 2019-06-03 15:16:27 +0800
committer Lorenzo Colitti <lorenzo@google.com> 2019-06-03 12:49:53 +0000
commitaedf0479d3811b522b8ff8be999f67ee186617f7 (patch)
tree78b510b83ce6396afee4abb6d3bf95de0c71e08e
parent95ae9c0b370ca9048d16e67c0d11ae54ca84ed7c (diff)
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
-rw-r--r--services/core/java/com/android/server/ConnectivityService.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java
index dbee09450faa..c64c2783da51 100644
--- a/services/core/java/com/android/server/ConnectivityService.java
+++ b/services/core/java/com/android/server/ConnectivityService.java
@@ -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);
}