Remove ScrimView's drawing controller when resetting All Apps.

Previously broken flow:
 - Open All Apps on inner screen
   - Drawing controller is set to the AllApps container
 - Close All Apps (resting state becomes NORMAL)
 - Fold, unlock
   - Because we are still in NORMAL, the drawing controller was not
     updated. Therefore when the ScrimView draws (alongside all other
     views due to Launcher starting), it asks the inner screen's All
     Apps container to render its panel on the scrim.

The fix is to remove the drawing controller when All Apps resets,
thereby avoiding trying to draw on the scrim in the first place. The
drawing controller is updated upon the next transition to All Apps,
as usual.

Bug: 426397329
Test: Manual: https://drive.google.com/file/d/1l9qAIkrgFalcO5DABOEIRX1Po3POYzab/view?usp=sharing&resourcekey=0-ccU6q2fbYE6y87ehIKdbEQ
Flag: com.android.launcher3.all_apps_sheet_for_handheld
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:288006fe11bdaec4bd229999619dd7097806620a)
Merged-In: I0a4872e6bd668583d08848a8b9c5f0f1389c4f0f
Change-Id: I0a4872e6bd668583d08848a8b9c5f0f1389c4f0f
This commit is contained in:
Andy Wickham authored and Android Build Coastguard Worker committed 2025-06-26 19:46:15 -07:00
1 parent 0b844fd156
commit 1fa500b17e
1 file changed
+4 -1
@@ -116,7 +116,6 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext>
OnDeviceProfileChangeListener, PersonalWorkSlidingTabStrip.OnActivePageChangedListener,
ScrimView.ScrimDrawingController {
private static final String TAG = "ActivityAllAppsContainerView";
public static final float PULL_MULTIPLIER = .02f;
public static final float FLING_VELOCITY_MULTIPLIER = 1200f;
@@ -507,6 +506,10 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext>
if (isSearching()) {
mWorkManager.reset();
}
// Remove the scrim drawing controller to:
// 1) clean up its reference to this class; and
// 2) avoid using the unfolded version of this class for the folded screen or vice-versa
mScrimView.setDrawingController(null);
}
/**