Revert DeviceState callback to main thread in FFP.
This partially reverts commit I8a4af1c5ac98f5653e4293a049291ba5ff7cd464. Revert device state callback to the main thread in FFP to fix crashes in Chrome and Photos. The original change allowed callbacks off the main thread but this caused crashes because: 1. Chrome loads window extension directly; it crashs when receiving callbacks on binder thread. 2. Photos uses Java API with Runnable::run, breaking the flowOn main operator; it crashs when receiving callbacks on the binder thread. Window layout info remains available via getter because the device state is available synchronously in the DeviceStateManagerGlobal constructor, so this rollback does not impact functionality. Bug: 337820752 Bug: 379501835 Test: atest WMJetpackUnitTests:DeviceStateManagerFoldingFeatureProducerTest Test: Run with latest Chrome (131.0.6778.39) Flag: com.android.window.flags.wlinfo_oncreate Change-Id: Ifc5af9955a27b6cfb5405e63c0763f3c55a5a75e
Loading
Please register or sign in to comment