Loading core/java/android/view/AttachedSurfaceControl.java +1 −1 Original line number Diff line number Diff line Loading @@ -192,7 +192,7 @@ public interface AttachedSurfaceControl { * {@link WindowManager#registerUnbatchedSurfaceControlInputReceiver(int, InputTransferToken, * SurfaceControl, Looper, SurfaceControlInputReceiver)} * * @return The SurfaceControlViewHost link token. * @return The {@link InputTransferToken} for the {@link AttachedSurfaceControl} * @throws IllegalStateException if the {@link AttachedSurfaceControl} was created with no * registered input */ Loading core/java/android/view/SurfaceControlViewHost.java +1 −0 Original line number Diff line number Diff line Loading @@ -293,6 +293,7 @@ public class SurfaceControlViewHost { /** * Gets an {@link InputTransferToken} which can be used to request focus on the embedded * surface or to transfer touch gesture to the embedded surface. * * @return the InputTransferToken associated with {@link SurfacePackage} or {@code null} if * the embedded hasn't set up its view or doesn't have input. * @see WindowManager#transferTouchGesture(InputTransferToken, InputTransferToken) Loading core/java/android/view/WindowManager.java +10 −11 Original line number Diff line number Diff line Loading @@ -6184,7 +6184,7 @@ public interface WindowManager extends ViewManager { * receive batched input event. For those events that are batched, the invocation will happen * once per {@link Choreographer} frame, and other input events will be delivered immediately. * This is different from * { #registerUnbatchedSurfaceControlInputReceiver(int, InputTransferToken, SurfaceControl, * {@link #registerUnbatchedSurfaceControlInputReceiver(int, InputTransferToken, SurfaceControl, * Looper, SurfaceControlInputReceiver)} in that the input events are received batched. The * caller must invoke {@link #unregisterSurfaceControlInputReceiver(SurfaceControl)} to clean up * the resources when no longer needing to use the {@link SurfaceControlInputReceiver} Loading Loading @@ -6253,10 +6253,9 @@ public interface WindowManager extends ViewManager { * <p> * Must be called on the same {@link Looper} thread to which was passed to the * {@link #registerBatchedSurfaceControlInputReceiver(int, InputTransferToken, SurfaceControl, * Choreographer, * SurfaceControlInputReceiver)} or * {@link #registerUnbatchedSurfaceControlInputReceiver(int, InputTransferToken, SurfaceControl, Looper, * SurfaceControlInputReceiver)} * Choreographer, SurfaceControlInputReceiver)} or * {@link #registerUnbatchedSurfaceControlInputReceiver(int, InputTransferToken, SurfaceControl, * Looper, SurfaceControlInputReceiver)} * * @param surfaceControl The SurfaceControl to remove and unregister the input channel for. */ Loading @@ -6267,12 +6266,12 @@ public interface WindowManager extends ViewManager { } /** * Returns the input client token for the {@link SurfaceControl}. This will only return non null * if the SurfaceControl was registered for input via * { #registerBatchedSurfaceControlInputReceiver(int, IBinder, SurfaceControl, Choreographer, * SurfaceControlInputReceiver)} or * {@link #registerUnbatchedSurfaceControlInputReceiver(int, InputTransferToken, SurfaceControl, Looper, * SurfaceControlInputReceiver)}. * Returns the input client token for the {@link SurfaceControl}. This will only return non * null if the SurfaceControl was registered for input via * {@link #registerBatchedSurfaceControlInputReceiver(int, InputTransferToken, SurfaceControl, * Choreographer, SurfaceControlInputReceiver)} or * {@link #registerUnbatchedSurfaceControlInputReceiver(int, InputTransferToken, * SurfaceControl, Looper, SurfaceControlInputReceiver)}. * <p> * This is helpful for testing to ensure the test waits for the layer to be registered with * SurfaceFlinger and Input before proceeding with the test. Loading core/java/android/view/WindowManagerGlobal.java +4 −4 Original line number Diff line number Diff line Loading @@ -898,7 +898,7 @@ public final class WindowManagerGlobal { return inputTransferToken; } void unregisterSurfaceControlInputReceiver(SurfaceControl surfaceControl) { void unregisterSurfaceControlInputReceiver(@NonNull SurfaceControl surfaceControl) { SurfaceControlInputReceiverInfo surfaceControlInputReceiverInfo; synchronized (mSurfaceControlInputReceivers) { surfaceControlInputReceiverInfo = mSurfaceControlInputReceivers.removeReturnOld( Loading @@ -920,7 +920,7 @@ public final class WindowManagerGlobal { surfaceControlInputReceiverInfo.mInputEventReceiver.dispose(); } IBinder getSurfaceControlInputClientToken(SurfaceControl surfaceControl) { IBinder getSurfaceControlInputClientToken(@NonNull SurfaceControl surfaceControl) { SurfaceControlInputReceiverInfo surfaceControlInputReceiverInfo; synchronized (mSurfaceControlInputReceivers) { surfaceControlInputReceiverInfo = mSurfaceControlInputReceivers.get( Loading @@ -934,8 +934,8 @@ public final class WindowManagerGlobal { return surfaceControlInputReceiverInfo.mClientToken; } boolean transferTouchGesture(InputTransferToken transferFromToken, InputTransferToken transferToToken) { boolean transferTouchGesture(@NonNull InputTransferToken transferFromToken, @NonNull InputTransferToken transferToToken) { try { return getWindowManagerService().transferTouchGesture(transferFromToken, transferToToken); Loading core/java/android/view/WindowManagerImpl.java +10 −0 Original line number Diff line number Diff line Loading @@ -539,6 +539,10 @@ public final class WindowManagerImpl implements WindowManager { @NonNull InputTransferToken hostInputTransferToken, @NonNull SurfaceControl surfaceControl, @NonNull Choreographer choreographer, @NonNull SurfaceControlInputReceiver receiver) { Objects.requireNonNull(hostInputTransferToken); Objects.requireNonNull(surfaceControl); Objects.requireNonNull(choreographer); Objects.requireNonNull(receiver); return mGlobal.registerBatchedSurfaceControlInputReceiver(displayId, hostInputTransferToken, surfaceControl, choreographer, receiver); } Loading @@ -549,18 +553,24 @@ public final class WindowManagerImpl implements WindowManager { @NonNull InputTransferToken hostInputTransferToken, @NonNull SurfaceControl surfaceControl, @NonNull Looper looper, @NonNull SurfaceControlInputReceiver receiver) { Objects.requireNonNull(hostInputTransferToken); Objects.requireNonNull(surfaceControl); Objects.requireNonNull(looper); Objects.requireNonNull(receiver); return mGlobal.registerUnbatchedSurfaceControlInputReceiver(displayId, hostInputTransferToken, surfaceControl, looper, receiver); } @Override public void unregisterSurfaceControlInputReceiver(@NonNull SurfaceControl surfaceControl) { Objects.requireNonNull(surfaceControl); mGlobal.unregisterSurfaceControlInputReceiver(surfaceControl); } @Override @Nullable public IBinder getSurfaceControlInputClientToken(@NonNull SurfaceControl surfaceControl) { Objects.requireNonNull(surfaceControl); return mGlobal.getSurfaceControlInputClientToken(surfaceControl); } Loading Loading
core/java/android/view/AttachedSurfaceControl.java +1 −1 Original line number Diff line number Diff line Loading @@ -192,7 +192,7 @@ public interface AttachedSurfaceControl { * {@link WindowManager#registerUnbatchedSurfaceControlInputReceiver(int, InputTransferToken, * SurfaceControl, Looper, SurfaceControlInputReceiver)} * * @return The SurfaceControlViewHost link token. * @return The {@link InputTransferToken} for the {@link AttachedSurfaceControl} * @throws IllegalStateException if the {@link AttachedSurfaceControl} was created with no * registered input */ Loading
core/java/android/view/SurfaceControlViewHost.java +1 −0 Original line number Diff line number Diff line Loading @@ -293,6 +293,7 @@ public class SurfaceControlViewHost { /** * Gets an {@link InputTransferToken} which can be used to request focus on the embedded * surface or to transfer touch gesture to the embedded surface. * * @return the InputTransferToken associated with {@link SurfacePackage} or {@code null} if * the embedded hasn't set up its view or doesn't have input. * @see WindowManager#transferTouchGesture(InputTransferToken, InputTransferToken) Loading
core/java/android/view/WindowManager.java +10 −11 Original line number Diff line number Diff line Loading @@ -6184,7 +6184,7 @@ public interface WindowManager extends ViewManager { * receive batched input event. For those events that are batched, the invocation will happen * once per {@link Choreographer} frame, and other input events will be delivered immediately. * This is different from * { #registerUnbatchedSurfaceControlInputReceiver(int, InputTransferToken, SurfaceControl, * {@link #registerUnbatchedSurfaceControlInputReceiver(int, InputTransferToken, SurfaceControl, * Looper, SurfaceControlInputReceiver)} in that the input events are received batched. The * caller must invoke {@link #unregisterSurfaceControlInputReceiver(SurfaceControl)} to clean up * the resources when no longer needing to use the {@link SurfaceControlInputReceiver} Loading Loading @@ -6253,10 +6253,9 @@ public interface WindowManager extends ViewManager { * <p> * Must be called on the same {@link Looper} thread to which was passed to the * {@link #registerBatchedSurfaceControlInputReceiver(int, InputTransferToken, SurfaceControl, * Choreographer, * SurfaceControlInputReceiver)} or * {@link #registerUnbatchedSurfaceControlInputReceiver(int, InputTransferToken, SurfaceControl, Looper, * SurfaceControlInputReceiver)} * Choreographer, SurfaceControlInputReceiver)} or * {@link #registerUnbatchedSurfaceControlInputReceiver(int, InputTransferToken, SurfaceControl, * Looper, SurfaceControlInputReceiver)} * * @param surfaceControl The SurfaceControl to remove and unregister the input channel for. */ Loading @@ -6267,12 +6266,12 @@ public interface WindowManager extends ViewManager { } /** * Returns the input client token for the {@link SurfaceControl}. This will only return non null * if the SurfaceControl was registered for input via * { #registerBatchedSurfaceControlInputReceiver(int, IBinder, SurfaceControl, Choreographer, * SurfaceControlInputReceiver)} or * {@link #registerUnbatchedSurfaceControlInputReceiver(int, InputTransferToken, SurfaceControl, Looper, * SurfaceControlInputReceiver)}. * Returns the input client token for the {@link SurfaceControl}. This will only return non * null if the SurfaceControl was registered for input via * {@link #registerBatchedSurfaceControlInputReceiver(int, InputTransferToken, SurfaceControl, * Choreographer, SurfaceControlInputReceiver)} or * {@link #registerUnbatchedSurfaceControlInputReceiver(int, InputTransferToken, * SurfaceControl, Looper, SurfaceControlInputReceiver)}. * <p> * This is helpful for testing to ensure the test waits for the layer to be registered with * SurfaceFlinger and Input before proceeding with the test. Loading
core/java/android/view/WindowManagerGlobal.java +4 −4 Original line number Diff line number Diff line Loading @@ -898,7 +898,7 @@ public final class WindowManagerGlobal { return inputTransferToken; } void unregisterSurfaceControlInputReceiver(SurfaceControl surfaceControl) { void unregisterSurfaceControlInputReceiver(@NonNull SurfaceControl surfaceControl) { SurfaceControlInputReceiverInfo surfaceControlInputReceiverInfo; synchronized (mSurfaceControlInputReceivers) { surfaceControlInputReceiverInfo = mSurfaceControlInputReceivers.removeReturnOld( Loading @@ -920,7 +920,7 @@ public final class WindowManagerGlobal { surfaceControlInputReceiverInfo.mInputEventReceiver.dispose(); } IBinder getSurfaceControlInputClientToken(SurfaceControl surfaceControl) { IBinder getSurfaceControlInputClientToken(@NonNull SurfaceControl surfaceControl) { SurfaceControlInputReceiverInfo surfaceControlInputReceiverInfo; synchronized (mSurfaceControlInputReceivers) { surfaceControlInputReceiverInfo = mSurfaceControlInputReceivers.get( Loading @@ -934,8 +934,8 @@ public final class WindowManagerGlobal { return surfaceControlInputReceiverInfo.mClientToken; } boolean transferTouchGesture(InputTransferToken transferFromToken, InputTransferToken transferToToken) { boolean transferTouchGesture(@NonNull InputTransferToken transferFromToken, @NonNull InputTransferToken transferToToken) { try { return getWindowManagerService().transferTouchGesture(transferFromToken, transferToToken); Loading
core/java/android/view/WindowManagerImpl.java +10 −0 Original line number Diff line number Diff line Loading @@ -539,6 +539,10 @@ public final class WindowManagerImpl implements WindowManager { @NonNull InputTransferToken hostInputTransferToken, @NonNull SurfaceControl surfaceControl, @NonNull Choreographer choreographer, @NonNull SurfaceControlInputReceiver receiver) { Objects.requireNonNull(hostInputTransferToken); Objects.requireNonNull(surfaceControl); Objects.requireNonNull(choreographer); Objects.requireNonNull(receiver); return mGlobal.registerBatchedSurfaceControlInputReceiver(displayId, hostInputTransferToken, surfaceControl, choreographer, receiver); } Loading @@ -549,18 +553,24 @@ public final class WindowManagerImpl implements WindowManager { @NonNull InputTransferToken hostInputTransferToken, @NonNull SurfaceControl surfaceControl, @NonNull Looper looper, @NonNull SurfaceControlInputReceiver receiver) { Objects.requireNonNull(hostInputTransferToken); Objects.requireNonNull(surfaceControl); Objects.requireNonNull(looper); Objects.requireNonNull(receiver); return mGlobal.registerUnbatchedSurfaceControlInputReceiver(displayId, hostInputTransferToken, surfaceControl, looper, receiver); } @Override public void unregisterSurfaceControlInputReceiver(@NonNull SurfaceControl surfaceControl) { Objects.requireNonNull(surfaceControl); mGlobal.unregisterSurfaceControlInputReceiver(surfaceControl); } @Override @Nullable public IBinder getSurfaceControlInputClientToken(@NonNull SurfaceControl surfaceControl) { Objects.requireNonNull(surfaceControl); return mGlobal.getSurfaceControlInputClientToken(surfaceControl); } Loading