diff options
author | Adrian Roos <roosa@google.com> | 2014-11-06 18:15:16 +0100 |
---|---|---|
committer | Adrian Roos <roosa@google.com> | 2014-11-10 17:46:57 +0100 |
commit | 37d7a68de7e353c31a3a4736054cd86f0e002eaf (patch) | |
tree | c2dc2c064b1e57b29efdd0b233a4725f42857585 /core | |
parent | 3e54ce273abafec3a0eca9e7064d5151ec096f0b (diff) | |
download | frameworks_base-37d7a68de7e353c31a3a4736054cd86f0e002eaf.zip frameworks_base-37d7a68de7e353c31a3a4736054cd86f0e002eaf.tar.gz frameworks_base-37d7a68de7e353c31a3a4736054cd86f0e002eaf.tar.bz2 |
Fix inset hinting when adding window
Windows with FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS were
getting an incorrect content inset hint, because the
hinting didn't see the adjusted systemUiVisibility.
Also adds hinting for the stable insets.
Bug: 17508238
Change-Id: If9647277feb6811b15665b801accd896c51dbd12
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/service/wallpaper/WallpaperService.java | 3 | ||||
-rw-r--r-- | core/java/android/view/IWindowSession.aidl | 9 | ||||
-rw-r--r-- | core/java/android/view/SurfaceView.java | 3 | ||||
-rw-r--r-- | core/java/android/view/ViewRootImpl.java | 2 | ||||
-rw-r--r-- | core/java/android/view/WindowManagerPolicy.java | 11 |
5 files changed, 17 insertions, 11 deletions
diff --git a/core/java/android/service/wallpaper/WallpaperService.java b/core/java/android/service/wallpaper/WallpaperService.java index 26e9a30..ceaf5f8 100644 --- a/core/java/android/service/wallpaper/WallpaperService.java +++ b/core/java/android/service/wallpaper/WallpaperService.java @@ -675,7 +675,8 @@ public abstract class WallpaperService extends Service { com.android.internal.R.style.Animation_Wallpaper; mInputChannel = new InputChannel(); if (mSession.addToDisplay(mWindow, mWindow.mSeq, mLayout, View.VISIBLE, - Display.DEFAULT_DISPLAY, mContentInsets, mInputChannel) < 0) { + Display.DEFAULT_DISPLAY, mContentInsets, mStableInsets, + mInputChannel) < 0) { Log.w(TAG, "Failed to add window while updating wallpaper surface."); return; } diff --git a/core/java/android/view/IWindowSession.aidl b/core/java/android/view/IWindowSession.aidl index 037ed28..7b13e84 100644 --- a/core/java/android/view/IWindowSession.aidl +++ b/core/java/android/view/IWindowSession.aidl @@ -36,15 +36,16 @@ import android.view.Surface; */ interface IWindowSession { int add(IWindow window, int seq, in WindowManager.LayoutParams attrs, - in int viewVisibility, out Rect outContentInsets, + in int viewVisibility, out Rect outContentInsets, out Rect outStableInsets, out InputChannel outInputChannel); int addToDisplay(IWindow window, int seq, in WindowManager.LayoutParams attrs, in int viewVisibility, in int layerStackId, out Rect outContentInsets, - out InputChannel outInputChannel); + out Rect outStableInsets, out InputChannel outInputChannel); int addWithoutInputChannel(IWindow window, int seq, in WindowManager.LayoutParams attrs, - in int viewVisibility, out Rect outContentInsets); + in int viewVisibility, out Rect outContentInsets, out Rect outStableInsets); int addToDisplayWithoutInputChannel(IWindow window, int seq, in WindowManager.LayoutParams attrs, - in int viewVisibility, in int layerStackId, out Rect outContentInsets); + in int viewVisibility, in int layerStackId, out Rect outContentInsets, + out Rect outStableInsets); void remove(IWindow window); /** diff --git a/core/java/android/view/SurfaceView.java b/core/java/android/view/SurfaceView.java index afc804c..49be57d 100644 --- a/core/java/android/view/SurfaceView.java +++ b/core/java/android/view/SurfaceView.java @@ -496,7 +496,8 @@ public class SurfaceView extends View { mLayout.type = mWindowType; mLayout.gravity = Gravity.START|Gravity.TOP; mSession.addToDisplayWithoutInputChannel(mWindow, mWindow.mSeq, mLayout, - mVisible ? VISIBLE : GONE, display.getDisplayId(), mContentInsets); + mVisible ? VISIBLE : GONE, display.getDisplayId(), mContentInsets, + mStableInsets); } boolean realSizeChanged; diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index ea0a077..5d2a24b 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -526,7 +526,7 @@ public final class ViewRootImpl implements ViewParent, collectViewAttributes(); res = mWindowSession.addToDisplay(mWindow, mSeq, mWindowAttributes, getHostVisibility(), mDisplay.getDisplayId(), - mAttachInfo.mContentInsets, mInputChannel); + mAttachInfo.mContentInsets, mAttachInfo.mStableInsets, mInputChannel); } catch (RemoteException e) { mAdded = false; mView = null; diff --git a/core/java/android/view/WindowManagerPolicy.java b/core/java/android/view/WindowManagerPolicy.java index 673f075..b8e94ee 100644 --- a/core/java/android/view/WindowManagerPolicy.java +++ b/core/java/android/view/WindowManagerPolicy.java @@ -865,12 +865,15 @@ public interface WindowManagerPolicy { * Return the insets for the areas covered by system windows. These values * are computed on the most recent layout, so they are not guaranteed to * be correct. - * + * * @param attrs The LayoutParams of the window. - * @param contentInset The areas covered by system windows, expressed as positive insets - * + * @param outContentInsets The areas covered by system windows, expressed as positive insets. + * @param outStableInsets The areas covered by stable system windows irrespective of their + * current visibility. Expressed as positive insets. + * */ - public void getContentInsetHintLw(WindowManager.LayoutParams attrs, Rect contentInset); + public void getInsetHintLw(WindowManager.LayoutParams attrs, Rect outContentInsets, + Rect outStableInsets); /** * Called when layout of the windows is finished. After this function has |