diff options
author | Diego Vela <diegovela@google.com> | 2023-05-05 17:53:52 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-07-25 04:59:05 +0000 |
commit | 8f277c0bcb3903e122a3a37748ad4e1bbfb8a479 (patch) | |
tree | f22d30d6e750080e8841d268f8952693f1f2a0b9 | |
parent | ac65c1602adfeca638f50f11e81a497263035c1f (diff) | |
download | base-8f277c0bcb3903e122a3a37748ad4e1bbfb8a479.tar.gz |
Report folding features to letterboxed apps.
Folding features were filtered out from letterboxed apps because we
assumed that letterboxed apps did not want to optimize. We have found
apps do want to support folding features but may also request fixed
orientation for their experience. We are removing the filter so that
letterboxed apps will get folding feature information.
Bug: 262900133
Test: Manual - open the samples and check if folding features report.
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:3e428597423552cd806a9658c763ed3f7ffcbc2c)
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:58855b37c9ba3cdf6e4885fd1ece41ffb4626a03)
Merged-In: I427f0bc23f00d245c5093c75f13c9e533209362e
Change-Id: I427f0bc23f00d245c5093c75f13c9e533209362e
-rw-r--r-- | libs/WindowManager/Jetpack/src/androidx/window/extensions/layout/WindowLayoutComponentImpl.java | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/libs/WindowManager/Jetpack/src/androidx/window/extensions/layout/WindowLayoutComponentImpl.java b/libs/WindowManager/Jetpack/src/androidx/window/extensions/layout/WindowLayoutComponentImpl.java index 8386131b177d..dd2d0ec57d54 100644 --- a/libs/WindowManager/Jetpack/src/androidx/window/extensions/layout/WindowLayoutComponentImpl.java +++ b/libs/WindowManager/Jetpack/src/androidx/window/extensions/layout/WindowLayoutComponentImpl.java @@ -381,24 +381,15 @@ public class WindowLayoutComponentImpl implements WindowLayoutComponent { final Rect taskBounds = taskConfig.windowConfiguration.getBounds(); final WindowManager windowManager = Objects.requireNonNull( context.getSystemService(WindowManager.class)); - final Rect currentBounds = windowManager.getCurrentWindowMetrics().getBounds(); final Rect maxBounds = windowManager.getMaximumWindowMetrics().getBounds(); boolean isTaskExpanded = maxBounds.equals(taskBounds); - boolean isActivityExpanded = maxBounds.equals(currentBounds); /* * We need to proxy being in full screen because when a user enters PiP and exits PiP * the task windowingMode will report multi-window/pinned until the transition is * finished in WM Shell. * maxBounds == taskWindowBounds is a proxy check to verify the window is full screen - * For tasks that are letterboxed, we use currentBounds == maxBounds to filter these - * out. */ - // TODO(b/262900133) remove currentBounds check when letterboxed apps report bounds. - // currently we don't want to report to letterboxed apps since they do not update the - // window bounds when the Activity is moved. An inaccurate fold will be reported so - // we skip. - return isTaskExpanded && (isActivityExpanded - || mTaskFragmentOrganizer.isActivityEmbedded(activityToken)); + return isTaskExpanded; } else { // TODO(b/242674941): use task windowing mode for window context that associates with // activity. |