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

Commit 14c040bd authored by Chong Zhang's avatar Chong Zhang Committed by Android (Google) Code Review
Browse files

Merge "Fixes for dim bounds and touch bounds"

parents 1bc5d9b3 4c9ba52a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -70,7 +70,7 @@ public class DimLayer {
        /** Returns the display info. of the dim layer user. */
        DisplayInfo getDisplayInfo();
        /** Gets the bounds of the dim layer user. */
        void getBounds(Rect outBounds);
        void getDimBounds(Rect outBounds);
        String toShortString();
    }
    /** The user of this dim layer. */
+7 −8
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ class DimLayerController {

    /** Updates the dim layer bounds, recreating it if needed. */
    void updateDimLayer(DimLayer.DimLayerUser dimLayerUser) {
        DimLayerState state = getOrCreateDimLayerState(dimLayerUser, false);
        DimLayerState state = getOrCreateDimLayerState(dimLayerUser);
        final boolean previousFullscreen = state.dimLayer != null
                && state.dimLayer == mSharedFullScreenDimLayer;
        DimLayer newDimLayer;
@@ -63,7 +63,7 @@ class DimLayerController {
                    // Create new full screen dim layer.
                    newDimLayer = new DimLayer(mDisplayContent.mService, dimLayerUser, displayId);
                }
                dimLayerUser.getBounds(mTmpBounds);
                dimLayerUser.getDimBounds(mTmpBounds);
                newDimLayer.setBounds(mTmpBounds);
                mSharedFullScreenDimLayer = newDimLayer;
            } else if (state.dimLayer != null) {
@@ -73,14 +73,13 @@ class DimLayerController {
            newDimLayer = (state.dimLayer == null || previousFullscreen)
                    ? new DimLayer(mDisplayContent.mService, dimLayerUser, displayId)
                    : state.dimLayer;
            dimLayerUser.getBounds(mTmpBounds);
            dimLayerUser.getDimBounds(mTmpBounds);
            newDimLayer.setBounds(mTmpBounds);
        }
        state.dimLayer = newDimLayer;
    }

    private DimLayerState getOrCreateDimLayerState(
            DimLayer.DimLayerUser dimLayerUser, boolean aboveApp) {
    private DimLayerState getOrCreateDimLayerState(DimLayer.DimLayerUser dimLayerUser) {
        if (DEBUG_DIM_LAYER) Slog.v(TAG, "getOrCreateDimLayerState, dimLayerUser="
                + dimLayerUser.toShortString());
        DimLayerState state = mState.get(dimLayerUser);
@@ -88,7 +87,6 @@ class DimLayerController {
            state = new DimLayerState();
            mState.put(dimLayerUser, state);
        }
        state.dimAbove = aboveApp;
        return state;
    }

@@ -127,7 +125,8 @@ class DimLayerController {
            WindowStateAnimator newWinAnimator, boolean aboveApp) {
        // Only set dim params on the highest dimmed layer.
        // Don't turn on for an unshown surface, or for any layer but the highest dimmed layer.
        DimLayerState state = getOrCreateDimLayerState(dimLayerUser, aboveApp);
        DimLayerState state = getOrCreateDimLayerState(dimLayerUser);
        state.dimAbove = aboveApp;
        if (DEBUG_DIM_LAYER) Slog.v(TAG, "startDimmingIfNeeded,"
                + " dimLayerUser=" + dimLayerUser.toShortString()
                + " newWinAnimator=" + newWinAnimator
@@ -161,7 +160,7 @@ class DimLayerController {
                + " state.dimLayer.isDimming=" + state.dimLayer.isDimming());
        if (!state.continueDimming && state.dimLayer.isDimming()) {
            state.animator = null;
            dimLayerUser.getBounds(mTmpBounds);
            dimLayerUser.getDimBounds(mTmpBounds);
            state.dimLayer.setBounds(mTmpBounds);
        }
    }
+2 −2
Original line number Diff line number Diff line
@@ -297,7 +297,7 @@ class DisplayContent {
                // windows frames when the app window is the IME target.
                final WindowState win = task.getTopAppMainWindow();
                if (win != null) {
                    win.getVisibleBounds(mTmpRect, !BOUNDS_FOR_TOUCH);
                    win.getVisibleBounds(mTmpRect);
                    if (mTmpRect.contains(x, y)) {
                        return task.mTaskId;
                    }
@@ -332,7 +332,7 @@ class DisplayContent {
                // start at (0,0) after it's adjusted for the status bar.)
                final WindowState win = task.getTopAppMainWindow();
                if (win != null) {
                    win.getVisibleBounds(mTmpRect, !BOUNDS_FOR_TOUCH);
                    win.getVisibleBounds(mTmpRect);
                    mTmpRect.inset(-delta, -delta);
                    if (mTmpRect.contains(x, y)) {
                        mTmpRect.inset(delta, delta);
+1 −1
Original line number Diff line number Diff line
@@ -87,7 +87,7 @@ public class DockedStackDividerController {
            frame.set(mLastRect);
            return;
        } else {
            stack.getBounds(mTmpRect);
            stack.getDimBounds(mTmpRect);
        }
        int side = stack.getDockSide();
        switch (side) {
+1 −1
Original line number Diff line number Diff line
@@ -435,7 +435,7 @@ class DragState {
                continue;
            }

            child.getVisibleBounds(mTmpRect, !BOUNDS_FOR_TOUCH);
            child.getVisibleBounds(mTmpRect);
            if (!mTmpRect.contains(x, y)) {
                // outside of this window's activity stack == don't tell about drags
                continue;
Loading