summaryrefslogtreecommitdiffstats
path: root/core/java/android/view/ViewRootImpl.java
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2015-02-19 14:36:50 -0800
committerJohn Reck <jreck@google.com>2015-03-18 14:22:01 -0700
commit2614bd225f84f7a23e6b30fc6b47bede153e5f4c (patch)
treeee9a807f2fd740b33410f8e540af95972d12fde0 /core/java/android/view/ViewRootImpl.java
parent0d756f7d5646f84753a3db5f702f4ac79bda22bf (diff)
downloadframeworks_base-2614bd225f84f7a23e6b30fc6b47bede153e5f4c.zip
frameworks_base-2614bd225f84f7a23e6b30fc6b47bede153e5f4c.tar.gz
frameworks_base-2614bd225f84f7a23e6b30fc6b47bede153e5f4c.tar.bz2
DO NOT MERGE Backport of limited jank-tracking metrics
Bug: 19821830 Cherry-pick of ba6adf66d3c44c0aa2fd8a224862ff1901d64300 Cherry-pick of e70c5754d01f2ab0ff47ea3eabaa88aca5ed2a36 Change-Id: Id342fa0ab345f204bec58acf45ce72f6de950cfb
Diffstat (limited to 'core/java/android/view/ViewRootImpl.java')
-rw-r--r--core/java/android/view/ViewRootImpl.java16
1 files changed, 15 insertions, 1 deletions
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index e4d82b1..3566140 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -56,6 +56,7 @@ import android.util.AndroidRuntimeException;
import android.util.DisplayMetrics;
import android.util.Log;
import android.util.Slog;
+import android.util.TimeUtils;
import android.util.TypedValue;
import android.view.Surface.OutOfResourcesException;
import android.view.View.AttachInfo;
@@ -1502,6 +1503,7 @@ public final class ViewRootImpl implements ViewParent,
// to resume them
mDirty.set(0, 0, mWidth, mHeight);
}
+ mChoreographer.mFrameInfo.addFlags(FrameInfo.FLAG_WINDOW_LAYOUT_CHANGED);
}
final int surfaceGenerationId = mSurface.getGenerationId();
relayoutResult = relayoutWindow(params, viewVisibility, insetsPending);
@@ -2505,6 +2507,9 @@ public final class ViewRootImpl implements ViewParent,
}
}
+ mAttachInfo.mDrawingTime =
+ mChoreographer.getFrameTimeNanos() / TimeUtils.NANOS_PER_MS;
+
if (!dirty.isEmpty() || mIsAnimating || accessibilityFocusDirty) {
if (mAttachInfo.mHardwareRenderer != null && mAttachInfo.mHardwareRenderer.isEnabled()) {
// If accessibility focus moved, always invalidate the root.
@@ -2624,7 +2629,6 @@ public final class ViewRootImpl implements ViewParent,
dirty.setEmpty();
mIsAnimating = false;
- attachInfo.mDrawingTime = SystemClock.uptimeMillis();
mView.mPrivateFlags |= View.PFLAG_DRAWN;
if (DEBUG_DRAW) {
@@ -5778,6 +5782,16 @@ public final class ViewRootImpl implements ViewParent,
Trace.traceCounter(Trace.TRACE_TAG_INPUT, mPendingInputEventQueueLengthCounterName,
mPendingInputEventCount);
+ long eventTime = q.mEvent.getEventTimeNano();
+ long oldestEventTime = eventTime;
+ if (q.mEvent instanceof MotionEvent) {
+ MotionEvent me = (MotionEvent)q.mEvent;
+ if (me.getHistorySize() > 0) {
+ oldestEventTime = me.getHistoricalEventTimeNano(0);
+ }
+ }
+ mChoreographer.mFrameInfo.updateInputEventTime(eventTime, oldestEventTime);
+
deliverInputEvent(q);
}