summaryrefslogtreecommitdiffstats
path: root/core/java/android/view/ViewRootImpl.java
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2015-05-13 22:07:15 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-05-13 22:07:15 +0000
commite869835d6a884434842838fce6d17c770fa1ef8b (patch)
tree61002dcce98ce661db0c3b73796aabda1804a1d6 /core/java/android/view/ViewRootImpl.java
parent0cbd0cbd138cdaa367d21f58d8a3fd36f1e73f69 (diff)
parenta5b28b92b14d0949d43be6198fedc31872ad07f6 (diff)
downloadframeworks_base-e869835d6a884434842838fce6d17c770fa1ef8b.zip
frameworks_base-e869835d6a884434842838fce6d17c770fa1ef8b.tar.gz
frameworks_base-e869835d6a884434842838fce6d17c770fa1ef8b.tar.bz2
am a5b28b92: am 69355eaa: Merge "DO NOT MERGE Backport of limited jank-tracking metrics" into lmp-mr1-dev
* commit 'a5b28b92b14d0949d43be6198fedc31872ad07f6': DO NOT MERGE Backport of limited jank-tracking metrics
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 113ad8d..397cbb8 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -55,6 +55,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;
@@ -1515,6 +1516,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);
@@ -2518,6 +2520,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.
@@ -2637,7 +2642,6 @@ public final class ViewRootImpl implements ViewParent,
dirty.setEmpty();
mIsAnimating = false;
- attachInfo.mDrawingTime = SystemClock.uptimeMillis();
mView.mPrivateFlags |= View.PFLAG_DRAWN;
if (DEBUG_DRAW) {
@@ -5786,6 +5790,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);
}