Extract dozing parts of StatusBarState logic out of onStateChanged

Status bar used to be calling updateDozingState every time the state
changed. When moving to StatusBarStateController however, the state
change callbacks happen less often (due to not triggering callbacks if
the state doesn't actually change). Because of this, the status bar
lost the opportunity to collapse the panel when AOD got triggered.

To fix it, I've started to transition StatusBar#mDozing to be a state on
SbStateController. This way related classes can get callbacks when the
state OR dozing chnages.

The actual bit that fixes the collapsing of the panel is to put the
logic for collapsing in the state change for dozing rather than SbState.

Change-Id: Ibabfdbfdc2e96d1f44b1d50b10e2ffdbe01a2293
Fixes: 114300041
Test: expand QS on keyguard and power screen off
Test: atest SystemUITests
2 files changed