Symptom
On a tri-fold device, the value returned by the on('foldDisplayModeChange') listener is 5, whereas getFoldDisplayMode() never returns 5.
Possible Causes
Meaning of FoldDisplayMode = 5
On tri-fold devices, a FoldDisplayMode value of 5 indicates that the device is in the fully expanded display mode, where all three displays are fully unfolded and content is displayed using the maximum available screen area.
Why on('foldDisplayModeChange') returns 5
The on('foldDisplayModeChange') API monitors display mode changes in real time and therefore reports all actual display mode values, including 5. When the listener receives a value of 5, the device has entered the fully expanded display mode.
Why getFoldDisplayMode() does not return 5
To reduce the cost of adapting applications across different devices and avoid exposing device form factor–specific values, the getFoldDisplayMode() API does not return 5. Instead, you are encouraged to adapt to different display states by using the unified breakpoint management mechanism and the One-Time Development for Multi-Device Deployment approach, which simplifies layout adaptation.
Suggestions
Although you can listen for a FoldDisplayMode value of 5 and handle it explicitly, using the One-Time Development for Multi-Device Deployment approach is recommended for better development efficiency and compatibility. For tri-fold devices, see Tri-Fold Phone Application Development. This approach reduces duplicated adaptation work and helps ensure a consistent and stable user experience across different device types.
Symptom
On a foldable PC in half-folded mode (foldStatus = FOLD_STATUS_HALF_FOLDED), calling getDefaultDisplaySync() from the lower screen returns the Display object for the upper screen (displayId = 0).
Solution
Use the getDisplayByIdSync() API to obtain the Display object for the specified displayId.
Symptom
After obtaining the Display object of a virtual screen, the orientation value is 4, which is not within the Orientation enumeration range.
Possible Causes
A virtual screen has no physical screen and cannot perceive the screen orientation. If the screen orientation is not actively set, the system cannot return any value in the Orientation enumeration. In this case, the orientation property returns 4 to indicate that the screen orientation is unknown.