Use CharSequence for DisplayName

Change-Id: I2601eb9dc1edf585ad3b48da9fb97c65cb1face5
This commit is contained in:
Stuart Scott
2014-11-04 14:52:23 -08:00
parent 508a693c9a
commit b153181c9c
2 changed files with 7 additions and 3 deletions

View File

@@ -710,7 +710,7 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable
/** /**
* Build {@link TabSpec} with thin indicator, and empty content. * Build {@link TabSpec} with thin indicator, and empty content.
*/ */
private TabSpec buildTabSpec(String tag, String title) { private TabSpec buildTabSpec(String tag, CharSequence title) {
return mTabHost.newTabSpec(tag).setIndicator(title).setContent( return mTabHost.newTabSpec(tag).setIndicator(title).setContent(
mEmptyTabContent); mEmptyTabContent);
} }
@@ -2590,7 +2590,7 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable
for (SubInfoRecord subInfo : mSubInfoList) { for (SubInfoRecord subInfo : mSubInfoList) {
if (hasReadyMobileRadio(context, subInfo.getSubscriptionId())) { if (hasReadyMobileRadio(context, subInfo.getSubscriptionId())) {
mTabHost.addTab(buildTabSpec(mMobileTagMap.get(subInfo.getSubscriptionId()), mTabHost.addTab(buildTabSpec(mMobileTagMap.get(subInfo.getSubscriptionId()),
subInfo.getDisplayName().toString())); subInfo.getDisplayName()));
} }
} }
} }

View File

@@ -370,7 +370,11 @@ public class SimSettings extends RestrictedSettingsFragment implements Indexable
} else { } else {
for (int i = 0; i < selectableSubInfoLength; ++i) { for (int i = 0; i < selectableSubInfoLength; ++i) {
final SubInfoRecord sir = mSelectableSubInfos.get(i); final SubInfoRecord sir = mSelectableSubInfos.get(i);
list.add(sir.getDisplayName().toString()); CharSequence displayName = sir.getDisplayName();
if (displayName == null) {
displayName = "";
}
list.add(displayName.toString());
} }
} }