Clear notif upon bad wifi off + tests for bad wifi notif
If a notification is up and the avoid bad wifi setting is turned off, the notification should disappear. This patch also adds some general tests for the bad wifi notifications. Test: new tests in this patch Change-Id: I5bc42afbe0efd93cfb59a759bf0aaba49a4bfc9f
This commit is contained in:
@@ -5083,8 +5083,14 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
||||
private void updateAvoidBadWifi() {
|
||||
ensureRunningOnConnectivityServiceThread();
|
||||
// Agent info scores and offer scores depend on whether cells yields to bad wifi.
|
||||
final boolean avoidBadWifi = avoidBadWifi();
|
||||
for (final NetworkAgentInfo nai : mNetworkAgentInfos) {
|
||||
nai.updateScoreForNetworkAgentUpdate();
|
||||
if (avoidBadWifi) {
|
||||
// If the device is now avoiding bad wifi, remove notifications that might have
|
||||
// been put up when the device didn't.
|
||||
mNotifier.clearNotification(nai.network.getNetId(), NotificationType.LOST_INTERNET);
|
||||
}
|
||||
}
|
||||
// UpdateOfferScore will update mNetworkOffers inline, so make a copy first.
|
||||
final ArrayList<NetworkOfferInfo> offersToUpdate = new ArrayList<>(mNetworkOffers);
|
||||
|
||||
Reference in New Issue
Block a user