Loading core/java/android/service/autofill/InlineSuggestionRenderService.java +1 −1 Original line number Diff line number Diff line Loading @@ -166,7 +166,7 @@ public abstract class InlineSuggestionRenderService extends Service { PixelFormat.TRANSPARENT); final SurfaceControlViewHost host = new SurfaceControlViewHost(this, getDisplay(), hostInputToken); 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 +1 −1 Original line number Diff line number Diff line Loading @@ -125,7 +125,7 @@ public abstract class GameSessionService extends Service { final Context windowContext = createWindowContext(display, WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY, /*options=*/ null); SurfaceControlViewHost surfaceControlViewHost = new SurfaceControlViewHost(windowContext, display, hostToken); new SurfaceControlViewHost(windowContext, display, hostToken, "GameSessionService"); gameSession.attach( gameSessionController, Loading core/java/android/service/selectiontoolbar/RemoteSelectionToolbar.java +1 −1 Original line number Diff line number Diff line Loading @@ -275,7 +275,7 @@ final class RemoteSelectionToolbar { mHostInputToken, mTransferTouchListener); contentHolder.addView(mContentContainer); mSurfaceControlViewHost = new SurfaceControlViewHost(mContext, mContext.getDisplay(), mHostInputToken); mHostInputToken, "RemoteSelectionToolbar"); mSurfaceControlViewHost.setView(contentHolder, mPopupWidth, mPopupHeight); } if (mSurfacePackage == null) { Loading core/java/android/view/SurfaceControlViewHost.java +30 −3 Original line number Diff line number Diff line Loading @@ -32,6 +32,8 @@ import android.view.accessibility.IAccessibilityEmbeddedConnection; import android.window.ISurfaceSyncGroup; import android.window.WindowTokenClient; import dalvik.system.CloseGuard; import java.util.Objects; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; Loading @@ -51,6 +53,7 @@ import java.util.concurrent.TimeoutException; public class SurfaceControlViewHost { private final static String TAG = "SurfaceControlViewHost"; private final ViewRootImpl mViewRoot; private final CloseGuard mCloseGuard = CloseGuard.get(); private WindowlessWindowManager mWm; private SurfaceControl mSurfaceControl; Loading Loading @@ -292,9 +295,10 @@ public class SurfaceControlViewHost { /** @hide */ public SurfaceControlViewHost(@NonNull Context c, @NonNull Display d, @NonNull WindowlessWindowManager wwm) { @NonNull WindowlessWindowManager wwm, @NonNull String callsite) { mWm = wwm; mViewRoot = new ViewRootImpl(c, d, mWm, new WindowlessWindowLayout()); mCloseGuard.openWithCallSite("release", callsite); addConfigCallback(c, d); WindowManagerGlobal.getInstance().addWindowlessRoot(mViewRoot); Loading @@ -316,15 +320,35 @@ public class SurfaceControlViewHost { */ public SurfaceControlViewHost(@NonNull Context context, @NonNull Display display, @Nullable IBinder hostToken) { this(context, display, hostToken, "untracked"); } /** * Construct a new SurfaceControlViewHost. The root Surface will be * allocated internally and is accessible via getSurfacePackage(). * * The {@param hostToken} parameter, primarily used for ANR reporting, * must be obtained from whomever will be hosting the embedded hierarchy. * It's accessible from {@link SurfaceView#getHostToken}. * * @param context The Context object for your activity or application. * @param display The Display the hierarchy will be placed on. * @param hostToken The host token, as discussed above. * @param callsite The call site, used for tracking leakage of the host * @hide */ public SurfaceControlViewHost(@NonNull Context context, @NonNull Display display, @Nullable IBinder hostToken, @NonNull String callsite) { mSurfaceControl = new SurfaceControl.Builder() .setContainerLayer() .setName("SurfaceControlViewHost") .setCallsite("SurfaceControlViewHost") .setCallsite("SurfaceControlViewHost[" + callsite + "]") .build(); mWm = new WindowlessWindowManager(context.getResources().getConfiguration(), mSurfaceControl, hostToken); mViewRoot = new ViewRootImpl(context, display, mWm, new WindowlessWindowLayout()); mCloseGuard.openWithCallSite("release", callsite); addConfigCallback(context, display); WindowManagerGlobal.getInstance().addWindowlessRoot(mViewRoot); Loading @@ -350,7 +374,9 @@ public class SurfaceControlViewHost { if (mReleased) { return; } Log.e(TAG, "SurfaceControlViewHost finalized without being released: " + this); if (mCloseGuard != null) { mCloseGuard.warnIfOpen(); } // We aren't on the UI thread here so we need to pass false to doDie mViewRoot.die(false /* immediate */); WindowManagerGlobal.getInstance().removeWindowlessRoot(mViewRoot); Loading Loading @@ -466,6 +492,7 @@ public class SurfaceControlViewHost { mViewRoot.die(true /* immediate */); WindowManagerGlobal.getInstance().removeWindowlessRoot(mViewRoot); mReleased = true; mCloseGuard.close(); } /** Loading core/java/android/window/SplashScreenView.java +2 −1 Original line number Diff line number Diff line Loading @@ -333,7 +333,8 @@ public final class SplashScreenView extends FrameLayout { SurfaceControlViewHost viewHost = new SurfaceControlViewHost(viewContext, viewContext.getDisplay(), surfaceView.getHostToken()); surfaceView.getHostToken(), "SplashScreenView"); ImageView imageView = new ImageView(viewContext); imageView.setBackground(mIconDrawable); viewHost.setView(imageView, mIconSize, mIconSize); Loading Loading
core/java/android/service/autofill/InlineSuggestionRenderService.java +1 −1 Original line number Diff line number Diff line Loading @@ -166,7 +166,7 @@ public abstract class InlineSuggestionRenderService extends Service { PixelFormat.TRANSPARENT); final SurfaceControlViewHost host = new SurfaceControlViewHost(this, getDisplay(), hostInputToken); 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 +1 −1 Original line number Diff line number Diff line Loading @@ -125,7 +125,7 @@ public abstract class GameSessionService extends Service { final Context windowContext = createWindowContext(display, WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY, /*options=*/ null); SurfaceControlViewHost surfaceControlViewHost = new SurfaceControlViewHost(windowContext, display, hostToken); new SurfaceControlViewHost(windowContext, display, hostToken, "GameSessionService"); gameSession.attach( gameSessionController, Loading
core/java/android/service/selectiontoolbar/RemoteSelectionToolbar.java +1 −1 Original line number Diff line number Diff line Loading @@ -275,7 +275,7 @@ final class RemoteSelectionToolbar { mHostInputToken, mTransferTouchListener); contentHolder.addView(mContentContainer); mSurfaceControlViewHost = new SurfaceControlViewHost(mContext, mContext.getDisplay(), mHostInputToken); mHostInputToken, "RemoteSelectionToolbar"); mSurfaceControlViewHost.setView(contentHolder, mPopupWidth, mPopupHeight); } if (mSurfacePackage == null) { Loading
core/java/android/view/SurfaceControlViewHost.java +30 −3 Original line number Diff line number Diff line Loading @@ -32,6 +32,8 @@ import android.view.accessibility.IAccessibilityEmbeddedConnection; import android.window.ISurfaceSyncGroup; import android.window.WindowTokenClient; import dalvik.system.CloseGuard; import java.util.Objects; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; Loading @@ -51,6 +53,7 @@ import java.util.concurrent.TimeoutException; public class SurfaceControlViewHost { private final static String TAG = "SurfaceControlViewHost"; private final ViewRootImpl mViewRoot; private final CloseGuard mCloseGuard = CloseGuard.get(); private WindowlessWindowManager mWm; private SurfaceControl mSurfaceControl; Loading Loading @@ -292,9 +295,10 @@ public class SurfaceControlViewHost { /** @hide */ public SurfaceControlViewHost(@NonNull Context c, @NonNull Display d, @NonNull WindowlessWindowManager wwm) { @NonNull WindowlessWindowManager wwm, @NonNull String callsite) { mWm = wwm; mViewRoot = new ViewRootImpl(c, d, mWm, new WindowlessWindowLayout()); mCloseGuard.openWithCallSite("release", callsite); addConfigCallback(c, d); WindowManagerGlobal.getInstance().addWindowlessRoot(mViewRoot); Loading @@ -316,15 +320,35 @@ public class SurfaceControlViewHost { */ public SurfaceControlViewHost(@NonNull Context context, @NonNull Display display, @Nullable IBinder hostToken) { this(context, display, hostToken, "untracked"); } /** * Construct a new SurfaceControlViewHost. The root Surface will be * allocated internally and is accessible via getSurfacePackage(). * * The {@param hostToken} parameter, primarily used for ANR reporting, * must be obtained from whomever will be hosting the embedded hierarchy. * It's accessible from {@link SurfaceView#getHostToken}. * * @param context The Context object for your activity or application. * @param display The Display the hierarchy will be placed on. * @param hostToken The host token, as discussed above. * @param callsite The call site, used for tracking leakage of the host * @hide */ public SurfaceControlViewHost(@NonNull Context context, @NonNull Display display, @Nullable IBinder hostToken, @NonNull String callsite) { mSurfaceControl = new SurfaceControl.Builder() .setContainerLayer() .setName("SurfaceControlViewHost") .setCallsite("SurfaceControlViewHost") .setCallsite("SurfaceControlViewHost[" + callsite + "]") .build(); mWm = new WindowlessWindowManager(context.getResources().getConfiguration(), mSurfaceControl, hostToken); mViewRoot = new ViewRootImpl(context, display, mWm, new WindowlessWindowLayout()); mCloseGuard.openWithCallSite("release", callsite); addConfigCallback(context, display); WindowManagerGlobal.getInstance().addWindowlessRoot(mViewRoot); Loading @@ -350,7 +374,9 @@ public class SurfaceControlViewHost { if (mReleased) { return; } Log.e(TAG, "SurfaceControlViewHost finalized without being released: " + this); if (mCloseGuard != null) { mCloseGuard.warnIfOpen(); } // We aren't on the UI thread here so we need to pass false to doDie mViewRoot.die(false /* immediate */); WindowManagerGlobal.getInstance().removeWindowlessRoot(mViewRoot); Loading Loading @@ -466,6 +492,7 @@ public class SurfaceControlViewHost { mViewRoot.die(true /* immediate */); WindowManagerGlobal.getInstance().removeWindowlessRoot(mViewRoot); mReleased = true; mCloseGuard.close(); } /** Loading
core/java/android/window/SplashScreenView.java +2 −1 Original line number Diff line number Diff line Loading @@ -333,7 +333,8 @@ public final class SplashScreenView extends FrameLayout { SurfaceControlViewHost viewHost = new SurfaceControlViewHost(viewContext, viewContext.getDisplay(), surfaceView.getHostToken()); surfaceView.getHostToken(), "SplashScreenView"); ImageView imageView = new ImageView(viewContext); imageView.setBackground(mIconDrawable); viewHost.setView(imageView, mIconSize, mIconSize); Loading