Merge changes from topic "running-in-test-camel" into tm-qpr-dev am: d2d2913812
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/21725479 Change-Id: Iad48010b9309567049338220a2300cf85f7567c1 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -118,7 +118,7 @@ public class AppEventProducer implements StatsLogConsumer {
|
||||
private void sendEvent(AppTarget target, LauncherAtom.ItemInfo locationInfo, int eventId,
|
||||
int targetPredictor) {
|
||||
// TODO: remove the running test check when b/231648228 is fixed.
|
||||
if (target != null && !Utilities.IS_RUNNING_IN_TEST_HARNESS) {
|
||||
if (target != null && !Utilities.isRunningInTestHarness()) {
|
||||
AppTargetEvent event = new AppTargetEvent.Builder(target, eventId)
|
||||
.setLaunchLocation(getContainer(locationInfo))
|
||||
.build();
|
||||
|
||||
@@ -280,7 +280,7 @@ public class LauncherTaskbarUIController extends TaskbarUIController {
|
||||
* Returns {@code true} if a Taskbar education should be shown on application launch.
|
||||
*/
|
||||
public boolean shouldShowEduOnAppLaunch() {
|
||||
if (Utilities.IS_RUNNING_IN_TEST_HARNESS) {
|
||||
if (Utilities.isRunningInTestHarness()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ import static android.view.WindowManager.LayoutParams.TYPE_NAVIGATION_BAR_PANEL;
|
||||
|
||||
import static com.android.launcher3.AbstractFloatingView.TYPE_ALL;
|
||||
import static com.android.launcher3.AbstractFloatingView.TYPE_REBIND_SAFE;
|
||||
import static com.android.launcher3.Utilities.IS_RUNNING_IN_TEST_HARNESS;
|
||||
import static com.android.launcher3.Utilities.isRunningInTestHarness;
|
||||
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_FOLDER_OPEN;
|
||||
import static com.android.launcher3.taskbar.TaskbarAutohideSuspendController.FLAG_AUTOHIDE_SUSPEND_DRAGGING;
|
||||
import static com.android.launcher3.taskbar.TaskbarAutohideSuspendController.FLAG_AUTOHIDE_SUSPEND_FULLSCREEN;
|
||||
@@ -337,8 +337,7 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
|
||||
int windowFlags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
|
||||
| WindowManager.LayoutParams.FLAG_SLIPPERY
|
||||
| WindowManager.LayoutParams.FLAG_SPLIT_TOUCH;
|
||||
if (DisplayController.isTransientTaskbar(this)
|
||||
&& !IS_RUNNING_IN_TEST_HARNESS) {
|
||||
if (DisplayController.isTransientTaskbar(this) && !isRunningInTestHarness()) {
|
||||
windowFlags |= WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL
|
||||
| WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH;
|
||||
}
|
||||
|
||||
@@ -28,7 +28,6 @@ import com.airbnb.lottie.LottieProperty.COLOR_FILTER
|
||||
import com.airbnb.lottie.model.KeyPath
|
||||
import com.android.launcher3.R
|
||||
import com.android.launcher3.Utilities
|
||||
import com.android.launcher3.Utilities.IS_RUNNING_IN_TEST_HARNESS
|
||||
import com.android.launcher3.config.FeatureFlags.ENABLE_TASKBAR_EDU_TOOLTIP
|
||||
import com.android.launcher3.taskbar.TaskbarAutohideSuspendController.FLAG_AUTOHIDE_SUSPEND_EDU_OPEN
|
||||
import com.android.launcher3.taskbar.TaskbarControllers.LoggableTaskbarController
|
||||
@@ -57,7 +56,7 @@ class TaskbarEduTooltipController(val activityContext: TaskbarActivityContext) :
|
||||
LoggableTaskbarController {
|
||||
|
||||
private val isTooltipEnabled: Boolean
|
||||
get() = !IS_RUNNING_IN_TEST_HARNESS && ENABLE_TASKBAR_EDU_TOOLTIP.get()
|
||||
get() = !Utilities.isRunningInTestHarness() && ENABLE_TASKBAR_EDU_TOOLTIP.get()
|
||||
private val isOpen: Boolean
|
||||
get() = tooltip?.isOpen ?: false
|
||||
|
||||
|
||||
@@ -460,7 +460,7 @@ import java.util.StringJoiner;
|
||||
updateIconAlphaForHome(taskbarWillBeVisible ? 1 : 0);
|
||||
|
||||
// Sync the first frame where we swap taskbar and hotseat.
|
||||
if (firstFrameVisChanged && mCanSyncViews && !Utilities.IS_RUNNING_IN_TEST_HARNESS) {
|
||||
if (firstFrameVisChanged && mCanSyncViews && !Utilities.isRunningInTestHarness()) {
|
||||
ViewRootSync.synchronizeNextDraw(mLauncher.getHotseat(),
|
||||
mControllers.taskbarActivityContext.getDragLayer(),
|
||||
() -> {});
|
||||
|
||||
@@ -297,7 +297,7 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba
|
||||
}
|
||||
return supportsVisualStashing()
|
||||
&& isInApp()
|
||||
&& (!Utilities.IS_RUNNING_IN_TEST_HARNESS || mEnableManualStashingDuringTests)
|
||||
&& (!Utilities.isRunningInTestHarness() || mEnableManualStashingDuringTests)
|
||||
&& !DisplayController.isTransientTaskbar(mActivity);
|
||||
}
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ public final class RecentsViewStateController extends
|
||||
builder.addOnFrameCallback(() -> mRecentsView.loadVisibleTaskData(FLAG_UPDATE_ALL));
|
||||
mRecentsView.updateEmptyMessage();
|
||||
// TODO(b/246283207): Remove logging once root cause of flake detected.
|
||||
if (Utilities.IS_RUNNING_IN_TEST_HARNESS) {
|
||||
if (Utilities.isRunningInTestHarness()) {
|
||||
Log.d("b/246283207", "RecentsView#setStateWithAnimationInternal getCurrentPage(): "
|
||||
+ mRecentsView.getCurrentPage()
|
||||
+ ", getScrollForPage(getCurrentPage())): "
|
||||
|
||||
@@ -139,7 +139,7 @@ public class StatsLogCompatManager extends StatsLogManager {
|
||||
if (IS_VERBOSE) {
|
||||
Log.d(TAG, String.format("\nwriteSnapshot(%d):\n%s", instanceId.getId(), info));
|
||||
}
|
||||
if (!Utilities.ATLEAST_R || Utilities.IS_RUNNING_IN_TEST_HARNESS) {
|
||||
if (!Utilities.ATLEAST_R || Utilities.isRunningInTestHarness()) {
|
||||
return;
|
||||
}
|
||||
SysUiStatsLog.write(SysUiStatsLog.LAUNCHER_SNAPSHOT,
|
||||
@@ -438,7 +438,7 @@ public class StatsLogCompatManager extends StatsLogManager {
|
||||
}
|
||||
|
||||
// TODO: remove this when b/231648228 is fixed.
|
||||
if (Utilities.IS_RUNNING_IN_TEST_HARNESS) {
|
||||
if (Utilities.isRunningInTestHarness()) {
|
||||
return;
|
||||
}
|
||||
int cardinality = mCardinality.orElseGet(() -> getCardinality(atomInfo));
|
||||
@@ -636,7 +636,7 @@ public class StatsLogCompatManager extends StatsLogManager {
|
||||
}
|
||||
|
||||
private static int getCardinality(LauncherAtom.ItemInfo info) {
|
||||
if (Utilities.IS_RUNNING_IN_TEST_HARNESS) {
|
||||
if (Utilities.isRunningInTestHarness()) {
|
||||
return 0;
|
||||
}
|
||||
switch (info.getContainerInfo().getContainerCase()) {
|
||||
@@ -758,7 +758,7 @@ public class StatsLogCompatManager extends StatsLogManager {
|
||||
}
|
||||
|
||||
private static int getHierarchy(LauncherAtom.ItemInfo info) {
|
||||
if (Utilities.IS_RUNNING_IN_TEST_HARNESS) {
|
||||
if (Utilities.isRunningInTestHarness()) {
|
||||
return 0;
|
||||
}
|
||||
if (info.getContainerInfo().getContainerCase() == FOLDER) {
|
||||
@@ -801,7 +801,7 @@ public class StatsLogCompatManager extends StatsLogManager {
|
||||
}
|
||||
|
||||
private static int getSearchAttributes(LauncherAtom.ItemInfo info) {
|
||||
if (Utilities.IS_RUNNING_IN_TEST_HARNESS) {
|
||||
if (Utilities.isRunningInTestHarness()) {
|
||||
return 0;
|
||||
}
|
||||
ContainerInfo containerInfo = info.getContainerInfo();
|
||||
|
||||
@@ -129,7 +129,7 @@ public class MotionPauseDetector {
|
||||
* @param pointerIndex Index for the pointer being tracked in the motion event
|
||||
*/
|
||||
public void addPosition(MotionEvent ev, int pointerIndex) {
|
||||
long timeoutMs = Utilities.IS_RUNNING_IN_TEST_HARNESS
|
||||
long timeoutMs = Utilities.isRunningInTestHarness()
|
||||
? TEST_HARNESS_TRIGGER_TIMEOUT
|
||||
: mMakePauseHarderToTrigger
|
||||
? HARDER_TRIGGER_TIMEOUT
|
||||
@@ -195,7 +195,7 @@ public class MotionPauseDetector {
|
||||
if (mIsPaused != isPaused) {
|
||||
mIsPaused = isPaused;
|
||||
String logString = "onMotionPauseChanged, paused=" + mIsPaused + " reason=" + reason;
|
||||
if (Utilities.IS_RUNNING_IN_TEST_HARNESS) {
|
||||
if (Utilities.isRunningInTestHarness()) {
|
||||
Log.d(TAG, logString);
|
||||
}
|
||||
ActiveGestureLog.INSTANCE.addLog(logString);
|
||||
|
||||
@@ -64,7 +64,7 @@ public class QuickstepOnboardingPrefs extends OnboardingPrefs<QuickstepLauncher>
|
||||
});
|
||||
}
|
||||
|
||||
if (!Utilities.IS_RUNNING_IN_TEST_HARNESS
|
||||
if (!Utilities.isRunningInTestHarness()
|
||||
&& !hasReachedMaxCount(HOTSEAT_DISCOVERY_TIP_COUNT)) {
|
||||
stateManager.addStateListener(new StateListener<LauncherState>() {
|
||||
boolean mFromAllApps = false;
|
||||
|
||||
@@ -1718,7 +1718,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
int finalTargetPage = targetPage;
|
||||
runOnPageScrollsInitialized(() -> {
|
||||
// TODO(b/246283207): Remove logging once root cause of flake detected.
|
||||
if (Utilities.IS_RUNNING_IN_TEST_HARNESS) {
|
||||
if (Utilities.isRunningInTestHarness()) {
|
||||
Log.d("b/246283207", "RecentsView#applyLoadPlan() -> "
|
||||
+ "previousCurrentPage: " + previousCurrentPage
|
||||
+ ", targetPage: " + finalTargetPage
|
||||
|
||||
Reference in New Issue
Block a user