Commit 1c449075 authored by knn's avatar knn Committed by Commit bot

Defer waiting for child account status until it is actually used.

BUG=471229

Review URL: https://codereview.chromium.org/1039233002

Cr-Commit-Position: refs/heads/master@{#322586}
parent aa43cdeb
......@@ -178,9 +178,7 @@ public abstract class ChromiumApplication extends ContentApplication {
public Integer call() {
try {
// Kick off checking for a child account with an empty callback.
ChildAccountService childAccountService =
ChildAccountService.getInstance(context);
childAccountService.checkHasChildAccount(
ChildAccountService.getInstance(context).checkHasChildAccount(
new ChildAccountService.HasChildAccountCallback() {
@Override
public void onChildAccountChecked(boolean hasChildAccount) {
......@@ -189,8 +187,6 @@ public abstract class ChromiumApplication extends ContentApplication {
BrowserStartupController.get(context, LibraryProcessType.PROCESS_BROWSER)
.startBrowserProcessesSync(false);
if (initGoogleServicesManager) initializeGoogleServicesManager();
// Wait until ChildAccountManager finishes its check.
childAccountService.waitUntilFinished();
return LoaderErrors.LOADER_ERROR_NORMAL_COMPLETION;
} catch (ProcessInitException e) {
Log.e(TAG, "Unable to load native library.", e);
......
......@@ -195,6 +195,8 @@ public class AccountManagementFragment extends PreferenceFragment
getActivity().setTitle(fullName);
ChildAccountService.getInstance(getActivity()).waitUntilFinished();
configureSignOutSwitch();
configureAddAccountPreference(fullName);
configureGoIncognitoPreferences(fullName);
......
......@@ -170,6 +170,7 @@ public class SyncCustomizationFragment extends PreferenceFragment implements
displaySpinnerDialog();
}
}
ChildAccountService.getInstance(getActivity()).waitUntilFinished();
mSyncSwitchPreference = (ChromeSwitchPreference) findPreference(PREF_SYNC_SWITCH);
boolean isSyncEnabled = mAndroidSyncSettings.isSyncEnabled();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment