Fix empty CompositePositionUpdateListener

ArrayUtils methods can return null. Fix the assumption made by CPUL.

Test: atest android.view.cts.SystemGestureExclusionRectsTest
Change-Id: I513e179b9a5715c381218a1ceb7e35dc91d1797a
This commit is contained in:
Adam Powell
2019-03-20 14:32:29 -07:00
parent 30115c998c
commit 6b46fc59d4

View File

@@ -284,9 +284,10 @@ public final class RenderNode {
private static final class CompositePositionUpdateListener implements PositionUpdateListener {
private final PositionUpdateListener[] mListeners;
private static final PositionUpdateListener[] sEmpty = new PositionUpdateListener[0];
CompositePositionUpdateListener(PositionUpdateListener... listeners) {
mListeners = listeners;
mListeners = listeners != null ? listeners : sEmpty;
}
public CompositePositionUpdateListener with(PositionUpdateListener listener) {