Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e94831e5 authored by Craig Mautner's avatar Craig Mautner Committed by Android (Google) Code Review
Browse files

Merge "Minor refactors." into jb-mr1-dev

parents 0baaac5e 39834192
Loading
Loading
Loading
Loading
+9 −8
Original line number Diff line number Diff line
@@ -827,32 +827,33 @@ public interface WindowManagerPolicy {
    static final int FINISH_LAYOUT_REDO_ANIM = 0x0008;
    
    /**
     * Called when animation of the windows is about to start.
     * Called following layout of all windows before each window has policy applied.
     * 
     * @param displayWidth The current full width of the screen.
     * @param displayHeight The current full height of the screen.
     */
    public void beginAnimationLw(int displayWidth, int displayHeight);
    public void beginPostLayoutPolicyLw(int displayWidth, int displayHeight);

    /**
     * Called each time a window is animating.
     * Called following layout of all window to apply policy to each window.
     * 
     * @param win The window being positioned.
     * @param attrs The LayoutParams of the window. 
     */
    public void animatingWindowLw(WindowState win,
    public void applyPostLayoutPolicyLw(WindowState win,
            WindowManager.LayoutParams attrs);

    /**
     * Called when animation of the windows is finished.  If in this function you do 
     * Called following layout of all windows and after policy has been applied
     * to each window. If in this function you do
     * something that may have modified the animation state of another window,
     * be sure to return true in order to perform another animation frame. 
     * be sure to return non-zero in order to perform another pass through layout.
     *  
     * @return Return any bit set of {@link #FINISH_LAYOUT_REDO_LAYOUT},
     * {@link #FINISH_LAYOUT_REDO_CONFIG}, {@link #FINISH_LAYOUT_REDO_WALLPAPER},
     * or {@link #FINISH_LAYOUT_REDO_ANIM}.
     */
    public int finishAnimationLw();
    public int finishPostLayoutPolicyLw();

    /**
     * Return true if it is okay to perform animations for an app transition
+7 −6
Original line number Diff line number Diff line
@@ -2809,7 +2809,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
    }

    /** {@inheritDoc} */
    public void beginAnimationLw(int displayWidth, int displayHeight) {
    public void beginPostLayoutPolicyLw(int displayWidth, int displayHeight) {
        mTopFullscreenOpaqueWindowState = null;
        mForceStatusBar = false;
        
@@ -2819,7 +2819,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
    }

    /** {@inheritDoc} */
    public void animatingWindowLw(WindowState win,
    public void applyPostLayoutPolicyLw(WindowState win,
                                WindowManager.LayoutParams attrs) {
        if (DEBUG_LAYOUT) Slog.i(TAG, "Win " + win + ": isVisibleOrBehindKeyguardLw="
                + win.isVisibleOrBehindKeyguardLw());
@@ -2851,7 +2851,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
    }

    /** {@inheritDoc} */
    public int finishAnimationLw() {
    public int finishPostLayoutPolicyLw() {
        int changes = 0;
        boolean topIsFullscreen = false;

@@ -2906,10 +2906,11 @@ public class PhoneWindowManager implements WindowManagerPolicy {

        mTopIsFullscreen = topIsFullscreen;

        // Hide the key guard if a visible window explicitly specifies that it wants to be displayed
        // when the screen is locked
        // Hide the key guard if a visible window explicitly specifies that it wants to be
        // displayed when the screen is locked.
        if (mKeyguard != null) {
            if (localLOGV) Log.v(TAG, "finishAnimationLw::mHideKeyguard="+mHideLockScreen);
            if (localLOGV) Log.v(TAG, "finishPostLayoutPolicyLw: mHideKeyguard="
                    + mHideLockScreen);
            if (mDismissKeyguard && !mKeyguardMediator.isSecure()) {
                if (mKeyguard.hideLw(true)) {
                    changes |= FINISH_LAYOUT_REDO_LAYOUT
+4 −0
Original line number Diff line number Diff line
@@ -62,6 +62,9 @@ class DisplayContent {
    final DisplayInfo mDisplayInfo = new DisplayInfo();
    final Display mDisplay;

    // Accessed directly by all users.
    boolean layoutNeeded;

    DisplayContent(Display display) {
        mDisplay = display;
        mDisplayId = display.getDisplayId();
@@ -106,6 +109,7 @@ class DisplayContent {
        pw.print("x"); pw.print(mDisplayInfo.smallestNominalAppHeight);
        pw.print("-"); pw.print(mDisplayInfo.largestNominalAppWidth);
        pw.print("x"); pw.println(mDisplayInfo.largestNominalAppHeight);
        pw.print("layoutNeeded="); pw.println(layoutNeeded);
        pw.println();
    }
}
+13 −11
Original line number Diff line number Diff line
@@ -23,13 +23,14 @@ import com.android.server.wm.WindowManagerService.H;

import android.content.ClipData;
import android.content.ClipDescription;
import android.graphics.Point;
import android.graphics.Region;
import android.os.IBinder;
import android.os.Message;
import android.os.Process;
import android.os.RemoteException;
import android.util.Slog;
import android.view.DisplayInfo;
import android.view.Display;
import android.view.DragEvent;
import android.view.InputChannel;
import android.view.Surface;
@@ -59,7 +60,7 @@ class DragState {
    WindowState mTargetWindow;
    ArrayList<WindowState> mNotifiedWindows;
    boolean mDragInProgress;
    DisplayContent mDisplayContent;
    Display mDisplay;

    private final Region mTmpRegion = new Region();

@@ -87,10 +88,10 @@ class DragState {
    }

    /**
     * @param displayContent The display parameters associated with the window being dragged.
     * @param display The Display that the window being dragged is on.
     */
    void register(DisplayContent displayContent) {
        mDisplayContent = displayContent;
    void register(Display display) {
        mDisplay = display;
        if (WindowManagerService.DEBUG_DRAG) Slog.d(WindowManagerService.TAG, "registering drag input channel");
        if (mClientChannel != null) {
            Slog.e(WindowManagerService.TAG, "Duplicate register of drag input channel");
@@ -108,7 +109,7 @@ class DragState {
                    WindowManagerService.DEFAULT_INPUT_DISPATCHING_TIMEOUT_NANOS;

            mDragWindowHandle = new InputWindowHandle(mDragApplicationHandle, null,
                    mDisplayContent.getDisplayId());
                    mDisplay.getDisplayId());
            mDragWindowHandle.name = "drag";
            mDragWindowHandle.inputChannel = mServerChannel;
            mDragWindowHandle.layer = getDragLayerLw();
@@ -132,9 +133,10 @@ class DragState {
            // The drag window covers the entire display
            mDragWindowHandle.frameLeft = 0;
            mDragWindowHandle.frameTop = 0;
            DisplayInfo displayInfo = mDisplayContent.getDisplayInfo();
            mDragWindowHandle.frameRight = displayInfo.logicalWidth;
            mDragWindowHandle.frameBottom = displayInfo.logicalHeight;
            Point p = new Point();
            mDisplay.getRealSize(p);
            mDragWindowHandle.frameRight = p.x;
            mDragWindowHandle.frameBottom = p.y;

            // Pause rotations before a drag.
            if (WindowManagerService.DEBUG_ORIENTATION) {
@@ -187,7 +189,7 @@ class DragState {
            Slog.d(WindowManagerService.TAG, "broadcasting DRAG_STARTED at (" + touchX + ", " + touchY + ")");
        }

        final WindowList windows = mDisplayContent.getWindowList();
        final WindowList windows = mService.getWindowList(mDisplay);
        final int N = windows.size();
        for (int i = 0; i < N; i++) {
            sendDragStartedLw(windows.get(i), touchX, touchY, mDataDescription);
@@ -390,7 +392,7 @@ class DragState {
        final int x = (int) xf;
        final int y = (int) yf;

        final WindowList windows = mDisplayContent.getWindowList();
        final WindowList windows = mService.getWindowList(mDisplay);
        final int N = windows.size();
        for (int i = N - 1; i >= 0; i--) {
            WindowState child = windows.get(i);
+1 −1
Original line number Diff line number Diff line
@@ -280,7 +280,7 @@ final class Session extends IWindowSession.Stub
            // !!! FIXME: put all this heavy stuff onto the mH looper, as well as
            // the actual drag event dispatch stuff in the dragstate

            mService.mDragState.register(callingWin.mDisplayContent);
            mService.mDragState.register(callingWin.mDisplayContent.getDisplay());
            mService.mInputMonitor.updateInputWindowsLw(true /*force*/);
            if (!mService.mInputManager.transferTouchFocus(callingWin.mInputChannel,
                    mService.mDragState.mServerChannel)) {
Loading