Merge "Allow renaming inactive subscriptions." into qt-dev

This commit is contained in:
TreeHugger Robot
2019-05-29 18:16:40 +00:00
committed by Android (Google) Code Review

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();