• James Cook's avatar
    cros: Migrate PrivetNotificationService to consent aware identity API · b09b9b4d
    James Cook authored
    PrivetNotificationService uses IdentityManager::HasPrimaryAccount
    to detect if a Profile is for a signed-in user. However, that method
    returns false if the user has not consented to browser sync.
    
    Historically all Chrome OS users were consented to browser sync, but
    the SplitSettingsSync project is making it possible for users to
    opt-out.
    
    Change the call site to the new API, indicating that browser sync
    consent is not required. The updated call returns true for any
    signed-in user.
    
    See go/cros-primary-account and go/consent-aware-api-dd
    
    Also fix the startup delay timing, which was trying to generate
    a TimeDelta between 0 and 1.25 seconds, but always chose exactly
    0 or exactly 1.
    
    Bug: 349098, 1042400, 1046746
    Test: added to unit_tests
    Change-Id: Ic7484428cd718937173d5097e57672d74c8db614
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2055963Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
    Commit-Queue: James Cook <jamescook@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#741299}
    b09b9b4d
privet_notifications.h 5.5 KB