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

Commit 7470d095 authored by Sean Liu's avatar Sean Liu Committed by Android (Google) Code Review
Browse files

Merge "Deleting obsolete code and changing code structure since we stop...

Merge "Deleting obsolete code and changing code structure since we stop prompting user to add account when no account available Bug:25161189"
parents bbdcd52b 10be3bf8
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -144,12 +144,6 @@ public class ContactsUtils {
        return TextUtils.equals(a.getAction(), b.getAction());
    }

    public static boolean areContactWritableAccountsAvailable(Context context) {
        final List<AccountWithDataSet> accounts =
                AccountTypeManager.getInstance(context).getAccounts(true /* writeable */);
        return !accounts.isEmpty();
    }

    public static boolean areGroupWritableAccountsAvailable(Context context) {
        final List<AccountWithDataSet> accounts =
                AccountTypeManager.getInstance(context).getGroupWritableAccounts();
+14 −0
Original line number Diff line number Diff line
@@ -22,7 +22,9 @@ import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.net.Uri;
import android.os.Build;
import android.provider.ContactsContract;
import android.provider.ContactsContract.QuickContact;
import android.provider.Settings;
import android.text.TextUtils;

import java.util.List;
@@ -101,6 +103,18 @@ public class ImplicitIntentsUtil {
        return intent;
    }

    /**
     * When adding account
     * open the same UI screen for user to choose account
     */
    public static Intent getIntentForAddingAccount() {
        final Intent intent = new Intent(Settings.ACTION_ADD_ACCOUNT);
        intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
        intent.putExtra(Settings.EXTRA_AUTHORITIES,
                new String[]{ContactsContract.AUTHORITY});
        return intent;
    }

    /**
     * Returns a copy of {@param intent} with a class name set, if a class inside this app
     * has a corresponding intent filter.