Add logs to see if launcher model isn't loaded when work profile app is added

* Add helper method to avoid checking sDebugTracing when
logging for tests

Bug: 243688989
Flag: None
Change-Id: Id6cc3b286171eb598e593c5a8aaea6f2466aad60
This commit is contained in:
Vinit Nayak
2023-05-26 15:45:42 -07:00
parent 883871e280
commit 2c353f29a2
3 changed files with 17 additions and 1 deletions

View File

@@ -16,6 +16,7 @@
package com.android.launcher3.model;
import static com.android.launcher3.testing.shared.TestProtocol.WORK_TAB_MISSING;
import static com.android.launcher3.testing.shared.TestProtocol.testLogD;
import android.util.Log;
@@ -72,7 +73,9 @@ public abstract class BaseModelUpdateTask implements ModelUpdateTask {
@Override
public final void run() {
if (!Objects.requireNonNull(mModel).isModelLoaded()) {
boolean isModelLoaded = Objects.requireNonNull(mModel).isModelLoaded();
testLogD(WORK_TAB_MISSING, "modelLoaded: " + isModelLoaded + " forTask: " + this);
if (!isModelLoaded) {
if (DEBUG_TASKS) {
Log.d(TAG, "Ignoring model task since loader is pending=" + this);
}