Index: chrome/android/java/src/org/chromium/chrome/browser/childaccounts/ChildAccountService.java |
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/childaccounts/ChildAccountService.java b/chrome/android/java/src/org/chromium/chrome/browser/childaccounts/ChildAccountService.java |
index 856da364c1a57ff19f32bbce32a2633baec69859..cb732e0c61b2856ba32e1383c4848da8254d7d8f 100644 |
--- a/chrome/android/java/src/org/chromium/chrome/browser/childaccounts/ChildAccountService.java |
+++ b/chrome/android/java/src/org/chromium/chrome/browser/childaccounts/ChildAccountService.java |
@@ -9,18 +9,23 @@ import android.content.Context; |
import org.chromium.base.Callback; |
import org.chromium.base.ThreadUtils; |
+import org.chromium.base.annotations.CalledByNative; |
import org.chromium.components.signin.AccountManagerHelper; |
/** |
- * This class serves as a simple interface for querying the child account information. |
- * It has two methods namely, checkHasChildAccount(...) which is asynchronous and queries the |
- * system directly for the information and the synchronous isChildAccount() which asks the native |
- * side assuming it has been set correctly already. |
+ * This class serves as a simple interface for querying the child account information. It has two |
+ * methods for querying the child account information; checkHasChildAccount(...) which is |
+ * asynchronous and queries the system directly for the information and the synchronous |
+ * isChildAccount() which asks the native side assuming it has been set correctly already. |
* |
* The former method is used by ForcedSigninProcessor and FirstRunFlowSequencer to detect child |
- * accounts since the native side is only activated on signing in. |
- * Once signed in by the ForcedSigninProcessor, the ChildAccountInfoFetcher will notify the native |
- * side and also takes responsibility for monitoring changes and taking a suitable action. |
+ * accounts since the native side is only activated on signing in. Once signed in by the |
+ * ForcedSigninProcessor, the ChildAccountInfoFetcher will notify the native side and also takes |
+ * responsibility for monitoring changes and taking a suitable action. |
+ * |
+ * The class also provides an interface through which a client can listen for child account status |
+ * changes. When the SupervisedUserContentProvider forces sign-in it waits for a status change |
+ * before querying the URL filters. |
*/ |
public class ChildAccountService { |
private ChildAccountService() { |
@@ -57,5 +62,16 @@ public class ChildAccountService { |
return nativeIsChildAccount(); |
} |
+ public static void listenForStatusChange(Runnable callback) { |
Bernhard Bauer
2017/02/15 15:09:37
Javadoc for public methods. In particular, when an
aberent
2017/02/15 18:34:46
Done.
|
+ nativeListenForChildStatusReceived(callback); |
+ } |
+ |
+ @CalledByNative |
+ private static void childStatusReceived(Runnable callback) { |
+ callback.run(); |
+ } |
+ |
private static native boolean nativeIsChildAccount(); |
+ |
+ private static native void nativeListenForChildStatusReceived(Runnable callback); |
} |