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

Commit 63c931e9 authored by Shawn Lin's avatar Shawn Lin Committed by Android (Google) Code Review
Browse files

Merge "The rounded corners from getCurrentMetrics should account for taskbar" into tm-qpr-dev

parents 3f5ba376 a8b27153
Loading
Loading
Loading
Loading
+15 −10
Original line number Diff line number Diff line
@@ -265,7 +265,7 @@ class InsetsPolicy {
            state = originalState;
        }
        state = adjustVisibilityForIme(target, state, state == originalState);
        return adjustInsetsForRoundedCorners(target, state, state == originalState);
        return adjustInsetsForRoundedCorners(target.mToken, state, state == originalState);
    }

    InsetsState adjustInsetsForWindow(WindowState target, InsetsState originalState) {
@@ -290,7 +290,8 @@ class InsetsPolicy {
        final InsetsState originalState = mDisplayContent.getInsetsPolicy()
                .enforceInsetsPolicyForTarget(type, WINDOWING_MODE_FULLSCREEN, alwaysOnTop,
                        mStateController.getRawInsetsState());
        return adjustVisibilityForTransientTypes(originalState);
        InsetsState state = adjustVisibilityForTransientTypes(originalState);
        return adjustInsetsForRoundedCorners(token, state, state == originalState);
    }

    /**
@@ -465,16 +466,20 @@ class InsetsPolicy {
        return originalState;
    }

    private InsetsState adjustInsetsForRoundedCorners(WindowState w, InsetsState originalState,
    private InsetsState adjustInsetsForRoundedCorners(WindowToken token, InsetsState originalState,
            boolean copyState) {
        final Task task = w.getTask();
        if (token != null) {
            final ActivityRecord activityRecord = token.asActivityRecord();
            final Task task = activityRecord != null ? activityRecord.getTask() : null;
            if (task != null && !task.getWindowConfiguration().tasksAreFloating()) {
                // Use task bounds to calculating rounded corners if the task is not floating.
                final Rect roundedCornerFrame = new Rect(task.getBounds());
            final InsetsState state = copyState ? new InsetsState(originalState) : originalState;
                final InsetsState state = copyState ? new InsetsState(originalState)
                        : originalState;
                state.setRoundedCornerFrame(roundedCornerFrame);
                return state;
            }
        }
        return originalState;
    }