Add synchronous transaction to wait for setInputWindow to complete (1/n)
Add SurfaceFlinger callback to notify when input windows have been set.
The call to set input windows from SF to InputDispatcher is one way.
Therefore, it won't wait to ensure the windows have been set. Add a
callback method to allow InputDispatcher to notify SF when it's finished
setting the input windows, allowing SF to block if needed.
Bug: 123041491
Test: Builds and runs
Change-Id: Ia4196d2e517c07d94ab9da71beab057d5d6fcf1c
diff --git a/libs/gui/ISurfaceComposer.cpp b/libs/gui/ISurfaceComposer.cpp
index f77eeb2..9197262 100644
--- a/libs/gui/ISurfaceComposer.cpp
+++ b/libs/gui/ISurfaceComposer.cpp
@@ -806,6 +806,12 @@
}
return error;
}
+
+ virtual void setInputWindowsFinished() {
+ Parcel data, reply;
+ data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
+ remote()->transact(BnSurfaceComposer::SET_INPUT_WINDOWS_FINISHED, data, &reply);
+ }
};
// Out-of-line virtual method definition to trigger vtable emission in this
@@ -1317,6 +1323,11 @@
}
return removeRegionSamplingListener(listener);
}
+ case SET_INPUT_WINDOWS_FINISHED: {
+ CHECK_INTERFACE(ISurfaceComposer, data, reply);
+ setInputWindowsFinished();
+ return NO_ERROR;
+ }
default: {
return BBinder::onTransact(code, data, reply, flags);
}