Improve transient bar transitions.

1. If app clears transient flag w/ a gesture, the touch-outside
listener would always win, causing an unsightly hide + immediate
reshow.  Instead, give the app some time to clear the flag, then
perform a smooth transition in place.

2. When the transient bars are hidden, we do not know ahead of time
which background will be used on reshow (if transient bars are
revealed, the background is semi-transparent, if transient bars
are cleared, the background is opaque).  Window manager is responsible
for showing windows, but sysui is responsible for setting the view
background.  Therefore, we need some level of coordination between
the two in this case.  Introduce two new non-public sysui flags
that represent the window manager's request to reshow the hidden
bars, but do not reshow until sysui acknowledges (by clearing the flag).
This gives sysui whatever time is necessary to prepare itself for
reshow, avoiding unsightly blip from opaque -> transparent during
the enter animation.

3. When both system bars are hidden, any low-profile changes are
moot.  Avoid unsightly low-profile animations during bar reshow
by suppressing the flag in this case.

4. Improve transient bar home -> launcher transition by cancelling
the -> opaque animation.  This also fixes a bug where hitting
home from the transient bar would leave you with a semi-transparent
bar in a non-transient state.

Bug:10284800
Change-Id: I238210561d8d5f70c1a517283b986c9105a1ec75
7 files changed