From e798b47821d07191a20bdb7a3a1fc3887b661635 Mon Sep 17 00:00:00 2001 From: Vishnu Nair Date: Thu, 23 Jul 2020 13:52:21 -0700 Subject: Add setFocusedWindow function stub This function, once implemented, will set focus on the specified window. This is the first step in changing focus selection from setInputWindows and using explicit call which will help us more easily decouple z-order from focus selection and support focus for SurfaceViewHost surfaces. Bug: 151179149 Test: presubmit Test: go/wm-smoke Test: atest inputflinger_tests Change-Id: Ib2254b4ab3ba8d579dfe49ddf3286f8ce2eecf9e --- libs/gui/SurfaceComposerClient.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'libs/gui/SurfaceComposerClient.cpp') diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp index d797a3547a..229a5c2e62 100644 --- a/libs/gui/SurfaceComposerClient.cpp +++ b/libs/gui/SurfaceComposerClient.cpp @@ -1364,6 +1364,21 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setInput return *this; } +SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setFocusedWindow( + const sp& token, const sp& focusedToken, nsecs_t timestampNanos) { + FocusRequest request; + request.token = token; + request.focusedToken = focusedToken; + request.timestamp = timestampNanos; + return setFocusedWindow(request); +} + +SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setFocusedWindow( + const FocusRequest& request) { + mInputWindowCommands.focusRequests.push_back(request); + return *this; +} + SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::syncInputWindows() { mInputWindowCommands.syncInputWindows = true; return *this; -- cgit v1.2.3-59-g8ed1b