Merge "Fixed display name not saved after carrier changed" into qt-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
b346760045
@@ -99,7 +99,8 @@ public class RenameMobileNetworkDialogFragment extends InstrumentedDialogFragmen
|
|||||||
mSubId);
|
mSubId);
|
||||||
String newName = mNameView.getText().toString();
|
String newName = mNameView.getText().toString();
|
||||||
if (currentInfo != null && !currentInfo.getDisplayName().equals(newName)) {
|
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);
|
.setNegativeButton(android.R.string.cancel, null);
|
||||||
|
@@ -102,7 +102,7 @@ public class RenameMobileNetworkDialogFragmentTest {
|
|||||||
final Button negativeButton = dialog.getButton(DialogInterface.BUTTON_NEGATIVE);
|
final Button negativeButton = dialog.getButton(DialogInterface.BUTTON_NEGATIVE);
|
||||||
negativeButton.performClick();
|
negativeButton.performClick();
|
||||||
|
|
||||||
verify(mSubscriptionMgr, never()).setDisplayName(anyString(), anyInt());
|
verify(mSubscriptionMgr, never()).setDisplayName(anyString(), anyInt(), anyInt());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -118,7 +118,8 @@ public class RenameMobileNetworkDialogFragmentTest {
|
|||||||
positiveButton.performClick();
|
positiveButton.performClick();
|
||||||
|
|
||||||
final ArgumentCaptor<String> captor = ArgumentCaptor.forClass(String.class);
|
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");
|
assertThat(captor.getValue()).isEqualTo("test2");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user