Move UI logic to UI thread

All UI updates should happen on the UI thread. Currently, the various
callbacks in PreviewActivity are spread across different threads.
This leads to unhandled race condition when attempting to access the
PreviewActivity state.

This CL moves all activity logic to the UI thread. All non-UI logic is
already offloaded to a separate thread, so moving all UI logic to the
UI thread should provide a consistent view of the UI state.

Bug: 291133993
Test: Manually played around with PreviewActivity without any crashes.

Merged-In: I43c21206a3b815dd486646818ba569e1d0ec0080
Change-Id: I43c21206a3b815dd486646818ba569e1d0ec0080
(cherry picked from commit 68e16d807f10a5fb032be1aee26fd6e626970688)
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
1 file changed