Adding tracing for a lab-only flake
Bug: 142514365 Change-Id: I9c93ecabbcbad6d4683d595587831d8465e62ee8
This commit is contained in:
+8
@@ -4,7 +4,10 @@ import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
|
||||
import com.android.launcher3.Launcher;
|
||||
import com.android.launcher3.LauncherAppState;
|
||||
import com.android.launcher3.testing.TestInformationHandler;
|
||||
import com.android.launcher3.testing.TestProtocol;
|
||||
import com.android.launcher3.uioverrides.states.OverviewState;
|
||||
@@ -109,6 +112,11 @@ public class QuickstepTestInformationHandler extends TestInformationHandler {
|
||||
|
||||
@Override
|
||||
protected boolean isLauncherInitialized() {
|
||||
if (TestProtocol.sDebugTracing) {
|
||||
Log.d(TestProtocol.LAUNCHER_DIDNT_INITIALIZE,
|
||||
"isLauncherInitialized.TouchInteractionService.isInitialized=" +
|
||||
TouchInteractionService.isInitialized());
|
||||
}
|
||||
return super.isLauncherInitialized() && TouchInteractionService.isInitialized();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,6 +53,8 @@ import androidx.annotation.UiThread;
|
||||
import androidx.annotation.WorkerThread;
|
||||
|
||||
import com.android.launcher3.BaseDraggingActivity;
|
||||
import com.android.launcher3.Launcher;
|
||||
import com.android.launcher3.LauncherAppState;
|
||||
import com.android.launcher3.Utilities;
|
||||
import com.android.launcher3.allapps.DiscoveryBounce;
|
||||
import com.android.launcher3.config.FeatureFlags;
|
||||
@@ -131,6 +133,9 @@ public class TouchInteractionService extends Service implements
|
||||
.setProxy(proxy));
|
||||
MAIN_EXECUTOR.execute(TouchInteractionService.this::initInputMonitor);
|
||||
MAIN_EXECUTOR.execute(() -> preloadOverview(true /* fromInit */));
|
||||
if (TestProtocol.sDebugTracing) {
|
||||
Log.d(TestProtocol.LAUNCHER_DIDNT_INITIALIZE, "TIS initialized");
|
||||
}
|
||||
sIsInitialized = true;
|
||||
}
|
||||
|
||||
@@ -380,6 +385,9 @@ public class TouchInteractionService extends Service implements
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
if (TestProtocol.sDebugTracing) {
|
||||
Log.d(TestProtocol.LAUNCHER_DIDNT_INITIALIZE, "TIS destroyed");
|
||||
}
|
||||
sIsInitialized = false;
|
||||
if (mDeviceState.isUserUnlocked()) {
|
||||
mInputConsumer.unregisterInputConsumer();
|
||||
|
||||
@@ -53,6 +53,7 @@ import com.android.launcher3.model.UserLockStateChangedTask;
|
||||
import com.android.launcher3.pm.InstallSessionTracker;
|
||||
import com.android.launcher3.pm.PackageInstallInfo;
|
||||
import com.android.launcher3.shortcuts.DeepShortcutManager;
|
||||
import com.android.launcher3.testing.TestProtocol;
|
||||
import com.android.launcher3.util.IntSparseArrayMap;
|
||||
import com.android.launcher3.util.ItemInfoMatcher;
|
||||
import com.android.launcher3.util.PackageUserKey;
|
||||
@@ -92,6 +93,10 @@ public class LauncherModel extends LauncherApps.Callback implements InstallSessi
|
||||
private boolean mModelLoaded;
|
||||
public boolean isModelLoaded() {
|
||||
synchronized (mLock) {
|
||||
if (TestProtocol.sDebugTracing) {
|
||||
Log.d(TestProtocol.LAUNCHER_DIDNT_INITIALIZE,
|
||||
"isModelLoaded: " + mModelLoaded + ", " + mLoaderTask);
|
||||
}
|
||||
return mModelLoaded && mLoaderTask == null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ import android.graphics.Bitmap;
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.os.Debug;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
|
||||
import com.android.launcher3.DeviceProfile;
|
||||
@@ -176,6 +177,11 @@ public class TestInformationHandler implements ResourceBasedOverride {
|
||||
}
|
||||
|
||||
protected boolean isLauncherInitialized() {
|
||||
if (TestProtocol.sDebugTracing) {
|
||||
Log.d(TestProtocol.LAUNCHER_DIDNT_INITIALIZE,
|
||||
"isLauncherInitialized " + Launcher.ACTIVITY_TRACKER.getCreatedActivity() + ", "
|
||||
+ LauncherAppState.getInstance(mContext).getModel().isModelLoaded());
|
||||
}
|
||||
return Launcher.ACTIVITY_TRACKER.getCreatedActivity() == null
|
||||
|| LauncherAppState.getInstance(mContext).getModel().isModelLoaded();
|
||||
}
|
||||
|
||||
@@ -85,4 +85,5 @@ public final class TestProtocol {
|
||||
public static final String NO_DRAG_TO_WORKSPACE = "b/138729456";
|
||||
public static final String APP_NOT_DISABLED = "b/139891609";
|
||||
public static final String NO_CONTEXT_MENU = "b/141770616";
|
||||
public static final String LAUNCHER_DIDNT_INITIALIZE = "b/142514365";
|
||||
}
|
||||
|
||||
@@ -20,10 +20,12 @@ import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.IBinder;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.android.launcher3.BaseActivity;
|
||||
import com.android.launcher3.testing.TestProtocol;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
@@ -43,7 +45,13 @@ public final class ActivityTracker<T extends BaseActivity> implements Runnable {
|
||||
}
|
||||
|
||||
public void onActivityDestroyed(T activity) {
|
||||
if (TestProtocol.sDebugTracing) {
|
||||
Log.d(TestProtocol.LAUNCHER_DIDNT_INITIALIZE, "onActivityDestroyed");
|
||||
}
|
||||
if (mCurrentActivity.get() == activity) {
|
||||
if (TestProtocol.sDebugTracing) {
|
||||
Log.d(TestProtocol.LAUNCHER_DIDNT_INITIALIZE, "onActivityDestroyed: clear");
|
||||
}
|
||||
mCurrentActivity.clear();
|
||||
}
|
||||
}
|
||||
@@ -89,6 +97,10 @@ public final class ActivityTracker<T extends BaseActivity> implements Runnable {
|
||||
}
|
||||
|
||||
public boolean handleCreate(T activity) {
|
||||
if (TestProtocol.sDebugTracing) {
|
||||
Log.d(TestProtocol.LAUNCHER_DIDNT_INITIALIZE,
|
||||
"ActivityTracker.handleCreate " + mCurrentActivity.get() + " => " + activity);
|
||||
}
|
||||
mCurrentActivity = new WeakReference<>(activity);
|
||||
return handleIntent(activity, activity.getIntent(), false, false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user