From 6642e51ac5d0351f02fc929817603d7371e08e10 Mon Sep 17 00:00:00 2001 From: Michael Kolb Date: Thu, 17 Apr 2014 14:45:29 -0700 Subject: [PATCH] Populate isRound from config.xml to WindowInsets Change-Id: I41b3aef1322a7cdccdcbc679eb753e0a1e561fad --- core/java/android/view/ViewRootImpl.java | 10 +++++++++- core/java/android/view/WindowInsets.java | 5 +++++ core/res/res/values/config.xml | 3 +++ core/res/res/values/symbols.xml | 1 + 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index db80aed0281ce..bac7fac71f463 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -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() { diff --git a/core/java/android/view/WindowInsets.java b/core/java/android/view/WindowInsets.java index f8cc793f477b6..2160efeadc0e0 100644 --- a/core/java/android/view/WindowInsets.java +++ b/core/java/android/view/WindowInsets.java @@ -50,6 +50,11 @@ public class WindowInsets { this(systemWindowInsets, windowDecorInsets, false); } + /** @hide */ + public WindowInsets(Rect systemWindowInsets, boolean isRound) { + this(systemWindowInsets, EMPTY_RECT, isRound); + } + /** @hide */ public WindowInsets(Rect systemWindowInsets, Rect windowDecorInsets, boolean isRound) { mSystemWindowInsets = systemWindowInsets; diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index 88deb398453bb..c761a7ced2186 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -1421,4 +1421,7 @@ 2 - The device DOES NOT have a permanent menu key; ignore autodetection. --> 0 + + false + diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index f88b8bbef9990..5c4471ee26efe 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -288,6 +288,7 @@ +