Home
last modified time | relevance | path

Searched refs:DataUsageUtils (Results 1 – 25 of 35) sorted by relevance

12

/packages/apps/Car/Settings/tests/unit/src/com/android/car/settings/datausage/
DDataUsageUtilsTest.java45 assertThat(DataUsageUtils.getDefaultSubscriptionId(null)).isEqualTo( in getDefaultSubscriptionId_nullSubscriptionManager_returnsInvalidId()
55 assertThat(DataUsageUtils.getDefaultSubscriptionId(subscriptionManager)).isEqualTo( in getDefaultSubscriptionId_noSubscriptions_returnsInvalidId()
71 assertThat(DataUsageUtils.getDefaultSubscriptionId(subscriptionManager)).isEqualTo(1); in getDefaultSubscriptionId_noDefaultSubscription_returnsFirstSubscription()
81 assertThat(DataUsageUtils.getDefaultSubscriptionId(subscriptionManager)).isEqualTo(1); in getDefaultSubscriptionId_hasDefaultSubscription_returnsDefaultSubscription()
90 assertThat(DataUsageUtils.getPrimaryPlan(subscriptionManager, SUBSCRIPTION_ID)).isNull(); in getPrimaryPlan_noSubscriptions_returnsNull()
101 assertThat(DataUsageUtils.getPrimaryPlan(subscriptionManager, SUBSCRIPTION_ID)).isNull(); in getPrimaryPlan_dataLimitBytesIsZero_returnsNull()
112 when(subscriptionPlan.getDataUsageBytes()).thenReturn(2 * DataUsageUtils.PETA); in getPrimaryPlan_dataUsageBytesIsHuge_returnsNull()
114 assertThat(DataUsageUtils.getPrimaryPlan(subscriptionManager, SUBSCRIPTION_ID)).isNull(); in getPrimaryPlan_dataUsageBytesIsHuge_returnsNull()
127 assertThat(DataUsageUtils.getPrimaryPlan(subscriptionManager, SUBSCRIPTION_ID)).isNull(); in getPrimaryPlan_cycleRuleIsNull_returnsNull()
141 assertThat(DataUsageUtils.getPrimaryPlan(subscriptionManager, SUBSCRIPTION_ID)).isEqualTo( in getPrimaryPlan_cycleRuleIsValid_returnsSubscriptionPlan()
DDataUsageSetThresholdBaseFragmentTest.java85 mSession = ExtendedMockito.mockitoSession().mockStatic(DataUsageUtils.class, in setUp()
99 when(DataUsageUtils.getDefaultSubscriptionId(any())).thenReturn(SUB_ID); in onActivityCreated_noTemplateSet_getsDefaultTemplate()
100 when(DataUsageUtils.getMobileNetworkTemplate(any(), eq(SUB_ID))) in onActivityCreated_noTemplateSet_getsDefaultTemplate()
/packages/apps/Settings/src/com/android/settings/datausage/
DDataUsageSummaryPreferenceController.kt62 if (DataUsageUtils.hasMobileData(mContext)) { in <lambda>()
123 DataUsageUtils.formatDataUsage(mContext, /* byteValue = */ 0), in setDataBarSize()
124 DataUsageUtils.formatDataUsage(mContext, dataBarSize) in setDataBarSize()
132 DataUsageUtils.formatDataUsage(mContext, warningBytes), in getLimitInfo()
133 DataUsageUtils.formatDataUsage(mContext, limitBytes), in getLimitInfo()
140 DataUsageUtils.formatDataUsage(mContext, warningBytes), in getLimitInfo()
147 DataUsageUtils.formatDataUsage(mContext, limitBytes), in getLimitInfo()
DDataUsageUtils.java48 public final class DataUsageUtils { class
54 private DataUsageUtils() { in DataUsageUtils() method in DataUsageUtils
74 if (DataUsageUtils.TEST_RADIOS) { in hasEthernet()
75 return SystemProperties.get(DataUsageUtils.TEST_RADIOS_PROP).contains(ETHERNET); in hasEthernet()
DDataUsageSummary.java92 boolean hasMobileData = DataUsageUtils.hasMobileData(context); in onCreate()
102 boolean hasWifiRadio = DataUsageUtils.hasWifiRadio(context); in onCreate()
116 if (DataUsageUtils.hasEthernet(context)) { in onCreate()
141 DataUsageUtils.getDefaultSubscriptionId(activity)); in createPreferenceControllers()
DDataSaverSummary.kt100 DataUsageUtils.hasMobileData(context) && in <lambda>()
101 (DataUsageUtils.getDefaultSubscriptionId(context) != in <lambda>()
DBillingCycleSettings.java126 DataUsageUtils.getMobileNetworkTemplateFromSubId(context, getIntent()); in onCreate()
156 mDataWarning.setSummary(DataUsageUtils.formatDataUsage(getContext(), warningBytes)); in updatePrefs()
166 mDataLimit.setSummary(DataUsageUtils.formatDataUsage(getContext(), limitBytes)); in updatePrefs()
532 && DataUsageUtils.hasMobileData(context);
DBillingCyclePreferenceController.java50 return DataUsageUtils.hasMobileData(mContext) ? AVAILABLE : CONDITIONALLY_UNAVAILABLE; in getAvailabilityStatus()
/packages/apps/Car/Settings/src/com/android/car/settings/datausage/
DDataWarningAndLimitPreferenceController.java62 DataUsageUtils.bytesToIecUnits(getContext(), info.warningLevel), in getLimitText()
63 DataUsageUtils.bytesToIecUnits(getContext(), info.limitLevel)); in getLimitText()
66 DataUsageUtils.bytesToIecUnits(getContext(), info.warningLevel)); in getLimitText()
69 DataUsageUtils.bytesToIecUnits(getContext(), info.limitLevel)); in getLimitText()
DAppSpecificDataUsageFragment.java82 networkTemplate = DataUsageUtils.getMobileNetworkTemplate(telephonyManager, in onAttach()
83 DataUsageUtils.getDefaultSubscriptionId(subscriptionManager)); in onAttach()
121 .setSummary(DataUsageUtils.bytesToIecUnits(getContext(), cycleData.getTotalUsage()) in onDataCyclePicked()
125 .setSummary(DataUsageUtils.bytesToIecUnits(getContext(), in onDataCyclePicked()
129 .setSummary(DataUsageUtils.bytesToIecUnits(getContext(), in onDataCyclePicked()
DDataUsageEntryPreferenceController.java69 SubscriptionPlan defaultPlan = DataUsageUtils.getPrimaryPlan(subscriptionManager, in formatUsedData()
76 return DataUsageUtils.formatDataUsageInCycle(getContext(), defaultPlan.getDataUsageBytes(), in formatUsedData()
DDataWarningAndLimitFragment.java77 mNetworkTemplate = DataUsageUtils.getMobileNetworkTemplate(mTelephonyManager, in onAttach()
78 DataUsageUtils.getDefaultSubscriptionId(mSubscriptionManager)); in onAttach()
DDataUsageSetThresholdBaseFragment.java89 mNetworkTemplate = DataUsageUtils.getMobileNetworkTemplate(mTelephonyManager, in onAttach()
90 DataUsageUtils.getDefaultSubscriptionId(mSubscriptionManager)); in onAttach()
DDataUsageSummaryPreferenceController.java144 preference.setMinLabel(DataUsageUtils.bytesToIecUnits(getContext(), /* byteValue= */ 0)); in updateState()
146 DataUsageUtils.bytesToIecUnits(getContext(), mDataplanTrackingThreshold)); in updateState()
209 SubscriptionPlan primaryPlan = DataUsageUtils.getPrimaryPlan(mSubscriptionManager, in refreshDataplanInfo()
DDataUsageUtils.java42 public final class DataUsageUtils { class
47 private DataUsageUtils() { in DataUsageUtils() method in DataUsageUtils
DAppDataUsageFragment.java88 subId = DataUsageUtils.getDefaultSubscriptionId(subscriptionManager); in onAttach()
90 mNetworkTemplate = DataUsageUtils.getMobileNetworkTemplate(telephonyManager, subId); in onAttach()
DAppDataUsageTotalPreferenceController.java62 mDataUsage = DataUsageUtils.bytesToIecUnits(getContext(), usage).toString(); in setDataUsage()
/packages/apps/Settings/tests/robotests/src/com/android/settings/datausage/
DDataUsageUtilsTest.java66 final boolean hasMobileData = DataUsageUtils.hasMobileData(mContext); in mobileDataStatus_whenNetworkIsSupported()
73 final boolean hasMobileData = DataUsageUtils.hasMobileData(mContext); in mobileDataStatus_whenNetworkIsNotSupported()
79 final CharSequence formattedDataUsage = DataUsageUtils.formatDataUsage( in formatDataUsage_useIECUnit()
92 DataUsageUtils.hasEthernet(mContext); in hasEthernet_shouldQueryEthernetSummaryForUser()
/packages/apps/Car/Settings/tests/unit/src/com/android/car/settings/network/
DNetworkBasePreferenceControllerTest.java35 import com.android.car.settings.datausage.DataUsageUtils;
69 .mockStatic(DataUsageUtils.class, withSettings().lenient()) in setUp()
75 ExtendedMockito.when(DataUsageUtils.getMobileNetworkTemplate(mMockTelephonyManager, SUB_ID)) in setUp()
/packages/apps/Settings/tests/robotests/src/com/android/settings/testutils/shadow/
DShadowDataUsageUtils.java6 import com.android.settings.datausage.DataUsageUtils;
11 @Implements(DataUsageUtils.class)
/packages/apps/Settings/src/com/android/settings/datausage/lib/
DNetworkTemplates.kt24 import com.android.settings.datausage.DataUsageUtils
52 DataUsageUtils.getDefaultTemplate( in getDefaultTemplate()
/packages/apps/Car/Settings/src/com/android/car/settings/network/
DNetworkBasePreferenceController.java28 import com.android.car.settings.datausage.DataUsageUtils;
68 mNetworkTemplate = DataUsageUtils.getMobileNetworkTemplate(mTelephonyManager, subId); in setFields()
/packages/apps/Settings/tests/spa_unit/src/com/android/settings/network/telephony/
DDataUsagePreferenceControllerTest.kt33 import com.android.settings.datausage.DataUsageUtils
81 .spyStatic(DataUsageUtils::class.java) in setUp()
86 ExtendedMockito.doReturn(true).`when` { DataUsageUtils.hasMobileData(context) } in setUp()
/packages/apps/Settings/src/com/android/settings/network/telephony/
DAutoDataSwitchPreferenceController.java37 import com.android.settings.datausage.DataUsageUtils;
133 return DataUsageUtils.hasMobileData(mContext); in hasMobileData()
DDataUsagePreferenceController.kt32 import com.android.settings.datausage.DataUsageUtils in <lambda>()
57 DataUsageUtils.hasMobileData(mContext) -> AVAILABLE in <lambda>()

12