• wutao's avatar
    ambient: Do not interrupt video wake lock · 455bfb16
    wutao authored
    When ambient mode starts and exits, it will change the video visibility
    and update the video wake lock.
    For example, when a video is playing in browser, it will request a video
    wake lock to prevent screen dim and off. However, when we lock the
    screen while playing the video in an active tab, the ambient mode will
    start after several seconds. Ambient widget covers the fullscreen and
    change the browser visibility to not visible and release the video wake
    lock. After some time, screen is turned off and ambient mode exits. The
    browser visibility becomes visible again and acquire the video wake lock
    again and turn on the screen. The screen on event will start ambient
    mode in a few seconds again.
    
    To fix this bug, we set the opacity of the ambient widget to be
    translucent, which will not change the browser visibility and therefore
    the video wake lock. As long as the video wake lock is held, the ambient
    mode will not exit since there is no dim event.
    
    Bug: b/173806284
    Test: manual
    Change-Id: I0bb7f3c8f6fdeb04d9831a85ffe97eeb769f3b7e
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2612386
    Commit-Queue: Tao Wu <wutao@chromium.org>
    Reviewed-by: default avatarXiaohui Chen <xiaohuic@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#841137}
    455bfb16
ambient_controller.cc 23.4 KB