Use TelephonyManager api to get SPN of sim to display in UI.

Bug: 19476304
Change-Id: Ia16465584cf31858bbf1ae36cfdbf21184de10d7
This commit is contained in:
Sanket Padawe
2015-02-24 13:30:33 -08:00
parent 7e21fa5ab4
commit 8f77f435d8

View File

@@ -365,8 +365,14 @@ public class SimSettings extends RestrictedSettingsFragment implements Indexable
numberView.setText(PhoneNumberUtils.formatNumber(rawNumber));
}
final TelephonyManager tm =
(TelephonyManager) getActivity().getSystemService(
Context.TELEPHONY_SERVICE);
String simCarrierName = tm.getSimOperatorNameForSubscription(mSubInfoRecord
.getSubscriptionId());
TextView carrierView = (TextView)dialogLayout.findViewById(R.id.carrier);
carrierView.setText(mSubInfoRecord.getCarrierName());
carrierView.setText(!TextUtils.isEmpty(simCarrierName) ? simCarrierName :
getContext().getString(com.android.internal.R.string.unknownName));
builder.setTitle(String.format(res.getString(R.string.sim_editor_title),
(mSubInfoRecord.getSimSlotIndex() + 1)));