diff options
| author | 2024-09-19 14:48:56 +0800 | |
|---|---|---|
| committer | 2024-09-27 11:51:43 +0800 | |
| commit | 8c11797f0a747bf590df51c4aa83ba55fe4bb944 (patch) | |
| tree | 15c71e590e13e078e5ecd1a0ae201825998aa846 /api/api.go | |
| parent | c27648b852bf502221554caa87007ff9a4d22700 (diff) | |
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
Diffstat (limited to 'api/api.go')
0 files changed, 0 insertions, 0 deletions