Fix AbsListView StrictMode.Span end point on flings.

Noticed after logs showed a ton of false positives, I went back and
looked at the history.  During the review of the previous CL, I
accidentally moved the finish() of the fling animation tracking inside
the PROFILE_FLINGING block, which is normally off.

Re-tested this CL with StrictMode debugging enabled and it now always
propertly resets to 0 animations in flight when no animations are
running.

Change-Id: Ie9746df36e2ec3f82679b20e91e3d93c05b863d4
This commit is contained in:
Brad Fitzpatrick
2010-11-19 12:03:22 -08:00
parent de8da848cd
commit 5e9d94505b

View File

@@ -3018,6 +3018,11 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
reportScrollStateChange(OnScrollListener.SCROLL_STATE_IDLE);
clearScrollingCache();
mScroller.abortAnimation();
if (mFlingStrictSpan != null) {
mFlingStrictSpan.finish();
mFlingStrictSpan = null;
}
}
void flywheelTouch() {
@@ -3086,11 +3091,6 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
Debug.stopMethodTracing();
mFlingProfilingStarted = false;
}
if (mFlingStrictSpan != null) {
mFlingStrictSpan.finish();
mFlingStrictSpan = null;
}
}
}
}