diff options
| author | John Reck <jreck@google.com> | 2015-05-13 21:52:50 +0000 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2015-05-13 21:52:50 +0000 |
| commit | a5b28b92b14d0949d43be6198fedc31872ad07f6 (patch) | |
| tree | 0165794ce1bf1976ef0d68d868f51b2f38433e0d /core/java/android/view/ViewRootImpl.java | |
| parent | 613626b7488c5c35a4816804fbe8f837a7e30440 (diff) | |
| parent | 69355eaa1c1f4bfc961d5dd9fdb0f3817d36d5f0 (diff) | |
| download | frameworks_base-a5b28b92b14d0949d43be6198fedc31872ad07f6.zip frameworks_base-a5b28b92b14d0949d43be6198fedc31872ad07f6.tar.gz frameworks_base-a5b28b92b14d0949d43be6198fedc31872ad07f6.tar.bz2 | |
am 69355eaa: Merge "DO NOT MERGE Backport of limited jank-tracking metrics" into lmp-mr1-dev
* commit '69355eaa1c1f4bfc961d5dd9fdb0f3817d36d5f0':
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.java | 16 |
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); } |
