From 25d8a48e7348c939a3f829fe87e47857307bdbf9 Mon Sep 17 00:00:00 2001 From: Jason Monk Date: Tue, 9 Dec 2014 12:27:24 -0500 Subject: [PATCH] Push inet condition to new MobileSignalControllers When new MobileSignalControllers were created after we already received the inet condition broadcast, they would never receive the current state of inet condition. This pushes it to all controllers whenever they are created. Bug: 18666876 Change-Id: Ie9997f94f3fbe206ed222a62e2a902fd43f4d67c --- .../statusbar/policy/NetworkControllerImpl.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java index 6431ab54a2caa..070af78924903 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java @@ -483,6 +483,10 @@ public class NetworkControllerImpl extends BroadcastReceiver cachedControllers.get(key).unregisterListener(); } } + // There may be new MobileSignalControllers around, make sure they get the current + // inet condition and airplane mode. + pushConnectivityToSignals(); + updateAirplaneMode(true /* force */); } private boolean hasCorrectMobileControllers(List allSubscriptions) { @@ -577,6 +581,13 @@ public class NetworkControllerImpl extends BroadcastReceiver mBluetoothTethered = mConnectedTransports.get(TRANSPORT_BLUETOOTH); mEthernetConnected = mConnectedTransports.get(TRANSPORT_ETHERNET); + pushConnectivityToSignals(); + } + + /** + * Pushes the current connectivity state to all SignalControllers. + */ + private void pushConnectivityToSignals() { // We want to update all the icons, all at once, for any condition change for (MobileSignalController mobileSignalController : mMobileSignalControllers.values()) { mobileSignalController.setInetCondition(