OSDN Git Service

If no display settings are matched, return the first one. DO NOT MERGE
authorMark Renouf <mrenouf@google.com>
Thu, 30 Oct 2014 20:57:30 +0000 (16:57 -0400)
committerMark Renouf <mrenouf@google.com>
Fri, 31 Oct 2014 01:42:11 +0000 (21:42 -0400)
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

services/core/java/com/android/server/wm/DisplaySettings.java

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