| Index: chrome/android/java/src/org/chromium/chrome/browser/child_accounts/ChildAccountService.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/child_accounts/ChildAccountService.java b/chrome/android/java/src/org/chromium/chrome/browser/child_accounts/ChildAccountService.java
|
| index 012513b662f534b09c9194ea6404e281264c2ff9..1b6136a09a450acc9dee2dd8acab24ee45df1651 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/child_accounts/ChildAccountService.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/child_accounts/ChildAccountService.java
|
| @@ -111,9 +111,10 @@ public class ChildAccountService {
|
| }
|
| Account account = googleAccounts[0];
|
|
|
| - if (shouldForceChildAccount(account)) {
|
| - mHasChildAccount = true;
|
| - callback.onChildAccountChecked(true);
|
| + Boolean forceChildAccount = shouldForceChildAccount(account);
|
| + if (forceChildAccount != null) {
|
| + mHasChildAccount = forceChildAccount;
|
| + callback.onChildAccountChecked(mHasChildAccount);
|
| return;
|
| }
|
|
|
| @@ -151,10 +152,12 @@ public class ChildAccountService {
|
| }}, CHILD_ACCOUNT_TIMEOUT_MS);
|
| }
|
|
|
| - private boolean shouldForceChildAccount(Account account) {
|
| + private Boolean shouldForceChildAccount(Account account) {
|
| String childAccountName = CommandLine.getInstance().getSwitchValue(
|
| ChromeSwitches.CHILD_ACCOUNT);
|
| - return childAccountName != null && account.name.equals(childAccountName);
|
| + if (childAccountName != null && account.name.equals(childAccountName)) return true;
|
| + if (!isChildAccountDetectionEnabled()) return false;
|
| + return null;
|
| }
|
|
|
| private boolean getFutureResult() {
|
| @@ -213,9 +216,14 @@ public class ChildAccountService {
|
| }
|
| }
|
|
|
| + private boolean isChildAccountDetectionEnabled() {
|
| + return nativeIsChildAccountDetectionEnabled();
|
| + }
|
| +
|
| public void onChildAccountSigninComplete() {
|
| nativeOnChildAccountSigninComplete();
|
| }
|
|
|
| + private native boolean nativeIsChildAccountDetectionEnabled();
|
| private native void nativeOnChildAccountSigninComplete();
|
| }
|
|
|