Loading core/api/current.txt +1 −0 Original line number Original line Diff line number Diff line Loading @@ -49829,6 +49829,7 @@ package android.view { method public default void removeOnBufferTransformHintChangedListener(@NonNull android.view.AttachedSurfaceControl.OnBufferTransformHintChangedListener); method public default void removeOnBufferTransformHintChangedListener(@NonNull android.view.AttachedSurfaceControl.OnBufferTransformHintChangedListener); method public default void setChildBoundingInsets(@NonNull android.graphics.Rect); method public default void setChildBoundingInsets(@NonNull android.graphics.Rect); method public default void setTouchableRegion(@Nullable android.graphics.Region); method public default void setTouchableRegion(@Nullable android.graphics.Region); method @FlaggedApi("com.android.window.flags.transfer_gesture_to_embedded") public default boolean transferHostTouchGestureToEmbedded(@NonNull android.view.SurfaceControlViewHost.SurfacePackage); } } @UiThread public static interface AttachedSurfaceControl.OnBufferTransformHintChangedListener { @UiThread public static interface AttachedSurfaceControl.OnBufferTransformHintChangedListener { core/java/android/view/AttachedSurfaceControl.java +15 −0 Original line number Original line Diff line number Diff line Loading @@ -231,4 +231,19 @@ public interface AttachedSurfaceControl { default void removeTrustedPresentationCallback(@NonNull SurfaceControl.Transaction t, default void removeTrustedPresentationCallback(@NonNull SurfaceControl.Transaction t, @NonNull Consumer<Boolean> listener) { @NonNull Consumer<Boolean> listener) { } } /** * Transfer the currently in progress touch gesture from the host to the requested * {@link SurfaceControlViewHost.SurfacePackage}. This requires that the * SurfaceControlViewHost was created with the current host's inputToken. * * @param surfacePackage The SurfacePackage to transfer the gesture to. * @return Whether the touch stream was transferred. */ @FlaggedApi(Flags.FLAG_TRANSFER_GESTURE_TO_EMBEDDED) default boolean transferHostTouchGestureToEmbedded( @NonNull SurfaceControlViewHost.SurfacePackage surfacePackage) { throw new UnsupportedOperationException( "transferHostTouchGestureToEmbedded is unimplemented"); } } } core/java/android/view/IWindowSession.aidl +2 −0 Original line number Original line Diff line number Diff line Loading @@ -357,4 +357,6 @@ interface IWindowSession { boolean cancelDraw(IWindow window); boolean cancelDraw(IWindow window); boolean transferEmbeddedTouchFocusToHost(IWindow embeddedWindow); boolean transferEmbeddedTouchFocusToHost(IWindow embeddedWindow); boolean transferHostTouchGestureToEmbedded(IWindow hostWindow, IBinder transferTouchToken); } } core/java/android/view/SurfaceControlViewHost.java +4 −2 Original line number Original line Diff line number Diff line Loading @@ -287,7 +287,8 @@ public class SurfaceControlViewHost { } } /** /** * Returns an input token used which can be used to request focus on the embedded surface. * Returns an input token used which can be used to request focus on the embedded surface * or to transfer touch gesture to the embedded surface. * * * @hide * @hide */ */ Loading Loading @@ -526,7 +527,8 @@ public class SurfaceControlViewHost { } } /** /** * Returns an input token used which can be used to request focus on the embedded surface. * Returns an input token used which can be used to request focus on the embedded surface * or to transfer touch gesture to the embedded surface. * * * @hide * @hide */ */ Loading core/java/android/view/ViewRootImpl.java +13 −0 Original line number Original line Diff line number Diff line Loading @@ -11893,4 +11893,17 @@ public final class ViewRootImpl implements ViewParent, } } Log.d(mTag, msg); Log.d(mTag, msg); } } @Override public boolean transferHostTouchGestureToEmbedded( @NonNull SurfaceControlViewHost.SurfacePackage surfacePackage) { final IWindowSession realWm = WindowManagerGlobal.getWindowSession(); try { return realWm.transferHostTouchGestureToEmbedded(mWindow, surfacePackage.getInputToken()); } catch (RemoteException e) { e.rethrowAsRuntimeException(); } return false; } } } Loading
core/api/current.txt +1 −0 Original line number Original line Diff line number Diff line Loading @@ -49829,6 +49829,7 @@ package android.view { method public default void removeOnBufferTransformHintChangedListener(@NonNull android.view.AttachedSurfaceControl.OnBufferTransformHintChangedListener); method public default void removeOnBufferTransformHintChangedListener(@NonNull android.view.AttachedSurfaceControl.OnBufferTransformHintChangedListener); method public default void setChildBoundingInsets(@NonNull android.graphics.Rect); method public default void setChildBoundingInsets(@NonNull android.graphics.Rect); method public default void setTouchableRegion(@Nullable android.graphics.Region); method public default void setTouchableRegion(@Nullable android.graphics.Region); method @FlaggedApi("com.android.window.flags.transfer_gesture_to_embedded") public default boolean transferHostTouchGestureToEmbedded(@NonNull android.view.SurfaceControlViewHost.SurfacePackage); } } @UiThread public static interface AttachedSurfaceControl.OnBufferTransformHintChangedListener { @UiThread public static interface AttachedSurfaceControl.OnBufferTransformHintChangedListener {
core/java/android/view/AttachedSurfaceControl.java +15 −0 Original line number Original line Diff line number Diff line Loading @@ -231,4 +231,19 @@ public interface AttachedSurfaceControl { default void removeTrustedPresentationCallback(@NonNull SurfaceControl.Transaction t, default void removeTrustedPresentationCallback(@NonNull SurfaceControl.Transaction t, @NonNull Consumer<Boolean> listener) { @NonNull Consumer<Boolean> listener) { } } /** * Transfer the currently in progress touch gesture from the host to the requested * {@link SurfaceControlViewHost.SurfacePackage}. This requires that the * SurfaceControlViewHost was created with the current host's inputToken. * * @param surfacePackage The SurfacePackage to transfer the gesture to. * @return Whether the touch stream was transferred. */ @FlaggedApi(Flags.FLAG_TRANSFER_GESTURE_TO_EMBEDDED) default boolean transferHostTouchGestureToEmbedded( @NonNull SurfaceControlViewHost.SurfacePackage surfacePackage) { throw new UnsupportedOperationException( "transferHostTouchGestureToEmbedded is unimplemented"); } } }
core/java/android/view/IWindowSession.aidl +2 −0 Original line number Original line Diff line number Diff line Loading @@ -357,4 +357,6 @@ interface IWindowSession { boolean cancelDraw(IWindow window); boolean cancelDraw(IWindow window); boolean transferEmbeddedTouchFocusToHost(IWindow embeddedWindow); boolean transferEmbeddedTouchFocusToHost(IWindow embeddedWindow); boolean transferHostTouchGestureToEmbedded(IWindow hostWindow, IBinder transferTouchToken); } }
core/java/android/view/SurfaceControlViewHost.java +4 −2 Original line number Original line Diff line number Diff line Loading @@ -287,7 +287,8 @@ public class SurfaceControlViewHost { } } /** /** * Returns an input token used which can be used to request focus on the embedded surface. * Returns an input token used which can be used to request focus on the embedded surface * or to transfer touch gesture to the embedded surface. * * * @hide * @hide */ */ Loading Loading @@ -526,7 +527,8 @@ public class SurfaceControlViewHost { } } /** /** * Returns an input token used which can be used to request focus on the embedded surface. * Returns an input token used which can be used to request focus on the embedded surface * or to transfer touch gesture to the embedded surface. * * * @hide * @hide */ */ Loading
core/java/android/view/ViewRootImpl.java +13 −0 Original line number Original line Diff line number Diff line Loading @@ -11893,4 +11893,17 @@ public final class ViewRootImpl implements ViewParent, } } Log.d(mTag, msg); Log.d(mTag, msg); } } @Override public boolean transferHostTouchGestureToEmbedded( @NonNull SurfaceControlViewHost.SurfacePackage surfacePackage) { final IWindowSession realWm = WindowManagerGlobal.getWindowSession(); try { return realWm.transferHostTouchGestureToEmbedded(mWindow, surfacePackage.getInputToken()); } catch (RemoteException e) { e.rethrowAsRuntimeException(); } return false; } } }