Merge "Remove unused debug logs" into udc-dev am: 8c1bffb24f am: 3a7ae396fa

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/22558557

Change-Id: I917caacd332cfc969ee9b4532c1ac482b6b9f8e5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Schneider Victor-tulias
2023-04-27 19:25:15 +00:00
committed by Automerger Merge Worker
20 changed files with 5 additions and 289 deletions
@@ -66,7 +66,6 @@ import com.android.launcher3.R;
import com.android.launcher3.Utilities; import com.android.launcher3.Utilities;
import com.android.launcher3.anim.AnimatedFloat; import com.android.launcher3.anim.AnimatedFloat;
import com.android.launcher3.anim.AnimatorListeners; import com.android.launcher3.anim.AnimatorListeners;
import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.util.DisplayController; import com.android.launcher3.util.DisplayController;
import com.android.launcher3.util.MultiPropertyFactory.MultiProperty; import com.android.launcher3.util.MultiPropertyFactory.MultiProperty;
import com.android.quickstep.SystemUiProxy; import com.android.quickstep.SystemUiProxy;
@@ -1022,10 +1021,6 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba
* unstashed. * unstashed.
*/ */
public void updateStateForFlag(int flag, boolean enabled) { public void updateStateForFlag(int flag, boolean enabled) {
if (flag == FLAG_IN_APP && TestProtocol.sDebugTracing) {
Log.d(TestProtocol.TASKBAR_IN_APP_STATE, String.format(
"setting flag FLAG_IN_APP to: %b", enabled), new Exception());
}
if (enabled) { if (enabled) {
mState |= flag; mState |= flag;
} else { } else {
@@ -1250,16 +1245,6 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba
&& animationType != TRANSITION_DEFAULT; && animationType != TRANSITION_DEFAULT;
if (mIsStashed != isStashed || transitionTypeChanged) { if (mIsStashed != isStashed || transitionTypeChanged) {
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.TASKBAR_IN_APP_STATE, String.format(
"setState: mIsStashed=%b, isStashed=%b, "
+ "mAnimationType=%d, animationType=%d, duration=%d",
mIsStashed,
isStashed,
mLastStartedTransitionType,
animationType,
duration));
}
mIsStashed = isStashed; mIsStashed = isStashed;
mLastStartedTransitionType = animationType; mLastStartedTransitionType = animationType;
@@ -1,6 +1,5 @@
package com.android.quickstep; package com.android.quickstep;
import static com.android.launcher3.testing.shared.TestProtocol.NPE_TRANSIENT_TASKBAR;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR; import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
import android.app.Activity; import android.app.Activity;
@@ -8,7 +7,6 @@ import android.content.Context;
import android.content.res.Resources; import android.content.res.Resources;
import android.graphics.Rect; import android.graphics.Rect;
import android.os.Bundle; import android.os.Bundle;
import android.util.Log;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
@@ -184,13 +182,9 @@ public class QuickstepTestInformationHandler extends TestInformationHandler {
TouchInteractionService.TISBinder tisBinder, boolean enable) { TouchInteractionService.TISBinder tisBinder, boolean enable) {
TaskbarActivityContext context = tisBinder.getTaskbarManager().getCurrentActivityContext(); TaskbarActivityContext context = tisBinder.getTaskbarManager().getCurrentActivityContext();
if (context == null) { if (context == null) {
if (TestProtocol.sDebugTracing) { return;
Log.d(NPE_TRANSIENT_TASKBAR, "enableBlockingTimeout: enable=" + enable,
new Exception());
}
} else {
context.enableBlockingTimeoutDuringTests(enable);
} }
context.enableBlockingTimeoutDuringTests(enable);
} }
private void enableTransientTaskbar(boolean enable) { private void enableTransientTaskbar(boolean enable) {
@@ -23,7 +23,6 @@ import android.animation.TimeInterpolator;
import android.content.Context; import android.content.Context;
import android.graphics.Rect; import android.graphics.Rect;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.util.Log;
import android.util.TypedValue; import android.util.TypedValue;
import android.view.Gravity; import android.view.Gravity;
import android.view.View; import android.view.View;
@@ -31,13 +30,10 @@ import android.view.ViewDebug;
import android.view.ViewPropertyAnimator; import android.view.ViewPropertyAnimator;
import android.widget.FrameLayout; import android.widget.FrameLayout;
import androidx.annotation.NonNull;
import com.android.launcher3.anim.Interpolators; import com.android.launcher3.anim.Interpolators;
import com.android.launcher3.dragndrop.DragController; import com.android.launcher3.dragndrop.DragController;
import com.android.launcher3.dragndrop.DragController.DragListener; import com.android.launcher3.dragndrop.DragController.DragListener;
import com.android.launcher3.dragndrop.DragOptions; import com.android.launcher3.dragndrop.DragOptions;
import com.android.launcher3.testing.shared.TestProtocol;
/* /*
* The top bar containing various drop targets: Delete/App Info/Uninstall. * The top bar containing various drop targets: Delete/App Info/Uninstall.
@@ -299,9 +295,6 @@ public class DropTargetBar extends FrameLayout
} }
public void animateToVisibility(boolean isVisible) { public void animateToVisibility(boolean isVisible) {
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.NO_DROP_TARGET, "8");
}
if (mVisible != isVisible) { if (mVisible != isVisible) {
mVisible = isVisible; mVisible = isVisible;
@@ -328,9 +321,6 @@ public class DropTargetBar extends FrameLayout
*/ */
@Override @Override
public void onDragStart(DropTarget.DragObject dragObject, DragOptions options) { public void onDragStart(DropTarget.DragObject dragObject, DragOptions options) {
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.NO_DROP_TARGET, "7");
}
animateToVisibility(true); animateToVisibility(true);
} }
@@ -354,16 +344,4 @@ public class DropTargetBar extends FrameLayout
public ButtonDropTarget[] getDropTargets() { public ButtonDropTarget[] getDropTargets() {
return getVisibility() == View.VISIBLE ? mDropTargets : new ButtonDropTarget[0]; return getVisibility() == View.VISIBLE ? mDropTargets : new ButtonDropTarget[0];
} }
@Override
protected void onVisibilityChanged(@NonNull View changedView, int visibility) {
super.onVisibilityChanged(changedView, visibility);
if (TestProtocol.sDebugTracing) {
if (visibility == VISIBLE) {
Log.d(TestProtocol.NO_DROP_TARGET, "9");
} else {
Log.d(TestProtocol.NO_DROP_TARGET, "Hiding drop target", new Exception());
}
}
}
} }
+2 -23
View File
@@ -1836,9 +1836,6 @@ public class Launcher extends StatefulActivity<LauncherState>
} }
private void setWorkspaceLoading(boolean value) { private void setWorkspaceLoading(boolean value) {
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.FLAKY_BINDING, "running: setWorkspaceLoading=" + value);
}
mWorkspaceLoading = value; mWorkspaceLoading = value;
} }
@@ -2211,10 +2208,6 @@ public class Launcher extends StatefulActivity<LauncherState>
IntSet result = new IntSet(); IntSet result = new IntSet();
if (visibleIds.isEmpty()) { if (visibleIds.isEmpty()) {
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.NULL_INT_SET, "getPagesToBindSynchronously (1): "
+ result);
}
return result; return result;
} }
for (int id : orderedScreenIds.toArray()) { for (int id : orderedScreenIds.toArray()) {
@@ -2235,10 +2228,6 @@ public class Launcher extends StatefulActivity<LauncherState>
// pages being hidden in single panel. // pages being hidden in single panel.
result.add(pairId); result.add(pairId);
} }
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.NULL_INT_SET, "getPagesToBindSynchronously (2): "
+ result);
}
return result; return result;
} }
@@ -2260,14 +2249,11 @@ public class Launcher extends StatefulActivity<LauncherState>
/** /**
* Refreshes the shortcuts shown on the workspace. * Refreshes the shortcuts shown on the workspace.
* * <p>
* Implementation of the method from LauncherModel.Callbacks. * Implementation of the method from LauncherModel.Callbacks.
*/ */
public void startBinding() { public void startBinding() {
Object traceToken = TraceHelper.INSTANCE.beginSection("startBinding"); Object traceToken = TraceHelper.INSTANCE.beginSection("startBinding");
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.FLAKY_BINDING, "running: startBinding");
}
// Floating panels (except the full widget sheet) are associated with individual icons. If // Floating panels (except the full widget sheet) are associated with individual icons. If
// we are starting a fresh bind, close all such panels as all the icons are about // we are starting a fresh bind, close all such panels as all the icons are about
// to go away. // to go away.
@@ -2452,10 +2438,6 @@ public class Launcher extends StatefulActivity<LauncherState>
throw (new RuntimeException(desc)); throw (new RuntimeException(desc));
} else { } else {
getModelWriter().deleteItemFromDatabase(item, desc); getModelWriter().deleteItemFromDatabase(item, desc);
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.MISSING_PROMISE_ICON,
TAG + "bindItems failed for item=" + item);
}
continue; continue;
} }
} }
@@ -2741,14 +2723,11 @@ public class Launcher extends StatefulActivity<LauncherState>
/** /**
* Callback saying that there aren't any more items to bind. * Callback saying that there aren't any more items to bind.
* * <p>
* Implementation of the method from LauncherModel.Callbacks. * Implementation of the method from LauncherModel.Callbacks.
*/ */
public void finishBindingItems(IntSet pagesBoundFirst) { public void finishBindingItems(IntSet pagesBoundFirst) {
Object traceToken = TraceHelper.INSTANCE.beginSection("finishBindingItems"); Object traceToken = TraceHelper.INSTANCE.beginSection("finishBindingItems");
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.FLAKY_BINDING, "running: finishBindingItems");
}
mWorkspace.restoreInstanceStateForRemainingPages(); mWorkspace.restoreInstanceStateForRemainingPages();
setWorkspaceLoading(false); setWorkspaceLoading(false);
@@ -383,12 +383,6 @@ public class LauncherModel extends LauncherApps.Callback implements InstallSessi
public void addCallbacks(@NonNull final Callbacks callbacks) { public void addCallbacks(@NonNull final Callbacks callbacks) {
Preconditions.assertUIThread(); Preconditions.assertUIThread();
synchronized (mCallbacksList) { synchronized (mCallbacksList) {
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.NULL_INT_SET, "addCallbacks pointer: "
+ callbacks
+ ", name: "
+ callbacks.getClass().getName(), new Exception());
}
mCallbacksList.add(callbacks); mCallbacksList.add(callbacks);
} }
} }
@@ -24,14 +24,12 @@ import android.content.pm.PackageInstaller.SessionInfo;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.os.UserHandle; import android.os.UserHandle;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log;
import androidx.annotation.WorkerThread; import androidx.annotation.WorkerThread;
import com.android.launcher3.logging.FileLog; import com.android.launcher3.logging.FileLog;
import com.android.launcher3.model.ItemInstallQueue; import com.android.launcher3.model.ItemInstallQueue;
import com.android.launcher3.pm.InstallSessionHelper; import com.android.launcher3.pm.InstallSessionHelper;
import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.util.Executors; import com.android.launcher3.util.Executors;
/** /**
@@ -53,9 +51,6 @@ public class SessionCommitReceiver extends BroadcastReceiver {
private static void processIntent(Context context, Intent intent) { private static void processIntent(Context context, Intent intent) {
if (!isEnabled(context)) { if (!isEnabled(context)) {
// User has decided to not add icons on homescreen. // User has decided to not add icons on homescreen.
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.MISSING_PROMISE_ICON, LOG + " not enabled");
}
return; return;
} }
@@ -64,9 +59,6 @@ public class SessionCommitReceiver extends BroadcastReceiver {
if (!PackageInstaller.ACTION_SESSION_COMMITTED.equals(intent.getAction()) if (!PackageInstaller.ACTION_SESSION_COMMITTED.equals(intent.getAction())
|| info == null || user == null) { || info == null || user == null) {
// Invalid intent. // Invalid intent.
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.MISSING_PROMISE_ICON, LOG + " invalid intent");
}
return; return;
} }
@@ -75,15 +67,6 @@ public class SessionCommitReceiver extends BroadcastReceiver {
|| info.getInstallReason() != PackageManager.INSTALL_REASON_USER || info.getInstallReason() != PackageManager.INSTALL_REASON_USER
|| packageInstallerCompat.promiseIconAddedForId(info.getSessionId())) { || packageInstallerCompat.promiseIconAddedForId(info.getSessionId())) {
packageInstallerCompat.removePromiseIconId(info.getSessionId()); packageInstallerCompat.removePromiseIconId(info.getSessionId());
if (TestProtocol.sDebugTracing) {
int id = info.getSessionId();
Log.d(TestProtocol.MISSING_PROMISE_ICON, LOG
+ ", TextUtils.isEmpty=" + TextUtils.isEmpty(info.getAppPackageName())
+ ", info.getInstallReason()=" + info.getInstallReason()
+ ", INSTALL_REASON_USER=" + PackageManager.INSTALL_REASON_USER
+ ", icon added=" + packageInstallerCompat.promiseIconAddedForId(id)
);
}
return; return;
} }
@@ -21,7 +21,6 @@ import static com.android.launcher3.Utilities.ATLEAST_Q;
import android.graphics.Point; import android.graphics.Point;
import android.graphics.Rect; import android.graphics.Rect;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.util.Log;
import android.view.DragEvent; import android.view.DragEvent;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.MotionEvent; import android.view.MotionEvent;
@@ -35,7 +34,6 @@ import com.android.launcher3.anim.Interpolators;
import com.android.launcher3.logging.InstanceId; import com.android.launcher3.logging.InstanceId;
import com.android.launcher3.model.data.ItemInfo; import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.model.data.WorkspaceItemInfo; import com.android.launcher3.model.data.WorkspaceItemInfo;
import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.util.TouchController; import com.android.launcher3.util.TouchController;
import com.android.launcher3.views.ActivityContext; import com.android.launcher3.views.ActivityContext;
@@ -150,9 +148,6 @@ public abstract class DragController<T extends ActivityContext>
float initialDragViewScale, float initialDragViewScale,
float dragViewScaleOnDrop, float dragViewScaleOnDrop,
DragOptions options) { DragOptions options) {
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.NO_DROP_TARGET, "4");
}
return startDrag(drawable, /* view= */ null, originalView, dragLayerX, dragLayerY, return startDrag(drawable, /* view= */ null, originalView, dragLayerX, dragLayerY,
source, dragInfo, dragOffset, dragRegion, initialDragViewScale, dragViewScaleOnDrop, source, dragInfo, dragOffset, dragRegion, initialDragViewScale, dragViewScaleOnDrop,
options); options);
@@ -210,9 +205,6 @@ public abstract class DragController<T extends ActivityContext>
DragOptions options); DragOptions options);
protected void callOnDragStart() { protected void callOnDragStart() {
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.NO_DROP_TARGET, "6");
}
if (mOptions.preDragCondition != null) { if (mOptions.preDragCondition != null) {
mOptions.preDragCondition.onPreDragEnd(mDragObject, true /* dragStarted*/); mOptions.preDragCondition.onPreDragEnd(mDragObject, true /* dragStarted*/);
} }
@@ -24,7 +24,6 @@ import android.content.res.Resources;
import android.graphics.Point; import android.graphics.Point;
import android.graphics.Rect; import android.graphics.Rect;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.util.Log;
import android.view.HapticFeedbackConstants; import android.view.HapticFeedbackConstants;
import android.view.View; import android.view.View;
@@ -37,7 +36,6 @@ import com.android.launcher3.Launcher;
import com.android.launcher3.R; import com.android.launcher3.R;
import com.android.launcher3.accessibility.DragViewStateAnnouncer; import com.android.launcher3.accessibility.DragViewStateAnnouncer;
import com.android.launcher3.model.data.ItemInfo; import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.testing.shared.TestProtocol;
/** /**
* Drag controller for Launcher activity * Drag controller for Launcher activity
@@ -67,9 +65,6 @@ public class LauncherDragController extends DragController<Launcher> {
float initialDragViewScale, float initialDragViewScale,
float dragViewScaleOnDrop, float dragViewScaleOnDrop,
DragOptions options) { DragOptions options) {
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.NO_DROP_TARGET, "5");
}
if (PROFILE_DRAWING_DURING_DRAG) { if (PROFILE_DRAWING_DURING_DRAG) {
android.os.Debug.startMethodTracing("Launcher"); android.os.Debug.startMethodTracing("Launcher");
} }
@@ -20,7 +20,6 @@ import android.content.pm.LauncherActivityInfo;
import android.content.pm.LauncherApps; import android.content.pm.LauncherApps;
import android.content.pm.PackageInstaller.SessionInfo; import android.content.pm.PackageInstaller.SessionInfo;
import android.os.UserHandle; import android.os.UserHandle;
import android.util.Log;
import android.util.Pair; import android.util.Pair;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
@@ -39,7 +38,6 @@ import com.android.launcher3.model.data.WorkspaceItemFactory;
import com.android.launcher3.model.data.WorkspaceItemInfo; import com.android.launcher3.model.data.WorkspaceItemInfo;
import com.android.launcher3.pm.InstallSessionHelper; import com.android.launcher3.pm.InstallSessionHelper;
import com.android.launcher3.pm.PackageInstallInfo; import com.android.launcher3.pm.PackageInstallInfo;
import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.util.IntArray; import com.android.launcher3.util.IntArray;
import com.android.launcher3.util.PackageManagerHelper; import com.android.launcher3.util.PackageManagerHelper;
@@ -97,20 +95,12 @@ public class AddWorkspaceItemsTask extends BaseModelUpdateTask {
item.itemType == LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT) { item.itemType == LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT) {
// Short-circuit this logic if the icon exists somewhere on the workspace // Short-circuit this logic if the icon exists somewhere on the workspace
if (shortcutExists(dataModel, item.getIntent(), item.user)) { if (shortcutExists(dataModel, item.getIntent(), item.user)) {
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.MISSING_PROMISE_ICON,
LOG + " Item already on workspace.");
}
continue; continue;
} }
// b/139663018 Short-circuit this logic if the icon is a system app // b/139663018 Short-circuit this logic if the icon is a system app
if (PackageManagerHelper.isSystemApp(app.getContext(), if (PackageManagerHelper.isSystemApp(app.getContext(),
Objects.requireNonNull(item.getIntent()))) { Objects.requireNonNull(item.getIntent()))) {
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.MISSING_PROMISE_ICON,
LOG + " Item is a system app.");
}
continue; continue;
} }
} }
@@ -150,9 +140,6 @@ public class AddWorkspaceItemsTask extends BaseModelUpdateTask {
String packageName = item.getTargetComponent() != null String packageName = item.getTargetComponent() != null
? item.getTargetComponent().getPackageName() : null; ? item.getTargetComponent().getPackageName() : null;
if (packageName == null) { if (packageName == null) {
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.MISSING_PROMISE_ICON, LOG + " Null packageName.");
}
continue; continue;
} }
SessionInfo sessionInfo = packageInstaller.getActiveSessionInfo(item.user, SessionInfo sessionInfo = packageInstaller.getActiveSessionInfo(item.user,
@@ -161,9 +148,6 @@ public class AddWorkspaceItemsTask extends BaseModelUpdateTask {
if (!packageInstaller.verifySessionInfo(sessionInfo)) { if (!packageInstaller.verifySessionInfo(sessionInfo)) {
FileLog.d(LOG, "Item info failed session info verification. " FileLog.d(LOG, "Item info failed session info verification. "
+ "Skipping : " + workspaceInfo); + "Skipping : " + workspaceInfo);
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.MISSING_PROMISE_ICON, LOG + "Failed verification.");
}
continue; continue;
} }
@@ -174,9 +158,6 @@ public class AddWorkspaceItemsTask extends BaseModelUpdateTask {
if (sessionInfo == null) { if (sessionInfo == null) {
if (!hasActivity) { if (!hasActivity) {
// Session was cancelled, do not add. // Session was cancelled, do not add.
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.MISSING_PROMISE_ICON, LOG + "Session cancelled");
}
continue; continue;
} }
} else { } else {
@@ -196,9 +177,6 @@ public class AddWorkspaceItemsTask extends BaseModelUpdateTask {
// workspace items as promise icons. At this point we now have the // workspace items as promise icons. At this point we now have the
// correct intent to compare against existing workspace icons. // correct intent to compare against existing workspace icons.
// Icon already exists on the workspace and should not be auto-added. // Icon already exists on the workspace and should not be auto-added.
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.MISSING_PROMISE_ICON, LOG + "shortcutExists");
}
continue; continue;
} }
@@ -34,7 +34,6 @@ import com.android.launcher3.model.BgDataModel.FixedContainerItems;
import com.android.launcher3.model.data.AppInfo; import com.android.launcher3.model.data.AppInfo;
import com.android.launcher3.model.data.ItemInfo; import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.model.data.LauncherAppWidgetInfo; import com.android.launcher3.model.data.LauncherAppWidgetInfo;
import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.util.IntArray; import com.android.launcher3.util.IntArray;
import com.android.launcher3.util.IntSet; import com.android.launcher3.util.IntSet;
import com.android.launcher3.util.LooperExecutor; import com.android.launcher3.util.LooperExecutor;
@@ -258,20 +257,8 @@ public abstract class BaseLauncherBinder {
ArrayList<LauncherAppWidgetInfo> currentAppWidgets = new ArrayList<>(); ArrayList<LauncherAppWidgetInfo> currentAppWidgets = new ArrayList<>();
ArrayList<LauncherAppWidgetInfo> otherAppWidgets = new ArrayList<>(); ArrayList<LauncherAppWidgetInfo> otherAppWidgets = new ArrayList<>();
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.NULL_INT_SET, "bind (1) currentScreenIds: "
+ currentScreenIds
+ ", pointer: "
+ mCallbacks
+ ", name: "
+ mCallbacks.getClass().getName());
}
filterCurrentWorkspaceItems(currentScreenIds, mWorkspaceItems, currentWorkspaceItems, filterCurrentWorkspaceItems(currentScreenIds, mWorkspaceItems, currentWorkspaceItems,
otherWorkspaceItems); otherWorkspaceItems);
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.NULL_INT_SET, "bind (2) currentScreenIds: "
+ currentScreenIds);
}
filterCurrentWorkspaceItems(currentScreenIds, mAppWidgets, currentAppWidgets, filterCurrentWorkspaceItems(currentScreenIds, mAppWidgets, currentAppWidgets,
otherAppWidgets); otherAppWidgets);
final InvariantDeviceProfile idp = mApp.getInvariantDeviceProfile(); final InvariantDeviceProfile idp = mApp.getInvariantDeviceProfile();
@@ -279,9 +266,6 @@ public abstract class BaseLauncherBinder {
sortWorkspaceItemsSpatially(idp, otherWorkspaceItems); sortWorkspaceItemsSpatially(idp, otherWorkspaceItems);
// Tell the workspace that we're about to start binding items // Tell the workspace that we're about to start binding items
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.FLAKY_BINDING, "scheduling: startBinding");
}
executeCallbacksTask(c -> { executeCallbacksTask(c -> {
c.clearPendingBinds(); c.clearPendingBinds();
c.startBinding(); c.startBinding();
@@ -302,9 +286,6 @@ public abstract class BaseLauncherBinder {
Executor pendingExecutor = pendingTasks::add; Executor pendingExecutor = pendingTasks::add;
bindWorkspaceItems(otherWorkspaceItems, pendingExecutor); bindWorkspaceItems(otherWorkspaceItems, pendingExecutor);
bindAppWidgets(otherAppWidgets, pendingExecutor); bindAppWidgets(otherAppWidgets, pendingExecutor);
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.FLAKY_BINDING, "scheduling: finishBindingItems");
}
executeCallbacksTask(c -> c.finishBindingItems(currentScreenIds), pendingExecutor); executeCallbacksTask(c -> c.finishBindingItems(currentScreenIds), pendingExecutor);
pendingExecutor.execute( pendingExecutor.execute(
() -> { () -> {
@@ -49,7 +49,6 @@ import com.android.launcher3.model.data.LauncherAppWidgetInfo;
import com.android.launcher3.model.data.WorkspaceItemInfo; import com.android.launcher3.model.data.WorkspaceItemInfo;
import com.android.launcher3.shortcuts.ShortcutKey; import com.android.launcher3.shortcuts.ShortcutKey;
import com.android.launcher3.shortcuts.ShortcutRequest; import com.android.launcher3.shortcuts.ShortcutRequest;
import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.util.MainThreadInitializedObject; import com.android.launcher3.util.MainThreadInitializedObject;
import com.android.launcher3.util.PersistedItemArray; import com.android.launcher3.util.PersistedItemArray;
import com.android.launcher3.util.Preconditions; import com.android.launcher3.util.Preconditions;
@@ -119,18 +118,10 @@ public class ItemInstallQueue {
Launcher launcher = Launcher.ACTIVITY_TRACKER.getCreatedActivity(); Launcher launcher = Launcher.ACTIVITY_TRACKER.getCreatedActivity();
if (launcher == null) { if (launcher == null) {
// Launcher not loaded // Launcher not loaded
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.MISSING_PROMISE_ICON,
LOG + " flushQueueInBackground launcher not loaded");
}
return; return;
} }
ensureQueueLoaded(); ensureQueueLoaded();
if (mItems.isEmpty()) { if (mItems.isEmpty()) {
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.MISSING_PROMISE_ICON,
LOG + " flushQueueInBackground no items to load");
}
return; return;
} }
@@ -140,10 +131,6 @@ public class ItemInstallQueue {
// Add the items and clear queue // Add the items and clear queue
if (!installQueue.isEmpty()) { if (!installQueue.isEmpty()) {
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.MISSING_PROMISE_ICON,
LOG + " flushQueueInBackground launcher addAndBindAddedWorkspaceItems");
}
// add log // add log
launcher.getModel().addAndBindAddedWorkspaceItems(installQueue); launcher.getModel().addAndBindAddedWorkspaceItems(installQueue);
} }
@@ -204,10 +191,6 @@ public class ItemInstallQueue {
// Queue the item up for adding if launcher has not loaded properly yet // Queue the item up for adding if launcher has not loaded properly yet
MODEL_EXECUTOR.post(() -> { MODEL_EXECUTOR.post(() -> {
Pair<ItemInfo, Object> itemInfo = info.getItemInfo(mContext); Pair<ItemInfo, Object> itemInfo = info.getItemInfo(mContext);
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.MISSING_PROMISE_ICON, LOG + " queuePendingShortcutInfo"
+ ", itemInfo=" + itemInfo);
}
if (itemInfo == null) { if (itemInfo == null) {
FileLog.d(LOG, FileLog.d(LOG,
"Adding PendingInstallShortcutInfo with no attached info to queue.", "Adding PendingInstallShortcutInfo with no attached info to queue.",
@@ -15,11 +15,8 @@
*/ */
package com.android.launcher3.model; package com.android.launcher3.model;
import android.util.Log;
import com.android.launcher3.LauncherSettings; import com.android.launcher3.LauncherSettings;
import com.android.launcher3.model.data.ItemInfo; import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.util.IntArray; import com.android.launcher3.util.IntArray;
import com.android.launcher3.util.IntSet; import com.android.launcher3.util.IntSet;
@@ -34,8 +31,6 @@ import java.util.stream.IntStream;
*/ */
public class ModelUtils { public class ModelUtils {
private static final String TAG = "ModelUtils";
/** /**
* Filters the set of items who are directly or indirectly (via another container) on the * Filters the set of items who are directly or indirectly (via another container) on the
* specified screen. * specified screen.
@@ -55,10 +50,6 @@ public class ModelUtils {
(lhs, rhs) -> Integer.compare(lhs.container, rhs.container)); (lhs, rhs) -> Integer.compare(lhs.container, rhs.container));
for (T info : allWorkspaceItems) { for (T info : allWorkspaceItems) {
if (info.container == LauncherSettings.Favorites.CONTAINER_DESKTOP) { if (info.container == LauncherSettings.Favorites.CONTAINER_DESKTOP) {
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.NULL_INT_SET, "filterCurrentWorkspaceItems: "
+ currentScreenIds);
}
if (currentScreenIds.contains(info.screenId)) { if (currentScreenIds.contains(info.screenId)) {
currentScreenItems.add(info); currentScreenItems.add(info);
itemsOnScreen.add(info.id); itemsOnScreen.add(info.id);
@@ -25,7 +25,6 @@ import android.content.pm.PackageManager;
import android.os.Process; import android.os.Process;
import android.os.UserHandle; import android.os.UserHandle;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
@@ -36,7 +35,6 @@ import com.android.launcher3.SessionCommitReceiver;
import com.android.launcher3.Utilities; import com.android.launcher3.Utilities;
import com.android.launcher3.logging.FileLog; import com.android.launcher3.logging.FileLog;
import com.android.launcher3.model.ItemInstallQueue; import com.android.launcher3.model.ItemInstallQueue;
import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.util.IntArray; import com.android.launcher3.util.IntArray;
import com.android.launcher3.util.IntSet; import com.android.launcher3.util.IntSet;
import com.android.launcher3.util.MainThreadInitializedObject; import com.android.launcher3.util.MainThreadInitializedObject;
@@ -156,16 +154,6 @@ public class InstallSessionHelper {
if (sessionInfo == null if (sessionInfo == null
|| sessionInfo.getInstallerPackageName() == null || sessionInfo.getInstallerPackageName() == null
|| TextUtils.isEmpty(sessionInfo.getAppPackageName())) { || TextUtils.isEmpty(sessionInfo.getAppPackageName())) {
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.MISSING_PROMISE_ICON, LOG + " verify"
+ ", info=" + (sessionInfo == null)
+ ", info install name" + (sessionInfo == null
? null
: sessionInfo.getInstallerPackageName())
+ ", empty pkg name" + TextUtils.isEmpty((sessionInfo == null
? null
: sessionInfo.getAppPackageName())));
}
return null; return null;
} }
return isTrustedPackage(sessionInfo.getInstallerPackageName(), getUserHandle(sessionInfo)) return isTrustedPackage(sessionInfo.getInstallerPackageName(), getUserHandle(sessionInfo))
@@ -224,13 +212,6 @@ public class InstallSessionHelper {
*/ */
@WorkerThread @WorkerThread
void tryQueuePromiseAppIcon(@Nullable final PackageInstaller.SessionInfo sessionInfo) { void tryQueuePromiseAppIcon(@Nullable final PackageInstaller.SessionInfo sessionInfo) {
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.MISSING_PROMISE_ICON, LOG + " tryQueuePromiseAppIcon"
+ ", SessionCommitReceiveEnabled" + SessionCommitReceiver.isEnabled(mAppContext)
+ ", verifySessionInfo(sessionInfo)=" + verifySessionInfo(sessionInfo)
+ ", !promiseIconAdded=" + (sessionInfo != null
&& !promiseIconAddedForId(sessionInfo.getSessionId())));
}
if (SessionCommitReceiver.isEnabled(mAppContext) if (SessionCommitReceiver.isEnabled(mAppContext)
&& verifySessionInfo(sessionInfo) && verifySessionInfo(sessionInfo)
&& !promiseIconAddedForId(sessionInfo.getSessionId())) { && !promiseIconAddedForId(sessionInfo.getSessionId())) {
@@ -246,20 +227,6 @@ public class InstallSessionHelper {
} }
public boolean verifySessionInfo(@Nullable final PackageInstaller.SessionInfo sessionInfo) { public boolean verifySessionInfo(@Nullable final PackageInstaller.SessionInfo sessionInfo) {
if (TestProtocol.sDebugTracing) {
boolean appNotInstalled = sessionInfo == null
|| !new PackageManagerHelper(mAppContext)
.isAppInstalled(sessionInfo.getAppPackageName(), getUserHandle(sessionInfo));
boolean labelNotEmpty = sessionInfo != null
&& !TextUtils.isEmpty(sessionInfo.getAppLabel());
Log.d(TestProtocol.MISSING_PROMISE_ICON, LOG + " verifySessionInfo"
+ ", verify(sessionInfo)=" + verify(sessionInfo)
+ ", reason=" + (sessionInfo == null ? null : sessionInfo.getInstallReason())
+ ", PackageManager.INSTALL_REASON_USER=" + PackageManager.INSTALL_REASON_USER
+ ", hasIcon=" + (sessionInfo != null && sessionInfo.getAppIcon() != null)
+ ", label is ! empty=" + labelNotEmpty
+ " +, app not installed=" + appNotInstalled);
}
return verify(sessionInfo) != null return verify(sessionInfo) != null
&& sessionInfo.getInstallReason() == PackageManager.INSTALL_REASON_USER && sessionInfo.getInstallReason() == PackageManager.INSTALL_REASON_USER
&& sessionInfo.getAppIcon() != null && sessionInfo.getAppIcon() != null
@@ -25,14 +25,12 @@ import android.content.pm.PackageInstaller;
import android.content.pm.PackageInstaller.SessionInfo; import android.content.pm.PackageInstaller.SessionInfo;
import android.os.Build; import android.os.Build;
import android.os.UserHandle; import android.os.UserHandle;
import android.util.Log;
import android.util.SparseArray; import android.util.SparseArray;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.annotation.WorkerThread; import androidx.annotation.WorkerThread;
import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.util.PackageUserKey; import com.android.launcher3.util.PackageUserKey;
import java.lang.ref.WeakReference; import java.lang.ref.WeakReference;
@@ -70,19 +68,10 @@ public class InstallSessionTracker extends PackageInstaller.SessionCallback {
public void onCreated(final int sessionId) { public void onCreated(final int sessionId) {
InstallSessionHelper helper = mWeakHelper.get(); InstallSessionHelper helper = mWeakHelper.get();
Callback callback = mWeakCallback.get(); Callback callback = mWeakCallback.get();
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.MISSING_PROMISE_ICON, "Session created sessionId=" + sessionId
+ ", callback=" + callback
+ ", helper=" + helper);
}
if (callback == null || helper == null) { if (callback == null || helper == null) {
return; return;
} }
SessionInfo sessionInfo = pushSessionDisplayToLauncher(sessionId, helper, callback); SessionInfo sessionInfo = pushSessionDisplayToLauncher(sessionId, helper, callback);
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.MISSING_PROMISE_ICON, "Session created sessionId=" + sessionId
+ ", sessionInfo=" + sessionInfo);
}
if (sessionInfo != null) { if (sessionInfo != null) {
callback.onInstallSessionCreated(PackageInstallInfo.fromInstallingState(sessionInfo)); callback.onInstallSessionCreated(PackageInstallInfo.fromInstallingState(sessionInfo));
} }
@@ -20,7 +20,6 @@ import android.content.res.Resources;
import android.graphics.Point; import android.graphics.Point;
import android.graphics.Rect; import android.graphics.Rect;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.util.Log;
import android.view.HapticFeedbackConstants; import android.view.HapticFeedbackConstants;
import android.view.View; import android.view.View;
@@ -37,7 +36,6 @@ import com.android.launcher3.dragndrop.DragOptions;
import com.android.launcher3.dragndrop.DragView; import com.android.launcher3.dragndrop.DragView;
import com.android.launcher3.dragndrop.DraggableView; import com.android.launcher3.dragndrop.DraggableView;
import com.android.launcher3.model.data.ItemInfo; import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.testing.shared.TestProtocol;
/** /**
* Drag controller for Secondary Launcher activity * Drag controller for Secondary Launcher activity
@@ -55,11 +53,6 @@ public class SecondaryDragController extends DragController<SecondaryDisplayLaun
DraggableView originalView, int dragLayerX, int dragLayerY, DragSource source, DraggableView originalView, int dragLayerX, int dragLayerY, DragSource source,
ItemInfo dragInfo, Point dragOffset, Rect dragRegion, float initialDragViewScale, ItemInfo dragInfo, Point dragOffset, Rect dragRegion, float initialDragViewScale,
float dragViewScaleOnDrop, DragOptions options) { float dragViewScaleOnDrop, DragOptions options) {
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.NO_DROP_TARGET, "5");
}
if (PROFILE_DRAWING_DURING_DRAG) { if (PROFILE_DRAWING_DURING_DRAG) {
android.os.Debug.startMethodTracing("Launcher"); android.os.Debug.startMethodTracing("Launcher");
} }
@@ -16,13 +16,11 @@
package com.android.launcher3.util; package com.android.launcher3.util;
import android.util.Log;
import android.view.View; import android.view.View;
import android.view.View.OnAttachStateChangeListener; import android.view.View.OnAttachStateChangeListener;
import android.view.ViewTreeObserver.OnDrawListener; import android.view.ViewTreeObserver.OnDrawListener;
import com.android.launcher3.Launcher; import com.android.launcher3.Launcher;
import com.android.launcher3.testing.shared.TestProtocol;
import java.util.function.Consumer; import java.util.function.Consumer;
@@ -44,9 +42,6 @@ public class ViewOnDrawExecutor implements OnDrawListener, Runnable,
private boolean mCancelled; private boolean mCancelled;
public ViewOnDrawExecutor(RunnableList tasks) { public ViewOnDrawExecutor(RunnableList tasks) {
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.FLAKY_BINDING, "Initialize ViewOnDrawExecutor");
}
mTasks = tasks; mTasks = tasks;
} }
@@ -54,11 +49,6 @@ public class ViewOnDrawExecutor implements OnDrawListener, Runnable,
mOnClearCallback = launcher::clearPendingExecutor; mOnClearCallback = launcher::clearPendingExecutor;
mAttachedView = launcher.getWorkspace(); mAttachedView = launcher.getWorkspace();
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.FLAKY_BINDING, "ViewOnDrawExecutor.attachTo: launcher=" + launcher
+ ", isAttachedToWindow=" + mAttachedView.isAttachedToWindow());
}
mAttachedView.addOnAttachStateChangeListener(this); mAttachedView.addOnAttachStateChangeListener(this);
if (mAttachedView.isAttachedToWindow()) { if (mAttachedView.isAttachedToWindow()) {
@@ -67,10 +57,6 @@ public class ViewOnDrawExecutor implements OnDrawListener, Runnable,
} }
private void attachObserver() { private void attachObserver() {
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.FLAKY_BINDING,
"ViewOnDrawExecutor.attachObserver: mCompleted=" + mCompleted);
}
if (!mCompleted) { if (!mCompleted) {
mAttachedView.getViewTreeObserver().addOnDrawListener(this); mAttachedView.getViewTreeObserver().addOnDrawListener(this);
} }
@@ -78,9 +64,6 @@ public class ViewOnDrawExecutor implements OnDrawListener, Runnable,
@Override @Override
public void onViewAttachedToWindow(View v) { public void onViewAttachedToWindow(View v) {
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.FLAKY_BINDING, "ViewOnDrawExecutor.onViewAttachedToWindow");
}
attachObserver(); attachObserver();
} }
@@ -89,19 +72,11 @@ public class ViewOnDrawExecutor implements OnDrawListener, Runnable,
@Override @Override
public void onDraw() { public void onDraw() {
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.FLAKY_BINDING, "ViewOnDrawExecutor.onDraw");
}
mFirstDrawCompleted = true; mFirstDrawCompleted = true;
mAttachedView.post(this); mAttachedView.post(this);
} }
public void onLoadAnimationCompleted() { public void onLoadAnimationCompleted() {
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.FLAKY_BINDING,
"ViewOnDrawExecutor.onLoadAnimationCompleted: mAttachedView != null="
+ (mAttachedView != null));
}
mLoadAnimationCompleted = true; mLoadAnimationCompleted = true;
if (mAttachedView != null) { if (mAttachedView != null) {
mAttachedView.post(this); mAttachedView.post(this);
@@ -110,12 +85,6 @@ public class ViewOnDrawExecutor implements OnDrawListener, Runnable,
@Override @Override
public void run() { public void run() {
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.FLAKY_BINDING,
"ViewOnDrawExecutor.run: mLoadAnimationCompleted=" + mLoadAnimationCompleted
+ ", mFirstDrawCompleted=" + mFirstDrawCompleted
+ ", mCompleted=" + mCompleted);
}
// Post the pending tasks after both onDraw and onLoadAnimationCompleted have been called. // Post the pending tasks after both onDraw and onLoadAnimationCompleted have been called.
if (mLoadAnimationCompleted && mFirstDrawCompleted && !mCompleted) { if (mLoadAnimationCompleted && mFirstDrawCompleted && !mCompleted) {
markCompleted(); markCompleted();
@@ -126,12 +95,6 @@ public class ViewOnDrawExecutor implements OnDrawListener, Runnable,
* Executes all tasks immediately * Executes all tasks immediately
*/ */
public void markCompleted() { public void markCompleted() {
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.FLAKY_BINDING,
"ViewOnDrawExecutor.markCompleted: mCancelled=" + mCancelled
+ ", mOnClearCallback != null=" + (mOnClearCallback != null)
+ ", mAttachedView != null=" + (mAttachedView != null));
}
if (!mCancelled) { if (!mCancelled) {
mTasks.executeAllAndDestroy(); mTasks.executeAllAndDestroy();
} }
@@ -146,9 +109,6 @@ public class ViewOnDrawExecutor implements OnDrawListener, Runnable,
} }
public void cancel() { public void cancel() {
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.FLAKY_BINDING, "ViewOnDrawExecutor.cancel");
}
mCancelled = true; mCancelled = true;
markCompleted(); markCompleted();
} }
@@ -24,7 +24,6 @@ import android.graphics.Paint;
import android.graphics.Point; import android.graphics.Point;
import android.graphics.Rect; import android.graphics.Rect;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.util.Log;
import android.view.View; import android.view.View;
import android.view.View.OnClickListener; import android.view.View.OnClickListener;
import android.view.View.OnLongClickListener; import android.view.View.OnLongClickListener;
@@ -136,9 +135,6 @@ public abstract class BaseWidgetSheet extends AbstractSlideInView<Launcher>
@Override @Override
public boolean onLongClick(View v) { public boolean onLongClick(View v) {
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.NO_DROP_TARGET, "1");
}
TestLogging.recordEvent(TestProtocol.SEQUENCE_MAIN, "Widgets.onLongClick"); TestLogging.recordEvent(TestProtocol.SEQUENCE_MAIN, "Widgets.onLongClick");
v.cancelLongPress(); v.cancelLongPress();
if (!ItemLongClickListener.canStartDrag(mActivityContext)) return false; if (!ItemLongClickListener.canStartDrag(mActivityContext)) return false;
@@ -220,9 +216,6 @@ public abstract class BaseWidgetSheet extends AbstractSlideInView<Launcher>
} }
private boolean beginDraggingWidget(WidgetCell v) { private boolean beginDraggingWidget(WidgetCell v) {
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.NO_DROP_TARGET, "2");
}
// Get the widget preview as the drag representation // Get the widget preview as the drag representation
WidgetImageView image = v.getWidgetView(); WidgetImageView image = v.getWidgetView();
@@ -22,7 +22,6 @@ import android.graphics.Paint;
import android.graphics.Point; import android.graphics.Point;
import android.graphics.Rect; import android.graphics.Rect;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.util.Log;
import android.util.Size; import android.util.Size;
import android.view.View; import android.view.View;
import android.view.View.MeasureSpec; import android.view.View.MeasureSpec;
@@ -43,7 +42,6 @@ import com.android.launcher3.icons.BaseIconFactory;
import com.android.launcher3.icons.FastBitmapDrawable; import com.android.launcher3.icons.FastBitmapDrawable;
import com.android.launcher3.icons.LauncherIcons; import com.android.launcher3.icons.LauncherIcons;
import com.android.launcher3.icons.RoundDrawableWrapper; import com.android.launcher3.icons.RoundDrawableWrapper;
import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.widget.dragndrop.AppWidgetHostViewDragListener; import com.android.launcher3.widget.dragndrop.AppWidgetHostViewDragListener;
import com.android.launcher3.widget.util.WidgetSizes; import com.android.launcher3.widget.util.WidgetSizes;
@@ -97,9 +95,6 @@ public class PendingItemDragHelper extends DragPreviewProvider {
*/ */
public void startDrag(Rect previewBounds, int previewBitmapWidth, int previewViewWidth, public void startDrag(Rect previewBounds, int previewBitmapWidth, int previewViewWidth,
Point screenPos, DragSource source, DragOptions options) { Point screenPos, DragSource source, DragOptions options) {
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.NO_DROP_TARGET, "3");
}
final Launcher launcher = Launcher.getLauncher(mView.getContext()); final Launcher launcher = Launcher.getLauncher(mView.getContext());
LauncherAppState app = LauncherAppState.getInstance(launcher); LauncherAppState app = LauncherAppState.getInstance(launcher);
@@ -147,12 +147,6 @@ public final class TestProtocol {
public static final String REQUEST_MOCK_SENSOR_ROTATION = "mock-sensor-rotation"; public static final String REQUEST_MOCK_SENSOR_ROTATION = "mock-sensor-rotation";
public static final String PERMANENT_DIAG_TAG = "TaplTarget"; public static final String PERMANENT_DIAG_TAG = "TaplTarget";
public static final String NO_DROP_TARGET = "b/195031154";
public static final String NULL_INT_SET = "b/200572078";
public static final String MISSING_PROMISE_ICON = "b/202985412";
public static final String TASKBAR_IN_APP_STATE = "b/227657604";
public static final String NPE_TRANSIENT_TASKBAR = "b/257549303";
public static final String FLAKY_BINDING = "b/270216650";
public static final String VIEW_AND_ACTIVITY_LEAKS = "b/260260325"; public static final String VIEW_AND_ACTIVITY_LEAKS = "b/260260325";
public static final String WORK_TAB_MISSING = "b/243688989"; public static final String WORK_TAB_MISSING = "b/243688989";
@@ -28,7 +28,6 @@ import com.android.launcher3.InvariantDeviceProfile;
import com.android.launcher3.celllayout.testcases.MultipleCellLayoutsSimpleReorder; import com.android.launcher3.celllayout.testcases.MultipleCellLayoutsSimpleReorder;
import com.android.launcher3.tapl.Widget; import com.android.launcher3.tapl.Widget;
import com.android.launcher3.tapl.WidgetResizeFrame; import com.android.launcher3.tapl.WidgetResizeFrame;
import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.ui.AbstractLauncherUiTest; import com.android.launcher3.ui.AbstractLauncherUiTest;
import com.android.launcher3.ui.TaplTestsLauncher3; import com.android.launcher3.ui.TaplTestsLauncher3;
import com.android.launcher3.util.rule.ShellCommandRule; import com.android.launcher3.util.rule.ShellCommandRule;
@@ -116,14 +115,7 @@ public class ReorderWidgets extends AbstractLauncherUiTest {
// waitForLauncherCondition to wait for that condition, otherwise the condition would // waitForLauncherCondition to wait for that condition, otherwise the condition would
// always be true and it wouldn't wait for the changes to be applied. // always be true and it wouldn't wait for the changes to be applied.
resetLoaderState(); resetLoaderState();
Log.d(TestProtocol.FLAKY_BINDING, "waiting for: isWorkspaceLoading=false"); waitForLauncherCondition("Workspace didn't finish loading", l -> !l.isWorkspaceLoading());
waitForLauncherCondition("Workspace didn't finish loading", l -> {
boolean isWorkspaceLoading = l.isWorkspaceLoading();
Log.d(TestProtocol.FLAKY_BINDING, "checking: isWorkspaceLoading=" + isWorkspaceLoading);
return !isWorkspaceLoading;
});
Widget widget = mLauncher.getWorkspace().getWidgetAtCell(mainWidgetCellPos.getCellX(), Widget widget = mLauncher.getWorkspace().getWidgetAtCell(mainWidgetCellPos.getCellX(),
mainWidgetCellPos.getCellY()); mainWidgetCellPos.getCellY());
assertNotNull(widget); assertNotNull(widget);