FlingRunnable runs constantly after panning and releasing without flinging

RESOLVED FIXED in Firefox 11

Status

()

Firefox for Android
General
P2
normal
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: kats, Assigned: kats)

Tracking

({regression})

Trunk
Firefox 12
ARM
Android
regression
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox11 fixed, fennec11+)

Details

Attachments

(1 attachment)

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.
Created attachment 584474 [details] [diff] [review]
Don't let the FlingRunnable run forever

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 FlingRunnable.run(), 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)
status-firefox11: --- → affected
Keywords: regression
Comment on attachment 584474 [details] [diff] [review]
Don't let the FlingRunnable run forever

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

r=me
Attachment #584474 - Flags: review?(pwalton) → review+
Priority: -- → P2
Try run showed green: https://tbpl.mozilla.org/?tree=Try&rev=d9f8a97679fa

Landed on m-i: https://hg.mozilla.org/integration/mozilla-inbound/rev/bcfe95e5f7bd
Whiteboard: [inbound], [leave open after inbound merge]
https://hg.mozilla.org/mozilla-central/rev/bcfe95e5f7bd
Whiteboard: [inbound], [leave open after inbound merge]
Target Milestone: --- → Firefox 12
Attachment #584474 - Flags: approval-mozilla-aurora?
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED

Comment 5

6 years ago
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+
Landed on aurora:

https://hg.mozilla.org/releases/mozilla-aurora/rev/1953793c93e2
status-firefox11: affected → fixed
tracking-fennec: --- → 11+
You need to log in before you can comment on or make changes to this bug.