Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 8c11797f authored by Eric Lin's avatar Eric Lin
Browse files

Unblock device state callback in Window Extension.

Update DeviceStateManagerFoldingFeatureProducer to allow device state
callback off the main thread. Implement a lock to synchronize access to
the device state, ensuring thread-safety and immediate visibility of
updates from the binder thread to other threads. This allows device
state manager initialization within Activity#onCreate(), removing the
requirement to initialize WindowInfoTracker in an app initializer or
Application#onCreate().

Additional changes improve readability and add unit tests to verify the
new behavior. Notably, a new DeviceStateMapper class is introduced to
encapsulate the device state to posture mapping logic, limiting access
and ensuring immutability after initialization for thread safety.

Bug: 337820752
Test: atest WMJetpackUnitTests:DeviceStateManagerFoldingFeatureProducerTest
Flag: com.android.window.flags.wlinfo_oncreate
Change-Id: I8a4af1c5ac98f5653e4293a049291ba5ff7cd464
parent c27648b8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment