• Marc Treib's avatar
    UnifiedConsentService: fix Sync feature state checks · 93083e2e
    Marc Treib authored
    This includes two fixes:
    1) In OnStateChanged, check CanSyncFeatureStart instead of checking for
       absence of disable reasons. CanSyncFeatureStart also implies no
       disable reasons, but additionally checks that the syncing account is
       primary, meaning that Sync the *feature* can start, not just the
       transport layer.
    2) In UpdateSettingsForMigration, when determining the UKM state, add a
       check for IsSyncFeatureEnabled. The reason is that
       GetChosenDataTypes returns "all types" by default, even if Sync is
       disabled, or only the transport layer is running. So the old code
       could result in some false positives.
       This change is analogous to https://crrev.com/c/1343369.
    
    Bug: 907027
    Change-Id: Ie5eaf261b17da072dcd2cb8a596a7342e2fc8192
    Reviewed-on: https://chromium-review.googlesource.com/c/1346131Reviewed-by: default avatarThomas Tangl <tangltom@chromium.org>
    Commit-Queue: Marc Treib <treib@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#610038}
    93083e2e
unified_consent_service.cc 15.8 KB