summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSanket Padawe <sanketpadawe@google.com>2015-02-12 23:50:02 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-02-12 23:50:02 +0000
commit24401dfea093e0590487f955df95e437e962cdc8 (patch)
treee4bd336b04da3011275cf2a3da884923a37ba5b5
parent6d1193e2da4dd372dbfdf9057e1fb18282e77318 (diff)
parent7e21fa5ab4f867263088a38ed279d889b902a05b (diff)
downloadpackages_apps_Settings-24401dfea093e0590487f955df95e437e962cdc8.zip
packages_apps_Settings-24401dfea093e0590487f955df95e437e962cdc8.tar.gz
packages_apps_Settings-24401dfea093e0590487f955df95e437e962cdc8.tar.bz2
am 7e21fa5a: Data Usage tab title should say "Cellular" with only 1 sim and wifi tab.
* commit '7e21fa5ab4f867263088a38ed279d889b902a05b': Data Usage tab title should say "Cellular" with only 1 sim and wifi tab.
-rw-r--r--src/com/android/settings/DataUsageSummary.java17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/com/android/settings/DataUsageSummary.java b/src/com/android/settings/DataUsageSummary.java
index ce68e3d..c4c79d1 100644
--- a/src/com/android/settings/DataUsageSummary.java
+++ b/src/com/android/settings/DataUsageSummary.java
@@ -670,10 +670,12 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable
final Context context = getActivity();
mTabHost.clearAllTabs();
- for (int i = 0; i < mTelephonyManager.getSimCount(); i++) {
+ int simCount = mTelephonyManager.getSimCount();
+
+ for (int i = 0; i < simCount; i++) {
final SubscriptionInfo sir = Utils.findRecordBySlotId(context, i);
if (sir != null) {
- addMobileTab(context, sir);
+ addMobileTab(context, sir, (simCount > 1));
}
}
@@ -2672,11 +2674,16 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable
}
};
- private void addMobileTab(Context context, SubscriptionInfo subInfo) {
+ private void addMobileTab(Context context, SubscriptionInfo subInfo, boolean isMultiSim) {
if (subInfo != null && mMobileTagMap != null) {
if (hasReadyMobileRadio(context, subInfo.getSubscriptionId())) {
- mTabHost.addTab(buildTabSpec(mMobileTagMap.get(subInfo.getSubscriptionId()),
- subInfo.getDisplayName()));
+ if (isMultiSim) {
+ mTabHost.addTab(buildTabSpec(mMobileTagMap.get(subInfo.getSubscriptionId()),
+ subInfo.getDisplayName()));
+ } else {
+ mTabHost.addTab(buildTabSpec(mMobileTagMap.get(subInfo.getSubscriptionId()),
+ R.string.data_usage_tab_mobile));
+ }
}
} else {
if (LOGD) Log.d(TAG, "addMobileTab: subInfoList is null");