Report sync complete when VRI won't draw

There is some checks in performDraw that will skip drawing. For example,
if the display is off or if there's no view. In those cases, we don't
want to wait for a frame since there will be none and instead
immediately report back that the sync for this VRI is complete.

Test: Repro from bug
Fixes: 234426290
Change-Id: I7d5993f9980b9cdafc99a5712e74a4de704aef47
This commit is contained in:
chaviw
2022-06-07 12:02:07 -05:00
parent d72491683d
commit 71e6329765

View File

@@ -3496,7 +3496,9 @@ public final class ViewRootImpl implements ViewParent,
}
mPendingTransitions.clear();
}
performDraw();
if (!performDraw() && mSyncBufferCallback != null) {
mSyncBufferCallback.onBufferReady(null);
}
}
if (mAttachInfo.mContentCaptureEvents != null) {
@@ -4239,11 +4241,11 @@ public final class ViewRootImpl implements ViewParent,
});
}
private void performDraw() {
private boolean performDraw() {
if (mAttachInfo.mDisplayState == Display.STATE_OFF && !mReportNextDraw) {
return;
return false;
} else if (mView == null) {
return;
return false;
}
final boolean fullRedrawNeeded = mFullRedrawNeeded || mSyncBufferCallback != null;
@@ -4327,6 +4329,7 @@ public final class ViewRootImpl implements ViewParent,
if (mPerformContentCapture) {
performContentCaptureInitialReport();
}
return true;
}
/**