Last Comment Bug 713729 - FlingRunnable runs constantly after panning and releasing without flinging
: FlingRunnable runs constantly after panning and releasing without flinging
Status: RESOLVED FIXED
: regression
Product: Firefox for Android
Classification: Client Software
Component: General (show other bugs)
: Trunk
: ARM Android
: P2 normal (vote)
: Firefox 12
Assigned To: Kartikaya Gupta (email:kats@mozilla.com)
:
:
Mentors:
Depends on:
Blocks: 709924 713011
  Show dependency treegraph
 
Reported: 2011-12-27 13:04 PST by Kartikaya Gupta (email:kats@mozilla.com)
Modified: 2012-01-06 15:45 PST (History)
4 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
fixed
11+


Attachments
Don't let the FlingRunnable run forever (2.52 KB, patch)
2011-12-27 13:12 PST, Kartikaya Gupta (email:kats@mozilla.com)
pwalton: review+
akeybl: approval‑mozilla‑aurora+
Details | Diff | Splinter Review

Description Kartikaya Gupta (email:kats@mozilla.com) 2011-12-27 13:04:41 PST
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.
Comment 1 Kartikaya Gupta (email:kats@mozilla.com) 2011-12-27 13:12:12 PST
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.
Comment 2 Patrick Walton (:pcwalton) 2011-12-29 09:06:39 PST
Comment on attachment 584474 [details] [diff] [review]
Don't let the FlingRunnable run forever

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

r=me
Comment 3 Kartikaya Gupta (email:kats@mozilla.com) 2011-12-29 21:17:48 PST
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
Comment 4 Kyle Huey [:khuey] (Exited; not receiving bugmail, email if necessary) 2011-12-30 04:51:32 PST
https://hg.mozilla.org/mozilla-central/rev/bcfe95e5f7bd
Comment 5 Alex Keybl [:akeybl] 2012-01-03 13:31:28 PST
Comment on attachment 584474 [details] [diff] [review]
Don't let the FlingRunnable run forever

[Triage Comment]
Mobile only - approving for Aurora.
Comment 6 Kartikaya Gupta (email:kats@mozilla.com) 2012-01-03 13:42:27 PST
Landed on aurora:

https://hg.mozilla.org/releases/mozilla-aurora/rev/1953793c93e2

Note You need to log in before you can comment on or make changes to this bug.