Loading core/java/android/service/wallpaper/WallpaperService.java +1 −1 Original line number Diff line number Diff line Loading @@ -649,7 +649,7 @@ 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, mStableInsets, Display.DEFAULT_DISPLAY, mContentInsets, mStableInsets, mOutsets, mInputChannel) < 0) { Log.w(TAG, "Failed to add window while updating wallpaper surface."); return; Loading core/java/android/view/IWindowSession.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -40,7 +40,7 @@ interface IWindowSession { out InputChannel outInputChannel); int addToDisplay(IWindow window, int seq, in WindowManager.LayoutParams attrs, in int viewVisibility, in int layerStackId, out Rect outContentInsets, out Rect outStableInsets, out InputChannel outInputChannel); out Rect outStableInsets, out Rect outOutsets, out InputChannel outInputChannel); int addWithoutInputChannel(IWindow window, int seq, in WindowManager.LayoutParams attrs, in int viewVisibility, out Rect outContentInsets, out Rect outStableInsets); int addToDisplayWithoutInputChannel(IWindow window, int seq, in WindowManager.LayoutParams attrs, Loading core/java/android/view/ViewRootImpl.java +3 −1 Original line number Diff line number Diff line Loading @@ -531,7 +531,8 @@ public final class ViewRootImpl implements ViewParent, collectViewAttributes(); res = mWindowSession.addToDisplay(mWindow, mSeq, mWindowAttributes, getHostVisibility(), mDisplay.getDisplayId(), mAttachInfo.mContentInsets, mAttachInfo.mStableInsets, mInputChannel); mAttachInfo.mContentInsets, mAttachInfo.mStableInsets, mAttachInfo.mOutsets, mInputChannel); } catch (RemoteException e) { mAdded = false; mView = null; Loading Loading @@ -1590,6 +1591,7 @@ public final class ViewRootImpl implements ViewParent, + " content=" + mPendingContentInsets.toShortString() + " visible=" + mPendingVisibleInsets.toShortString() + " visible=" + mPendingStableInsets.toShortString() + " outsets=" + mPendingOutsets.toShortString() + " surface=" + mSurface); if (mPendingConfiguration.seq != 0) { Loading core/java/android/view/WindowManagerPolicy.java +4 −2 Original line number Diff line number Diff line Loading @@ -879,13 +879,15 @@ public interface WindowManagerPolicy { * be correct. * * @param attrs The LayoutParams of the window. * @param rotation Rotation of the display. * @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. * @param outOutsets The areas that are not real display, but we would like to treat as such. * */ public void getInsetHintLw(WindowManager.LayoutParams attrs, Rect outContentInsets, Rect outStableInsets); public void getInsetHintLw(WindowManager.LayoutParams attrs, int rotation, Rect outContentInsets, Rect outStableInsets, Rect outOutsets); /** * Called when layout of the windows is finished. After this function has Loading services/core/java/com/android/server/policy/PhoneWindowManager.java +28 −10 Original line number Diff line number Diff line Loading @@ -549,6 +549,8 @@ public class PhoneWindowManager implements WindowManagerPolicy { Display mDisplay; private int mDisplayRotation; int mLandscapeRotation = 0; // default landscape rotation int mSeascapeRotation = 0; // "other" landscape rotation, 180 degrees from mLandscapeRotation int mPortraitRotation = 0; // default portrait rotation Loading Loading @@ -3304,12 +3306,28 @@ public class PhoneWindowManager implements WindowManagerPolicy { } @Override public void getInsetHintLw(WindowManager.LayoutParams attrs, Rect outContentInsets, Rect outStableInsets) { public void getInsetHintLw(WindowManager.LayoutParams attrs, int displayRotation, Rect outContentInsets, Rect outStableInsets, Rect outOutsets) { final int fl = PolicyControl.getWindowFlags(null, attrs); final int sysuiVis = PolicyControl.getSystemUiVisibility(null, attrs); final int systemUiVisibility = (sysuiVis | attrs.subtreeSystemUiVisibility); final boolean useOutsets = outOutsets != null && shouldUseOutsets(attrs, fl); if (useOutsets) { int outset = ScreenShapeHelper.getWindowOutsetBottomPx(mContext.getResources()); if (outset > 0) { if (displayRotation == Surface.ROTATION_0) { outOutsets.bottom += outset; } else if (displayRotation == Surface.ROTATION_90) { outOutsets.right += outset; } else if (displayRotation == Surface.ROTATION_180) { outOutsets.top += outset; } else if (displayRotation == Surface.ROTATION_270) { outOutsets.left += outset; } } } if ((fl & (FLAG_LAYOUT_IN_SCREEN | FLAG_LAYOUT_INSET_DECOR)) == (FLAG_LAYOUT_IN_SCREEN | FLAG_LAYOUT_INSET_DECOR)) { int availRight, availBottom; Loading Loading @@ -3349,10 +3367,16 @@ public class PhoneWindowManager implements WindowManagerPolicy { outStableInsets.setEmpty(); } private boolean shouldUseOutsets(WindowManager.LayoutParams attrs, int fl) { return attrs.type == TYPE_WALLPAPER || (fl & (WindowManager.LayoutParams.FLAG_FULLSCREEN | WindowManager.LayoutParams.FLAG_LAYOUT_IN_OVERSCAN)) != 0; } /** {@inheritDoc} */ @Override public void beginLayoutLw(boolean isDefaultDisplay, int displayWidth, int displayHeight, int displayRotation) { mDisplayRotation = displayRotation; final int overscanLeft, overscanTop, overscanRight, overscanBottom; if (isDefaultDisplay) { switch (displayRotation) { Loading Loading @@ -4139,19 +4163,13 @@ public class PhoneWindowManager implements WindowManagerPolicy { // need to provide information to the clients that want to pretend that you can draw there. // We only want to apply outsets to certain types of windows. For example, we never want to // apply the outsets to floating dialogs, because they wouldn't make sense there. final boolean useOutsets = attrs.type == TYPE_WALLPAPER || (fl & (WindowManager.LayoutParams.FLAG_FULLSCREEN | WindowManager.LayoutParams.FLAG_LAYOUT_IN_OVERSCAN)) != 0; final boolean useOutsets = shouldUseOutsets(attrs, fl); if (isDefaultDisplay && useOutsets) { osf = mTmpOutsetFrame; osf.set(cf.left, cf.top, cf.right, cf.bottom); int outset = ScreenShapeHelper.getWindowOutsetBottomPx(mContext.getResources()); if (outset > 0) { int rotation = Surface.ROTATION_0; try { rotation = mWindowManager.getRotation(); } catch (RemoteException e) { } int rotation = mDisplayRotation; if (rotation == Surface.ROTATION_0) { osf.bottom += outset; } else if (rotation == Surface.ROTATION_90) { Loading Loading
core/java/android/service/wallpaper/WallpaperService.java +1 −1 Original line number Diff line number Diff line Loading @@ -649,7 +649,7 @@ 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, mStableInsets, Display.DEFAULT_DISPLAY, mContentInsets, mStableInsets, mOutsets, mInputChannel) < 0) { Log.w(TAG, "Failed to add window while updating wallpaper surface."); return; Loading
core/java/android/view/IWindowSession.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -40,7 +40,7 @@ interface IWindowSession { out InputChannel outInputChannel); int addToDisplay(IWindow window, int seq, in WindowManager.LayoutParams attrs, in int viewVisibility, in int layerStackId, out Rect outContentInsets, out Rect outStableInsets, out InputChannel outInputChannel); out Rect outStableInsets, out Rect outOutsets, out InputChannel outInputChannel); int addWithoutInputChannel(IWindow window, int seq, in WindowManager.LayoutParams attrs, in int viewVisibility, out Rect outContentInsets, out Rect outStableInsets); int addToDisplayWithoutInputChannel(IWindow window, int seq, in WindowManager.LayoutParams attrs, Loading
core/java/android/view/ViewRootImpl.java +3 −1 Original line number Diff line number Diff line Loading @@ -531,7 +531,8 @@ public final class ViewRootImpl implements ViewParent, collectViewAttributes(); res = mWindowSession.addToDisplay(mWindow, mSeq, mWindowAttributes, getHostVisibility(), mDisplay.getDisplayId(), mAttachInfo.mContentInsets, mAttachInfo.mStableInsets, mInputChannel); mAttachInfo.mContentInsets, mAttachInfo.mStableInsets, mAttachInfo.mOutsets, mInputChannel); } catch (RemoteException e) { mAdded = false; mView = null; Loading Loading @@ -1590,6 +1591,7 @@ public final class ViewRootImpl implements ViewParent, + " content=" + mPendingContentInsets.toShortString() + " visible=" + mPendingVisibleInsets.toShortString() + " visible=" + mPendingStableInsets.toShortString() + " outsets=" + mPendingOutsets.toShortString() + " surface=" + mSurface); if (mPendingConfiguration.seq != 0) { Loading
core/java/android/view/WindowManagerPolicy.java +4 −2 Original line number Diff line number Diff line Loading @@ -879,13 +879,15 @@ public interface WindowManagerPolicy { * be correct. * * @param attrs The LayoutParams of the window. * @param rotation Rotation of the display. * @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. * @param outOutsets The areas that are not real display, but we would like to treat as such. * */ public void getInsetHintLw(WindowManager.LayoutParams attrs, Rect outContentInsets, Rect outStableInsets); public void getInsetHintLw(WindowManager.LayoutParams attrs, int rotation, Rect outContentInsets, Rect outStableInsets, Rect outOutsets); /** * Called when layout of the windows is finished. After this function has Loading
services/core/java/com/android/server/policy/PhoneWindowManager.java +28 −10 Original line number Diff line number Diff line Loading @@ -549,6 +549,8 @@ public class PhoneWindowManager implements WindowManagerPolicy { Display mDisplay; private int mDisplayRotation; int mLandscapeRotation = 0; // default landscape rotation int mSeascapeRotation = 0; // "other" landscape rotation, 180 degrees from mLandscapeRotation int mPortraitRotation = 0; // default portrait rotation Loading Loading @@ -3304,12 +3306,28 @@ public class PhoneWindowManager implements WindowManagerPolicy { } @Override public void getInsetHintLw(WindowManager.LayoutParams attrs, Rect outContentInsets, Rect outStableInsets) { public void getInsetHintLw(WindowManager.LayoutParams attrs, int displayRotation, Rect outContentInsets, Rect outStableInsets, Rect outOutsets) { final int fl = PolicyControl.getWindowFlags(null, attrs); final int sysuiVis = PolicyControl.getSystemUiVisibility(null, attrs); final int systemUiVisibility = (sysuiVis | attrs.subtreeSystemUiVisibility); final boolean useOutsets = outOutsets != null && shouldUseOutsets(attrs, fl); if (useOutsets) { int outset = ScreenShapeHelper.getWindowOutsetBottomPx(mContext.getResources()); if (outset > 0) { if (displayRotation == Surface.ROTATION_0) { outOutsets.bottom += outset; } else if (displayRotation == Surface.ROTATION_90) { outOutsets.right += outset; } else if (displayRotation == Surface.ROTATION_180) { outOutsets.top += outset; } else if (displayRotation == Surface.ROTATION_270) { outOutsets.left += outset; } } } if ((fl & (FLAG_LAYOUT_IN_SCREEN | FLAG_LAYOUT_INSET_DECOR)) == (FLAG_LAYOUT_IN_SCREEN | FLAG_LAYOUT_INSET_DECOR)) { int availRight, availBottom; Loading Loading @@ -3349,10 +3367,16 @@ public class PhoneWindowManager implements WindowManagerPolicy { outStableInsets.setEmpty(); } private boolean shouldUseOutsets(WindowManager.LayoutParams attrs, int fl) { return attrs.type == TYPE_WALLPAPER || (fl & (WindowManager.LayoutParams.FLAG_FULLSCREEN | WindowManager.LayoutParams.FLAG_LAYOUT_IN_OVERSCAN)) != 0; } /** {@inheritDoc} */ @Override public void beginLayoutLw(boolean isDefaultDisplay, int displayWidth, int displayHeight, int displayRotation) { mDisplayRotation = displayRotation; final int overscanLeft, overscanTop, overscanRight, overscanBottom; if (isDefaultDisplay) { switch (displayRotation) { Loading Loading @@ -4139,19 +4163,13 @@ public class PhoneWindowManager implements WindowManagerPolicy { // need to provide information to the clients that want to pretend that you can draw there. // We only want to apply outsets to certain types of windows. For example, we never want to // apply the outsets to floating dialogs, because they wouldn't make sense there. final boolean useOutsets = attrs.type == TYPE_WALLPAPER || (fl & (WindowManager.LayoutParams.FLAG_FULLSCREEN | WindowManager.LayoutParams.FLAG_LAYOUT_IN_OVERSCAN)) != 0; final boolean useOutsets = shouldUseOutsets(attrs, fl); if (isDefaultDisplay && useOutsets) { osf = mTmpOutsetFrame; osf.set(cf.left, cf.top, cf.right, cf.bottom); int outset = ScreenShapeHelper.getWindowOutsetBottomPx(mContext.getResources()); if (outset > 0) { int rotation = Surface.ROTATION_0; try { rotation = mWindowManager.getRotation(); } catch (RemoteException e) { } int rotation = mDisplayRotation; if (rotation == Surface.ROTATION_0) { osf.bottom += outset; } else if (rotation == Surface.ROTATION_90) { Loading