Disable model loading with Sandbox check instead of static boolean.

The static boolean also affects Taskbar within the Launcher process. We
only want this disabled for the Taskbar test Sandbox.

Flag: TEST_ONLY
Bug: 230027385
Test: NexusLauncherTests:com.android.launcher3.taskbar
Change-Id: Ife12e95ab34755d1aec42d79188c15232d8da092
This commit is contained in:
Brian Isganitis
2024-12-10 17:44:24 -05:00
parent cedfde549e
commit 002ef1f550
2 changed files with 3 additions and 13 deletions

View File

@@ -29,7 +29,6 @@ import com.android.launcher3.taskbar.TaskbarActivityContext
import com.android.launcher3.taskbar.TaskbarControllers
import com.android.launcher3.taskbar.TaskbarManager
import com.android.launcher3.taskbar.TaskbarNavButtonController.TaskbarNavButtonCallbacks
import com.android.launcher3.taskbar.TaskbarViewController
import com.android.launcher3.taskbar.bubbles.BubbleControllers
import com.android.launcher3.taskbar.rules.TaskbarUnitTestRule.InjectController
import com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR
@@ -130,15 +129,12 @@ class TaskbarUnitTestRule(
}
try {
TaskbarViewController.enableModelLoadingForTests(false)
// Required to complete initialization.
instrumentation.runOnMainSync { taskbarManager.onUserUnlocked() }
base.evaluate()
} finally {
instrumentation.runOnMainSync { taskbarManager.destroy() }
TaskbarViewController.enableModelLoadingForTests(true)
}
}
}