Store display window settings per user to avoid conflicts.
This change resolves conflicts arising from shared display window
settings between users. The density preference is stored in both
per-user secure settings `display_density_forced` and the shared
display_settings.xml written by DisplayWindowSettingsProvider.
The window manager service reads display density from settings during
display initialization and user switching, showing correct density
before device folding. However, after folding, it update display
content from the DisplayWindowSettingsProvider, leading to incorrect
density values based on the previously active user's settings.
This change store display window settings in user-specific data
directories, allowing each user's window settings to persist
independently. The window manager service has been updated to
notify the DisplayWindowSettingsProvider during user switching.
Additionally, stale settings are now removed upon initialization
to ensure settings accuracy and optimize storage resources.
Fix: 346668297
Flag: com.android.window.flags.per_user_display_window_settings
Test: atest WmTests:DisplayWindowSettingsProviderTests
Change-Id: I7d34939212ec3aa7af698cccdd23f1cfdecb8b7b
4 files changed