diff options
| author | 2020-04-07 17:25:10 +0000 | |
|---|---|---|
| committer | 2020-04-07 17:25:10 +0000 | |
| commit | 2d8d9812e9925ed017c5ce10208b3d807258a2cc (patch) | |
| tree | c348a1f5a030520f14af0fdf9c47dfe5673115bb | |
| parent | 41db36ec481d65e86edf44044853bda7a7972ff5 (diff) | |
| parent | 51e4c2f25d04fca66bf0d91c29b016989a18303a (diff) | |
Merge "Move DimLayer to Root if translucent window and not multi-window" into rvc-dev
| -rw-r--r-- | services/core/java/com/android/server/wm/DisplayArea.java | 6 | ||||
| -rw-r--r-- | services/core/java/com/android/server/wm/Task.java | 15 |
2 files changed, 21 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/wm/DisplayArea.java b/services/core/java/com/android/server/wm/DisplayArea.java index 90fdf19d9781..edd14b7bebf3 100644 --- a/services/core/java/com/android/server/wm/DisplayArea.java +++ b/services/core/java/com/android/server/wm/DisplayArea.java @@ -253,6 +253,12 @@ public class DisplayArea<T extends WindowContainer> extends WindowContainer<T> { super.prepareSurfaces(); getBounds(mTmpDimBoundsRect); + // If SystemUI is dragging for recents, we want to reset the dim state so any dim layer + // on the display level fades out. + if (forAllTasks(task -> !task.canAffectSystemUiFlags())) { + mDimmer.resetDimStates(); + } + if (mDimmer.updateDims(getPendingTransaction(), mTmpDimBoundsRect)) { scheduleAnimation(); } diff --git a/services/core/java/com/android/server/wm/Task.java b/services/core/java/com/android/server/wm/Task.java index cb897db9a2d0..9adacb8c578d 100644 --- a/services/core/java/com/android/server/wm/Task.java +++ b/services/core/java/com/android/server/wm/Task.java @@ -3348,6 +3348,21 @@ class Task extends WindowContainer<WindowContainer> { @Override Dimmer getDimmer() { + // If the window is in multi-window mode, we want to dim at the Task level to ensure the dim + // bounds match the area the app lives in + if (inMultiWindowMode()) { + return mDimmer; + } + + // If we're not at the root task level, we want to keep traversing through the parents to + // find the root. + // Once at the root task level, we want to check {@link #isTranslucent(ActivityRecord)}. + // If true, we want to get the Dimmer from the level above since we don't want to animate + // the dim with the Task. + if (!isRootTask() || isTranslucent(null)) { + return super.getDimmer(); + } + return mDimmer; } |