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

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

Merge changes from topic "presubmit-am-9a89763689094e51b347f585fe1f995d"

* changes:
  [automerge] Fix crash when unfolding a device. 2p: 9af40986 2p: 1240b477
  [automerge] Fix crash when unfolding a device. 2p: 9af40986
  Fix crash when unfolding a device.
parents ed4823d0 f21b74b4
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -200,12 +200,23 @@ public class WindowLayoutComponentImpl implements WindowLayoutComponent {
                rotateRectToDisplayRotation(displayId, featureRect);
                transformToWindowSpaceRect(activity, featureRect);

                if (!isRectZero(featureRect)) {
                    // TODO(b/228641877) Remove guarding if when fixed.
                    features.add(new FoldingFeature(featureRect, baseFeature.getType(), state));
                }
            }
        }
        return features;
    }

    /**
     * Returns {@link true} if a {@link Rect} has zero width and zero height,
     * {@code false} otherwise.
     */
    private boolean isRectZero(Rect rect) {
        return rect.width() == 0 && rect.height() == 0;
    }

    private final class NotifyOnConfigurationChanged extends EmptyLifecycleCallbacksAdapter {
        @Override
        public void onActivityCreated(Activity activity, Bundle savedInstanceState) {