• Risan's avatar
    Split Removable Media Watchers to be one per media · 643971b5
    Risan authored
    Currently, Removable Media is watched at the top-level directory under
    /media/removable. Unfortunately, this only works if the removable media
    was attached before the inotify is attached (since inotify does not
    detect mount event).
    
    This changes listen to the mount events from cros-disks through
    ArcVolumeManager (to synchronize with Android volume mounting) and
    create a FilePathWatcher per removable media.
    
    BUG=b:150883493
    TEST=Mount invisible removable media, the media changes are indexed.
    TEST=Reboot DUT with non-visible removable media attached, still indexed.
    TEST=Change the removable media to be visible, still indexed.
    TEST=Reboot DUT with visible media attached, still indexed
    TEST=Change the removable media to be invisible, still indexed.
    
    Change-Id: Ia02012676681e025431d74f2c3f9b951a77ca783
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2362376
    Auto-Submit: Risan <risan@chromium.org>
    Reviewed-by: default avatarYusuke Sato <yusukes@chromium.org>
    Reviewed-by: default avatarRyo Hashimoto <hashimoto@chromium.org>
    Commit-Queue: Risan <risan@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#806716}
    643971b5
arc_volume_mounter_bridge.cc 10.6 KB