Fix race condition in TileSpecRepository

Before this change, after a factory reset, the list of tiles will be
empty. While CurrentTilesInteractor was processing the first emit of the
flow (default tiles), AutoAdd will try to add tiles to whatever was in
Settings (empty list), causing only those tiles to be present.

This change introduces a local cache in TileSpecSettingsRepository so
changes are applied to its value (last known value).

Test: manual, check tiles after factory reset
Test: atest TileSpecSettingsRepositoryTest
CurrentTilesInteractorImplTest
Fixes 289003025

Change-Id: I05c25ffa9206c98533647f641184dcaa819925e7
5 files changed