Loading core/java/android/view/ISurfaceControlViewHost.aidl 0 → 100644 +28 −0 Original line number Diff line number Diff line /* ** Copyright 2021, The Android Open Source Project ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. ** You may obtain a copy of the License at ** ** http://www.apache.org/licenses/LICENSE-2.0 ** ** Unless required by applicable law or agreed to in writing, software ** distributed under the License is distributed on an "AS IS" BASIS, ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ** See the License for the specific language governing permissions and ** limitations under the License. */ package android.view; import android.content.res.Configuration; /** * API from content embedder back to embedded content in SurfaceControlViewHost * {@hide} */ oneway interface ISurfaceControlViewHost { void onConfigurationChanged(in Configuration newConfig); void onDispatchDetachedFromWindow(); } core/java/android/view/OWNERS +1 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,7 @@ per-file Inset*.aidl = file:/services/core/java/com/android/server/wm/OWNERS per-file IPinnedStackListener.aidl = file:/services/core/java/com/android/server/wm/OWNERS per-file IRecents*.aidl = file:/services/core/java/com/android/server/wm/OWNERS per-file IRemote*.aidl = file:/services/core/java/com/android/server/wm/OWNERS per-file ISurfaceControlViewHost*.aidl = file:/services/core/java/com/android/server/wm/OWNERS per-file IWindow*.aidl = file:/services/core/java/com/android/server/wm/OWNERS per-file RemoteAnimation*.java = file:/services/core/java/com/android/server/wm/OWNERS per-file RemoteAnimation*.aidl = file:/services/core/java/com/android/server/wm/OWNERS Loading core/java/android/view/SurfaceControlViewHost.java +45 −2 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.TestApi; import android.content.Context; import android.content.res.Configuration; import android.graphics.PixelFormat; import android.os.IBinder; import android.os.Parcel; Loading @@ -45,6 +46,35 @@ public class SurfaceControlViewHost { private SurfaceControl mSurfaceControl; private IAccessibilityEmbeddedConnection mAccessibilityEmbeddedConnection; private final class ISurfaceControlViewHostImpl extends ISurfaceControlViewHost.Stub { @Override public void onConfigurationChanged(Configuration configuration) { if (mViewRoot == null) { return; } mViewRoot.mHandler.post(() -> { if (mWm != null) { mWm.setConfiguration(configuration); } if (mViewRoot != null) { mViewRoot.forceWmRelayout(); } }); } @Override public void onDispatchDetachedFromWindow() { if (mViewRoot == null) { return; } mViewRoot.mHandler.post(() -> { release(); }); } } private ISurfaceControlViewHost mRemoteInterface = new ISurfaceControlViewHostImpl(); /** * Package encapsulating a Surface hierarchy which contains interactive view * elements. It's expected to get this object from Loading @@ -71,12 +101,14 @@ public class SurfaceControlViewHost { private SurfaceControl mSurfaceControl; private final IAccessibilityEmbeddedConnection mAccessibilityEmbeddedConnection; private final IBinder mInputToken; private final ISurfaceControlViewHost mRemoteInterface; SurfacePackage(SurfaceControl sc, IAccessibilityEmbeddedConnection connection, IBinder inputToken) { IBinder inputToken, ISurfaceControlViewHost ri) { mSurfaceControl = sc; mAccessibilityEmbeddedConnection = connection; mInputToken = inputToken; mRemoteInterface = ri; } /** Loading @@ -97,6 +129,7 @@ public class SurfaceControlViewHost { } mAccessibilityEmbeddedConnection = other.mAccessibilityEmbeddedConnection; mInputToken = other.mInputToken; mRemoteInterface = other.mRemoteInterface; } private SurfacePackage(Parcel in) { Loading @@ -105,6 +138,8 @@ public class SurfaceControlViewHost { mAccessibilityEmbeddedConnection = IAccessibilityEmbeddedConnection.Stub.asInterface( in.readStrongBinder()); mInputToken = in.readStrongBinder(); mRemoteInterface = ISurfaceControlViewHost.Stub.asInterface( in.readStrongBinder()); } /** Loading @@ -126,6 +161,13 @@ public class SurfaceControlViewHost { return mAccessibilityEmbeddedConnection; } /** * @hide */ public ISurfaceControlViewHost getRemoteInterface() { return mRemoteInterface; } @Override public int describeContents() { return 0; Loading @@ -136,6 +178,7 @@ public class SurfaceControlViewHost { mSurfaceControl.writeToParcel(out, flags); out.writeStrongBinder(mAccessibilityEmbeddedConnection.asBinder()); out.writeStrongBinder(mInputToken); out.writeStrongBinder(mRemoteInterface.asBinder()); } /** Loading Loading @@ -231,7 +274,7 @@ public class SurfaceControlViewHost { public @Nullable SurfacePackage getSurfacePackage() { if (mSurfaceControl != null && mAccessibilityEmbeddedConnection != null) { return new SurfacePackage(mSurfaceControl, mAccessibilityEmbeddedConnection, mViewRoot.getInputToken()); mViewRoot.getInputToken(), mRemoteInterface); } else { return null; } Loading core/java/android/view/ViewRootImpl.java +5 −0 Original line number Diff line number Diff line Loading @@ -10639,4 +10639,9 @@ public final class ViewRootImpl implements ViewParent, boolean wasRelayoutRequested() { return mRelayoutRequested; } void forceWmRelayout() { mForceNextWindowRelayout = true; scheduleTraversals(); } } core/java/android/view/WindowlessWindowManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -87,7 +87,7 @@ public class WindowlessWindowManager implements IWindowSession { mHostInputToken = hostInputToken; } protected void setConfiguration(Configuration configuration) { public void setConfiguration(Configuration configuration) { mConfiguration.setTo(configuration); } Loading Loading
core/java/android/view/ISurfaceControlViewHost.aidl 0 → 100644 +28 −0 Original line number Diff line number Diff line /* ** Copyright 2021, The Android Open Source Project ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. ** You may obtain a copy of the License at ** ** http://www.apache.org/licenses/LICENSE-2.0 ** ** Unless required by applicable law or agreed to in writing, software ** distributed under the License is distributed on an "AS IS" BASIS, ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ** See the License for the specific language governing permissions and ** limitations under the License. */ package android.view; import android.content.res.Configuration; /** * API from content embedder back to embedded content in SurfaceControlViewHost * {@hide} */ oneway interface ISurfaceControlViewHost { void onConfigurationChanged(in Configuration newConfig); void onDispatchDetachedFromWindow(); }
core/java/android/view/OWNERS +1 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,7 @@ per-file Inset*.aidl = file:/services/core/java/com/android/server/wm/OWNERS per-file IPinnedStackListener.aidl = file:/services/core/java/com/android/server/wm/OWNERS per-file IRecents*.aidl = file:/services/core/java/com/android/server/wm/OWNERS per-file IRemote*.aidl = file:/services/core/java/com/android/server/wm/OWNERS per-file ISurfaceControlViewHost*.aidl = file:/services/core/java/com/android/server/wm/OWNERS per-file IWindow*.aidl = file:/services/core/java/com/android/server/wm/OWNERS per-file RemoteAnimation*.java = file:/services/core/java/com/android/server/wm/OWNERS per-file RemoteAnimation*.aidl = file:/services/core/java/com/android/server/wm/OWNERS Loading
core/java/android/view/SurfaceControlViewHost.java +45 −2 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.TestApi; import android.content.Context; import android.content.res.Configuration; import android.graphics.PixelFormat; import android.os.IBinder; import android.os.Parcel; Loading @@ -45,6 +46,35 @@ public class SurfaceControlViewHost { private SurfaceControl mSurfaceControl; private IAccessibilityEmbeddedConnection mAccessibilityEmbeddedConnection; private final class ISurfaceControlViewHostImpl extends ISurfaceControlViewHost.Stub { @Override public void onConfigurationChanged(Configuration configuration) { if (mViewRoot == null) { return; } mViewRoot.mHandler.post(() -> { if (mWm != null) { mWm.setConfiguration(configuration); } if (mViewRoot != null) { mViewRoot.forceWmRelayout(); } }); } @Override public void onDispatchDetachedFromWindow() { if (mViewRoot == null) { return; } mViewRoot.mHandler.post(() -> { release(); }); } } private ISurfaceControlViewHost mRemoteInterface = new ISurfaceControlViewHostImpl(); /** * Package encapsulating a Surface hierarchy which contains interactive view * elements. It's expected to get this object from Loading @@ -71,12 +101,14 @@ public class SurfaceControlViewHost { private SurfaceControl mSurfaceControl; private final IAccessibilityEmbeddedConnection mAccessibilityEmbeddedConnection; private final IBinder mInputToken; private final ISurfaceControlViewHost mRemoteInterface; SurfacePackage(SurfaceControl sc, IAccessibilityEmbeddedConnection connection, IBinder inputToken) { IBinder inputToken, ISurfaceControlViewHost ri) { mSurfaceControl = sc; mAccessibilityEmbeddedConnection = connection; mInputToken = inputToken; mRemoteInterface = ri; } /** Loading @@ -97,6 +129,7 @@ public class SurfaceControlViewHost { } mAccessibilityEmbeddedConnection = other.mAccessibilityEmbeddedConnection; mInputToken = other.mInputToken; mRemoteInterface = other.mRemoteInterface; } private SurfacePackage(Parcel in) { Loading @@ -105,6 +138,8 @@ public class SurfaceControlViewHost { mAccessibilityEmbeddedConnection = IAccessibilityEmbeddedConnection.Stub.asInterface( in.readStrongBinder()); mInputToken = in.readStrongBinder(); mRemoteInterface = ISurfaceControlViewHost.Stub.asInterface( in.readStrongBinder()); } /** Loading @@ -126,6 +161,13 @@ public class SurfaceControlViewHost { return mAccessibilityEmbeddedConnection; } /** * @hide */ public ISurfaceControlViewHost getRemoteInterface() { return mRemoteInterface; } @Override public int describeContents() { return 0; Loading @@ -136,6 +178,7 @@ public class SurfaceControlViewHost { mSurfaceControl.writeToParcel(out, flags); out.writeStrongBinder(mAccessibilityEmbeddedConnection.asBinder()); out.writeStrongBinder(mInputToken); out.writeStrongBinder(mRemoteInterface.asBinder()); } /** Loading Loading @@ -231,7 +274,7 @@ public class SurfaceControlViewHost { public @Nullable SurfacePackage getSurfacePackage() { if (mSurfaceControl != null && mAccessibilityEmbeddedConnection != null) { return new SurfacePackage(mSurfaceControl, mAccessibilityEmbeddedConnection, mViewRoot.getInputToken()); mViewRoot.getInputToken(), mRemoteInterface); } else { return null; } Loading
core/java/android/view/ViewRootImpl.java +5 −0 Original line number Diff line number Diff line Loading @@ -10639,4 +10639,9 @@ public final class ViewRootImpl implements ViewParent, boolean wasRelayoutRequested() { return mRelayoutRequested; } void forceWmRelayout() { mForceNextWindowRelayout = true; scheduleTraversals(); } }
core/java/android/view/WindowlessWindowManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -87,7 +87,7 @@ public class WindowlessWindowManager implements IWindowSession { mHostInputToken = hostInputToken; } protected void setConfiguration(Configuration configuration) { public void setConfiguration(Configuration configuration) { mConfiguration.setTo(configuration); } Loading