Loading core/java/android/service/autofill/InlineSuggestionRenderService.java +2 −1 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ import android.view.SurfaceControlViewHost; import android.view.View; import android.view.ViewGroup; import android.view.WindowManager; import android.window.InputTransferToken; import java.io.FileDescriptor; import java.io.PrintWriter; Loading Loading @@ -166,7 +167,7 @@ public abstract class InlineSuggestionRenderService extends Service { PixelFormat.TRANSPARENT); final SurfaceControlViewHost host = new SurfaceControlViewHost(this, getDisplay(), hostInputToken, "InlineSuggestionRenderService"); new InputTransferToken(hostInputToken), "InlineSuggestionRenderService"); host.setView(suggestionRoot, lp); // Set the suggestion view to be non-focusable so that if its background is set to a Loading core/java/android/service/games/GameSessionService.java +3 −4 Original line number Diff line number Diff line Loading @@ -24,12 +24,12 @@ import android.app.Service; import android.content.Context; import android.content.Intent; import android.hardware.display.DisplayManager; import android.os.Binder; import android.os.Handler; import android.os.IBinder; import android.view.Display; import android.view.SurfaceControlViewHost; import android.view.WindowManager; import android.window.InputTransferToken; import com.android.internal.infra.AndroidFuture; import com.android.internal.util.function.pooled.PooledLambda; Loading Loading @@ -118,14 +118,13 @@ public abstract class GameSessionService extends Service { return; } IBinder hostToken = new Binder(); // Use a WindowContext so that views attached to the SurfaceControlViewHost will receive // configuration changes (rather than always perceiving the global configuration). final Context windowContext = createWindowContext(display, WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY, /*options=*/ null); SurfaceControlViewHost surfaceControlViewHost = new SurfaceControlViewHost(windowContext, display, hostToken, "GameSessionService"); new SurfaceControlViewHost(windowContext, display, new InputTransferToken(), "GameSessionService"); gameSession.attach( gameSessionController, Loading core/java/android/view/AttachedSurfaceControl.java +15 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.graphics.Rect; import android.graphics.Region; import android.hardware.HardwareBuffer; import android.os.IBinder; import android.window.InputTransferToken; import android.window.SurfaceSyncGroup; import com.android.window.flags.Flags; Loading Loading @@ -194,6 +195,20 @@ public interface AttachedSurfaceControl { + "implemented before making this call."); } /** * Gets the token used for associating this {@link AttachedSurfaceControl} with an embedded * {@link SurfaceControlViewHost} or {@link SurfaceControl} * * @return The SurfaceControlViewHost link token. This can return {@code null} if the * {@link AttachedSurfaceControl} was created with no registered input * @hide */ @Nullable default InputTransferToken getInputTransferToken() { throw new UnsupportedOperationException("The getHostToken needs to be " + "implemented before making this call."); } /** * Transfer the currently in progress touch gesture from the host to the requested * {@link SurfaceControlViewHost.SurfacePackage}. This requires that the Loading core/java/android/view/IWindowManager.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -73,6 +73,7 @@ import android.window.IScreenRecordingCallback; import android.window.ISurfaceSyncGroupCompletedListener; import android.window.ITaskFpsCallback; import android.window.ITrustedPresentationListener; import android.window.InputTransferToken; import android.window.ScreenCapture; import android.window.TrustedPresentationThresholds; import android.window.WindowContextInfo; Loading core/java/android/view/IWindowSession.aidl +8 −4 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ import android.view.Surface; import android.view.SurfaceControl; import android.view.SurfaceControl.Transaction; import android.window.ClientWindowFrames; import android.window.InputTransferToken; import android.window.OnBackInvokedCallbackInfo; import java.util.List; Loading Loading @@ -310,8 +311,9 @@ interface IWindowSession { * be used as unique identifier. */ void grantInputChannel(int displayId, in SurfaceControl surface, in IBinder clientToken, in IBinder hostInputToken, int flags, int privateFlags, int inputFeatures, int type, in IBinder windowToken, in IBinder focusGrantToken, String inputHandleName, in @nullable InputTransferToken hostInputTransferToken, int flags, int privateFlags, int inputFeatures, int type, in IBinder windowToken, in InputTransferToken embeddedInputTransferToken, String inputHandleName, out InputChannel outInputChannel); /** Loading @@ -332,7 +334,8 @@ interface IWindowSession { * should be transferred back to the host window. If there is no host * window, the system will try to find a new focus target. */ void grantEmbeddedWindowFocus(IWindow window, in IBinder inputToken, boolean grantFocus); void grantEmbeddedWindowFocus(IWindow window, in InputTransferToken inputToken, boolean grantFocus); /** * Generates an DisplayHash that can be used to validate whether specific content was on Loading Loading @@ -369,7 +372,8 @@ interface IWindowSession { boolean transferEmbeddedTouchFocusToHost(IWindow embeddedWindow); boolean transferHostTouchGestureToEmbedded(IWindow hostWindow, IBinder transferTouchToken); boolean transferHostTouchGestureToEmbedded(IWindow hostWindow, in InputTransferToken transferTouchToken); /** * Moves the focus to the adjacent window if there is one in the given direction. This can only Loading Loading
core/java/android/service/autofill/InlineSuggestionRenderService.java +2 −1 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ import android.view.SurfaceControlViewHost; import android.view.View; import android.view.ViewGroup; import android.view.WindowManager; import android.window.InputTransferToken; import java.io.FileDescriptor; import java.io.PrintWriter; Loading Loading @@ -166,7 +167,7 @@ public abstract class InlineSuggestionRenderService extends Service { PixelFormat.TRANSPARENT); final SurfaceControlViewHost host = new SurfaceControlViewHost(this, getDisplay(), hostInputToken, "InlineSuggestionRenderService"); new InputTransferToken(hostInputToken), "InlineSuggestionRenderService"); host.setView(suggestionRoot, lp); // Set the suggestion view to be non-focusable so that if its background is set to a Loading
core/java/android/service/games/GameSessionService.java +3 −4 Original line number Diff line number Diff line Loading @@ -24,12 +24,12 @@ import android.app.Service; import android.content.Context; import android.content.Intent; import android.hardware.display.DisplayManager; import android.os.Binder; import android.os.Handler; import android.os.IBinder; import android.view.Display; import android.view.SurfaceControlViewHost; import android.view.WindowManager; import android.window.InputTransferToken; import com.android.internal.infra.AndroidFuture; import com.android.internal.util.function.pooled.PooledLambda; Loading Loading @@ -118,14 +118,13 @@ public abstract class GameSessionService extends Service { return; } IBinder hostToken = new Binder(); // Use a WindowContext so that views attached to the SurfaceControlViewHost will receive // configuration changes (rather than always perceiving the global configuration). final Context windowContext = createWindowContext(display, WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY, /*options=*/ null); SurfaceControlViewHost surfaceControlViewHost = new SurfaceControlViewHost(windowContext, display, hostToken, "GameSessionService"); new SurfaceControlViewHost(windowContext, display, new InputTransferToken(), "GameSessionService"); gameSession.attach( gameSessionController, Loading
core/java/android/view/AttachedSurfaceControl.java +15 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.graphics.Rect; import android.graphics.Region; import android.hardware.HardwareBuffer; import android.os.IBinder; import android.window.InputTransferToken; import android.window.SurfaceSyncGroup; import com.android.window.flags.Flags; Loading Loading @@ -194,6 +195,20 @@ public interface AttachedSurfaceControl { + "implemented before making this call."); } /** * Gets the token used for associating this {@link AttachedSurfaceControl} with an embedded * {@link SurfaceControlViewHost} or {@link SurfaceControl} * * @return The SurfaceControlViewHost link token. This can return {@code null} if the * {@link AttachedSurfaceControl} was created with no registered input * @hide */ @Nullable default InputTransferToken getInputTransferToken() { throw new UnsupportedOperationException("The getHostToken needs to be " + "implemented before making this call."); } /** * Transfer the currently in progress touch gesture from the host to the requested * {@link SurfaceControlViewHost.SurfacePackage}. This requires that the Loading
core/java/android/view/IWindowManager.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -73,6 +73,7 @@ import android.window.IScreenRecordingCallback; import android.window.ISurfaceSyncGroupCompletedListener; import android.window.ITaskFpsCallback; import android.window.ITrustedPresentationListener; import android.window.InputTransferToken; import android.window.ScreenCapture; import android.window.TrustedPresentationThresholds; import android.window.WindowContextInfo; Loading
core/java/android/view/IWindowSession.aidl +8 −4 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ import android.view.Surface; import android.view.SurfaceControl; import android.view.SurfaceControl.Transaction; import android.window.ClientWindowFrames; import android.window.InputTransferToken; import android.window.OnBackInvokedCallbackInfo; import java.util.List; Loading Loading @@ -310,8 +311,9 @@ interface IWindowSession { * be used as unique identifier. */ void grantInputChannel(int displayId, in SurfaceControl surface, in IBinder clientToken, in IBinder hostInputToken, int flags, int privateFlags, int inputFeatures, int type, in IBinder windowToken, in IBinder focusGrantToken, String inputHandleName, in @nullable InputTransferToken hostInputTransferToken, int flags, int privateFlags, int inputFeatures, int type, in IBinder windowToken, in InputTransferToken embeddedInputTransferToken, String inputHandleName, out InputChannel outInputChannel); /** Loading @@ -332,7 +334,8 @@ interface IWindowSession { * should be transferred back to the host window. If there is no host * window, the system will try to find a new focus target. */ void grantEmbeddedWindowFocus(IWindow window, in IBinder inputToken, boolean grantFocus); void grantEmbeddedWindowFocus(IWindow window, in InputTransferToken inputToken, boolean grantFocus); /** * Generates an DisplayHash that can be used to validate whether specific content was on Loading Loading @@ -369,7 +372,8 @@ interface IWindowSession { boolean transferEmbeddedTouchFocusToHost(IWindow embeddedWindow); boolean transferHostTouchGestureToEmbedded(IWindow hostWindow, IBinder transferTouchToken); boolean transferHostTouchGestureToEmbedded(IWindow hostWindow, in InputTransferToken transferTouchToken); /** * Moves the focus to the adjacent window if there is one in the given direction. This can only Loading