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

Commit 5bdfd8c1 authored by Jason Monk's avatar Jason Monk Committed by android-build-merger
Browse files

Get data type from service state as well am: 67b2c16a am: 05130f3f

am: 8ced692e

* commit '8ced692e':
  Get data type from service state as well
parents f3b34603 8ced692e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -440,6 +440,7 @@ public class MobileSignalController extends SignalController<
                        + " dataState=" + state.getDataRegState());
            }
            mServiceState = state;
            mDataNetType = state.getDataNetworkType();
            updateTelephony();
        }

+4 −3
Original line number Diff line number Diff line
@@ -60,8 +60,8 @@ public class NetworkControllerBaseTest extends SysuiTestCase {
    protected NetworkControllerImpl mNetworkController;
    protected MobileSignalController mMobileSignalController;
    protected PhoneStateListener mPhoneStateListener;
    private SignalStrength mSignalStrength;
    private ServiceState mServiceState;
    protected SignalStrength mSignalStrength;
    protected ServiceState mServiceState;
    protected ConnectivityManager mMockCm;
    protected WifiManager mMockWm;
    protected SubscriptionManager mMockSm;
@@ -235,7 +235,7 @@ public class NetworkControllerBaseTest extends SysuiTestCase {
        mPhoneStateListener.onSignalStrengthsChanged(mSignalStrength);
    }

    private void updateServiceState() {
    protected void updateServiceState() {
        Log.d(TAG, "Sending Service State: " + mServiceState);
        mPhoneStateListener.onServiceStateChanged(mServiceState);
    }
@@ -246,6 +246,7 @@ public class NetworkControllerBaseTest extends SysuiTestCase {
    }

    public void updateDataConnectionState(int dataState, int dataNetType) {
        when(mServiceState.getDataNetworkType()).thenReturn(dataNetType);
        mPhoneStateListener.onDataConnectionStateChanged(dataState, dataNetType);
    }

+15 −0
Original line number Diff line number Diff line
@@ -115,6 +115,21 @@ public class NetworkControllerDataTest extends NetworkControllerBaseTest {
                TelephonyIcons.QS_DATA_4G);
    }

    public void testDataChangeWithoutConnectionState() {
        setupDefaultSignal();
        updateDataConnectionState(TelephonyManager.DATA_CONNECTED,
                TelephonyManager.NETWORK_TYPE_LTE);

        verifyDataIndicators(TelephonyIcons.DATA_LTE[1][0 /* No direction */],
                TelephonyIcons.QS_DATA_LTE);

        Mockito.when(mServiceState.getDataNetworkType())
                .thenReturn(TelephonyManager.NETWORK_TYPE_HSPA);
        updateServiceState();
        verifyDataIndicators(TelephonyIcons.DATA_H[1][0 /* No direction */],
                TelephonyIcons.QS_DATA_H);
    }

    public void testDataActivity() {
        setupDefaultSignal();