• Josh Nohle's avatar
    [Nearby] Support user cancellation before a connection is established · 8a194dea
    Josh Nohle authored
    Previously, a user cancellation of an outgoing share from a Chromebook
    would have no effect if a connection with the receiving device was
    not already established. (The connection is established in roughly
    a 3-second window after the share target is selected.) So, an immediate
    cancellation previously had no effect, and the transfer proceeded.
    
    In this CL, we support cancellation before a connection is established.
    We also bring the Chrome OS cancellation method more in line with the
    GmsCore implementation. Notably, we report a cancellation before
    disconnecting to provide a more accurate transfer update status of
    "cancelled" instead of "failed".
    
    Manually verified cancellation in the following scenarios:
     * sending to and receiving from a phone;
     * cancelling on both the phone and Chromebook;
     * cancelling before a connection was established, after a connection
       was established, and during a payload transfer.
    
    One scenario--cancelling a Chromebook-to-phone share from the phone
    while the payload transfer was in progress--resulted in a failure
    notification on the Chromebook instead of a cancellation notification.
    This seems unrelated to this CL, and it is being tracked in
    crbug/1155412.
    
    Fixed: 1154926
    Change-Id: I5ac141904af2fc614256b3c14e2ba3a99a984556
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2573884
    Auto-Submit: Josh Nohle <nohle@chromium.org>
    Commit-Queue: James Vecore <vecore@google.com>
    Reviewed-by: default avatarJames Vecore <vecore@google.com>
    Cr-Commit-Position: refs/heads/master@{#833627}
    8a194dea
nearby_sharing_service_impl.cc 129 KB