If no display settings are matched, return the first one. DO NOT MERGE

Language changes will prevent previously saved display settings from
being loaded. This provides a fallback in the event a single entry exists
but does not match the current (localized) name of the Built-In Display.

BUG: 18130296
BUG: 18190800
Change-Id: Ibeff56045fc5713b9f79707dfb92bafc9fadd84f
This commit is contained in:
Mark Renouf
2014-10-30 16:57:30 -04:00
parent 7be03da0d4
commit cf0f740e39

View File

@@ -66,6 +66,9 @@ public class DisplaySettings {
public void getOverscanLocked(String name, Rect outRect) { public void getOverscanLocked(String name, Rect outRect) {
Entry entry = mEntries.get(name); Entry entry = mEntries.get(name);
if (entry == null && mEntries.size() == 1) {
entry = mEntries.values().iterator().next();
}
if (entry != null) { if (entry != null) {
outRect.left = entry.overscanLeft; outRect.left = entry.overscanLeft;
outRect.top = entry.overscanTop; outRect.top = entry.overscanTop;