Handle timeout/state-change during fold animation

Currently when timeout/device-state-change occur while fold animation is
in progress, it is not handled well.
Due to this whenever the device is unfolded post poor handling folding
animation, there is a delay in onDraw callback. This results in inflated
unfold animation latency.
In this CL incomplete fold animation has been cleaned up with the help of opeartors like flatMapLatest and onCompletion.

Fixes: 324374084
Test: UnfoldFromScreenOffToLauncherMicrobenchmark
Flag: ACONFIG fold_lock_setting_enabled TRUNKFOOD

Change-Id: I96ddc3ff7894e95a0ec32565589b60c5eae7593a
1 file changed