Null check before writing RemoteAnimationTarget proto

Change-related variables are null when not changing, thus
we need to check for that before trying to write them to proto

Bug: 123538318
Test: ActivityLifecycleTopResumedStateTests#testTopPositionLostOnFinish
      passes

Change-Id: I643c48621602b5203f7f64a9af0578273f115dbe
This commit is contained in:
Evan Rosky
2019-01-29 18:44:28 -08:00
parent debdadecc2
commit baca819d26

View File

@@ -246,8 +246,12 @@ public class RemoteAnimationTarget implements Parcelable {
position.writeToProto(proto, POSITION);
sourceContainerBounds.writeToProto(proto, SOURCE_CONTAINER_BOUNDS);
windowConfiguration.writeToProto(proto, WINDOW_CONFIGURATION);
startLeash.writeToProto(proto, START_LEASH);
startBounds.writeToProto(proto, START_BOUNDS);
if (startLeash != null) {
startLeash.writeToProto(proto, START_LEASH);
}
if (startBounds != null) {
startBounds.writeToProto(proto, START_BOUNDS);
}
proto.end(token);
}