diff options
| author | 2019-02-12 15:30:13 +0800 | |
|---|---|---|
| committer | 2019-02-13 03:23:10 +0000 | |
| commit | f80b83b0e8617ebaf1dda4a807ba52ce4b8e3b57 (patch) | |
| tree | 0bfc6ebbbb9e127493d97dec8ad866d42acfacdc | |
| parent | 749dfc308353960c8454679654fc6cd0332f58dc (diff) | |
Clear all lingering notifications when network is disconnected
In aosp/861571, it tried to refine the design to prevent the
lingering notification is cleared unexpectedly. However, all
notifications should be cleared when network is disconnected.
Refine the design by clearing all lingering notifications when
network is disconnected.
Bug: 123488640
Bug: 123537643
Test: 1.Build pass
2.atest FrameworksNetTests
3.Connect to a hotspot which doesn't have internet,
after getting "NO_INTERNET" notification, disconnect
the wifi and check if "NO_INTERNET" notification will
be cleared or not.
Change-Id: Iac45ec186cf81915c318dba37f43136609d579f6
| -rw-r--r-- | services/core/java/com/android/server/ConnectivityService.java | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java index af2bbfbb1dc3..9b4cd230427f 100644 --- a/services/core/java/com/android/server/ConnectivityService.java +++ b/services/core/java/com/android/server/ConnectivityService.java @@ -2832,6 +2832,8 @@ public class ConnectivityService extends IConnectivityManager.Stub if (DBG) { log(nai.name() + " got DISCONNECTED, was satisfying " + nai.numNetworkRequests()); } + // Clear all notifications of this network. + mNotifier.clearNotification(nai.network.netId); // A network agent has disconnected. // TODO - if we move the logic to the network agent (have them disconnect // because they lost all their requests or because their score isn't good) |