Loading core/java/android/view/WindowManagerPolicy.java +14 −6 Original line number Diff line number Diff line Loading @@ -123,7 +123,7 @@ public interface WindowManagerPolicy { /** * This key event should put the device to sleep (and engage keyguard if necessary) * To be returned from {@link #interceptKeyBeforeQueueing}. * Do not return this and {@link #ACTION_POKE_USER_ACTIVITY} or {@link #ACTION_PASS_TO_USER}. * Do not return this and {@link #ACTION_WAKE_UP} or {@link #ACTION_PASS_TO_USER}. */ public final static int ACTION_GO_TO_SLEEP = 0x00000004; Loading Loading @@ -338,6 +338,12 @@ public interface WindowManagerPolicy { * Check whether the process hosting this window is currently alive. */ public boolean isAlive(); /** * Check if window is on {@link Display#DEFAULT_DISPLAY}. * @return true if window is on default display. */ public boolean isDefaultDisplay(); } /** Loading Loading @@ -707,7 +713,7 @@ public interface WindowManagerPolicy { * @param isScreenOn True if the screen is already on * * @return The bitwise or of the {@link #ACTION_PASS_TO_USER}, * {@link #ACTION_POKE_USER_ACTIVITY} and {@link #ACTION_GO_TO_SLEEP} flags. * {@link #ACTION_WAKE_UP} and {@link #ACTION_GO_TO_SLEEP} flags. */ public int interceptKeyBeforeQueueing(KeyEvent event, int policyFlags, boolean isScreenOn); Loading @@ -721,7 +727,7 @@ public interface WindowManagerPolicy { * @param policyFlags The policy flags associated with the motion. * * @return The bitwise or of the {@link #ACTION_PASS_TO_USER}, * {@link #ACTION_POKE_USER_ACTIVITY} and {@link #ACTION_GO_TO_SLEEP} flags. * {@link #ACTION_WAKE_UP} and {@link #ACTION_GO_TO_SLEEP} flags. */ public int interceptMotionBeforeQueueingWhenScreenOff(int policyFlags); Loading Loading @@ -762,12 +768,14 @@ public interface WindowManagerPolicy { /** * Called when layout of the windows is about to start. * * @param isDefaultDisplay true if window is on {@link Display#DEFAULT_DISPLAY}. * @param displayWidth The current full width of the screen. * @param displayHeight The current full height of the screen. * @param displayRotation The current rotation being applied to the base * window. */ public void beginLayoutLw(int displayWidth, int displayHeight, int displayRotation); public void beginLayoutLw(boolean isDefaultDisplay, int displayWidth, int displayHeight, int displayRotation); /** * Return the rectangle of the screen currently covered by system decorations. Loading Loading @@ -1066,7 +1074,7 @@ public interface WindowManagerPolicy { * Inform the policy that the user has chosen a preferred orientation ("rotation lock"). * * @param mode One of {@link WindowManagerPolicy#USER_ROTATION_LOCKED} or * {@link * WindowManagerPolicy#USER_ROTATION_FREE}. * {@link WindowManagerPolicy#USER_ROTATION_FREE}. * @param rotation One of {@link Surface#ROTATION_0}, {@link Surface#ROTATION_90}, * {@link Surface#ROTATION_180}, {@link Surface#ROTATION_270}. */ Loading policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +155 −132 Original line number Diff line number Diff line Loading @@ -40,7 +40,6 @@ import android.graphics.PixelFormat; import android.graphics.Rect; import android.media.AudioManager; import android.media.IAudioService; import android.os.BatteryManager; import android.os.Bundle; import android.os.FactoryTest; import android.os.Handler; Loading @@ -67,7 +66,6 @@ import com.android.internal.statusbar.IStatusBarService; import com.android.internal.telephony.ITelephony; import com.android.internal.widget.PointerLocationView; import android.service.dreams.IDreamManager; import android.util.DisplayMetrics; import android.util.EventLog; import android.util.Log; Loading Loading @@ -2239,6 +2237,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { & ~mForceClearedSystemUiFlags; } @Override public void getContentInsetHintLw(WindowManager.LayoutParams attrs, Rect contentInset) { final int fl = attrs.flags; final int systemUiVisibility = (attrs.systemUiVisibility|attrs.subtreeSystemUiVisibility); Loading Loading @@ -2279,7 +2278,9 @@ public class PhoneWindowManager implements WindowManagerPolicy { } /** {@inheritDoc} */ public void beginLayoutLw(int displayWidth, int displayHeight, int displayRotation) { @Override public void beginLayoutLw(boolean isDefaultDisplay, int displayWidth, int displayHeight, int displayRotation) { mUnrestrictedScreenLeft = mUnrestrictedScreenTop = 0; mUnrestrictedScreenWidth = displayWidth; mUnrestrictedScreenHeight = displayHeight; Loading @@ -2306,6 +2307,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { pf.right = df.right = vf.right = mDockRight; pf.bottom = df.bottom = vf.bottom = mDockBottom; if (isDefaultDisplay) { // For purposes of putting out fake window up to steal focus, we will // drive nav being hidden only by whether it is requested. boolean navVisible = (mLastSystemUiFlags&View.SYSTEM_UI_FLAG_HIDE_NAVIGATION) == 0; Loading Loading @@ -2439,6 +2441,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { } } } } /** {@inheritDoc} */ public int getSystemDecorRectLw(Rect systemRect) { Loading Loading @@ -2518,13 +2521,15 @@ public class PhoneWindowManager implements WindowManagerPolicy { } /** {@inheritDoc} */ @Override public void layoutWindowLw(WindowState win, WindowManager.LayoutParams attrs, WindowState attached) { // we've already done the status bar if (win == mStatusBar || win == mNavigationBar) { return; } final boolean needsToOffsetInputMethodTarget = final boolean isDefaultDisplay = win.isDefaultDisplay(); final boolean needsToOffsetInputMethodTarget = isDefaultDisplay && (win == mLastInputMethodTargetWindow && mLastInputMethodWindow != null); if (needsToOffsetInputMethodTarget) { if (DEBUG_LAYOUT) { Loading @@ -2542,10 +2547,24 @@ public class PhoneWindowManager implements WindowManagerPolicy { final Rect cf = mTmpContentFrame; final Rect vf = mTmpVisibleFrame; final boolean hasNavBar = (mHasNavigationBar final boolean hasNavBar = (isDefaultDisplay && mHasNavigationBar && mNavigationBar != null && mNavigationBar.isVisibleLw()); if (attrs.type == TYPE_INPUT_METHOD) { if (!isDefaultDisplay) { if (attached != null) { // If this window is attached to another, our display // frame is the same as the one we are attached to. setAttachedWindowFrames(win, fl, sim, attached, true, pf, df, cf, vf); } else { // Give the window full screen. pf.left = df.left = cf.left = mUnrestrictedScreenLeft; pf.top = df.top = cf.top = mUnrestrictedScreenTop; pf.right = df.right = cf.right = mUnrestrictedScreenLeft + mUnrestrictedScreenWidth; pf.bottom = df.bottom = cf.bottom = mUnrestrictedScreenTop + mUnrestrictedScreenHeight; } } else if (attrs.type == TYPE_INPUT_METHOD) { pf.left = df.left = cf.left = vf.left = mDockLeft; pf.top = df.top = cf.top = vf.top = mDockTop; pf.right = df.right = cf.right = vf.right = mDockRight; Loading Loading @@ -2612,6 +2631,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { pf.right = df.right = mRestrictedScreenLeft+mRestrictedScreenWidth; pf.bottom = df.bottom = mRestrictedScreenTop+mRestrictedScreenHeight; } if (adjust != SOFT_INPUT_ADJUST_RESIZE) { cf.left = mDockLeft; cf.top = mDockTop; Loading @@ -2623,6 +2643,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { cf.right = mContentRight; cf.bottom = mContentBottom; } applyStableConstraints(sysUiFl, fl, cf); if (adjust != SOFT_INPUT_ADJUST_NOTHING) { vf.left = mCurLeft; Loading Loading @@ -2706,7 +2727,9 @@ public class PhoneWindowManager implements WindowManagerPolicy { pf.bottom = df.bottom = cf.bottom = mRestrictedScreenTop+mRestrictedScreenHeight; } applyStableConstraints(sysUiFl, fl, cf); if (adjust != SOFT_INPUT_ADJUST_NOTHING) { vf.left = mCurLeft; vf.top = mCurTop; Loading services/java/com/android/server/wm/DisplayContent.java +4 −2 Original line number Diff line number Diff line Loading @@ -65,11 +65,13 @@ class DisplayContent { // Accessed directly by all users. boolean layoutNeeded; int pendingLayoutChanges; final boolean isDefaultDisplay; DisplayContent(Display display) { mDisplay = display; mDisplayId = display.getDisplayId(); display.getDisplayInfo(mDisplayInfo); isDefaultDisplay = mDisplayId == Display.DEFAULT_DISPLAY; } int getDisplayId() { Loading @@ -85,7 +87,7 @@ class DisplayContent { } DisplayInfo getDisplayInfo() { mDisplay.getDisplayInfo(mDisplayInfo); // TODO: Add a listener for changes to Display and update mDisplayInfo when appropriate. return mDisplayInfo; } Loading services/java/com/android/server/wm/WindowAnimator.java +1 −14 Original line number Diff line number Diff line Loading @@ -50,6 +50,7 @@ public class WindowAnimator { // Layout changes for individual Displays. Indexed by displayId. SparseIntArray mPendingLayoutChanges = new SparseIntArray(); // TODO: Assign these from each iteration through DisplayContent. Only valid between loops. /** Overall window dimensions */ int mDw, mDh; Loading Loading @@ -698,20 +699,6 @@ public class WindowAnimator { } } static class SetAnimationParams { final WindowStateAnimator mWinAnimator; final Animation mAnimation; final int mAnimDw; final int mAnimDh; public SetAnimationParams(final WindowStateAnimator winAnimator, final Animation animation, final int animDw, final int animDh) { mWinAnimator = winAnimator; mAnimation = animation; mAnimDw = animDw; mAnimDh = animDh; } } void clearPendingActions() { synchronized (this) { mPendingActions = 0; Loading services/java/com/android/server/wm/WindowManagerService.java +98 −64 File changed.Preview size limit exceeded, changes collapsed. Show changes Loading
core/java/android/view/WindowManagerPolicy.java +14 −6 Original line number Diff line number Diff line Loading @@ -123,7 +123,7 @@ public interface WindowManagerPolicy { /** * This key event should put the device to sleep (and engage keyguard if necessary) * To be returned from {@link #interceptKeyBeforeQueueing}. * Do not return this and {@link #ACTION_POKE_USER_ACTIVITY} or {@link #ACTION_PASS_TO_USER}. * Do not return this and {@link #ACTION_WAKE_UP} or {@link #ACTION_PASS_TO_USER}. */ public final static int ACTION_GO_TO_SLEEP = 0x00000004; Loading Loading @@ -338,6 +338,12 @@ public interface WindowManagerPolicy { * Check whether the process hosting this window is currently alive. */ public boolean isAlive(); /** * Check if window is on {@link Display#DEFAULT_DISPLAY}. * @return true if window is on default display. */ public boolean isDefaultDisplay(); } /** Loading Loading @@ -707,7 +713,7 @@ public interface WindowManagerPolicy { * @param isScreenOn True if the screen is already on * * @return The bitwise or of the {@link #ACTION_PASS_TO_USER}, * {@link #ACTION_POKE_USER_ACTIVITY} and {@link #ACTION_GO_TO_SLEEP} flags. * {@link #ACTION_WAKE_UP} and {@link #ACTION_GO_TO_SLEEP} flags. */ public int interceptKeyBeforeQueueing(KeyEvent event, int policyFlags, boolean isScreenOn); Loading @@ -721,7 +727,7 @@ public interface WindowManagerPolicy { * @param policyFlags The policy flags associated with the motion. * * @return The bitwise or of the {@link #ACTION_PASS_TO_USER}, * {@link #ACTION_POKE_USER_ACTIVITY} and {@link #ACTION_GO_TO_SLEEP} flags. * {@link #ACTION_WAKE_UP} and {@link #ACTION_GO_TO_SLEEP} flags. */ public int interceptMotionBeforeQueueingWhenScreenOff(int policyFlags); Loading Loading @@ -762,12 +768,14 @@ public interface WindowManagerPolicy { /** * Called when layout of the windows is about to start. * * @param isDefaultDisplay true if window is on {@link Display#DEFAULT_DISPLAY}. * @param displayWidth The current full width of the screen. * @param displayHeight The current full height of the screen. * @param displayRotation The current rotation being applied to the base * window. */ public void beginLayoutLw(int displayWidth, int displayHeight, int displayRotation); public void beginLayoutLw(boolean isDefaultDisplay, int displayWidth, int displayHeight, int displayRotation); /** * Return the rectangle of the screen currently covered by system decorations. Loading Loading @@ -1066,7 +1074,7 @@ public interface WindowManagerPolicy { * Inform the policy that the user has chosen a preferred orientation ("rotation lock"). * * @param mode One of {@link WindowManagerPolicy#USER_ROTATION_LOCKED} or * {@link * WindowManagerPolicy#USER_ROTATION_FREE}. * {@link WindowManagerPolicy#USER_ROTATION_FREE}. * @param rotation One of {@link Surface#ROTATION_0}, {@link Surface#ROTATION_90}, * {@link Surface#ROTATION_180}, {@link Surface#ROTATION_270}. */ Loading
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +155 −132 Original line number Diff line number Diff line Loading @@ -40,7 +40,6 @@ import android.graphics.PixelFormat; import android.graphics.Rect; import android.media.AudioManager; import android.media.IAudioService; import android.os.BatteryManager; import android.os.Bundle; import android.os.FactoryTest; import android.os.Handler; Loading @@ -67,7 +66,6 @@ import com.android.internal.statusbar.IStatusBarService; import com.android.internal.telephony.ITelephony; import com.android.internal.widget.PointerLocationView; import android.service.dreams.IDreamManager; import android.util.DisplayMetrics; import android.util.EventLog; import android.util.Log; Loading Loading @@ -2239,6 +2237,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { & ~mForceClearedSystemUiFlags; } @Override public void getContentInsetHintLw(WindowManager.LayoutParams attrs, Rect contentInset) { final int fl = attrs.flags; final int systemUiVisibility = (attrs.systemUiVisibility|attrs.subtreeSystemUiVisibility); Loading Loading @@ -2279,7 +2278,9 @@ public class PhoneWindowManager implements WindowManagerPolicy { } /** {@inheritDoc} */ public void beginLayoutLw(int displayWidth, int displayHeight, int displayRotation) { @Override public void beginLayoutLw(boolean isDefaultDisplay, int displayWidth, int displayHeight, int displayRotation) { mUnrestrictedScreenLeft = mUnrestrictedScreenTop = 0; mUnrestrictedScreenWidth = displayWidth; mUnrestrictedScreenHeight = displayHeight; Loading @@ -2306,6 +2307,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { pf.right = df.right = vf.right = mDockRight; pf.bottom = df.bottom = vf.bottom = mDockBottom; if (isDefaultDisplay) { // For purposes of putting out fake window up to steal focus, we will // drive nav being hidden only by whether it is requested. boolean navVisible = (mLastSystemUiFlags&View.SYSTEM_UI_FLAG_HIDE_NAVIGATION) == 0; Loading Loading @@ -2439,6 +2441,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { } } } } /** {@inheritDoc} */ public int getSystemDecorRectLw(Rect systemRect) { Loading Loading @@ -2518,13 +2521,15 @@ public class PhoneWindowManager implements WindowManagerPolicy { } /** {@inheritDoc} */ @Override public void layoutWindowLw(WindowState win, WindowManager.LayoutParams attrs, WindowState attached) { // we've already done the status bar if (win == mStatusBar || win == mNavigationBar) { return; } final boolean needsToOffsetInputMethodTarget = final boolean isDefaultDisplay = win.isDefaultDisplay(); final boolean needsToOffsetInputMethodTarget = isDefaultDisplay && (win == mLastInputMethodTargetWindow && mLastInputMethodWindow != null); if (needsToOffsetInputMethodTarget) { if (DEBUG_LAYOUT) { Loading @@ -2542,10 +2547,24 @@ public class PhoneWindowManager implements WindowManagerPolicy { final Rect cf = mTmpContentFrame; final Rect vf = mTmpVisibleFrame; final boolean hasNavBar = (mHasNavigationBar final boolean hasNavBar = (isDefaultDisplay && mHasNavigationBar && mNavigationBar != null && mNavigationBar.isVisibleLw()); if (attrs.type == TYPE_INPUT_METHOD) { if (!isDefaultDisplay) { if (attached != null) { // If this window is attached to another, our display // frame is the same as the one we are attached to. setAttachedWindowFrames(win, fl, sim, attached, true, pf, df, cf, vf); } else { // Give the window full screen. pf.left = df.left = cf.left = mUnrestrictedScreenLeft; pf.top = df.top = cf.top = mUnrestrictedScreenTop; pf.right = df.right = cf.right = mUnrestrictedScreenLeft + mUnrestrictedScreenWidth; pf.bottom = df.bottom = cf.bottom = mUnrestrictedScreenTop + mUnrestrictedScreenHeight; } } else if (attrs.type == TYPE_INPUT_METHOD) { pf.left = df.left = cf.left = vf.left = mDockLeft; pf.top = df.top = cf.top = vf.top = mDockTop; pf.right = df.right = cf.right = vf.right = mDockRight; Loading Loading @@ -2612,6 +2631,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { pf.right = df.right = mRestrictedScreenLeft+mRestrictedScreenWidth; pf.bottom = df.bottom = mRestrictedScreenTop+mRestrictedScreenHeight; } if (adjust != SOFT_INPUT_ADJUST_RESIZE) { cf.left = mDockLeft; cf.top = mDockTop; Loading @@ -2623,6 +2643,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { cf.right = mContentRight; cf.bottom = mContentBottom; } applyStableConstraints(sysUiFl, fl, cf); if (adjust != SOFT_INPUT_ADJUST_NOTHING) { vf.left = mCurLeft; Loading Loading @@ -2706,7 +2727,9 @@ public class PhoneWindowManager implements WindowManagerPolicy { pf.bottom = df.bottom = cf.bottom = mRestrictedScreenTop+mRestrictedScreenHeight; } applyStableConstraints(sysUiFl, fl, cf); if (adjust != SOFT_INPUT_ADJUST_NOTHING) { vf.left = mCurLeft; vf.top = mCurTop; Loading
services/java/com/android/server/wm/DisplayContent.java +4 −2 Original line number Diff line number Diff line Loading @@ -65,11 +65,13 @@ class DisplayContent { // Accessed directly by all users. boolean layoutNeeded; int pendingLayoutChanges; final boolean isDefaultDisplay; DisplayContent(Display display) { mDisplay = display; mDisplayId = display.getDisplayId(); display.getDisplayInfo(mDisplayInfo); isDefaultDisplay = mDisplayId == Display.DEFAULT_DISPLAY; } int getDisplayId() { Loading @@ -85,7 +87,7 @@ class DisplayContent { } DisplayInfo getDisplayInfo() { mDisplay.getDisplayInfo(mDisplayInfo); // TODO: Add a listener for changes to Display and update mDisplayInfo when appropriate. return mDisplayInfo; } Loading
services/java/com/android/server/wm/WindowAnimator.java +1 −14 Original line number Diff line number Diff line Loading @@ -50,6 +50,7 @@ public class WindowAnimator { // Layout changes for individual Displays. Indexed by displayId. SparseIntArray mPendingLayoutChanges = new SparseIntArray(); // TODO: Assign these from each iteration through DisplayContent. Only valid between loops. /** Overall window dimensions */ int mDw, mDh; Loading Loading @@ -698,20 +699,6 @@ public class WindowAnimator { } } static class SetAnimationParams { final WindowStateAnimator mWinAnimator; final Animation mAnimation; final int mAnimDw; final int mAnimDh; public SetAnimationParams(final WindowStateAnimator winAnimator, final Animation animation, final int animDw, final int animDh) { mWinAnimator = winAnimator; mAnimation = animation; mAnimDw = animDw; mAnimDh = animDh; } } void clearPendingActions() { synchronized (this) { mPendingActions = 0; Loading
services/java/com/android/server/wm/WindowManagerService.java +98 −64 File changed.Preview size limit exceeded, changes collapsed. Show changes