diff options
author | Filip Gruszczynski <gruszczy@google.com> | 2015-05-20 22:54:14 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-05-20 22:54:14 +0000 |
commit | 47249f2a9e49aa9626369517315eafc6b42fd8e9 (patch) | |
tree | 9961cf51931b0c023fe8e7585a35ee73e0850895 /services/core/java/com/android/server/wm | |
parent | 782def772adacaf029d7d9850605923066665424 (diff) | |
parent | cb89ac84c621e047d81873428325dfd747b90a6b (diff) | |
download | frameworks_base-47249f2a9e49aa9626369517315eafc6b42fd8e9.zip frameworks_base-47249f2a9e49aa9626369517315eafc6b42fd8e9.tar.gz frameworks_base-47249f2a9e49aa9626369517315eafc6b42fd8e9.tar.bz2 |
am cb89ac84: Merge "Support for devices with a chin." into cw-d-mr1-dev
* commit 'cb89ac84c621e047d81873428325dfd747b90a6b':
Support for devices with a chin.
Diffstat (limited to 'services/core/java/com/android/server/wm')
3 files changed, 43 insertions, 10 deletions
diff --git a/services/core/java/com/android/server/wm/Session.java b/services/core/java/com/android/server/wm/Session.java index a1d145c..40e6d58 100644 --- a/services/core/java/com/android/server/wm/Session.java +++ b/services/core/java/com/android/server/wm/Session.java @@ -190,14 +190,15 @@ final class Session extends IWindowSession.Stub public int relayout(IWindow window, int seq, WindowManager.LayoutParams attrs, int requestedWidth, int requestedHeight, int viewFlags, int flags, Rect outFrame, Rect outOverscanInsets, Rect outContentInsets, - Rect outVisibleInsets, Rect outStableInsets, Configuration outConfig, + Rect outVisibleInsets, Rect outStableInsets, Rect outsets, Configuration + outConfig, Surface outSurface) { if (false) Slog.d(WindowManagerService.TAG, ">>>>>> ENTERED relayout from " + Binder.getCallingPid()); int res = mService.relayoutWindow(this, window, seq, attrs, requestedWidth, requestedHeight, viewFlags, flags, outFrame, outOverscanInsets, outContentInsets, outVisibleInsets, - outStableInsets, outConfig, outSurface); + outStableInsets, outsets, outConfig, outSurface); if (false) Slog.d(WindowManagerService.TAG, "<<<<<< EXITING relayout to " + Binder.getCallingPid()); return res; @@ -536,4 +537,4 @@ final class Session extends IWindowSession.Stub public String toString() { return mStringName; } -}
\ No newline at end of file +} diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index e9df96b..566518c 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -3025,7 +3025,7 @@ public class WindowManagerService extends IWindowManager.Stub WindowManager.LayoutParams attrs, int requestedWidth, int requestedHeight, int viewVisibility, int flags, Rect outFrame, Rect outOverscanInsets, Rect outContentInsets, - Rect outVisibleInsets, Rect outStableInsets, Configuration outConfig, + Rect outVisibleInsets, Rect outStableInsets, Rect outOutsets, Configuration outConfig, Surface outSurface) { boolean toBeDisplayed = false; boolean inTouchMode; @@ -3310,6 +3310,7 @@ public class WindowManagerService extends IWindowManager.Stub outContentInsets.set(win.mContentInsets); outVisibleInsets.set(win.mVisibleInsets); outStableInsets.set(win.mStableInsets); + outOutsets.set(win.mOutsets); if (localLOGV) Slog.v( TAG, "Relayout given client " + client.asBinder() + ", requestedWidth=" + requestedWidth @@ -9577,6 +9578,7 @@ public class WindowManagerService extends IWindowManager.Stub w.mLastContentInsets.set(w.mContentInsets); w.mLastVisibleInsets.set(w.mVisibleInsets); w.mLastStableInsets.set(w.mStableInsets); + w.mLastOutsets.set(w.mOutsets); makeWindowFreezingScreenIfNeededLocked(w); // If the orientation is changing, then we need to // hold off on unfreezing the display until this diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java index d7b537f..a2b1880 100644 --- a/services/core/java/com/android/server/wm/WindowState.java +++ b/services/core/java/com/android/server/wm/WindowState.java @@ -179,6 +179,14 @@ final class WindowState implements WindowManagerPolicy.WindowState { boolean mStableInsetsChanged; /** + * Outsets determine the area outside of the surface where we want to pretend that it's possible + * to draw anyway. + */ + final Rect mOutsets = new Rect(); + final Rect mLastOutsets = new Rect(); + boolean mOutsetsChanged = false; + + /** * Set to true if we are waiting for this window to receive its * given internal insets before laying out other windows based on it. */ @@ -259,6 +267,10 @@ final class WindowState implements WindowManagerPolicy.WindowState { // displays hint text. final Rect mVisibleFrame = new Rect(); + // Frame that includes dead area outside of the surface but where we want to pretend that it's + // possible to draw. + final Rect mOutsetFrame = new Rect(); + boolean mContentChanged; // If a window showing a wallpaper: the requested offset for the @@ -515,7 +527,8 @@ final class WindowState implements WindowManagerPolicy.WindowState { } @Override - public void computeFrameLw(Rect pf, Rect df, Rect of, Rect cf, Rect vf, Rect dcf, Rect sf) { + public void computeFrameLw(Rect pf, Rect df, Rect of, Rect cf, Rect vf, Rect dcf, Rect sf, + Rect osf) { mHaveFrame = true; TaskStack stack = mAppToken != null ? getStack() : null; @@ -583,6 +596,7 @@ final class WindowState implements WindowManagerPolicy.WindowState { mVisibleFrame.set(vf); mDecorFrame.set(dcf); mStableFrame.set(sf); + mOutsetFrame.set(osf); final int fw = mFrame.width(); final int fh = mFrame.height(); @@ -645,6 +659,11 @@ final class WindowState implements WindowManagerPolicy.WindowState { Math.max(mFrame.right - mStableFrame.right, 0), Math.max(mFrame.bottom - mStableFrame.bottom, 0)); + mOutsets.set(Math.max(mContentFrame.left - mOutsetFrame.left, 0), + Math.max(mContentFrame.top - mOutsetFrame.top, 0), + Math.max(mOutsetFrame.right - mContentFrame.right, 0), + Math.max(mOutsetFrame.bottom - mContentFrame.bottom, 0)); + mCompatFrame.set(mFrame); if (mEnforceSizeCompat) { // If there is a size compatibility scale being applied to the @@ -654,6 +673,7 @@ final class WindowState implements WindowManagerPolicy.WindowState { mContentInsets.scale(mInvGlobalScale); mVisibleInsets.scale(mInvGlobalScale); mStableInsets.scale(mInvGlobalScale); + mOutsets.scale(mInvGlobalScale); // Also the scaled frame that we report to the app needs to be // adjusted to be in its coordinate space. @@ -676,7 +696,8 @@ final class WindowState implements WindowManagerPolicy.WindowState { + "): frame=" + mFrame.toShortString() + " ci=" + mContentInsets.toShortString() + " vi=" + mVisibleInsets.toShortString() - + " vi=" + mStableInsets.toShortString()); + + " vi=" + mStableInsets.toShortString() + + " of=" + mOutsets.toShortString()); } @Override @@ -782,7 +803,9 @@ final class WindowState implements WindowManagerPolicy.WindowState { mContentInsetsChanged |= !mLastContentInsets.equals(mContentInsets); mVisibleInsetsChanged |= !mLastVisibleInsets.equals(mVisibleInsets); mStableInsetsChanged |= !mLastStableInsets.equals(mStableInsets); - return mOverscanInsetsChanged || mContentInsetsChanged || mVisibleInsetsChanged; + mOutsetsChanged |= !mLastOutsets.equals(mOutsets); + return mOverscanInsetsChanged || mContentInsetsChanged || mVisibleInsetsChanged + || mOutsetsChanged; } public DisplayContent getDisplayContent() { @@ -1327,7 +1350,7 @@ final class WindowState implements WindowManagerPolicy.WindowState { } return displayContent.isDefaultDisplay; } - + public void setShowToOwnerOnlyLocked(boolean showToOwnerOnly) { mShowToOwnerOnly = showToOwnerOnly; } @@ -1437,6 +1460,7 @@ final class WindowState implements WindowManagerPolicy.WindowState { final Rect contentInsets = mLastContentInsets; final Rect visibleInsets = mLastVisibleInsets; final Rect stableInsets = mLastStableInsets; + final Rect outsets = mLastOutsets; final boolean reportDraw = mWinAnimator.mDrawState == WindowStateAnimator.DRAW_PENDING; final Configuration newConfig = configChanged ? mConfiguration : null; if (mAttrs.type != WindowManager.LayoutParams.TYPE_APPLICATION_STARTING @@ -1447,7 +1471,7 @@ final class WindowState implements WindowManagerPolicy.WindowState { public void run() { try { mClient.resized(frame, overscanInsets, contentInsets, - visibleInsets, stableInsets, reportDraw, newConfig); + visibleInsets, stableInsets, outsets, reportDraw, newConfig); } catch (RemoteException e) { // Not a remote call, RemoteException won't be raised. } @@ -1455,7 +1479,7 @@ final class WindowState implements WindowManagerPolicy.WindowState { }); } else { mClient.resized(frame, overscanInsets, contentInsets, visibleInsets, stableInsets, - reportDraw, newConfig); + outsets, reportDraw, newConfig); } //TODO (multidisplay): Accessibility supported only for the default display. @@ -1468,6 +1492,7 @@ final class WindowState implements WindowManagerPolicy.WindowState { mContentInsetsChanged = false; mVisibleInsetsChanged = false; mStableInsetsChanged = false; + mOutsetsChanged = false; mWinAnimator.mSurfaceResized = false; } catch (RemoteException e) { mOrientationChanging = false; @@ -1618,17 +1643,22 @@ final class WindowState implements WindowManagerPolicy.WindowState { pw.println(); pw.print(prefix); pw.print(" decor="); mDecorFrame.printShortString(pw); pw.println(); + pw.print(prefix); pw.print(" outset="); mOutsetFrame.printShortString(pw); + pw.println(); pw.print(prefix); pw.print("Cur insets: overscan="); mOverscanInsets.printShortString(pw); pw.print(" content="); mContentInsets.printShortString(pw); pw.print(" visible="); mVisibleInsets.printShortString(pw); pw.print(" stable="); mStableInsets.printShortString(pw); + pw.print(" outsets="); mOutsets.printShortString(pw); pw.println(); pw.print(prefix); pw.print("Lst insets: overscan="); mLastOverscanInsets.printShortString(pw); pw.print(" content="); mLastContentInsets.printShortString(pw); pw.print(" visible="); mLastVisibleInsets.printShortString(pw); pw.print(" stable="); mLastStableInsets.printShortString(pw); + pw.print(" physical="); mLastOutsets.printShortString(pw); + pw.print(" outset="); mLastOutsets.printShortString(pw); pw.println(); } pw.print(prefix); pw.print(mWinAnimator); pw.println(":"); |