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 { ...@@ -178,9 +178,7 @@ public abstract class ChromiumApplication extends ContentApplication {
public Integer call() { public Integer call() {
try { try {
// Kick off checking for a child account with an empty callback. // Kick off checking for a child account with an empty callback.
ChildAccountService childAccountService = ChildAccountService.getInstance(context).checkHasChildAccount(
ChildAccountService.getInstance(context);
childAccountService.checkHasChildAccount(
new ChildAccountService.HasChildAccountCallback() { new ChildAccountService.HasChildAccountCallback() {
@Override @Override
public void onChildAccountChecked(boolean hasChildAccount) { public void onChildAccountChecked(boolean hasChildAccount) {
...@@ -189,8 +187,6 @@ public abstract class ChromiumApplication extends ContentApplication { ...@@ -189,8 +187,6 @@ public abstract class ChromiumApplication extends ContentApplication {
BrowserStartupController.get(context, LibraryProcessType.PROCESS_BROWSER) BrowserStartupController.get(context, LibraryProcessType.PROCESS_BROWSER)
.startBrowserProcessesSync(false); .startBrowserProcessesSync(false);
if (initGoogleServicesManager) initializeGoogleServicesManager(); if (initGoogleServicesManager) initializeGoogleServicesManager();
// Wait until ChildAccountManager finishes its check.
childAccountService.waitUntilFinished();
return LoaderErrors.LOADER_ERROR_NORMAL_COMPLETION; return LoaderErrors.LOADER_ERROR_NORMAL_COMPLETION;
} catch (ProcessInitException e) { } catch (ProcessInitException e) {
Log.e(TAG, "Unable to load native library.", e); Log.e(TAG, "Unable to load native library.", e);
......
...@@ -195,6 +195,8 @@ public class AccountManagementFragment extends PreferenceFragment ...@@ -195,6 +195,8 @@ public class AccountManagementFragment extends PreferenceFragment
getActivity().setTitle(fullName); getActivity().setTitle(fullName);
ChildAccountService.getInstance(getActivity()).waitUntilFinished();
configureSignOutSwitch(); configureSignOutSwitch();
configureAddAccountPreference(fullName); configureAddAccountPreference(fullName);
configureGoIncognitoPreferences(fullName); configureGoIncognitoPreferences(fullName);
......
...@@ -170,6 +170,7 @@ public class SyncCustomizationFragment extends PreferenceFragment implements ...@@ -170,6 +170,7 @@ public class SyncCustomizationFragment extends PreferenceFragment implements
displaySpinnerDialog(); displaySpinnerDialog();
} }
} }
ChildAccountService.getInstance(getActivity()).waitUntilFinished();
mSyncSwitchPreference = (ChromeSwitchPreference) findPreference(PREF_SYNC_SWITCH); mSyncSwitchPreference = (ChromeSwitchPreference) findPreference(PREF_SYNC_SWITCH);
boolean isSyncEnabled = mAndroidSyncSettings.isSyncEnabled(); 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