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

Commit f80b83b0 authored by lucaslin's avatar lucaslin Committed by Lucas Lin
Browse files

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
parent 749dfc30
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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)