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

Commit c650dc96 authored by Tingting Wang's avatar Tingting Wang Committed by android-build-merger
Browse files

Merge "Set default account when there\'s only one writable account." into ub-contactsdialer-b-dev

am: 0e368b0a

* commit '0e368b0a':
  Set default account when there's only one writable account.
parents 4fbd086c 0e368b0a
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -148,6 +148,11 @@ public class ContactEditorUtils {
     * Also note that the returned account may have been removed already.
     */
    public AccountWithDataSet getDefaultAccount() {
        final List<AccountWithDataSet> currentWritableAccounts = getWritableAccounts();
        if (currentWritableAccounts.size() == 1) {
            return currentWritableAccounts.get(0);
        }

        final String saved = mPrefs.getString(mDefaultAccountKey, null);
        if (TextUtils.isEmpty(saved)) {
            return null;