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

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

Merge "Moving away from obsolete Display#getRealSize()." into tm-dev

parents aa35c391 c8aada44
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -877,10 +877,9 @@ public final class LauncherInstrumentation {
    }

    /**
     * @return the Workspace object.
     * @deprecated use goHome().
     * Presses nav bar home button.
     *
     * @return the Workspace object.
     */
    @Deprecated
    public Workspace pressHome() {
@@ -1653,6 +1652,13 @@ public final class LauncherInstrumentation {
    Point getRealDisplaySize() {
        final Point size = new Point();
        getContext().getSystemService(WindowManager.class).getDefaultDisplay().getRealSize(size);
        final Rect winMetricsHeight = getContext().getSystemService(WindowManager.class)
                .getMaximumWindowMetrics()
                .getBounds();
        final Point winMetricsSize = new Point(winMetricsHeight.width(), winMetricsHeight.height());
        if (!winMetricsSize.equals(size)) {
            fail("Display size mismatch: " + size + " vs " + winMetricsSize);
        }
        return size;
    }