Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5148c096 authored by Winson Chung's avatar Winson Chung Committed by Android Build Coastguard Worker
Browse files

Fix NPE due to invalid RecentsView access

Fixes: 288829919
Test: N/a, reorganizing code behind null check
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:cdf410f1349edf3451e1a8af64ea2d8cd676ffaa)
Merged-In: I9efe48cab239b521f7e729af06706c352be2499c
Change-Id: I9efe48cab239b521f7e729af06706c352be2499c
parent ef3f4df8
Loading
Loading
Loading
Loading
+13 −10
Original line number Original line Diff line number Diff line
@@ -841,18 +841,21 @@ public class TaskView extends FrameLayout implements Reusable {
                // the actual overview state
                // the actual overview state
                failureListener.register(mActivity, mTask.key.id, () -> {
                failureListener.register(mActivity, mTask.key.id, () -> {
                    notifyTaskLaunchFailed(TAG);
                    notifyTaskLaunchFailed(TAG);
                    // Disable animations for now, as it is an edge case and the app usually covers
                    // launcher and also any state transition animation also gets clobbered by
                    // QuickstepTransitionManager.createWallpaperOpenAnimations when launcher
                    // shows again
                    getRecentsView().startHome(false /* animated */);
                    RecentsView rv = getRecentsView();
                    RecentsView rv = getRecentsView();
                    if (rv != null && rv.mSizeStrategy.getTaskbarController() != null) {
                    if (rv != null) {
                        // LauncherTaskbarUIController depends on the launcher state when checking
                        // Disable animations for now, as it is an edge case and the app usually
                        // whether to handle resume, but that can come in before startHome() changes
                        // covers launcher and also any state transition animation also gets
                        // the state, so force-refresh here to ensure the taskbar is updated
                        // clobbered by QuickstepTransitionManager.createWallpaperOpenAnimations
                        // when launcher shows again
                        rv.startHome(false /* animated */);
                        if (rv.mSizeStrategy.getTaskbarController() != null) {
                            // LauncherTaskbarUIController depends on the launcher state when
                            // checking whether to handle resume, but that can come in before
                            // startHome() changes the state, so force-refresh here to ensure the
                            // taskbar is updated
                            rv.mSizeStrategy.getTaskbarController().refreshResumedState();
                            rv.mSizeStrategy.getTaskbarController().refreshResumedState();
                        }
                        }
                    }
                });
                });
            }
            }
            // Indicate success once the system has indicated that the transition has started
            // Indicate success once the system has indicated that the transition has started