Loading src/com/android/settings/network/ProviderModelSliceHelper.java +1 −1 Original line number Diff line number Diff line Loading @@ -140,7 +140,7 @@ public class ProviderModelSliceHelper { numLevels += 1; } return MobileNetworkUtils.getSignalStrengthIcon(mContext, level, numLevels, NO_CELL_DATA_TYPE_ICON, false); NO_CELL_DATA_TYPE_ICON, !mTelephonyManager.isDataEnabled()); } /** Loading src/com/android/settings/network/SubscriptionsPreferenceController.java +2 −1 Original line number Diff line number Diff line Loading @@ -311,7 +311,8 @@ public class SubscriptionsPreferenceController extends AbstractPreferenceControl numLevels += 1; } Drawable icon = mSubsPrefCtrlInjector.getIcon(mContext, level, numLevels, false); Drawable icon = mSubsPrefCtrlInjector.getIcon(mContext, level, numLevels, !mTelephonyManager.isDataEnabled()); final boolean isActiveCellularNetwork = mSubsPrefCtrlInjector.isActiveCellularNetwork(mContext); if (isActiveCellularNetwork || (mWifiPickerTrackerHelper != null) Loading tests/unit/src/com/android/settings/network/ProviderModelSliceHelperTest.java +5 −2 Original line number Diff line number Diff line Loading @@ -224,8 +224,9 @@ public class ProviderModelSliceHelperTest { public void getMobileDrawable_noCarrierData_getMobileDrawable() throws Throwable { mockConnections(false, ServiceState.STATE_OUT_OF_SERVICE, "", false, true); when(mConnectivityManager.getActiveNetwork()).thenReturn(null); Drawable expectDrawable = mock(Drawable.class); when(mConnectivityManager.getActiveNetwork()).thenReturn(null); when(mTelephonyManager.isDataEnabled()).thenReturn(false); assertThat(mProviderModelSliceHelper.getMobileDrawable(expectDrawable)).isEqualTo( expectDrawable); Loading @@ -236,8 +237,9 @@ public class ProviderModelSliceHelperTest { throws Throwable { mockConnections(true, ServiceState.STATE_IN_SERVICE, "", true, true); addNetworkTransportType(NetworkCapabilities.TRANSPORT_CELLULAR); Drawable drawable = mock(Drawable.class); addNetworkTransportType(NetworkCapabilities.TRANSPORT_CELLULAR); when(mTelephonyManager.isDataEnabled()).thenReturn(true); assertThat(mProviderModelSliceHelper.getMobileDrawable(drawable)).isEqualTo( mDrawableWithSignalStrength); Loading @@ -252,6 +254,7 @@ public class ProviderModelSliceHelperTest { true); Drawable drawable = mock(Drawable.class); addNetworkTransportType(NetworkCapabilities.TRANSPORT_WIFI); when(mTelephonyManager.isDataEnabled()).thenReturn(true); assertThat(mProviderModelSliceHelper.getMobileDrawable(drawable)).isEqualTo( mDrawableWithSignalStrength); Loading tests/unit/src/com/android/settings/network/SubscriptionsPreferenceControllerTest.java +4 −1 Original line number Diff line number Diff line Loading @@ -665,6 +665,7 @@ public class SubscriptionsPreferenceControllerTest { doReturn(true).when(sInjector).isProviderModelEnabled(mContext); doReturn(sub.get(0)).when(mSubscriptionManager).getDefaultDataSubscriptionInfo(); Drawable icon = mock(Drawable.class); when(mTelephonyManager.isDataEnabled()).thenReturn(true); doReturn(icon).when(sInjector).getIcon(any(), anyInt(), anyInt(), eq(false)); setupGetIconConditions(sub.get(0).getSubscriptionId(), true, true, true, ServiceState.STATE_IN_SERVICE); Loading @@ -683,6 +684,7 @@ public class SubscriptionsPreferenceControllerTest { doReturn(true).when(sInjector).isProviderModelEnabled(mContext); doReturn(subs.get(0)).when(mSubscriptionManager).getDefaultDataSubscriptionInfo(); Drawable icon = mock(Drawable.class); when(mTelephonyManager.isDataEnabled()).thenReturn(true); doReturn(icon).when(sInjector).getIcon(any(), anyInt(), anyInt(), eq(false)); setupGetIconConditions(subId, false, true, true, ServiceState.STATE_IN_SERVICE); Loading @@ -701,7 +703,8 @@ public class SubscriptionsPreferenceControllerTest { doReturn(true).when(sInjector).isProviderModelEnabled(mContext); doReturn(subs.get(0)).when(mSubscriptionManager).getDefaultDataSubscriptionInfo(); Drawable icon = mock(Drawable.class); doReturn(icon).when(sInjector).getIcon(any(), anyInt(), anyInt(), eq(false)); when(mTelephonyManager.isDataEnabled()).thenReturn(false); doReturn(icon).when(sInjector).getIcon(any(), anyInt(), anyInt(), eq(true)); setupGetIconConditions(subId, false, false, false, ServiceState.STATE_IN_SERVICE); Loading Loading
src/com/android/settings/network/ProviderModelSliceHelper.java +1 −1 Original line number Diff line number Diff line Loading @@ -140,7 +140,7 @@ public class ProviderModelSliceHelper { numLevels += 1; } return MobileNetworkUtils.getSignalStrengthIcon(mContext, level, numLevels, NO_CELL_DATA_TYPE_ICON, false); NO_CELL_DATA_TYPE_ICON, !mTelephonyManager.isDataEnabled()); } /** Loading
src/com/android/settings/network/SubscriptionsPreferenceController.java +2 −1 Original line number Diff line number Diff line Loading @@ -311,7 +311,8 @@ public class SubscriptionsPreferenceController extends AbstractPreferenceControl numLevels += 1; } Drawable icon = mSubsPrefCtrlInjector.getIcon(mContext, level, numLevels, false); Drawable icon = mSubsPrefCtrlInjector.getIcon(mContext, level, numLevels, !mTelephonyManager.isDataEnabled()); final boolean isActiveCellularNetwork = mSubsPrefCtrlInjector.isActiveCellularNetwork(mContext); if (isActiveCellularNetwork || (mWifiPickerTrackerHelper != null) Loading
tests/unit/src/com/android/settings/network/ProviderModelSliceHelperTest.java +5 −2 Original line number Diff line number Diff line Loading @@ -224,8 +224,9 @@ public class ProviderModelSliceHelperTest { public void getMobileDrawable_noCarrierData_getMobileDrawable() throws Throwable { mockConnections(false, ServiceState.STATE_OUT_OF_SERVICE, "", false, true); when(mConnectivityManager.getActiveNetwork()).thenReturn(null); Drawable expectDrawable = mock(Drawable.class); when(mConnectivityManager.getActiveNetwork()).thenReturn(null); when(mTelephonyManager.isDataEnabled()).thenReturn(false); assertThat(mProviderModelSliceHelper.getMobileDrawable(expectDrawable)).isEqualTo( expectDrawable); Loading @@ -236,8 +237,9 @@ public class ProviderModelSliceHelperTest { throws Throwable { mockConnections(true, ServiceState.STATE_IN_SERVICE, "", true, true); addNetworkTransportType(NetworkCapabilities.TRANSPORT_CELLULAR); Drawable drawable = mock(Drawable.class); addNetworkTransportType(NetworkCapabilities.TRANSPORT_CELLULAR); when(mTelephonyManager.isDataEnabled()).thenReturn(true); assertThat(mProviderModelSliceHelper.getMobileDrawable(drawable)).isEqualTo( mDrawableWithSignalStrength); Loading @@ -252,6 +254,7 @@ public class ProviderModelSliceHelperTest { true); Drawable drawable = mock(Drawable.class); addNetworkTransportType(NetworkCapabilities.TRANSPORT_WIFI); when(mTelephonyManager.isDataEnabled()).thenReturn(true); assertThat(mProviderModelSliceHelper.getMobileDrawable(drawable)).isEqualTo( mDrawableWithSignalStrength); Loading
tests/unit/src/com/android/settings/network/SubscriptionsPreferenceControllerTest.java +4 −1 Original line number Diff line number Diff line Loading @@ -665,6 +665,7 @@ public class SubscriptionsPreferenceControllerTest { doReturn(true).when(sInjector).isProviderModelEnabled(mContext); doReturn(sub.get(0)).when(mSubscriptionManager).getDefaultDataSubscriptionInfo(); Drawable icon = mock(Drawable.class); when(mTelephonyManager.isDataEnabled()).thenReturn(true); doReturn(icon).when(sInjector).getIcon(any(), anyInt(), anyInt(), eq(false)); setupGetIconConditions(sub.get(0).getSubscriptionId(), true, true, true, ServiceState.STATE_IN_SERVICE); Loading @@ -683,6 +684,7 @@ public class SubscriptionsPreferenceControllerTest { doReturn(true).when(sInjector).isProviderModelEnabled(mContext); doReturn(subs.get(0)).when(mSubscriptionManager).getDefaultDataSubscriptionInfo(); Drawable icon = mock(Drawable.class); when(mTelephonyManager.isDataEnabled()).thenReturn(true); doReturn(icon).when(sInjector).getIcon(any(), anyInt(), anyInt(), eq(false)); setupGetIconConditions(subId, false, true, true, ServiceState.STATE_IN_SERVICE); Loading @@ -701,7 +703,8 @@ public class SubscriptionsPreferenceControllerTest { doReturn(true).when(sInjector).isProviderModelEnabled(mContext); doReturn(subs.get(0)).when(mSubscriptionManager).getDefaultDataSubscriptionInfo(); Drawable icon = mock(Drawable.class); doReturn(icon).when(sInjector).getIcon(any(), anyInt(), anyInt(), eq(false)); when(mTelephonyManager.isDataEnabled()).thenReturn(false); doReturn(icon).when(sInjector).getIcon(any(), anyInt(), anyInt(), eq(true)); setupGetIconConditions(subId, false, false, false, ServiceState.STATE_IN_SERVICE); Loading