Merge "End the trace section in FrameTracker#cancel if it has begun" into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
a6907d35ea
@@ -206,9 +206,8 @@ public class FrameTracker extends SurfaceControl.OnJankDataListener
|
|||||||
* Cancel the trace session of the CUJ.
|
* Cancel the trace session of the CUJ.
|
||||||
*/
|
*/
|
||||||
public synchronized void cancel() {
|
public synchronized void cancel() {
|
||||||
// The session is ongoing, end the trace session.
|
// We don't need to end the trace section if it never begun.
|
||||||
// That means the cancel call is from external invocation, not from end().
|
if (mBeginVsyncId != INVALID_ID) {
|
||||||
if (mBeginVsyncId != INVALID_ID && mEndVsyncId == INVALID_ID) {
|
|
||||||
Trace.endAsyncSection(mSession.getName(), (int) mBeginVsyncId);
|
Trace.endAsyncSection(mSession.getName(), (int) mBeginVsyncId);
|
||||||
}
|
}
|
||||||
mCancelled = true;
|
mCancelled = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user