Loading core/java/android/view/IWindowSession.aidl +3 −2 Original line number Diff line number Diff line Loading @@ -294,7 +294,7 @@ interface IWindowSession { * an input channel where the client can receive input. */ void grantInputChannel(int displayId, in SurfaceControl surface, in IWindow window, in IBinder hostInputToken, int flags, int privateFlags, int type, in IBinder hostInputToken, int flags, int privateFlags, int inputFeatures, int type, in IBinder windowToken, in IBinder focusGrantToken, String inputHandleName, out InputChannel outInputChannel); Loading @@ -302,7 +302,8 @@ interface IWindowSession { * Update the flags on an input channel associated with a particular surface. */ oneway void updateInputChannel(in IBinder channelToken, int displayId, in SurfaceControl surface, int flags, int privateFlags, in Region region); in SurfaceControl surface, int flags, int privateFlags, int inputFeatures, in Region region); /** * Transfer window focus to an embedded window if the calling window has focus. Loading core/java/android/view/WindowlessWindowManager.java +16 −12 Original line number Diff line number Diff line Loading @@ -139,7 +139,7 @@ public class WindowlessWindowManager implements IWindowSession { try { mRealWm.updateInputChannel(state.mInputChannelToken, state.mDisplayId, state.mSurfaceControl, state.mParams.flags, state.mParams.privateFlags, state.mInputRegion); state.mParams.inputFeatures, state.mInputRegion); } catch (RemoteException e) { Log.e(TAG, "Failed to update surface input channel: ", e); } Loading Loading @@ -189,12 +189,13 @@ public class WindowlessWindowManager implements IWindowSession { mRealWm.grantInputChannel(displayId, new SurfaceControl(sc, "WindowlessWindowManager.addToDisplay"), window, mHostInputToken, attrs.flags, attrs.privateFlags, attrs.type, attrs.token, mFocusGrantToken, attrs.getTitle().toString(), outInputChannel); attrs.flags, attrs.privateFlags, attrs.inputFeatures, attrs.type, attrs.token, mFocusGrantToken, attrs.getTitle().toString(), outInputChannel); } else { mRealWm.grantInputChannel(displayId, sc, window, mHostInputToken, attrs.flags, attrs.privateFlags, attrs.type, attrs.token, mFocusGrantToken, attrs.getTitle().toString(), outInputChannel); attrs.privateFlags, attrs.inputFeatures, attrs.type, attrs.token, mFocusGrantToken, attrs.getTitle().toString(), outInputChannel); } } catch (RemoteException e) { Log.e(TAG, "Failed to grant input to surface: ", e); Loading Loading @@ -381,16 +382,19 @@ public class WindowlessWindowManager implements IWindowSession { outMergedConfiguration.setConfiguration(mConfiguration, mConfiguration); } if ((attrChanges & WindowManager.LayoutParams.FLAGS_CHANGED) != 0 && state.mInputChannelToken != null) { final int inputChangeMask = WindowManager.LayoutParams.FLAGS_CHANGED | WindowManager.LayoutParams.INPUT_FEATURES_CHANGED; if ((attrChanges & inputChangeMask) != 0 && state.mInputChannelToken != null) { try { if (mRealWm instanceof IWindowSession.Stub) { mRealWm.updateInputChannel(state.mInputChannelToken, state.mDisplayId, new SurfaceControl(sc, "WindowlessWindowManager.relayout"), attrs.flags, attrs.privateFlags, state.mInputRegion); attrs.flags, attrs.privateFlags, attrs.inputFeatures, state.mInputRegion); } else { mRealWm.updateInputChannel(state.mInputChannelToken, state.mDisplayId, sc, attrs.flags, attrs.privateFlags, state.mInputRegion); attrs.flags, attrs.privateFlags, attrs.inputFeatures, state.mInputRegion); } } catch (RemoteException e) { Log.e(TAG, "Failed to update surface input channel: ", e); Loading Loading @@ -560,14 +564,14 @@ public class WindowlessWindowManager implements IWindowSession { @Override public void grantInputChannel(int displayId, SurfaceControl surface, IWindow window, IBinder hostInputToken, int flags, int privateFlags, int type, IBinder hostInputToken, int flags, int privateFlags, int inputFeatures, int type, IBinder windowToken, IBinder focusGrantToken, String inputHandleName, InputChannel outInputChannel) { } @Override public void updateInputChannel(IBinder channelToken, int displayId, SurfaceControl surface, int flags, int privateFlags, Region region) { int flags, int privateFlags, int inputFeatures, Region region) { } @Override Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DragResizeInputListener.java +2 −0 Original line number Diff line number Diff line Loading @@ -103,6 +103,7 @@ class DragResizeInputListener implements AutoCloseable { null /* hostInputToken */, FLAG_NOT_FOCUSABLE, PRIVATE_FLAG_TRUSTED_OVERLAY, 0 /* inputFeatures */, TYPE_APPLICATION, null /* windowToken */, mFocusGrantToken, Loading Loading @@ -208,6 +209,7 @@ class DragResizeInputListener implements AutoCloseable { mDecorationSurface, FLAG_NOT_FOCUSABLE, PRIVATE_FLAG_TRUSTED_OVERLAY, 0 /* inputFeatures */, touchRegion); } catch (RemoteException e) { e.rethrowFromSystemServer(); Loading services/core/java/com/android/server/wm/Session.java +4 −4 Original line number Diff line number Diff line Loading @@ -857,7 +857,7 @@ class Session extends IWindowSession.Stub implements IBinder.DeathRecipient { @Override public void grantInputChannel(int displayId, SurfaceControl surface, IWindow window, IBinder hostInputToken, int flags, int privateFlags, int type, IBinder windowToken, IBinder focusGrantToken, String inputHandleName, int inputFeatures, IBinder windowToken, IBinder focusGrantToken, String inputHandleName, InputChannel outInputChannel) { if (hostInputToken == null && !mCanAddInternalSystemWindow) { // Callers without INTERNAL_SYSTEM_WINDOW permission cannot grant input channel to Loading @@ -869,7 +869,7 @@ class Session extends IWindowSession.Stub implements IBinder.DeathRecipient { try { mService.grantInputChannel(this, mUid, mPid, displayId, surface, window, hostInputToken, flags, mCanAddInternalSystemWindow ? privateFlags : 0, type, windowToken, focusGrantToken, inputHandleName, type, inputFeatures, windowToken, focusGrantToken, inputHandleName, outInputChannel); } finally { Binder.restoreCallingIdentity(identity); Loading @@ -878,11 +878,11 @@ class Session extends IWindowSession.Stub implements IBinder.DeathRecipient { @Override public void updateInputChannel(IBinder channelToken, int displayId, SurfaceControl surface, int flags, int privateFlags, Region region) { int flags, int privateFlags, int inputFeatures, Region region) { final long identity = Binder.clearCallingIdentity(); try { mService.updateInputChannel(channelToken, displayId, surface, flags, mCanAddInternalSystemWindow ? privateFlags : 0, region); mCanAddInternalSystemWindow ? privateFlags : 0, inputFeatures, region); } finally { Binder.restoreCallingIdentity(identity); } Loading services/core/java/com/android/server/wm/WindowManagerService.java +9 −7 Original line number Diff line number Diff line Loading @@ -8571,8 +8571,8 @@ public class WindowManagerService extends IWindowManager.Stub */ void grantInputChannel(Session session, int callingUid, int callingPid, int displayId, SurfaceControl surface, IWindow window, IBinder hostInputToken, int flags, int privateFlags, int type, IBinder windowToken, IBinder focusGrantToken, String inputHandleName, InputChannel outInputChannel) { int flags, int privateFlags, int inputFeatures, int type, IBinder windowToken, IBinder focusGrantToken, String inputHandleName, InputChannel outInputChannel) { final int sanitizedType = sanitizeWindowType(session, displayId, windowToken, type); final InputApplicationHandle applicationHandle; final String name; Loading @@ -8589,7 +8589,7 @@ public class WindowManagerService extends IWindowManager.Stub } updateInputChannel(clientChannel.getToken(), callingUid, callingPid, displayId, surface, name, applicationHandle, flags, privateFlags, sanitizedType, name, applicationHandle, flags, privateFlags, inputFeatures, sanitizedType, null /* region */, window); clientChannel.copyTo(outInputChannel); Loading Loading @@ -8630,13 +8630,14 @@ public class WindowManagerService extends IWindowManager.Stub private void updateInputChannel(IBinder channelToken, int callingUid, int callingPid, int displayId, SurfaceControl surface, String name, InputApplicationHandle applicationHandle, int flags, int privateFlags, int type, Region region, IWindow window) { int privateFlags, int inputFeatures, int type, Region region, IWindow window) { final InputWindowHandle h = new InputWindowHandle(applicationHandle, displayId); h.token = channelToken; h.setWindowToken(window); h.name = name; flags = sanitizeFlagSlippery(flags, name, callingUid, callingPid); inputFeatures = sanitizeSpyWindow(inputFeatures, name, callingUid, callingPid); final int sanitizedLpFlags = (flags & (FLAG_NOT_TOUCHABLE | FLAG_SLIPPERY | LayoutParams.FLAG_NOT_FOCUSABLE)) Loading @@ -8646,7 +8647,7 @@ public class WindowManagerService extends IWindowManager.Stub // Do not allow any input features to be set without sanitizing them first. h.inputConfig = InputConfigAdapter.getInputConfigFromWindowParams( type, sanitizedLpFlags, 0 /*inputFeatures*/); type, sanitizedLpFlags, inputFeatures); if ((flags & LayoutParams.FLAG_NOT_FOCUSABLE) != 0) { Loading Loading @@ -8683,7 +8684,7 @@ public class WindowManagerService extends IWindowManager.Stub * is undefined. */ void updateInputChannel(IBinder channelToken, int displayId, SurfaceControl surface, int flags, int privateFlags, Region region) { int flags, int privateFlags, int inputFeatures, Region region) { final InputApplicationHandle applicationHandle; final String name; final EmbeddedWindowController.EmbeddedWindow win; Loading @@ -8698,7 +8699,8 @@ public class WindowManagerService extends IWindowManager.Stub } updateInputChannel(channelToken, win.mOwnerUid, win.mOwnerPid, displayId, surface, name, applicationHandle, flags, privateFlags, win.mWindowType, region, win.mClient); applicationHandle, flags, privateFlags, inputFeatures, win.mWindowType, region, win.mClient); } /** Return whether layer tracing is enabled */ Loading Loading
core/java/android/view/IWindowSession.aidl +3 −2 Original line number Diff line number Diff line Loading @@ -294,7 +294,7 @@ interface IWindowSession { * an input channel where the client can receive input. */ void grantInputChannel(int displayId, in SurfaceControl surface, in IWindow window, in IBinder hostInputToken, int flags, int privateFlags, int type, in IBinder hostInputToken, int flags, int privateFlags, int inputFeatures, int type, in IBinder windowToken, in IBinder focusGrantToken, String inputHandleName, out InputChannel outInputChannel); Loading @@ -302,7 +302,8 @@ interface IWindowSession { * Update the flags on an input channel associated with a particular surface. */ oneway void updateInputChannel(in IBinder channelToken, int displayId, in SurfaceControl surface, int flags, int privateFlags, in Region region); in SurfaceControl surface, int flags, int privateFlags, int inputFeatures, in Region region); /** * Transfer window focus to an embedded window if the calling window has focus. Loading
core/java/android/view/WindowlessWindowManager.java +16 −12 Original line number Diff line number Diff line Loading @@ -139,7 +139,7 @@ public class WindowlessWindowManager implements IWindowSession { try { mRealWm.updateInputChannel(state.mInputChannelToken, state.mDisplayId, state.mSurfaceControl, state.mParams.flags, state.mParams.privateFlags, state.mInputRegion); state.mParams.inputFeatures, state.mInputRegion); } catch (RemoteException e) { Log.e(TAG, "Failed to update surface input channel: ", e); } Loading Loading @@ -189,12 +189,13 @@ public class WindowlessWindowManager implements IWindowSession { mRealWm.grantInputChannel(displayId, new SurfaceControl(sc, "WindowlessWindowManager.addToDisplay"), window, mHostInputToken, attrs.flags, attrs.privateFlags, attrs.type, attrs.token, mFocusGrantToken, attrs.getTitle().toString(), outInputChannel); attrs.flags, attrs.privateFlags, attrs.inputFeatures, attrs.type, attrs.token, mFocusGrantToken, attrs.getTitle().toString(), outInputChannel); } else { mRealWm.grantInputChannel(displayId, sc, window, mHostInputToken, attrs.flags, attrs.privateFlags, attrs.type, attrs.token, mFocusGrantToken, attrs.getTitle().toString(), outInputChannel); attrs.privateFlags, attrs.inputFeatures, attrs.type, attrs.token, mFocusGrantToken, attrs.getTitle().toString(), outInputChannel); } } catch (RemoteException e) { Log.e(TAG, "Failed to grant input to surface: ", e); Loading Loading @@ -381,16 +382,19 @@ public class WindowlessWindowManager implements IWindowSession { outMergedConfiguration.setConfiguration(mConfiguration, mConfiguration); } if ((attrChanges & WindowManager.LayoutParams.FLAGS_CHANGED) != 0 && state.mInputChannelToken != null) { final int inputChangeMask = WindowManager.LayoutParams.FLAGS_CHANGED | WindowManager.LayoutParams.INPUT_FEATURES_CHANGED; if ((attrChanges & inputChangeMask) != 0 && state.mInputChannelToken != null) { try { if (mRealWm instanceof IWindowSession.Stub) { mRealWm.updateInputChannel(state.mInputChannelToken, state.mDisplayId, new SurfaceControl(sc, "WindowlessWindowManager.relayout"), attrs.flags, attrs.privateFlags, state.mInputRegion); attrs.flags, attrs.privateFlags, attrs.inputFeatures, state.mInputRegion); } else { mRealWm.updateInputChannel(state.mInputChannelToken, state.mDisplayId, sc, attrs.flags, attrs.privateFlags, state.mInputRegion); attrs.flags, attrs.privateFlags, attrs.inputFeatures, state.mInputRegion); } } catch (RemoteException e) { Log.e(TAG, "Failed to update surface input channel: ", e); Loading Loading @@ -560,14 +564,14 @@ public class WindowlessWindowManager implements IWindowSession { @Override public void grantInputChannel(int displayId, SurfaceControl surface, IWindow window, IBinder hostInputToken, int flags, int privateFlags, int type, IBinder hostInputToken, int flags, int privateFlags, int inputFeatures, int type, IBinder windowToken, IBinder focusGrantToken, String inputHandleName, InputChannel outInputChannel) { } @Override public void updateInputChannel(IBinder channelToken, int displayId, SurfaceControl surface, int flags, int privateFlags, Region region) { int flags, int privateFlags, int inputFeatures, Region region) { } @Override Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DragResizeInputListener.java +2 −0 Original line number Diff line number Diff line Loading @@ -103,6 +103,7 @@ class DragResizeInputListener implements AutoCloseable { null /* hostInputToken */, FLAG_NOT_FOCUSABLE, PRIVATE_FLAG_TRUSTED_OVERLAY, 0 /* inputFeatures */, TYPE_APPLICATION, null /* windowToken */, mFocusGrantToken, Loading Loading @@ -208,6 +209,7 @@ class DragResizeInputListener implements AutoCloseable { mDecorationSurface, FLAG_NOT_FOCUSABLE, PRIVATE_FLAG_TRUSTED_OVERLAY, 0 /* inputFeatures */, touchRegion); } catch (RemoteException e) { e.rethrowFromSystemServer(); Loading
services/core/java/com/android/server/wm/Session.java +4 −4 Original line number Diff line number Diff line Loading @@ -857,7 +857,7 @@ class Session extends IWindowSession.Stub implements IBinder.DeathRecipient { @Override public void grantInputChannel(int displayId, SurfaceControl surface, IWindow window, IBinder hostInputToken, int flags, int privateFlags, int type, IBinder windowToken, IBinder focusGrantToken, String inputHandleName, int inputFeatures, IBinder windowToken, IBinder focusGrantToken, String inputHandleName, InputChannel outInputChannel) { if (hostInputToken == null && !mCanAddInternalSystemWindow) { // Callers without INTERNAL_SYSTEM_WINDOW permission cannot grant input channel to Loading @@ -869,7 +869,7 @@ class Session extends IWindowSession.Stub implements IBinder.DeathRecipient { try { mService.grantInputChannel(this, mUid, mPid, displayId, surface, window, hostInputToken, flags, mCanAddInternalSystemWindow ? privateFlags : 0, type, windowToken, focusGrantToken, inputHandleName, type, inputFeatures, windowToken, focusGrantToken, inputHandleName, outInputChannel); } finally { Binder.restoreCallingIdentity(identity); Loading @@ -878,11 +878,11 @@ class Session extends IWindowSession.Stub implements IBinder.DeathRecipient { @Override public void updateInputChannel(IBinder channelToken, int displayId, SurfaceControl surface, int flags, int privateFlags, Region region) { int flags, int privateFlags, int inputFeatures, Region region) { final long identity = Binder.clearCallingIdentity(); try { mService.updateInputChannel(channelToken, displayId, surface, flags, mCanAddInternalSystemWindow ? privateFlags : 0, region); mCanAddInternalSystemWindow ? privateFlags : 0, inputFeatures, region); } finally { Binder.restoreCallingIdentity(identity); } Loading
services/core/java/com/android/server/wm/WindowManagerService.java +9 −7 Original line number Diff line number Diff line Loading @@ -8571,8 +8571,8 @@ public class WindowManagerService extends IWindowManager.Stub */ void grantInputChannel(Session session, int callingUid, int callingPid, int displayId, SurfaceControl surface, IWindow window, IBinder hostInputToken, int flags, int privateFlags, int type, IBinder windowToken, IBinder focusGrantToken, String inputHandleName, InputChannel outInputChannel) { int flags, int privateFlags, int inputFeatures, int type, IBinder windowToken, IBinder focusGrantToken, String inputHandleName, InputChannel outInputChannel) { final int sanitizedType = sanitizeWindowType(session, displayId, windowToken, type); final InputApplicationHandle applicationHandle; final String name; Loading @@ -8589,7 +8589,7 @@ public class WindowManagerService extends IWindowManager.Stub } updateInputChannel(clientChannel.getToken(), callingUid, callingPid, displayId, surface, name, applicationHandle, flags, privateFlags, sanitizedType, name, applicationHandle, flags, privateFlags, inputFeatures, sanitizedType, null /* region */, window); clientChannel.copyTo(outInputChannel); Loading Loading @@ -8630,13 +8630,14 @@ public class WindowManagerService extends IWindowManager.Stub private void updateInputChannel(IBinder channelToken, int callingUid, int callingPid, int displayId, SurfaceControl surface, String name, InputApplicationHandle applicationHandle, int flags, int privateFlags, int type, Region region, IWindow window) { int privateFlags, int inputFeatures, int type, Region region, IWindow window) { final InputWindowHandle h = new InputWindowHandle(applicationHandle, displayId); h.token = channelToken; h.setWindowToken(window); h.name = name; flags = sanitizeFlagSlippery(flags, name, callingUid, callingPid); inputFeatures = sanitizeSpyWindow(inputFeatures, name, callingUid, callingPid); final int sanitizedLpFlags = (flags & (FLAG_NOT_TOUCHABLE | FLAG_SLIPPERY | LayoutParams.FLAG_NOT_FOCUSABLE)) Loading @@ -8646,7 +8647,7 @@ public class WindowManagerService extends IWindowManager.Stub // Do not allow any input features to be set without sanitizing them first. h.inputConfig = InputConfigAdapter.getInputConfigFromWindowParams( type, sanitizedLpFlags, 0 /*inputFeatures*/); type, sanitizedLpFlags, inputFeatures); if ((flags & LayoutParams.FLAG_NOT_FOCUSABLE) != 0) { Loading Loading @@ -8683,7 +8684,7 @@ public class WindowManagerService extends IWindowManager.Stub * is undefined. */ void updateInputChannel(IBinder channelToken, int displayId, SurfaceControl surface, int flags, int privateFlags, Region region) { int flags, int privateFlags, int inputFeatures, Region region) { final InputApplicationHandle applicationHandle; final String name; final EmbeddedWindowController.EmbeddedWindow win; Loading @@ -8698,7 +8699,8 @@ public class WindowManagerService extends IWindowManager.Stub } updateInputChannel(channelToken, win.mOwnerUid, win.mOwnerPid, displayId, surface, name, applicationHandle, flags, privateFlags, win.mWindowType, region, win.mClient); applicationHandle, flags, privateFlags, inputFeatures, win.mWindowType, region, win.mClient); } /** Return whether layer tracing is enabled */ Loading