Use default network template in billing cycle settings.

- if the network template is not set in the bundle arguments, use the
default network template for getting the billing data.
- change to use ConnectivityManager.from(context) in DataUsageUtils to
be consistent with the usage in other methods.

Change-Id: I25eb27f8f26d9ecafc66aa2c69806e94c6b63499
Fixes: 117452991
Test: make RunSettingsRoboTests
This commit is contained in:
Doris Ling
2018-10-09 17:10:34 -07:00
parent b3eaf62562
commit c4b40b0669
4 changed files with 59 additions and 10 deletions

View File

@@ -121,7 +121,7 @@ public class DataUsageSummaryPreferenceControllerTest {
mActivity = spy(Robolectric.buildActivity(FragmentActivity.class).get());
when(mActivity.getSystemService(TelephonyManager.class)).thenReturn(mTelephonyManager);
when(mActivity.getSystemService(ConnectivityManager.class))
when(mActivity.getSystemService(Context.CONNECTIVITY_SERVICE))
.thenReturn(mConnectivityManager);
when(mTelephonyManager.getSimState()).thenReturn(TelephonyManager.SIM_STATE_READY);
when(mConnectivityManager.isNetworkSupported(TYPE_WIFI)).thenReturn(false);