From 6151a34543be100447f8821d23acf0632e754749 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Wed, 24 Mar 2021 10:01:44 -0700 Subject: [PATCH] Fix activity NPE when clearing flags - If the activity is already destroyed then skip setting flags Bug: 183400378 Test: Just adding a null check Change-Id: Id2fddb5adb3b68302fb58fce340abd29237ca731 --- quickstep/src/com/android/quickstep/views/RecentsView.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index 4d8176c7e5..3cdb1dcc3e 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -3160,7 +3160,9 @@ public abstract class RecentsView extends PagedView MAIN_EXECUTOR.execute(() -> { // Needed for activities that auto-enter PiP, which will not trigger a remote // animation to be created - mActivity.clearForceInvisibleFlag(STATE_HANDLER_INVISIBILITY_FLAGS); + if (mActivity != null) { + mActivity.clearForceInvisibleFlag(STATE_HANDLER_INVISIBILITY_FLAGS); + } }); } }