Improve notification shade collapse code.

- Collapse after dismissing the last notification
- Avoid duplicate code paths for collapsing
- Improve variable naming according to AOSP review suggestions

Change-Id: I2ff833fc1f67db8f2626c502908477d20eeed820