1

In reference to https://learn.microsoft.com/en-us/dual-screen/android/platform/jetpack-window-manager, I initialized the window manager like this:

wm = WindowManager(this, null)

and called

wm.registerDeviceStateChangeCallback

The accept method implemented in DeviceStateChangeCallback was invoked when I changed the screen size of emulator while was not on a real Huawei foldable device.

Can anyone tell me the reason, pls!

1 Answers1

2

Window Manager (WM) has a couple of specific components: androidx.window.sidecar and androidx.window.extensions that have to be implemented by OEMs in order to provide Window Manager support.

Not sure if you are using Surface Duo emulator, since you link to its docs, but if you test your code in the Surface Duo emulator/device, you will be able to get the WM info --> Surface Duo already supports WM for both device and emulator.

It could be that Huawei has WM support for the foldable emulator but not for the device yet --> you don't get WM info when using the same code that works on Huawei foldable emulator or Surface Duo emulator/device.