Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit be69476b authored by Sakar Khattar's avatar Sakar Khattar
Browse files

Copy SurfaceControl object for inprocess calls from WindowlessWindowManager to WindowManager

Test: Manually tested on device via SurfaceControlViewHost.setView()->WindowlessWindowManager.addToDisplay()
Bug: b/171914211 (for original change on rvc-wear-dev)
Change-Id: I474949b53c570e01ba678e088a5001618ff0b26e
(cherry picked from commit 9eec64f031a1a1992461251ed3451fc48fd59224)
parent 637ddadc
Loading
Loading
Loading
Loading
+16 −3
Original line number Diff line number Diff line
@@ -149,8 +149,15 @@ public class WindowlessWindowManager implements IWindowSession {
        if (((attrs.inputFeatures &
                WindowManager.LayoutParams.INPUT_FEATURE_NO_INPUT_CHANNEL) == 0)) {
            try {
                if(mRealWm instanceof IWindowSession.Stub) {
                    mRealWm.grantInputChannel(displayId,
                        new SurfaceControl(sc, "WindowlessWindowManager.addToDisplay"),
                        window, mHostInputToken, attrs.flags, attrs.privateFlags, attrs.type,
                        outInputChannel);
                } else {
                    mRealWm.grantInputChannel(displayId, sc, window, mHostInputToken, attrs.flags,
                        attrs.privateFlags, attrs.type, outInputChannel);
                }
            } catch (RemoteException e) {
                Log.e(TAG, "Failed to grant input to surface: ", e);
            }
@@ -293,8 +300,14 @@ public class WindowlessWindowManager implements IWindowSession {
        if ((attrChanges & WindowManager.LayoutParams.FLAGS_CHANGED) != 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);
                } else {
                    mRealWm.updateInputChannel(state.mInputChannelToken, state.mDisplayId, sc,
                            attrs.flags, attrs.privateFlags, state.mInputRegion);
                }
            } catch (RemoteException e) {
                Log.e(TAG, "Failed to update surface input channel: ", e);
            }