Loading services/core/java/com/android/server/wm/Task.java +27 −13 Original line number Diff line number Diff line Loading @@ -1918,7 +1918,6 @@ class Task extends WindowContainer<WindowContainer> { super.onConfigurationChanged(newParentConfig); if (wasInMultiWindowMode != inMultiWindowMode()) { mStackSupervisor.scheduleUpdateMultiWindowMode(this); updateShadowsRadius(isFocused(), getPendingTransaction()); } final int newWinMode = getWindowingMode(); Loading Loading @@ -3325,6 +3324,7 @@ class Task extends WindowContainer<WindowContainer> { } updateSurfaceCrop(); updateShadowsRadius(isFocused(), getPendingTransaction()); if (mDimmer.updateDims(getPendingTransaction(), mTmpDimBoundsRect)) { scheduleAnimation(); Loading Loading @@ -4148,29 +4148,43 @@ class Task extends WindowContainer<WindowContainer> { return mDisplayContent.mCurrentFocus.getTask() == this; } /** * @return true if the task is visible and has at least one visible child. */ private boolean hasVisibleChildren() { if (!isAttached() || isForceHidden()) { return false; } return getActivity(ActivityRecord::isVisible) != null; } /** * @return the desired shadow radius in pixels for the current task. */ private float getShadowRadius(boolean taskIsFocused) { if (mDisplayContent == null) { return 0; } int elevation = 0; // Get elevation for a specific windowing mode. if (inPinnedWindowingMode()) { return dipToPixel(PINNED_WINDOWING_MODE_ELEVATION_IN_DIP, mDisplayContent.getDisplayMetrics()); } elevation = PINNED_WINDOWING_MODE_ELEVATION_IN_DIP; } else if (ENABLE_FREEFORM_COMPOSITOR_SHADOWS && inFreeformWindowingMode()) { // TODO(b/149585281) remove when root task has the correct bounds for freeform if (ENABLE_FREEFORM_COMPOSITOR_SHADOWS && inFreeformWindowingMode()) { final int elevation = taskIsFocused elevation = taskIsFocused ? DECOR_SHADOW_FOCUSED_HEIGHT_IN_DIP : DECOR_SHADOW_UNFOCUSED_HEIGHT_IN_DIP; return dipToPixel(elevation, mDisplayContent.getDisplayMetrics()); } else { // For all other windowing modes, do not draw a shadow. return 0; } // For all other windowing modes, do not draw a shadow. // If the task has no visible children, do not draw a shadow. if (!hasVisibleChildren()) { return 0; } return dipToPixel(elevation, getDisplayContent().getDisplayMetrics()); } /** * Update the length of the shadow if needed based on windowing mode and task focus state. */ Loading Loading
services/core/java/com/android/server/wm/Task.java +27 −13 Original line number Diff line number Diff line Loading @@ -1918,7 +1918,6 @@ class Task extends WindowContainer<WindowContainer> { super.onConfigurationChanged(newParentConfig); if (wasInMultiWindowMode != inMultiWindowMode()) { mStackSupervisor.scheduleUpdateMultiWindowMode(this); updateShadowsRadius(isFocused(), getPendingTransaction()); } final int newWinMode = getWindowingMode(); Loading Loading @@ -3325,6 +3324,7 @@ class Task extends WindowContainer<WindowContainer> { } updateSurfaceCrop(); updateShadowsRadius(isFocused(), getPendingTransaction()); if (mDimmer.updateDims(getPendingTransaction(), mTmpDimBoundsRect)) { scheduleAnimation(); Loading Loading @@ -4148,29 +4148,43 @@ class Task extends WindowContainer<WindowContainer> { return mDisplayContent.mCurrentFocus.getTask() == this; } /** * @return true if the task is visible and has at least one visible child. */ private boolean hasVisibleChildren() { if (!isAttached() || isForceHidden()) { return false; } return getActivity(ActivityRecord::isVisible) != null; } /** * @return the desired shadow radius in pixels for the current task. */ private float getShadowRadius(boolean taskIsFocused) { if (mDisplayContent == null) { return 0; } int elevation = 0; // Get elevation for a specific windowing mode. if (inPinnedWindowingMode()) { return dipToPixel(PINNED_WINDOWING_MODE_ELEVATION_IN_DIP, mDisplayContent.getDisplayMetrics()); } elevation = PINNED_WINDOWING_MODE_ELEVATION_IN_DIP; } else if (ENABLE_FREEFORM_COMPOSITOR_SHADOWS && inFreeformWindowingMode()) { // TODO(b/149585281) remove when root task has the correct bounds for freeform if (ENABLE_FREEFORM_COMPOSITOR_SHADOWS && inFreeformWindowingMode()) { final int elevation = taskIsFocused elevation = taskIsFocused ? DECOR_SHADOW_FOCUSED_HEIGHT_IN_DIP : DECOR_SHADOW_UNFOCUSED_HEIGHT_IN_DIP; return dipToPixel(elevation, mDisplayContent.getDisplayMetrics()); } else { // For all other windowing modes, do not draw a shadow. return 0; } // For all other windowing modes, do not draw a shadow. // If the task has no visible children, do not draw a shadow. if (!hasVisibleChildren()) { return 0; } return dipToPixel(elevation, getDisplayContent().getDisplayMetrics()); } /** * Update the length of the shadow if needed based on windowing mode and task focus state. */ Loading