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

Commit 4916b293 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix window cropping issue."

parents 6f45a394 0eac1689
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -4111,9 +4111,6 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
            policyCrop.intersect(-mCompatFrame.left, -mCompatFrame.top,
                    displayInfo.logicalWidth - mCompatFrame.left,
                    displayInfo.logicalHeight - mCompatFrame.top);
        } else if (mLayer >= mService.mSystemDecorLayer) {
            // Above the decor layer is easy, just use the entire window
            policyCrop.set(0, 0, mCompatFrame.width(), mCompatFrame.height());
        } else if (mDecorFrame.isEmpty()) {
            // Windows without policy decor aren't cropped.
            policyCrop.set(0, 0, mCompatFrame.width(), mCompatFrame.height());
+3 −5
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import org.junit.runner.RunWith;
import android.app.ActivityManager.TaskDescription;
import android.content.res.Configuration;
import android.graphics.Rect;
import android.os.Debug;
import android.platform.test.annotations.Presubmit;
import android.support.test.InstrumentationRegistry;
import android.support.test.filters.SmallTest;
@@ -339,11 +340,8 @@ public class WindowFrameTests extends WindowTestsBase {

        w.computeFrameLw(pf, df, of, cf, vf, dcf, sf, null);
        w.calculatePolicyCrop(policyCrop);
        // If we were above system decor we wouldnt' get any cropping though
        w.mLayer = sWm.mSystemDecorLayer + 1;
        w.calculatePolicyCrop(policyCrop);
        assertRect(policyCrop, 0, 0, logicalWidth, logicalHeight);
        w.mLayer = 1;
        assertRect(policyCrop, 0, cf.top, logicalWidth, cf.bottom);

        dcf.setEmpty();
        // Likewise with no decor frame we would get no crop
        w.computeFrameLw(pf, df, of, cf, vf, dcf, sf, null);