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

Commit 8be7701c authored by Walter Jang's avatar Walter Jang
Browse files

Open the old add account Settings Activity

..that filters on contacts providers when
you click "Accounts" in the Contacts app settings.

Bug 29184035

Change-Id: I0c9c727b128d25e00661a77b743b8c91d32893b6
parent f99acf71
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -300,8 +300,8 @@ public class DisplayOptionsPreferenceFragment extends PreferenceFragment
            ImplicitIntentsUtil.startActivityInApp(getActivity(), intent);
            return true;
        } else if (KEY_ACCOUNTS.equals(prefKey)) {
            final Intent intent = ImplicitIntentsUtil.getIntentForAccounts();
            ImplicitIntentsUtil.startActivityOutsideApp(getContext(), intent);
            ImplicitIntentsUtil.startActivityOutsideApp(getContext(),
                    ImplicitIntentsUtil.getIntentForAddingAccount());
            return true;
        } else if (KEY_BLOCKED_NUMBERS.equals(prefKey)) {
            final Intent intent = TelecomManagerUtil.createManageBlockedNumbersIntent(
+2 −12
Original line number Diff line number Diff line
@@ -104,8 +104,8 @@ public class ImplicitIntentsUtil {
    }

    /**
     * When adding account
     * open the same UI screen for user to choose account
     * Returns an Intent to open the Settings add account activity filtered to only
     * display contact provider account types.
     */
    public static Intent getIntentForAddingAccount() {
        final Intent intent = new Intent(Settings.ACTION_ADD_ACCOUNT);
@@ -115,16 +115,6 @@ public class ImplicitIntentsUtil {
        return intent;
    }

    /**
     * Starts Accounts activity in OS->Settings->Accounts.
     */
    public static Intent getIntentForAccounts() {
        final Intent intent = new Intent(Settings.ACTION_SYNC_SETTINGS);
        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.