OSDN Git Service

Populate isRound from config.xml to WindowInsets
authorMichael Kolb <kolby@google.com>
Thu, 17 Apr 2014 21:45:29 +0000 (14:45 -0700)
committerMichael Kolb <kolby@google.com>
Fri, 18 Apr 2014 00:32:50 +0000 (17:32 -0700)
Change-Id: I41b3aef1322a7cdccdcbc679eb753e0a1e561fad

core/java/android/view/ViewRootImpl.java
core/java/android/view/WindowInsets.java
core/res/res/values/config.xml
core/res/res/values/symbols.xml

index db80aed..bac7fac 100644 (file)
@@ -1153,7 +1153,15 @@ public final class ViewRootImpl implements ViewParent,
 
     void dispatchApplyInsets(View host) {
         mFitSystemWindowsInsets.set(mAttachInfo.mContentInsets);
-        host.dispatchApplyWindowInsets(new WindowInsets(mFitSystemWindowsInsets));
+        boolean isRound = false;
+        if ((mWindowAttributes.flags & WindowManager.LayoutParams.FLAG_LAYOUT_IN_OVERSCAN) != 0
+                && mDisplay.getDisplayId() == 0) {
+            // we're fullscreen and not hosted in an ActivityView
+            isRound = mContext.getResources().getBoolean(
+                    com.android.internal.R.bool.config_windowIsRound);
+        }
+        host.dispatchApplyWindowInsets(new WindowInsets(
+                mFitSystemWindowsInsets, isRound));
     }
 
     private void performTraversals() {
index f8cc793..2160efe 100644 (file)
@@ -51,6 +51,11 @@ public class WindowInsets {
     }
 
     /** @hide */
+    public WindowInsets(Rect systemWindowInsets, boolean isRound) {
+        this(systemWindowInsets, EMPTY_RECT, isRound);
+    }
+
+    /** @hide */
     public WindowInsets(Rect systemWindowInsets, Rect windowDecorInsets, boolean isRound) {
         mSystemWindowInsets = systemWindowInsets;
         mWindowDecorInsets = windowDecorInsets;
index 88deb39..c761a7c 100644 (file)
          2 - The device DOES NOT have a permanent menu key; ignore autodetection. -->
     <integer name="config_overrideHasPermanentMenuKey">0</integer>
 
+    <!-- default window inset isRound property -->
+    <bool name="config_windowIsRound">false</bool>
+
 </resources>
index f88b8bb..5c4471e 100644 (file)
   <java-symbol type="bool" name="config_useFixedVolume" />
   <java-symbol type="bool" name="config_forceDefaultOrientation" />
   <java-symbol type="bool" name="config_wifi_batched_scan_supported" />
+  <java-symbol type="bool" name="config_windowIsRound" />
 
   <java-symbol type="integer" name="config_cursorWindowSize" />
   <java-symbol type="integer" name="config_extraFreeKbytesAdjust" />