Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 20377350 authored by Nick Chameyev's avatar Nick Chameyev
Browse files

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
parent a7bb06b8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment