Loading services/core/java/com/android/server/wm/DimLayer.java +2 −0 Original line number Diff line number Diff line Loading @@ -77,6 +77,8 @@ public class DimLayer { boolean dimFullscreen(); /** Returns the display info. of the dim layer user. */ DisplayInfo getDisplayInfo(); /** Returns true if the dim layer user is currently attached to a display */ boolean isAttachedToDisplay(); /** Gets the bounds of the dim layer user. */ void getDimBounds(Rect outBounds); String toShortString(); Loading services/core/java/com/android/server/wm/DimLayerController.java +15 −2 Original line number Diff line number Diff line Loading @@ -191,8 +191,21 @@ class DimLayerController { boolean result = false; for (int i = mState.size() - 1; i >= 0; i--) { DimLayer.DimLayerUser user = mState.keyAt(i); DimLayerState state = mState.valueAt(i); final DimLayer.DimLayerUser user = mState.keyAt(i); final DimLayerState state = mState.valueAt(i); if (!user.isAttachedToDisplay()) { // Leaked dim user that is no longer attached to the display. Go ahead and clean it // clean-up and log what happened. // TODO: This is a work around for b/34395537 as the dim user should have cleaned-up // it self when it was detached from the display. Need to investigate how the dim // user is leaking... Slog.wtfStack(TAG_WM, "Leaked dim user=" + user.toShortString() + " state=" + state); removeDimLayerUser(user); continue; } // We have to check that we are actually the shared fullscreen layer // for this path. If we began as non fullscreen and became fullscreen // (e.g. Docked stack closing), then we may not be the shared layer Loading services/core/java/com/android/server/wm/DockedStackDividerController.java +5 −0 Original line number Diff line number Diff line Loading @@ -834,6 +834,11 @@ public class DockedStackDividerController implements DimLayerUser { return mDisplayContent.getDisplayInfo(); } @Override public boolean isAttachedToDisplay() { return mDisplayContent != null; } @Override public void getDimBounds(Rect outBounds) { // This dim layer user doesn't need this. Loading services/core/java/com/android/server/wm/Task.java +6 −1 Original line number Diff line number Diff line Loading @@ -628,7 +628,12 @@ class Task extends WindowContainer<AppWindowToken> implements DimLayer.DimLayerU @Override public DisplayInfo getDisplayInfo() { return mStack.getDisplayContent().getDisplayInfo(); return getDisplayContent().getDisplayInfo(); } @Override public boolean isAttachedToDisplay() { return getDisplayContent() != null; } void forceWindowsScaleable(boolean force) { Loading services/core/java/com/android/server/wm/TaskPositioner.java +5 −0 Original line number Diff line number Diff line Loading @@ -692,6 +692,11 @@ class TaskPositioner implements DimLayer.DimLayerUser { return mTask.mStack.getDisplayInfo(); } @Override public boolean isAttachedToDisplay() { return mTask != null && mTask.getDisplayContent() != null; } @Override public void getDimBounds(Rect out) { // This dim layer user doesn't need this. Loading Loading
services/core/java/com/android/server/wm/DimLayer.java +2 −0 Original line number Diff line number Diff line Loading @@ -77,6 +77,8 @@ public class DimLayer { boolean dimFullscreen(); /** Returns the display info. of the dim layer user. */ DisplayInfo getDisplayInfo(); /** Returns true if the dim layer user is currently attached to a display */ boolean isAttachedToDisplay(); /** Gets the bounds of the dim layer user. */ void getDimBounds(Rect outBounds); String toShortString(); Loading
services/core/java/com/android/server/wm/DimLayerController.java +15 −2 Original line number Diff line number Diff line Loading @@ -191,8 +191,21 @@ class DimLayerController { boolean result = false; for (int i = mState.size() - 1; i >= 0; i--) { DimLayer.DimLayerUser user = mState.keyAt(i); DimLayerState state = mState.valueAt(i); final DimLayer.DimLayerUser user = mState.keyAt(i); final DimLayerState state = mState.valueAt(i); if (!user.isAttachedToDisplay()) { // Leaked dim user that is no longer attached to the display. Go ahead and clean it // clean-up and log what happened. // TODO: This is a work around for b/34395537 as the dim user should have cleaned-up // it self when it was detached from the display. Need to investigate how the dim // user is leaking... Slog.wtfStack(TAG_WM, "Leaked dim user=" + user.toShortString() + " state=" + state); removeDimLayerUser(user); continue; } // We have to check that we are actually the shared fullscreen layer // for this path. If we began as non fullscreen and became fullscreen // (e.g. Docked stack closing), then we may not be the shared layer Loading
services/core/java/com/android/server/wm/DockedStackDividerController.java +5 −0 Original line number Diff line number Diff line Loading @@ -834,6 +834,11 @@ public class DockedStackDividerController implements DimLayerUser { return mDisplayContent.getDisplayInfo(); } @Override public boolean isAttachedToDisplay() { return mDisplayContent != null; } @Override public void getDimBounds(Rect outBounds) { // This dim layer user doesn't need this. Loading
services/core/java/com/android/server/wm/Task.java +6 −1 Original line number Diff line number Diff line Loading @@ -628,7 +628,12 @@ class Task extends WindowContainer<AppWindowToken> implements DimLayer.DimLayerU @Override public DisplayInfo getDisplayInfo() { return mStack.getDisplayContent().getDisplayInfo(); return getDisplayContent().getDisplayInfo(); } @Override public boolean isAttachedToDisplay() { return getDisplayContent() != null; } void forceWindowsScaleable(boolean force) { Loading
services/core/java/com/android/server/wm/TaskPositioner.java +5 −0 Original line number Diff line number Diff line Loading @@ -692,6 +692,11 @@ class TaskPositioner implements DimLayer.DimLayerUser { return mTask.mStack.getDisplayInfo(); } @Override public boolean isAttachedToDisplay() { return mTask != null && mTask.getDisplayContent() != null; } @Override public void getDimBounds(Rect out) { // This dim layer user doesn't need this. Loading