diff options
| author | Jorim Jaggi <jjaggi@google.com> | 2019-01-22 19:01:48 +0100 |
|---|---|---|
| committer | Jorim Jaggi <jjaggi@google.com> | 2020-03-03 15:12:15 +0100 |
| commit | 57157ac5d8d602e9497753333b8a47de5cf6ec81 (patch) | |
| tree | f53a46a59537127e2d3318824a9614ff65bb0cff /core/java/android/view/ViewRootImpl.java | |
| parent | 920105c38ba977c8b56e16e4d969ead3acbc576f (diff) | |
Fix WindowInsetsController lifecycle
Provide a recording insets controller before the window gets
created, and replay the commands once a view gets attached. This
allows the client to use the controller in Activity.onCreate.
Test: WindowInsetsControllerTests
Bug: 118118435
Change-Id: I1a825ecc4367c02b27f2d08cd5442325315d4f89
Diffstat (limited to 'core/java/android/view/ViewRootImpl.java')
| -rw-r--r-- | core/java/android/view/ViewRootImpl.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index 4de1c969057d..229143a71d57 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -1117,6 +1117,14 @@ public final class ViewRootImpl implements ViewParent, mFirstInputStage = nativePreImeStage; mFirstPostImeInputStage = earlyPostImeStage; mPendingInputEventQueueLengthCounterName = "aq:pending:" + counterSuffix; + + if (mView instanceof RootViewSurfaceTaker) { + PendingInsetsController pendingInsetsController = + ((RootViewSurfaceTaker) mView).providePendingInsetsController(); + if (pendingInsetsController != null) { + pendingInsetsController.replayAndAttach(mInsetsController); + } + } } } } |
