Reset wait for transition state to false when recents goes invisible

From ag/2572257, this change will ensure the transition wait flag to be
false when recents runs "onStop" or when it becomes invisible. This
should fix edge cases when a user goes from Recents to somewhere that
is not a fullscreen app (like home). Resetting the state should allow
users to use the recents button without getting blocked.

There is only two locations where the flag is set to true, when user
starts recents and when an app is started from recents. When a user goes
from recents to home with the recents button (when the phone gets into a
wierd state), then the flag is true but home does not reset the flag
because the old change expects a non-home app to start. Now whenever
recents is dismissed, the flag will be reset.

Fixes: 37277853
Bug: 64098508
Test: start recents with apps in it, go to guest account, start apps in
recents, go back to main account, unlock keyguard, press recents button
to dismiss recents (do not press home or back), it will go to home,
press recents again
Change-Id: I07c292d701a621685c836a4f6040864377f0a3dd
1 file changed