• Friedrich Horschig's avatar
    [Android][Mfill] Cache subsqeuent accessory sheet updates · f8b0c3b3
    Friedrich Horschig authored
    Currently, the keyboard accessory may show stale suggestions. This is
    because sheets are cached by adding them with `emplace` to a flat_map.
    `emplace` only adds an item if it isn't present, so the oldest,
    non-empty sheet (for a given tab) will be shown forever. This isn't
    immediately obvious since sheets are also pushed directly when they are
    updated but with indirect updates (e.g. updating another sheet), the
    stale value will override the new one.
    
    By using `insert_or_assign`, the newer value replaces the old one.
    
    Bug: 1140358, 1134119
    Change-Id: I933ec47a1da596f58fa99d5b9bc481954122c2a3
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2489899Reviewed-by: default avatarVasilii Sukhanov <vasilii@chromium.org>
    Commit-Queue: Friedrich [CET] <fhorschig@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#820165}
    f8b0c3b3
manual_filling_controller_impl_unittest.cc 15 KB