Closed Bug 713729 Opened 9 years ago Closed 9 years ago

FlingRunnable runs constantly after panning and releasing without flinging


(Firefox for Android :: General, defect, P2)




Firefox 12
Tracking Status
firefox11 --- fixed
fennec 11+ ---


(Reporter: kats, Assigned: kats)



(Keywords: regression)


(1 file)

While investigating some other bugs, I found a bug in the current FlingRunnable. If you touch down a finger, pan, and then touch up (such that the onTouchEnd happens in state PANNING_HOLD_LOCKED or PANNING_HOLD), this causes the FlingRunnable to continue running forever. This can be seen by sticking a printout in FlingRunnable's run method at the very top and watching logcat.

This appears to be because the mX and mY variables are put into state stopped, but the "flinging with an appreciable velocity" code doesn't take this into account, and bails out of the FlingRunnable too early. Therefore the animation timer never gets stopped and the runnable keeps getting scheduled.

Patch forthcoming.
Btw, this happens partly because the axes are put into FlingStates.STOPPED if the velocity vector has magnitude < 4.0 (as per stopped()) but in the, it uses the 0.1f threshold when there's no significant overscroll. This patch just moves that velocity check into the if condition, so that it doesn't run unless a fling is actually in progress.
Attachment #584474 - Flags: review?(pwalton)
Comment on attachment 584474 [details] [diff] [review]
Don't let the FlingRunnable run forever

Review of attachment 584474 [details] [diff] [review]:

Attachment #584474 - Flags: review?(pwalton) → review+
Priority: -- → P2
Try run showed green:

Landed on m-i:
Whiteboard: [inbound], [leave open after inbound merge]
Target Milestone: --- → Firefox 12
Attachment #584474 - Flags: approval-mozilla-aurora?
Closed: 9 years ago
Resolution: --- → FIXED
Comment on attachment 584474 [details] [diff] [review]
Don't let the FlingRunnable run forever

[Triage Comment]
Mobile only - approving for Aurora.
Attachment #584474 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
tracking-fennec: --- → 11+
You need to log in before you can comment on or make changes to this bug.