diff options
| author | Evan Rosky <erosky@google.com> | 2019-10-09 19:27:52 -0700 |
|---|---|---|
| committer | Evan Rosky <erosky@google.com> | 2019-11-25 17:19:22 -0800 |
| commit | 3f09bb3f11845bffc9d63f6eacb9ce53cc208ba7 (patch) | |
| tree | 161ceeaec72cbc747888054d91e42892fbf967da /core/java/android/view/WindowlessViewRoot.java | |
| parent | 58bea80fd242676a0303de4c9c387be9949ed465 (diff) | |
Add some lifecycle functionality to WindowlessWM
This adds other parts of the window lifecycle (eg. ViewRoot
death, window removal, layout update). Some of the lifecycle
controls are just utilities, but are needed so that they
can be performed out-of-package.
It also shows/hides the surface based on underlying view
visibility. In actual WM, the surface is actually created/
destroyed based on visibility, but this breaks continuity
in WWM because the WWM user should have full control over
it.
Also made this public so it can be subclassed.
Bug: 133381284
Test: manual test in later CLs
Change-Id: Ibd7792c3f52c216089d9b498e3770e100ff24642
Diffstat (limited to 'core/java/android/view/WindowlessViewRoot.java')
| -rw-r--r-- | core/java/android/view/WindowlessViewRoot.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/core/java/android/view/WindowlessViewRoot.java b/core/java/android/view/WindowlessViewRoot.java index addf8e242e3d..68f2bde9c265 100644 --- a/core/java/android/view/WindowlessViewRoot.java +++ b/core/java/android/view/WindowlessViewRoot.java @@ -32,6 +32,14 @@ import android.os.IBinder; public class WindowlessViewRoot { private ViewRootImpl mViewRoot; private WindowlessWindowManager mWm; + + /** @hide */ + public WindowlessViewRoot(@NonNull Context c, @NonNull Display d, + @NonNull WindowlessWindowManager wwm) { + mWm = wwm; + mViewRoot = new ViewRootImpl(c, d, mWm); + } + public WindowlessViewRoot(@NonNull Context c, @NonNull Display d, @NonNull SurfaceControl rootSurface, @Nullable IBinder hostInputToken) { @@ -55,4 +63,12 @@ public class WindowlessViewRoot { public void dispose() { mViewRoot.dispatchDetachedFromWindow(); } + + /** + * Tell this viewroot to clean itself up. + * @hide + */ + public void die() { + mViewRoot.die(false /* immediate */); + } } |
