Merge "Fix NPE when consuming snapshots for recent animation" into sc-v2-dev am: f6086e74e3

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/16598402

Change-Id: I9d66b3cb98ba5540e417c2acc7084d4edaa62e9f
This commit is contained in:
Jerry Chang
2022-01-12 01:41:13 +00:00
committed by Automerger Merge Worker

View File

@@ -20,6 +20,7 @@ import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_HOME;
import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_OVERVIEW;
import static com.android.quickstep.MultiStateCallback.DEBUG_STATES;
import android.annotation.Nullable;
import android.annotation.TargetApi;
import android.app.ActivityManager;
import android.content.Intent;
@@ -397,11 +398,15 @@ public class GestureState implements RecentsAnimationCallbacks.RecentsAnimationL
* while STATE_RECENTS_ANIMATION_CANCELED state is being set, and the caller is responsible for
* calling {@link RecentsAnimationController#cleanupScreenshot()}.
*/
@Nullable
HashMap<Integer, ThumbnailData> consumeRecentsAnimationCanceledSnapshot() {
HashMap<Integer, ThumbnailData> data =
new HashMap<Integer, ThumbnailData>(mRecentsAnimationCanceledSnapshots);
mRecentsAnimationCanceledSnapshots = null;
return data;
if (mRecentsAnimationCanceledSnapshots != null) {
HashMap<Integer, ThumbnailData> data =
new HashMap<Integer, ThumbnailData>(mRecentsAnimationCanceledSnapshots);
mRecentsAnimationCanceledSnapshots = null;
return data;
}
return null;
}
void setSwipeUpStartTimeMs(long uptimeMs) {