Closed Bug 1062549 Opened 10 years ago Closed 10 years ago

Lockscreen slider should not paint after unlocking

Categories

(Firefox OS Graveyard :: Gaia::System::Lockscreen, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
2.1 S3 (29aug)

People

(Reporter: BenWa, Assigned: timdream)

References

Details

(Whiteboard: [p=1])

Attachments

(1 file)

STR:
1) Lock phone
2) Unlock the phone using a swipe

The lockscreen lock slider repaints in the neutral position. This happens during the unlock animation and delays lock animation.
Summary: Lockscreen should not paint after unlocking → Lockscreen slider should not paint after unlocking
Blocks: 1063708
The cause of this bug is because we simply setTimeout(400) and reset the handle w/o waiting for the animation to complete.

https://github.com/mozilla-b2g/gaia/blob/master/shared/js/lockscreen_slide.js#L595-L597

:snowmantw, what kind of event we can listen to here (or any new API we should add to LockScreenHandle) to make sure we only resets the handle after the animation?

I can certainly help :)
Assignee: nobody → timdream
Status: NEW → ASSIGNED
Flags: needinfo?(gweng)
From a later offline discussion:

1. LockScreenSlider should add a method called 'reset' to correspond the 'start', 'stop' pattern in the current System.

2. The 'reset' method would reset the slider to the original state.

3. Component use the slider should control when to call the 'reset' method. In this case, when the visibility changed.

4. Principle is slider should not monitor too much things via itself. This should be done in LockScreenStateManager and implement LockScreenSlideShowState to command it to get reset.
Flags: needinfo?(gweng)
Comment on attachment 8494300 [details] [review]
mozilla-b2g:master PR#24370

After learned how state machine works in lock screen, I created this patch to introduce a new "slideHide" state so that we can transfer to "slideShow" state when lock screen is shown after unlocking. In the transferTo function, we would call lockScreenSlide.reset() to reset it's graphics.

There are some quirks in the lock screen inner working which I think we should address in follow-ups. First, There is only one function for each state when you transfer to it, and no function is called when transfer away from a state -- maybe having such API can help us writing lock screen code in a more DRY way.

Secondly, some of the unit test are invalid as there is no done() callback to wait for the then() function to call. We should address them too (and I should be more careful when doing review).
Attachment #8494300 - Flags: review?(gweng)
Comment on attachment 8494300 [details] [review]
mozilla-b2g:master PR#24370

R+ with some nits. I think I need to open other bugs to fix the transferOut function.
Attachment #8494300 - Flags: review?(gweng) → review+
Whiteboard: [p=1]
Target Milestone: --- → 2.1 S3 (29aug)
master: https://github.com/mozilla-b2g/gaia/commit/18327379e6c58f8173721f43da211a995cc527cb
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: