Ensure device state availability in registration.

This commit ensures the availability of DeviceStateInfo in
DeviceStateManager by modifying the registerCallback method to return
the current state upon completion of the two-way IPC call. This
eliminates the reliance on thread priority for state delivery.

This change supports timely window layout calculations in
Activity#onCreate(), improving the overall robustness of applications
that depend on accurate device state information during initialization.

Bug: 337820752
Test: atest FrameworksCoreDeviceStateManagerTests
Test: atest FrameworksServicesTests:DeviceStateManagerServiceTest
Flag: com.android.window.flags.wlinfo_oncreate
Change-Id: I9d00eed95c9f733e4eabd39506eb54c1286bfad6
7 files changed