Prevent user from creating duplicate labels.
This isn't enforced at the data layer just in the UI's that
allow editting of the group name.
Bug 28718604
Change-Id: I969b0298bd895fdbdd7f8609da05f2b801707c0a
(cherry picked from commit 8d62cd2c5c855fd5483c030c1d59e50830ce4dfc)
diff --git a/src/com/android/contacts/ContactsDrawerActivity.java b/src/com/android/contacts/ContactsDrawerActivity.java
index c8d8eb3..bea1411 100644
--- a/src/com/android/contacts/ContactsDrawerActivity.java
+++ b/src/com/android/contacts/ContactsDrawerActivity.java
@@ -88,8 +88,7 @@
AccountFiltersListener,
GroupsListener,
NavigationView.OnNavigationItemSelectedListener,
- SelectAccountDialogFragment.Listener,
- GroupNameEditDialogFragment.Listener {
+ SelectAccountDialogFragment.Listener {
protected static String TAG = "ContactsDrawerActivity";
@@ -650,26 +649,11 @@
@Override
public void onAccountChosen(AccountWithDataSet account, Bundle extraArgs) {
mNewGroupAccount = account;
- GroupNameEditDialogFragment.showInsertDialog(
- getFragmentManager(), TAG_GROUP_NAME_EDIT_DIALOG);
+ GroupNameEditDialogFragment.newInstanceForCreation(mNewGroupAccount, ACTION_CREATE_GROUP)
+ .show(getFragmentManager(), TAG_GROUP_NAME_EDIT_DIALOG);
}
@Override
public void onAccountSelectorCancelled() {
}
-
- @Override
- public void onGroupNameEdit(String groupName, boolean isInsert) {
- if (mNewGroupAccount == null) {
- Toast.makeText(this, R.string.groupCreateFailedToast, Toast.LENGTH_SHORT).show();
- return;
- }
- startService(ContactSaveService.createNewGroupIntent(this,
- mNewGroupAccount, groupName, /* rawContactsToAdd */ null, getClass(),
- ACTION_CREATE_GROUP));
- }
-
- @Override
- public void onGroupNameEditCancelled() {
- }
}