Settings: only set phone number if it's not empty

Only set the phone number in Rename mobile network dialog if it's not
empty in order to preserve the ´Not available´ -text.

Test: m, open ´SIMs´ in settings, click Pen-icon to edit SIM, verify
      either mobile number or ´Not available´ -text is shown.
Change-Id: I3bc1f1f4eb26cda38e5cc7a12bd4db1bf922f076
This commit is contained in:
Timi Rautamäki
2021-12-13 16:10:40 +00:00
committed by Tsung-Mao Fang
parent 4041027433
commit 46f8b18446

View File

@@ -184,7 +184,10 @@ public class RenameMobileNetworkDialogFragment extends InstrumentedDialogFragmen
phoneTitle.setVisibility(info.isOpportunistic() ? View.GONE : View.VISIBLE);
final TextView phoneNumber = view.findViewById(R.id.number_value);
phoneNumber.setText(DeviceInfoUtils.getBidiFormattedPhoneNumber(getContext(), info));
final String pn = DeviceInfoUtils.getBidiFormattedPhoneNumber(getContext(), info);
if (!TextUtils.isEmpty(pn)) {
phoneNumber.setText(pn);
}
}
@Override