Tell SIMs apart in Data usage settings in multi-SIM case
In multi-SIM case, multiple "Mobile" categories are shown in Data usage settings. To fix this issue, SubscriptionInfo#getDisplayName() should be used instead of "Mobile". Fixes: 62779261 Test: manual - go to Settings > Network & Internet > Data usage Author: Wu Qiang <qiang.x.wu@sonymobile.com> Change-Id: I4d95eceb24efd78ea3f3782d3a613edd2cf37d65
This commit is contained in:
committed by
Fan Zhang
parent
28c4a576d3
commit
c55ca0bf56
@@ -76,6 +76,7 @@ public class DataUsageSummary extends DataUsageBase implements Indexable, DataUs
|
||||
|
||||
private static final String KEY_STATUS_HEADER = "status_header";
|
||||
private static final String KEY_LIMIT_SUMMARY = "limit_summary";
|
||||
private static final String KEY_MOBILE_USAGE_TITLE = "mobile_category";
|
||||
private static final String KEY_WIFI_USAGE_TITLE = "wifi_category";
|
||||
|
||||
private DataUsageController mDataUsageController;
|
||||
@@ -126,7 +127,12 @@ public class DataUsageSummary extends DataUsageBase implements Indexable, DataUs
|
||||
addMobileSection(defaultSubId);
|
||||
}
|
||||
for (int i = 0; subscriptions != null && i < subscriptions.size(); i++) {
|
||||
addMobileSection(subscriptions.get(i).getSubscriptionId());
|
||||
SubscriptionInfo subInfo = subscriptions.get(i);
|
||||
if (subscriptions.size() > 1) {
|
||||
addMobileSection(subInfo.getSubscriptionId(), subInfo);
|
||||
} else {
|
||||
addMobileSection(subInfo.getSubscriptionId());
|
||||
}
|
||||
}
|
||||
mSummaryPreference.setSelectable(true);
|
||||
} else {
|
||||
@@ -179,10 +185,18 @@ public class DataUsageSummary extends DataUsageBase implements Indexable, DataUs
|
||||
}
|
||||
|
||||
private void addMobileSection(int subId) {
|
||||
addMobileSection(subId, null);
|
||||
}
|
||||
|
||||
private void addMobileSection(int subId, SubscriptionInfo subInfo) {
|
||||
TemplatePreferenceCategory category = (TemplatePreferenceCategory)
|
||||
inflatePreferences(R.xml.data_usage_cellular);
|
||||
category.setTemplate(getNetworkTemplate(subId), subId, services);
|
||||
category.pushTemplates(services);
|
||||
if (subInfo != null && !TextUtils.isEmpty(subInfo.getDisplayName())) {
|
||||
Preference title = category.findPreference(KEY_MOBILE_USAGE_TITLE);
|
||||
title.setTitle(subInfo.getDisplayName());
|
||||
}
|
||||
}
|
||||
|
||||
private void addWifiSection() {
|
||||
|
Reference in New Issue
Block a user