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

Commit 32dc8e1c authored by Makoto Onuki's avatar Makoto Onuki Committed by Android (Google) Code Review
Browse files

Merge "Group editor: Just close activity when there's no accounts"

parents e2405a56 94f216b2
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -146,6 +146,11 @@ public class GroupEditorActivity extends ContactsActivity
            finish();
        }

        @Override
        public void onAccountsNotFound() {
            finish();
        }

        @Override
        public void onSaveFinished(int resultCode, Intent resultIntent) {
            // TODO: Collapse these 2 cases into 1 that will just launch an intent with the VIEW
+10 −1
Original line number Diff line number Diff line
@@ -107,6 +107,11 @@ public class GroupEditorFragment extends Fragment implements SelectAccountDialog
         * Contact was saved and the Fragment can now be closed safely.
         */
        void onSaveFinished(int resultCode, Intent resultIntent);

        /**
         * Fragment is created but there's no accounts set up.
         */
        void onAccountsNotFound();
    }

    private static final int LOADER_GROUP_METADATA = 1;
@@ -308,7 +313,11 @@ public class GroupEditorFragment extends Fragment implements SelectAccountDialog
                AccountTypeManager.getInstance(mContext).getAccounts(true /* writeable */);
        // No Accounts available
        if (accounts.isEmpty()) {
            throw new IllegalStateException("No accounts were found.");
            Log.e(TAG, "No accounts were found.");
            if (mListener != null) {
                mListener.onAccountsNotFound();
            }
            return;
        }

        // In the common case of a single account being writable, auto-select