Fix some tests in TaskbarScrimViewController for bubble bar

When taskbar is in pinned mode with bubble bar expanded, in some
scenarios, we hide taskbar contents (i.e. when bubbles overlaps with
taskbar) and the scrim still shows.

One of the existing tests in TaskbarScrimViewController checks that
the scrim would be 0 when taskbar is not visible, however, in the
bubble bar case this isn't always true... I think there probably are
cases where taskbar isn't visible for other reasons (e.g. shade is
pulled down, but there are other tests specific to that). I'm
setting this test to only run when bubble bar isn't running, because
in that case bubbles never impacts taskbar visibility.

I added a test case to ensure scrim is hidden when pinned BUT bubble
bar is on home -- in this case we shouldn't show the scrim.

When adding the enableFlag/disableFlag I saw some NPEs in onDestroy
methods of some controllers so I protect against those as well.

Flag: EXEMPT test change
Test: atest NexusLauncherTest:TaskbarScrimViewControllerTest
      atest NexusLauncherRoboTest:TaskbarScrimViewControllerTest
Bug: 377764181
Change-Id: I71001222aa8a4393b341dd2b43a4b2e46e617a70
This commit is contained in:
Mady Mellor
2024-11-08 15:48:28 -08:00
parent a2603e829a
commit 1d1e50d33b
3 changed files with 38 additions and 7 deletions
@@ -192,7 +192,9 @@ public class StashedHandleViewController implements TaskbarControllers.LoggableT
public void onDestroy() {
mRegionSamplingHelper.stopAndDestroy();
if (mRegionSamplingHelper != null) {
mRegionSamplingHelper.stopAndDestroy();
}
mRegionSamplingHelper = null;
}