SF: Update InputFlinger outside main thread
Avoids parceling data inside main thread and hot path. Also
avoids any binder contention with one way binder calls. See
bug for more details.
Bug: 206380307
Test: presubmit
Test: systrace
Change-Id: I4f8640587c821ac471559f1e6d2fbe41a8e64c87
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
index 6093be9..353f747 100644
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ b/services/surfaceflinger/SurfaceFlinger.h
@@ -689,7 +689,8 @@
void updateLayerGeometry();
void updateInputFlinger();
- void notifyWindowInfos();
+ void buildWindowInfos(std::vector<gui::WindowInfo>& outWindowInfos,
+ std::vector<gui::DisplayInfo>& outDisplayInfos);
void commitInputWindowCommands() REQUIRES(mStateLock);
void updateCursorAsync();
@@ -1289,6 +1290,7 @@
const float mInternalDisplayDensity;
const float mEmulatedDisplayDensity;
+ // Should only be accessed by BackgroundExecutor thread.
sp<os::IInputFlinger> mInputFlinger;
// Should only be accessed by the main thread.
InputWindowCommands mInputWindowCommands;