Fix mismatchecd use of isEmpty in Sidecar

Replace use of isEmpty with check for zero Rect.

Test: n/a
Bug: 160827187
Change-Id: I22c041e095fd9b28c3b526f78e2adecd2ea4b88e
This commit is contained in:
Diego Vela
2020-07-13 15:20:59 -07:00
parent 530d86123e
commit 7b2fdb4cea

View File

@@ -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) {