• derat's avatar
    Use PowerSaveBlocker for audio and video on Chrome OS. · f3c302a3
    derat authored
    PowerSaveBlocker objects are constructed in response to web
    audio and video to keep the system from suspending or
    turning its display off. Historically, this was not used on
    Chrome OS, as Chrome OS has alternate mechanisms for
    detecting audio and video activity and using
    PowerSaveBlocker would interfere with enterprise
    power-management-policy prefs to ignore audio and video
    activity.
    
    However, low-framerate video, such as that used by WebRTC
    for Hangouts screen-sharing, can fail to trigger Chrome OS's
    video detection code, resulting in the screen being turned
    off while in use. This change renames PowerSaveBlocker's
    human-readable "reason" field to "description" and adds a
    new Reason enum that Chrome OS uses to identify and ignore
    audio- or video-triggered PowerSaveBlockers if needed.
    
    BUG=354723,176405
    TEST=watch /var/log/power_manager/powerd.LATEST on chrome os
         while on the receiving end of a screen-sharing hangout
         and observe that a policy is sent forcing the screen on
    
    Review URL: https://codereview.chromium.org/946643002
    
    Cr-Commit-Position: refs/heads/master@{#317612}
    f3c302a3
power_policy_controller.cc 13.5 KB