Merge transactions to parent if layer is going to be removed.

Transaction objects are stored in each WindowContainer. There are cases
where a transaction is added for a layer by using the WindowContainer
transaction object. The WindowContainer can be removed before its
transaction is merged to the global transaction. If that occurs, the
layer can remain around in SF until gc cleans it up.

Bug: 74078662
Test: Open new app. The snapshot animation leash should be gone from
dumpsys.
Test: Open app in split screen. Exit split screen. Open app again in
split screen. There shouldn't be any empty stacks in dumpsys.

Change-Id: I31a61773edf1f541726691b4510c544bbd5beea4
1 file changed