SF: Lock access to InputWindowCommands
Fixes regression caused by ag/6260282.
Create a pending list of InputWindowCommands so that we can apply the commands without
holding on to the mStateLock to better align with the current and drawing state locking
strategy.
Bug: 124061013
Test: go/wm-smoke
Change-Id: I9ccec72da0d2139ca546e34df8e62c58c178d292
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
index a0f83a2..ea7a32d 100644
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ b/services/surfaceflinger/SurfaceFlinger.h
@@ -538,6 +538,7 @@
void updateInputFlinger();
void updateInputWindowInfo();
+ void commitInputWindowCommands();
void executeInputWindowCommands();
void updateCursorAsync();
@@ -1144,6 +1145,9 @@
/* ------------------------------------------------------------------------ */
sp<IInputFlinger> mInputFlinger;
+ // Access must be protected by mStateLock.
+ InputWindowCommands mPendingInputWindowCommands;
+ // Should only be accessed by the drawing thread.
InputWindowCommands mInputWindowCommands;
ui::DisplayPrimaries mInternalDisplayPrimaries;