Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 187a8ac9 authored by Eric Lin's avatar Eric Lin
Browse files

Fix display settings persistence with LRU cache.

Rotation and density settings for external or simulated displays were
not being persisted across reboots. This was caused by an overly
aggressive cleanup mechanism that would remove settings for displays
that were only temporarily disconnected, such as during a device reboot.

This change replaces the ArrayMap in DisplayWindowSettingsProvider with
an LruCache to manage display settings. This aligns with the persistence
strategy used by DisplayManager's DisplayTopologyXmlStore, ensuring that
the settings for the 100 most recently used displays are retained.

When the cache limit is reached, the least recently used setting is
evicted. This prevents the settings file from growing indefinitely while
correctly preserving settings for active and recently used displays
across reboots. The previous removeStaleDisplaySettingsLocked method is
now obsolete and has been removed.

Bug: 397398590
Flag: EXEMPT bug fix
Test: atest WmTests:DisplayWindowSettingsProviderTests
Change-Id: I6bf2a0312403ebda10194bc76fe3e443d50f664b
parent 73ad5173
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment