• Michael Thiessen's avatar
    Implement Intent-less LaunchCauseMetrics · 2971d024
    Michael Thiessen authored
    Implements LaunchCauseMetrics for launch types that don't involve
    intents - Recents, Back, and Power button.
    
    It's not possible to distinguish between Back and Recents in all cases.
    However, when the Activity is killed in the background, and then
    restored from Recents, Android adds a flag to the intent we can look
    at. Also, when Chrome does not receive a UserLeaveHint when going to
    the background, we can be sure that the Back button will not return
    the user to that Chrome Activity.
    
    We can detect resume by power button by looking at whether the
    screen is off when Chrome is paused. (If Chrome happens to be killed
    while the screen is off, the launcher is shown on screen on)
    
    These changes range from extremely difficult to impossible to
    integration test as you would need control of multiple apps for some,
    and the ability to manipulate the Recents screen in others. I've opted
    for unit testing here, and have manually tested every situation I could
    think of in both CTA and CCT.
    
    Bug: 1163961
    Change-Id: I86a00dcf7333a22da724a1b26be2c5bcf5236cc3
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2625909
    Commit-Queue: Michael Thiessen <mthiesse@chromium.org>
    Reviewed-by: default avatarTed Choc <tedchoc@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#843898}
    2971d024
enums.xml 3.44 MB
The source could not be displayed because it is larger than 1 MB. You can load it anyway or download it instead.