Commit a6e7eef0 authored by Boris Sazonov's avatar Boris Sazonov Committed by Commit Bot

[Signin][Android] Remove onPolicyFetchedBeforeSignIn

Bug: None
Change-Id: I44ce5e128389a0a64f310e5b6d9d26a0ae231710
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1823118
Auto-Submit: Boris Sazonov <bsazonov@chromium.org>
Reviewed-by: default avatarPâris Meuleman <pmeuleman@chromium.org>
Reviewed-by: default avatarAlex Ilin <alexilin@chromium.org>
Commit-Queue: Boris Sazonov <bsazonov@chromium.org>
Cr-Commit-Position: refs/heads/master@{#700302}
parent 4f49f218
...@@ -451,19 +451,16 @@ public class SigninManager ...@@ -451,19 +451,16 @@ public class SigninManager
assert mSignInState.mCoreAccountInfo != null; assert mSignInState.mCoreAccountInfo != null;
Log.d(TAG, "Checking if account has policy management enabled"); Log.d(TAG, "Checking if account has policy management enabled");
fetchAndApplyCloudPolicy(mSignInState.mCoreAccountInfo, this::onPolicyFetchedBeforeSignIn); fetchAndApplyCloudPolicy(
mSignInState.mCoreAccountInfo, this::finishSignInAfterPolicyEnforced);
} }
@VisibleForTesting
/** /**
* If the user is managed, its policy has been fetched and is being enforced; features like sync * Finishes the sign-in flow. If the user is managed, the policy should be fetched and enforced
* may now be disabled by policy, and the rest of the sign-in flow can be resumed. * before calling this method.
*/ */
void onPolicyFetchedBeforeSignIn() { @VisibleForTesting
finishSignIn(); void finishSignInAfterPolicyEnforced() {
}
private void finishSignIn() {
// This method should be called at most once per sign-in flow. // This method should be called at most once per sign-in flow.
assert mSignInState != null && mSignInState.mCoreAccountInfo != null; assert mSignInState != null && mSignInState.mCoreAccountInfo != null;
......
...@@ -245,7 +245,7 @@ public class SigninManagerTest { ...@@ -245,7 +245,7 @@ public class SigninManagerTest {
mSigninManager.runAfterOperationInProgress(callCount::incrementAndGet); mSigninManager.runAfterOperationInProgress(callCount::incrementAndGet);
assertEquals(0, callCount.get()); assertEquals(0, callCount.get());
mSigninManager.onPolicyFetchedBeforeSignIn(); mSigninManager.finishSignInAfterPolicyEnforced();
assertFalse(mSigninManager.isOperationInProgress()); assertFalse(mSigninManager.isOperationInProgress());
assertEquals(1, callCount.get()); assertEquals(1, callCount.get());
} }
......
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