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

Commit 7b2fdb4c authored by Diego Vela's avatar Diego Vela
Browse files

Fix mismatchecd use of isEmpty in Sidecar

Replace use of isEmpty with check for zero Rect.

Test: n/a
Bug: 160827187
Change-Id: I22c041e095fd9b28c3b526f78e2adecd2ea4b88e
parent 530d8612
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -192,7 +192,7 @@ class SettingsSidecarImpl extends StubSidecar {
                Rect featureRect = new Rect(left, top, right, bottom);
                rotateRectToDisplayRotation(featureRect, displayId);
                transformToWindowSpaceRect(featureRect, windowToken);
                if (!featureRect.isEmpty()) {
                if (isNotZero(featureRect)) {
                    SidecarDisplayFeature feature = new SidecarDisplayFeature();
                    feature.setRect(featureRect);
                    feature.setType(type);
@@ -207,6 +207,10 @@ class SettingsSidecarImpl extends StubSidecar {
        return features;
    }

    private static boolean isNotZero(Rect rect) {
        return rect.height() > 0 || rect.width() > 0;
    }

    @Override
    protected void onListenersChanged() {
        if (mSettingsObserver == null) {