Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 948becd7 authored by Sayantan Roychowdhury's avatar Sayantan Roychowdhury Committed by Nishith Khanna
Browse files

Issue 1776: Default to phone-only if no account

parent 487d1183
Loading
Loading
Loading
Loading
+4 −29
Original line number Diff line number Diff line
@@ -171,36 +171,11 @@ public class ContactEditorAccountsChangedActivity extends Activity
                }
            });
        } else {
            // If the user has 0 writable accounts, we will just show the user a message with 2
            // possible action buttons.
            view = View.inflate(this,
                    R.layout.contact_editor_accounts_changed_activity_with_text, null);

            final TextView textView = (TextView) view.findViewById(R.id.text);
            final Button leftButton = (Button) view.findViewById(R.id.left_button);
            final Button rightButton = (Button) view.findViewById(R.id.right_button);

            textView.setText(getString(R.string.contact_editor_prompt_zero_accounts));

            // This button allows the user to continue editing the contact as a phone-only
            // local contact.
            leftButton.setText(getString(android.R.string.cancel));
            leftButton.setOnClickListener(new OnClickListener() {
                @Override
                public void onClick(View v) {
                    // Remember that the user wants to create local contacts, so the user is not
                    // prompted again with this activity.
                    saveAccountAndReturnResult(AccountWithDataSet.getLocalAccount(
                            ContactEditorAccountsChangedActivity.this));
            // If the user has 0 writable accounts, default to device contact
            view = new View(this);
            saveAccountAndReturnResult(AccountWithDataSet.getNullAccount());
            finish();
        }
            });

            // This button allows the user to add a new account to the device and return to
            // this app afterwards.
            rightButton.setText(getString(R.string.add_account));
            rightButton.setOnClickListener(mAddAccountClickListener);
        }

        if (mDialog != null && mDialog.isShowing()) {
            mDialog.dismiss();