diff options
| author | 2024-11-05 00:27:23 +0000 | |
|---|---|---|
| committer | 2024-11-05 17:05:00 +0000 | |
| commit | 10e0249609dc130df881f2667a51bee284041ffd (patch) | |
| tree | 95a133cae08772dbfc920a1ad770935b02257233 | |
| parent | 518a1febe4bddd0f88f2a36445b081fa5e634dbc (diff) | |
Treat emulated only states as not folded in WindowAreaComponentImpl
To keep consistent API behavior for 25Q1 and the usage of
the config_foldedDeviceStates configuration value, we have
to pair the outer display area property with a check to make
sure the state we're checking is not emulated only when
we are using the DeviceState#hasProperty API
This change guarantees that the status value for rear display
is available, to keep the same behavior between the property API
and the overlay configuration values.
Fixes: 377167065
Test: ExtensionRearDisplayPresentationTest#testRearDisplayPresentationStatusListeners
Flag: EXEMPT bugfix
Change-Id: I12d5f075c32ba9b41eed5c023c1548656a9d7919
| -rw-r--r-- | libs/WindowManager/Jetpack/src/androidx/window/extensions/area/WindowAreaComponentImpl.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libs/WindowManager/Jetpack/src/androidx/window/extensions/area/WindowAreaComponentImpl.java b/libs/WindowManager/Jetpack/src/androidx/window/extensions/area/WindowAreaComponentImpl.java index 438532725686..4d7be39ca5a4 100644 --- a/libs/WindowManager/Jetpack/src/androidx/window/extensions/area/WindowAreaComponentImpl.java +++ b/libs/WindowManager/Jetpack/src/androidx/window/extensions/area/WindowAreaComponentImpl.java @@ -16,6 +16,7 @@ package androidx.window.extensions.area; +import static android.hardware.devicestate.DeviceState.PROPERTY_EMULATED_ONLY; import static android.hardware.devicestate.DeviceState.PROPERTY_FEATURE_DUAL_DISPLAY_INTERNAL_DEFAULT; import static android.hardware.devicestate.DeviceState.PROPERTY_FEATURE_REAR_DISPLAY; import static android.hardware.devicestate.DeviceState.PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_OUTER_PRIMARY; @@ -569,7 +570,8 @@ public class WindowAreaComponentImpl implements WindowAreaComponent, private boolean isDeviceFolded() { if (Flags.deviceStatePropertyApi()) { return mCurrentDeviceState.hasProperty( - PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_OUTER_PRIMARY); + PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_OUTER_PRIMARY) + && !mCurrentDeviceState.hasProperty(PROPERTY_EMULATED_ONLY); } else { return ArrayUtils.contains(mFoldedDeviceStates, mCurrentDeviceState.getIdentifier()); } |