diff options
| author | Robert Carr <racarr@google.com> | 2018-02-26 17:46:00 -0800 |
|---|---|---|
| committer | Robert Carr <racarr@google.com> | 2018-02-28 11:44:14 -0800 |
| commit | c6d5af556e9e8b682d24e457e6236fe5ee11e2a6 (patch) | |
| tree | 37016d4b72fe94a4c272dbc7760d80f8f7a0de75 /core/java/android/view/WindowManager.java | |
| parent | 74a66a2c7ba0ee3472d4863c958df5d41bbc3267 (diff) | |
Handle surfaceInset changes with deferred transactions.
First we have the client pass up the next frameNumber from relayoutWindow
and then we simply deferTransactions at the WindowState level until
this frame number is reached. This was always a little terrifying
because deferring transaction effecftively meant we gave up
control of the surface until the frame number was reached. However now
we can still control the surface from the stack and other SurfaceControl
nodes and so the window can still be moved around and animated even if
the client is unresponsive.
Bug: 70666541
Test: Manual. go/wm-smoke
Change-Id: I2fecbeaa30fc0eb9cc8f08e1ea734dcc65da0aa0
Diffstat (limited to 'core/java/android/view/WindowManager.java')
| -rw-r--r-- | core/java/android/view/WindowManager.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/core/java/android/view/WindowManager.java b/core/java/android/view/WindowManager.java index c0a966602b0a..e2717018bb2c 100644 --- a/core/java/android/view/WindowManager.java +++ b/core/java/android/view/WindowManager.java @@ -2371,6 +2371,13 @@ public interface WindowManager extends ViewManager { public long hideTimeoutMilliseconds = -1; /** + * A frame number in which changes requested in this layout will be rendered. + * + * @hide + */ + public long frameNumber = -1; + + /** * The color mode requested by this window. The target display may * not be able to honor the request. When the color mode is not set * to {@link ActivityInfo#COLOR_MODE_DEFAULT}, it might override the @@ -2543,6 +2550,7 @@ public interface WindowManager extends ViewManager { TextUtils.writeToParcel(accessibilityTitle, out, parcelableFlags); out.writeInt(mColorMode); out.writeLong(hideTimeoutMilliseconds); + out.writeLong(frameNumber); } public static final Parcelable.Creator<LayoutParams> CREATOR @@ -2599,6 +2607,7 @@ public interface WindowManager extends ViewManager { accessibilityTitle = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in); mColorMode = in.readInt(); hideTimeoutMilliseconds = in.readLong(); + frameNumber = in.readLong(); } @SuppressWarnings({"PointlessBitwiseExpression"}) @@ -2799,6 +2808,10 @@ public interface WindowManager extends ViewManager { changes |= SURFACE_INSETS_CHANGED; } + // The frame number changing is only relevant in the context of other + // changes, and so we don't need to track it with a flag. + frameNumber = o.frameNumber; + if (hasManualSurfaceInsets != o.hasManualSurfaceInsets) { hasManualSurfaceInsets = o.hasManualSurfaceInsets; changes |= SURFACE_INSETS_CHANGED; |
