• Xing Liu's avatar
    Download: Retrieve display names for all downloads. · aed51f5d
    Xing Liu authored
    This CL fixes a bug that download may disappear on Android Q after
    they are completed.
    
    We query and cache the display names from media store only when there
    are more than 0 in progress downloads. So the cache might be empty and
    we use the cache for completed download as well, which result in
    missing display name and download history db recorded being removed.
    
    Also directly check Android version in c++. The current code loads Q
    API when loading Java static methods in DownloadCollectionBridge, which
    triggers disk read violation on Android P.
    
    Bug: 1106286
    Change-Id: I2338a665a2147154ffd20df447fe74b84a8c8738
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2314299
    Commit-Queue: Xing Liu <xingliu@chromium.org>
    Reviewed-by: default avatarMin Qin <qinmin@chromium.org>
    Reviewed-by: default avatarDavid Trainor <dtrainor@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#791631}
    aed51f5d
download_collection_bridge.cc 7.37 KB