Fix finishing unfold shell transition immediately after folding
This CL addresses an issue with UnfoldTransitionHandler that sometimes it finishes the animation immediately when the following events happen: - [folded the device] - onFoldedStateChanged(true) -> mAnimationFinished is set to 'false' - onStateChangeFinished() -> mAnimationFinished is set to 'true' (the order is not guaranteed between the last two events) - [unfolded the device] - handleRequest(unfold transition) - startAnimation() -> immediately finishes the animation because mAnimationFinished is set to true, but it should have animated it This is fixed by setting mAnimationFinished to false in onStateChangeFinished based on the last animation progress. It is guaranteed that we will receive onTransitionProgress with 0f value when folding and then onStateChangeFinished(), so we can use this signal instead of onFoldedStateChanged to reset the flag. Bug: 372319646 Test: atest UnfoldTransitionHandlerTest Test: fold multiple times => verify unfold transition is not finished immediately Flag: EXEMPT bugfix Change-Id: I2dc2f578b6132361c09cd8fe7e8ebc8fe586f5e4
Loading
Please register or sign in to comment