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 32dfc98382)
Merged-In: I4d6ca513c3daf5818ded03eae00e551fc319ad69
Change-Id: Ic8e1b17af825951505d448509530edf3ea81af5b
This commit is contained in:
Brett Chabot
2022-08-25 14:34:42 -07:00
parent 40d3988a65
commit 4f58dc16bf
2 changed files with 8 additions and 1 deletions

View File

@@ -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);

View File

@@ -481,7 +481,7 @@ final class LetterboxUiController {
}
private void updateRoundedCorners(WindowState mainWindow) {
final SurfaceControl windowSurface = mainWindow.getClientViewRootSurface();
final SurfaceControl windowSurface = mainWindow.getSurfaceControl();
if (windowSurface != null && windowSurface.isValid()) {
final Transaction transaction = mActivityRecord.getSyncTransaction();