Allow renaming inactive subscriptions.

Test: manual
Bug: 132922483
Change-Id: I30b4b88ddf53b917081a57bd9a917a51b4b44ec6
This commit is contained in:
Amit Mahajan
2019-05-28 16:03:55 -07:00
parent 99162f2a35
commit e0285703b2

View File

@@ -95,13 +95,9 @@ public class RenameMobileNetworkDialogFragment extends InstrumentedDialogFragmen
builder.setTitle(R.string.mobile_network_sim_name)
.setView(view)
.setPositiveButton(R.string.mobile_network_sim_name_rename, (dialog, which) -> {
SubscriptionInfo currentInfo = mSubscriptionManager.getActiveSubscriptionInfo(
mSubId);
String newName = mNameView.getText().toString();
if (currentInfo != null && !currentInfo.getDisplayName().equals(newName)) {
mSubscriptionManager.setDisplayName(newName, mSubId,
SubscriptionManager.NAME_SOURCE_USER_INPUT);
}
mSubscriptionManager.setDisplayName(newName, mSubId,
SubscriptionManager.NAME_SOURCE_USER_INPUT);
})
.setNegativeButton(android.R.string.cancel, null);
return builder.create();