SysUI: Refactor the NetworkControllerImpl
Minimal changes to interface/callbacks, all of the changes are
internal and prepare for MSIM.
Separate out AccessPoint and MobileData from the NetworkController
interface to give some space.
A SignalController class has been created as a base for both
WifiSignalController and MobileSignalController, both of which
internally handle the state of their respective connectivity and
only reach up into the NetworkControllerImpl when completely
necessary (such as for combined carrier label).
Bug: 18222975
Change-Id: I75b954bbece187371cdb8571dd8420e7d2cad978
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerBaseTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerBaseTest.java
index 10cffc4..49fe1e3 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerBaseTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerBaseTest.java
@@ -17,6 +17,7 @@
import com.android.internal.telephony.cdma.EriInfo;
import com.android.systemui.statusbar.policy.NetworkController.NetworkSignalChangedCallback;
+import com.android.systemui.statusbar.policy.NetworkControllerImpl.Config;
import com.android.systemui.statusbar.policy.NetworkControllerImpl.SignalCluster;
import org.mockito.ArgumentCaptor;
@@ -44,6 +45,7 @@
protected ConnectivityManager mMockCm;
protected WifiManager mMockWm;
protected TelephonyManager mMockTm;
+ protected Config mConfig;
@Override
protected void setUp() throws Exception {
@@ -59,16 +61,19 @@
mSignalStrength = mock(SignalStrength.class);
mServiceState = mock(ServiceState.class);
- mSignalCluster = mock(SignalCluster.class);
- mNetworkSignalChangedCallback = mock(NetworkSignalChangedCallback.class);
+ mConfig = new Config();
+ mConfig.hspaDataDistinguishable = true;
mNetworkController = new NetworkControllerImpl(mContext, mMockCm, mMockTm, mMockWm,
- mock(AccessPointController.class), mock(MobileDataController.class));
+ mConfig, mock(AccessPointControllerImpl.class),
+ mock(MobileDataControllerImpl.class));
setupNetworkController();
}
protected void setupNetworkController() {
- mPhoneStateListener = mNetworkController.mPhoneStateListener;
+ mPhoneStateListener = mNetworkController.mMobileSignalController.mPhoneStateListener;
+ mSignalCluster = mock(SignalCluster.class);
+ mNetworkSignalChangedCallback = mock(NetworkSignalChangedCallback.class);
mNetworkController.addSignalCluster(mSignalCluster);
mNetworkController.addNetworkSignalChangedCallback(mNetworkSignalChangedCallback);
}