Ensure RemoteAnimationTargets.unfilteredApps is not null
Public field RemoteAnimationTargets.unfilteredApps is accessed in
various locations in the code, also outside of the owning class. It is
generally assumed that it is a valid, non-null array.
In RemoteAnimationTargets constructor, if parameter apps is null,
unfilteredApps was not getting initialized at all. Initialize it with an
empty array instead.
Issue: FP3-A13#137
Change-Id: I3c185988819f8dc60035451bbbc2b9108ab59855
diff --git a/quickstep/src/com/android/quickstep/RemoteAnimationTargets.java b/quickstep/src/com/android/quickstep/RemoteAnimationTargets.java
index 80aaad0..0203bf5 100644
--- a/quickstep/src/com/android/quickstep/RemoteAnimationTargets.java
+++ b/quickstep/src/com/android/quickstep/RemoteAnimationTargets.java
@@ -53,9 +53,11 @@
hasRecents |= target.windowConfiguration.getActivityType() == ACTIVITY_TYPE_RECENTS;
}
+ this.unfilteredApps = apps;
+ } else {
+ this.unfilteredApps = new RemoteAnimationTarget[0];
}
- this.unfilteredApps = apps;
this.apps = filteredApps.toArray(new RemoteAnimationTarget[filteredApps.size()]);
this.wallpapers = wallpapers;
this.targetMode = targetMode;