Fix lifecycle states in QSTileImpl

QSTileImpl set the lifecycle state to DESTROYED whenever it was supposed
to stop listening. Due to the correct enforcement that this is a final
state, it couldn't be moved out of it to RESUMED.

With this CL, QSTileImpl will toggle between RESUMED and STARTED to
determine it's listening state. Objects that track its lifecycle should
listen for ON_RESUME and ON_PAUSE events (like CallbackController).

Test: manual, toggle tiles
Test: manual, observe that CallbackController#removeCallback is called
Test: atest QSTileImplTest
Fixes: 159680648
Change-Id: I00fae4f13c446af103587e5f064277e8d42a7b22
2 files changed