diff options
| author | Rob Carr <racarr@google.com> | 2022-01-27 23:34:29 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2022-01-27 23:34:29 +0000 |
| commit | faaf3151b2caa19afc15290c9608f05dea33d382 (patch) | |
| tree | e4f3b3dcc75ccf998cf6b14bd1dab8385140d559 /core/java/android | |
| parent | f654a3ceb6d1220c8130d52d4b1d139de29b3d42 (diff) | |
| parent | 6f631db81b5b826a7497dae780b516c52a418301 (diff) | |
Merge "SurfaceControlViewHost: Expose IPC helpers"
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/view/SurfaceControlViewHost.java | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/core/java/android/view/SurfaceControlViewHost.java b/core/java/android/view/SurfaceControlViewHost.java index b461faf70296..7e0d887a8f79 100644 --- a/core/java/android/view/SurfaceControlViewHost.java +++ b/core/java/android/view/SurfaceControlViewHost.java @@ -26,6 +26,7 @@ import android.graphics.Rect; import android.os.IBinder; import android.os.Parcel; import android.os.Parcelable; +import android.os.RemoteException; import android.view.accessibility.IAccessibilityEmbeddedConnection; import android.view.InsetsState; @@ -180,6 +181,36 @@ public class SurfaceControlViewHost { return mRemoteInterface; } + /** + * Forward a configuration to the remote SurfaceControlViewHost. + * This will cause View#onConfigurationChanged to be invoked on the remote + * end. This does not automatically cause the SurfaceControlViewHost + * to be resized. The root View of a SurfaceControlViewHost + * is more akin to a PopupWindow in that the size is user specified + * independent of configuration width and height. + * + * @param c The configuration to forward + */ + public void notifyConfigurationChanged(@NonNull Configuration c) { + try { + getRemoteInterface().onConfigurationChanged(c); + } catch (RemoteException e) { + e.rethrowAsRuntimeException(); + } + } + + /** + * Tear down the remote SurfaceControlViewHost and cause + * View#onDetachedFromWindow to be invoked on the other side. + */ + public void notifyDetachedFromWindow() { + try { + getRemoteInterface().onDispatchDetachedFromWindow(); + } catch (RemoteException e) { + e.rethrowAsRuntimeException(); + } + } + @Override public int describeContents() { return 0; |
