Skip to content
Snippets Groups Projects
Commit 3b175a0b authored by Jatin Matani's avatar Jatin Matani Committed by Android (Google) Code Review
Browse files

Merge "Check for accounts when enabling sync features."

parents 600cca16 bb277317
No related branches found
No related tags found
No related merge requests found
......@@ -118,11 +118,17 @@ public final class AccountsSettingsFragment extends SubScreenFragment {
if (!ProductionFlags.ENABLE_USER_HISTORY_DICTIONARY_SYNC) {
removeSyncPreferences();
} else {
// Temporarily disable the preferences till we can
// check that we don't have a work profile.
disableSyncPreferences();
new ManagedProfileCheckerTask(this).execute();
}
}
/**
* Task to check work profile. If found, it removes the sync prefs. If not,
* it enables them.
*/
private static class ManagedProfileCheckerTask extends AsyncTask<Void, Void, Void> {
private final AccountsSettingsFragment mFragment;
......@@ -135,7 +141,8 @@ public final class AccountsSettingsFragment extends SubScreenFragment {
if (ManagedProfileUtils.getInstance().hasWorkProfile(mFragment.getActivity())) {
mFragment.removeSyncPreferences();
} else {
mFragment.enableSyncPreferences();
mFragment.refreshAccountAndDependentPreferences(
mFragment.getSignedInAccountName());
}
return null;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment