Wait for taskbar to become visible after closing launcher in tests
- Taskbar takes some time to appear after closing launcher and launching test app Bug: 193653850 Test: StartLauncherViaGestureTests Change-Id: I714e35ee855660ac28bb214386f48ddbea0e834c
This commit is contained in:
@@ -67,6 +67,7 @@ import androidx.annotation.BinderThread;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.UiThread;
|
||||
import androidx.annotation.VisibleForTesting;
|
||||
import androidx.annotation.WorkerThread;
|
||||
|
||||
import com.android.launcher3.BaseDraggingActivity;
|
||||
@@ -301,17 +302,26 @@ public class TouchInteractionService extends Service implements PluginListener<O
|
||||
|
||||
private static boolean sConnected = false;
|
||||
private static boolean sIsInitialized = false;
|
||||
private static TouchInteractionService sInstance;
|
||||
private RotationTouchHelper mRotationTouchHelper;
|
||||
|
||||
public static boolean isConnected() {
|
||||
return sConnected;
|
||||
}
|
||||
|
||||
|
||||
public static boolean isInitialized() {
|
||||
return sIsInitialized;
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
@Nullable
|
||||
public static TaskbarManager getTaskbarManagerForTesting() {
|
||||
if (sInstance == null) {
|
||||
return null;
|
||||
}
|
||||
return sInstance.mTaskbarManager;
|
||||
}
|
||||
|
||||
private final AbsSwipeUpHandler.Factory mLauncherSwipeHandlerFactory =
|
||||
this::createLauncherSwipeHandler;
|
||||
private final AbsSwipeUpHandler.Factory mFallbackSwipeHandlerFactory =
|
||||
@@ -355,6 +365,7 @@ public class TouchInteractionService extends Service implements PluginListener<O
|
||||
mDeviceState.runOnUserUnlocked(mTaskbarManager::onUserUnlocked);
|
||||
ProtoTracer.INSTANCE.get(this).add(this);
|
||||
sConnected = true;
|
||||
sInstance = this;
|
||||
}
|
||||
|
||||
private void disposeEventHandlers() {
|
||||
@@ -512,6 +523,7 @@ public class TouchInteractionService extends Service implements PluginListener<O
|
||||
|
||||
mTaskbarManager.destroy();
|
||||
sConnected = false;
|
||||
sInstance = null;
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user