Merge "Fix crash when unfolding a device." into tm-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
3cc4eea5b6
@@ -200,12 +200,23 @@ public class WindowLayoutComponentImpl implements WindowLayoutComponent {
|
||||
rotateRectToDisplayRotation(displayId, featureRect);
|
||||
transformToWindowSpaceRect(activity, featureRect);
|
||||
|
||||
features.add(new FoldingFeature(featureRect, baseFeature.getType(), state));
|
||||
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) {
|
||||
|
||||
Reference in New Issue
Block a user