Fix settings dialog offering ReferencePreviews when unavailable
Open questions:
- It is possible to make the patch smaller in case this makes it easier to backport it. Is this worth it?
- This code is not covered by any test. I think it's worth writing tests. Most of this code will stay, even after beta.
Bug: T281352
Change-Id: I5f30054f1664643b427909f7fa189b4ea5e11879
(cherry picked from commit 75155a076a0629cadb59f85a38a29bee16114c5a)