Update datausage for DataUsagePreferenceController
Data usage number was wrong because we didn't set correct subId, this CL fixes this issue. Bug: 132113657 Test: RunSettingsRoboTests Change-Id: If7c9cf2f4709d9a8e5f9a154c02de9484800d6d5
This commit is contained in:
@@ -178,9 +178,10 @@ public final class DataUsageUtils {
|
||||
* Returns the default network template based on the availability of mobile data, Wifi. Returns
|
||||
* ethernet template if both mobile data and Wifi are not available.
|
||||
*/
|
||||
static NetworkTemplate getDefaultTemplate(Context context, int defaultSubId) {
|
||||
public static NetworkTemplate getDefaultTemplate(Context context, int defaultSubId) {
|
||||
if (hasMobileData(context) && defaultSubId != SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
|
||||
TelephonyManager telephonyManager = TelephonyManager.from(context);
|
||||
TelephonyManager telephonyManager = TelephonyManager.from(context)
|
||||
.createForSubscriptionId(defaultSubId);
|
||||
NetworkTemplate mobileAll = NetworkTemplate.buildTemplateMobileAll(
|
||||
telephonyManager.getSubscriberId(defaultSubId));
|
||||
return NetworkTemplate.normalize(mobileAll,
|
||||
|
Reference in New Issue
Block a user