Dotcase: Fix brightness sticking

The UEventObserver sees the case open, so it turns on the screen and
kills the Dotcase activity. But, then the BroadcastReceiver sees the
screen turn on, so it tries to launch the Dotcase "stuff," including
setting the brightness to max. Sometimes, the order in which these
things happen causes the brightness to get set to max after the
activity is killed, and it gets stuck there until the case is closed
and opened again.

Make the switchState a class variable and, in the BroadcastReceiver,
check whether the case is open before starting any of the Dotcase
stuff.

Change-Id: I08b40bff766d8af6e467bf5be36f770566cee31f
Merge remote-tracking branch 'cm/cm-11.0' into HEAD