diff options
| author | Brett Chabot <brettchabot@google.com> | 2022-08-25 14:34:42 -0700 |
|---|---|---|
| committer | Brett Chabot <brettchabot@google.com> | 2022-09-19 10:29:06 -0700 |
| commit | 4f58dc16bfc9c3a17594285b751c841a59a19e8a (patch) | |
| tree | 32de2c6c81ceef92d4cb0284db1b512ffb1fde14 /core/java/android/view/ViewRootImpl.java | |
| parent | 40d3988a6574f6a1a972646778ae8e330c85414f (diff) | |
Fix input when hardware renderer drawing is disabled.
When drawing is disabled the window's layer won't have a valid buffer. This
causes surfaceflinger to set the window's touchableRegion to zero.
This commit sets a window crop when drawing is disabled, so surfaceflinger
set touchableregion from crop instead of buffer.
And it modifies LetterboxUiController to not reset the crop.
Test: cts and perf tests as documented in go/android-slimulator-dev-env
Bug: 229870984
(cherry picked from commit 32dfc9838243cb1a20f2262864fb884b536eb58e)
Merged-In: I4d6ca513c3daf5818ded03eae00e551fc319ad69
Change-Id: Ic8e1b17af825951505d448509530edf3ea81af5b
Diffstat (limited to 'core/java/android/view/ViewRootImpl.java')
| -rw-r--r-- | core/java/android/view/ViewRootImpl.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index ec6b4acd6aff..96e910c8305a 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -8152,6 +8152,7 @@ public final class ViewRootImpl implements ViewParent, mLastSyncSeqId, mTmpFrames, mPendingMergedConfiguration, mSurfaceControl, mTempInsets, mTempControls, mRelayoutBundle); mRelayoutRequested = true; + final int maybeSyncSeqId = mRelayoutBundle.getInt("seqid"); if (maybeSyncSeqId > 0) { mSyncSeqId = maybeSyncSeqId; @@ -8191,6 +8192,12 @@ public final class ViewRootImpl implements ViewParent, } } + if (mSurfaceControl.isValid() && !HardwareRenderer.isDrawingEnabled()) { + // When drawing is disabled the window layer won't have a valid buffer. + // Set a window crop so input can get delivered to the window. + mTransaction.setWindowCrop(mSurfaceControl, mSurfaceSize.x, mSurfaceSize.y).apply(); + } + mLastTransformHint = transformHint; mSurfaceControl.setTransformHint(transformHint); |
