From 2f1b547a4be3387c2a96311444c4d806dd237d54 Mon Sep 17 00:00:00 2001 From: Liran Binyamin Date: Wed, 7 Jun 2023 11:55:02 -0400 Subject: [PATCH] Crash fix in BubbleStachedHandleViewController. Switching between gesture nav and 3 button nav may lead to a state where the RegionSamplingHelper is unexpectedly null. Bug: 269670598 Test: In Settings switch navigation modes until launcher crashes. Change-Id: I56d6eea81070f367db292c1ded9866452f6e2650 --- .../bubbles/BubbleStashedHandleViewController.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleStashedHandleViewController.java b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleStashedHandleViewController.java index 2170a5dc5b..26756d4856 100644 --- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleStashedHandleViewController.java +++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleStashedHandleViewController.java @@ -203,12 +203,14 @@ public class BubbleStashedHandleViewController { private void updateRegionSampling() { boolean handleVisible = mStashedHandleView.getVisibility() == VISIBLE && mBubbleStashController.isStashed(); - mRegionSamplingHelper.setWindowVisible(handleVisible); - if (handleVisible) { - mStashedHandleView.updateSampledRegion(mStashedHandleBounds); - mRegionSamplingHelper.start(mStashedHandleView.getSampledRegion()); - } else { - mRegionSamplingHelper.stop(); + if (mRegionSamplingHelper != null) { + mRegionSamplingHelper.setWindowVisible(handleVisible); + if (handleVisible) { + mStashedHandleView.updateSampledRegion(mStashedHandleBounds); + mRegionSamplingHelper.start(mStashedHandleView.getSampledRegion()); + } else { + mRegionSamplingHelper.stop(); + } } }