Merge "Fixed display name not saved after carrier changed" into qt-dev
diff --git a/src/com/android/settings/network/telephony/RenameMobileNetworkDialogFragment.java b/src/com/android/settings/network/telephony/RenameMobileNetworkDialogFragment.java
index 488f930..7a131d7 100644
--- a/src/com/android/settings/network/telephony/RenameMobileNetworkDialogFragment.java
+++ b/src/com/android/settings/network/telephony/RenameMobileNetworkDialogFragment.java
@@ -99,7 +99,8 @@
                             mSubId);
                     String newName = mNameView.getText().toString();
                     if (currentInfo != null && !currentInfo.getDisplayName().equals(newName)) {
-                        mSubscriptionManager.setDisplayName(newName, mSubId);
+                        mSubscriptionManager.setDisplayName(newName, mSubId,
+                                SubscriptionManager.NAME_SOURCE_USER_INPUT);
                     }
                 })
                 .setNegativeButton(android.R.string.cancel, null);
diff --git a/tests/robotests/src/com/android/settings/network/telephony/RenameMobileNetworkDialogFragmentTest.java b/tests/robotests/src/com/android/settings/network/telephony/RenameMobileNetworkDialogFragmentTest.java
index df52302..70816ea 100644
--- a/tests/robotests/src/com/android/settings/network/telephony/RenameMobileNetworkDialogFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/network/telephony/RenameMobileNetworkDialogFragmentTest.java
@@ -102,7 +102,7 @@
         final Button negativeButton = dialog.getButton(DialogInterface.BUTTON_NEGATIVE);
         negativeButton.performClick();
 
-        verify(mSubscriptionMgr, never()).setDisplayName(anyString(), anyInt());
+        verify(mSubscriptionMgr, never()).setDisplayName(anyString(), anyInt(), anyInt());
     }
 
     @Test
@@ -118,7 +118,8 @@
         positiveButton.performClick();
 
         final ArgumentCaptor<String> captor = ArgumentCaptor.forClass(String.class);
-        verify(mSubscriptionMgr).setDisplayName(captor.capture(), eq(mSubscriptionId));
+        verify(mSubscriptionMgr).setDisplayName(captor.capture(), eq(mSubscriptionId),
+                eq(SubscriptionManager.NAME_SOURCE_USER_INPUT));
         assertThat(captor.getValue()).isEqualTo("test2");
     }