diff options
| author | 2020-05-12 14:19:12 +0000 | |
|---|---|---|
| committer | 2020-05-12 14:19:12 +0000 | |
| commit | efd288a3119a90f41d75d589faec4d94939b90bd (patch) | |
| tree | 640ffddb77858014193047d84b112f47fb57ffb0 | |
| parent | 772be3e0ca043be330c623f476d89276cb4a0d02 (diff) | |
| parent | af2c7c42dc29c93e4162b24e245f1d979adb519a (diff) | |
Merge "Reset visibilities if mDummyControlTarget is the control target" into rvc-dev
| -rw-r--r-- | services/core/java/com/android/server/wm/InsetsPolicy.java | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/wm/InsetsPolicy.java b/services/core/java/com/android/server/wm/InsetsPolicy.java index 317bb43adb98..d02be88ef0d4 100644 --- a/services/core/java/com/android/server/wm/InsetsPolicy.java +++ b/services/core/java/com/android/server/wm/InsetsPolicy.java @@ -60,7 +60,37 @@ class InsetsPolicy { private final IntArray mShowingTransientTypes = new IntArray(); /** For resetting visibilities of insets sources. */ - private final InsetsControlTarget mDummyControlTarget = new InsetsControlTarget() { }; + private final InsetsControlTarget mDummyControlTarget = new InsetsControlTarget() { + + @Override + public void notifyInsetsControlChanged() { + boolean hasLeash = false; + final InsetsSourceControl[] controls = + mStateController.getControlsForDispatch(this); + if (controls == null) { + return; + } + for (InsetsSourceControl control : controls) { + final @InternalInsetsType int type = control.getType(); + if (mShowingTransientTypes.indexOf(type) != -1) { + // The visibilities of transient bars will be handled with animations. + continue; + } + final SurfaceControl leash = control.getLeash(); + if (leash != null) { + hasLeash = true; + + // We use alpha to control the visibility here which aligns the logic at + // SurfaceAnimator.createAnimationLeash + mDisplayContent.getPendingTransaction().setAlpha( + leash, InsetsState.getDefaultVisibility(type) ? 1f : 0f); + } + } + if (hasLeash) { + mDisplayContent.scheduleAnimation(); + } + } + }; private WindowState mFocusedWin; private BarWindow mStatusBar = new BarWindow(StatusBarManager.WINDOW_STATUS_BAR); |