diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java index 69ea9fd03a..a27060c170 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java @@ -65,7 +65,6 @@ import com.android.launcher3.R; import com.android.launcher3.Utilities; import com.android.launcher3.anim.AnimatedFloat; import com.android.launcher3.anim.AnimatorListeners; -import com.android.launcher3.testing.shared.TestProtocol; import com.android.launcher3.util.DisplayController; import com.android.launcher3.util.MultiPropertyFactory.MultiProperty; import com.android.quickstep.SystemUiProxy; @@ -1021,10 +1020,6 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba * unstashed. */ 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) { mState |= flag; } else { @@ -1249,16 +1244,6 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba && animationType != TRANSITION_DEFAULT; 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; mLastStartedTransitionType = animationType; diff --git a/quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java b/quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java index 5391f4d46c..4bd1b30da0 100644 --- a/quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java +++ b/quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java @@ -1,6 +1,5 @@ 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 android.app.Activity; @@ -8,7 +7,6 @@ import android.content.Context; import android.content.res.Resources; import android.graphics.Rect; import android.os.Bundle; -import android.util.Log; import androidx.annotation.Nullable; @@ -177,13 +175,9 @@ public class QuickstepTestInformationHandler extends TestInformationHandler { TouchInteractionService.TISBinder tisBinder, boolean enable) { TaskbarActivityContext context = tisBinder.getTaskbarManager().getCurrentActivityContext(); if (context == null) { - if (TestProtocol.sDebugTracing) { - Log.d(NPE_TRANSIENT_TASKBAR, "enableBlockingTimeout: enable=" + enable, - new Exception()); - } - } else { - context.enableBlockingTimeoutDuringTests(enable); + return; } + context.enableBlockingTimeoutDuringTests(enable); } private void enableTransientTaskbar(boolean enable) { diff --git a/src/com/android/launcher3/DropTargetBar.java b/src/com/android/launcher3/DropTargetBar.java index 98ecf3a7e6..bb6d8b09a2 100644 --- a/src/com/android/launcher3/DropTargetBar.java +++ b/src/com/android/launcher3/DropTargetBar.java @@ -23,7 +23,6 @@ import android.animation.TimeInterpolator; import android.content.Context; import android.graphics.Rect; import android.util.AttributeSet; -import android.util.Log; import android.util.TypedValue; import android.view.Gravity; import android.view.View; @@ -31,13 +30,10 @@ import android.view.ViewDebug; import android.view.ViewPropertyAnimator; import android.widget.FrameLayout; -import androidx.annotation.NonNull; - import com.android.launcher3.anim.Interpolators; import com.android.launcher3.dragndrop.DragController; import com.android.launcher3.dragndrop.DragController.DragListener; import com.android.launcher3.dragndrop.DragOptions; -import com.android.launcher3.testing.shared.TestProtocol; /* * 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) { - if (TestProtocol.sDebugTracing) { - Log.d(TestProtocol.NO_DROP_TARGET, "8"); - } if (mVisible != isVisible) { mVisible = isVisible; @@ -328,9 +321,6 @@ public class DropTargetBar extends FrameLayout */ @Override public void onDragStart(DropTarget.DragObject dragObject, DragOptions options) { - if (TestProtocol.sDebugTracing) { - Log.d(TestProtocol.NO_DROP_TARGET, "7"); - } animateToVisibility(true); } @@ -354,16 +344,4 @@ public class DropTargetBar extends FrameLayout public ButtonDropTarget[] getDropTargets() { 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()); - } - } - } } diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 59f56ff1b5..4f69ee743c 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -1828,9 +1828,6 @@ public class Launcher extends StatefulActivity } private void setWorkspaceLoading(boolean value) { - if (TestProtocol.sDebugTracing) { - Log.d(TestProtocol.FLAKY_BINDING, "running: setWorkspaceLoading=" + value); - } mWorkspaceLoading = value; } @@ -2203,10 +2200,6 @@ public class Launcher extends StatefulActivity IntSet result = new IntSet(); if (visibleIds.isEmpty()) { - if (TestProtocol.sDebugTracing) { - Log.d(TestProtocol.NULL_INT_SET, "getPagesToBindSynchronously (1): " - + result); - } return result; } for (int id : orderedScreenIds.toArray()) { @@ -2227,10 +2220,6 @@ public class Launcher extends StatefulActivity // pages being hidden in single panel. result.add(pairId); } - if (TestProtocol.sDebugTracing) { - Log.d(TestProtocol.NULL_INT_SET, "getPagesToBindSynchronously (2): " - + result); - } return result; } @@ -2252,14 +2241,11 @@ public class Launcher extends StatefulActivity /** * Refreshes the shortcuts shown on the workspace. - * + *

* Implementation of the method from LauncherModel.Callbacks. */ public void 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 // we are starting a fresh bind, close all such panels as all the icons are about // to go away. @@ -2438,10 +2424,6 @@ public class Launcher extends StatefulActivity throw (new RuntimeException(desc)); } else { getModelWriter().deleteItemFromDatabase(item, desc); - if (TestProtocol.sDebugTracing) { - Log.d(TestProtocol.MISSING_PROMISE_ICON, - TAG + "bindItems failed for item=" + item); - } continue; } } @@ -2727,14 +2709,11 @@ public class Launcher extends StatefulActivity /** * Callback saying that there aren't any more items to bind. - * + *

* Implementation of the method from LauncherModel.Callbacks. */ public void finishBindingItems(IntSet pagesBoundFirst) { Object traceToken = TraceHelper.INSTANCE.beginSection("finishBindingItems"); - if (TestProtocol.sDebugTracing) { - Log.d(TestProtocol.FLAKY_BINDING, "running: finishBindingItems"); - } mWorkspace.restoreInstanceStateForRemainingPages(); setWorkspaceLoading(false); diff --git a/src/com/android/launcher3/LauncherModel.java b/src/com/android/launcher3/LauncherModel.java index 06ac44a744..aca58d572d 100644 --- a/src/com/android/launcher3/LauncherModel.java +++ b/src/com/android/launcher3/LauncherModel.java @@ -375,12 +375,6 @@ public class LauncherModel extends LauncherApps.Callback implements InstallSessi public void addCallbacks(@NonNull final Callbacks callbacks) { Preconditions.assertUIThread(); synchronized (mCallbacksList) { - if (TestProtocol.sDebugTracing) { - Log.d(TestProtocol.NULL_INT_SET, "addCallbacks pointer: " - + callbacks - + ", name: " - + callbacks.getClass().getName(), new Exception()); - } mCallbacksList.add(callbacks); } } diff --git a/src/com/android/launcher3/SessionCommitReceiver.java b/src/com/android/launcher3/SessionCommitReceiver.java index 32c8968732..aaccb7dfc0 100644 --- a/src/com/android/launcher3/SessionCommitReceiver.java +++ b/src/com/android/launcher3/SessionCommitReceiver.java @@ -24,14 +24,12 @@ import android.content.pm.PackageInstaller.SessionInfo; import android.content.pm.PackageManager; import android.os.UserHandle; import android.text.TextUtils; -import android.util.Log; import androidx.annotation.WorkerThread; import com.android.launcher3.logging.FileLog; import com.android.launcher3.model.ItemInstallQueue; import com.android.launcher3.pm.InstallSessionHelper; -import com.android.launcher3.testing.shared.TestProtocol; import com.android.launcher3.util.Executors; /** @@ -53,9 +51,6 @@ public class SessionCommitReceiver extends BroadcastReceiver { private static void processIntent(Context context, Intent intent) { if (!isEnabled(context)) { // User has decided to not add icons on homescreen. - if (TestProtocol.sDebugTracing) { - Log.d(TestProtocol.MISSING_PROMISE_ICON, LOG + " not enabled"); - } return; } @@ -64,9 +59,6 @@ public class SessionCommitReceiver extends BroadcastReceiver { if (!PackageInstaller.ACTION_SESSION_COMMITTED.equals(intent.getAction()) || info == null || user == null) { // Invalid intent. - if (TestProtocol.sDebugTracing) { - Log.d(TestProtocol.MISSING_PROMISE_ICON, LOG + " invalid intent"); - } return; } @@ -75,15 +67,6 @@ public class SessionCommitReceiver extends BroadcastReceiver { || info.getInstallReason() != PackageManager.INSTALL_REASON_USER || packageInstallerCompat.promiseIconAddedForId(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; } diff --git a/src/com/android/launcher3/dragndrop/DragController.java b/src/com/android/launcher3/dragndrop/DragController.java index 5368397c6d..328d7699ed 100644 --- a/src/com/android/launcher3/dragndrop/DragController.java +++ b/src/com/android/launcher3/dragndrop/DragController.java @@ -21,7 +21,6 @@ import static com.android.launcher3.Utilities.ATLEAST_Q; import android.graphics.Point; import android.graphics.Rect; import android.graphics.drawable.Drawable; -import android.util.Log; import android.view.DragEvent; import android.view.KeyEvent; import android.view.MotionEvent; @@ -35,7 +34,6 @@ import com.android.launcher3.anim.Interpolators; import com.android.launcher3.logging.InstanceId; import com.android.launcher3.model.data.ItemInfo; import com.android.launcher3.model.data.WorkspaceItemInfo; -import com.android.launcher3.testing.shared.TestProtocol; import com.android.launcher3.util.TouchController; import com.android.launcher3.views.ActivityContext; @@ -150,9 +148,6 @@ public abstract class DragController float initialDragViewScale, float dragViewScaleOnDrop, DragOptions options) { - if (TestProtocol.sDebugTracing) { - Log.d(TestProtocol.NO_DROP_TARGET, "4"); - } return startDrag(drawable, /* view= */ null, originalView, dragLayerX, dragLayerY, source, dragInfo, dragOffset, dragRegion, initialDragViewScale, dragViewScaleOnDrop, options); @@ -210,9 +205,6 @@ public abstract class DragController DragOptions options); protected void callOnDragStart() { - if (TestProtocol.sDebugTracing) { - Log.d(TestProtocol.NO_DROP_TARGET, "6"); - } if (mOptions.preDragCondition != null) { mOptions.preDragCondition.onPreDragEnd(mDragObject, true /* dragStarted*/); } diff --git a/src/com/android/launcher3/dragndrop/LauncherDragController.java b/src/com/android/launcher3/dragndrop/LauncherDragController.java index 75f4ad687e..0e8b0a5ba6 100644 --- a/src/com/android/launcher3/dragndrop/LauncherDragController.java +++ b/src/com/android/launcher3/dragndrop/LauncherDragController.java @@ -24,7 +24,6 @@ import android.content.res.Resources; import android.graphics.Point; import android.graphics.Rect; import android.graphics.drawable.Drawable; -import android.util.Log; import android.view.HapticFeedbackConstants; import android.view.View; @@ -37,7 +36,6 @@ import com.android.launcher3.Launcher; import com.android.launcher3.R; import com.android.launcher3.accessibility.DragViewStateAnnouncer; import com.android.launcher3.model.data.ItemInfo; -import com.android.launcher3.testing.shared.TestProtocol; /** * Drag controller for Launcher activity @@ -67,9 +65,6 @@ public class LauncherDragController extends DragController { float initialDragViewScale, float dragViewScaleOnDrop, DragOptions options) { - if (TestProtocol.sDebugTracing) { - Log.d(TestProtocol.NO_DROP_TARGET, "5"); - } if (PROFILE_DRAWING_DURING_DRAG) { android.os.Debug.startMethodTracing("Launcher"); } diff --git a/src/com/android/launcher3/model/AddWorkspaceItemsTask.java b/src/com/android/launcher3/model/AddWorkspaceItemsTask.java index 0d978e1b23..27d1f78fb5 100644 --- a/src/com/android/launcher3/model/AddWorkspaceItemsTask.java +++ b/src/com/android/launcher3/model/AddWorkspaceItemsTask.java @@ -20,7 +20,6 @@ import android.content.pm.LauncherActivityInfo; import android.content.pm.LauncherApps; import android.content.pm.PackageInstaller.SessionInfo; import android.os.UserHandle; -import android.util.Log; import android.util.Pair; 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.pm.InstallSessionHelper; import com.android.launcher3.pm.PackageInstallInfo; -import com.android.launcher3.testing.shared.TestProtocol; import com.android.launcher3.util.IntArray; import com.android.launcher3.util.PackageManagerHelper; @@ -97,20 +95,12 @@ public class AddWorkspaceItemsTask extends BaseModelUpdateTask { item.itemType == LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT) { // Short-circuit this logic if the icon exists somewhere on the workspace if (shortcutExists(dataModel, item.getIntent(), item.user)) { - if (TestProtocol.sDebugTracing) { - Log.d(TestProtocol.MISSING_PROMISE_ICON, - LOG + " Item already on workspace."); - } continue; } // b/139663018 Short-circuit this logic if the icon is a system app if (PackageManagerHelper.isSystemApp(app.getContext(), Objects.requireNonNull(item.getIntent()))) { - if (TestProtocol.sDebugTracing) { - Log.d(TestProtocol.MISSING_PROMISE_ICON, - LOG + " Item is a system app."); - } continue; } } @@ -150,9 +140,6 @@ public class AddWorkspaceItemsTask extends BaseModelUpdateTask { String packageName = item.getTargetComponent() != null ? item.getTargetComponent().getPackageName() : null; if (packageName == null) { - if (TestProtocol.sDebugTracing) { - Log.d(TestProtocol.MISSING_PROMISE_ICON, LOG + " Null packageName."); - } continue; } SessionInfo sessionInfo = packageInstaller.getActiveSessionInfo(item.user, @@ -161,9 +148,6 @@ public class AddWorkspaceItemsTask extends BaseModelUpdateTask { if (!packageInstaller.verifySessionInfo(sessionInfo)) { FileLog.d(LOG, "Item info failed session info verification. " + "Skipping : " + workspaceInfo); - if (TestProtocol.sDebugTracing) { - Log.d(TestProtocol.MISSING_PROMISE_ICON, LOG + "Failed verification."); - } continue; } @@ -174,9 +158,6 @@ public class AddWorkspaceItemsTask extends BaseModelUpdateTask { if (sessionInfo == null) { if (!hasActivity) { // Session was cancelled, do not add. - if (TestProtocol.sDebugTracing) { - Log.d(TestProtocol.MISSING_PROMISE_ICON, LOG + "Session cancelled"); - } continue; } } else { @@ -196,9 +177,6 @@ public class AddWorkspaceItemsTask extends BaseModelUpdateTask { // workspace items as promise icons. At this point we now have the // correct intent to compare against existing workspace icons. // Icon already exists on the workspace and should not be auto-added. - if (TestProtocol.sDebugTracing) { - Log.d(TestProtocol.MISSING_PROMISE_ICON, LOG + "shortcutExists"); - } continue; } diff --git a/src/com/android/launcher3/model/BaseLauncherBinder.java b/src/com/android/launcher3/model/BaseLauncherBinder.java index 358992e974..c946e2c2e2 100644 --- a/src/com/android/launcher3/model/BaseLauncherBinder.java +++ b/src/com/android/launcher3/model/BaseLauncherBinder.java @@ -34,7 +34,6 @@ import com.android.launcher3.model.BgDataModel.FixedContainerItems; import com.android.launcher3.model.data.AppInfo; import com.android.launcher3.model.data.ItemInfo; 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.IntSet; import com.android.launcher3.util.LooperExecutor; @@ -258,20 +257,8 @@ public abstract class BaseLauncherBinder { ArrayList currentAppWidgets = new ArrayList<>(); ArrayList 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, otherWorkspaceItems); - if (TestProtocol.sDebugTracing) { - Log.d(TestProtocol.NULL_INT_SET, "bind (2) currentScreenIds: " - + currentScreenIds); - } filterCurrentWorkspaceItems(currentScreenIds, mAppWidgets, currentAppWidgets, otherAppWidgets); final InvariantDeviceProfile idp = mApp.getInvariantDeviceProfile(); @@ -279,9 +266,6 @@ public abstract class BaseLauncherBinder { sortWorkspaceItemsSpatially(idp, otherWorkspaceItems); // Tell the workspace that we're about to start binding items - if (TestProtocol.sDebugTracing) { - Log.d(TestProtocol.FLAKY_BINDING, "scheduling: startBinding"); - } executeCallbacksTask(c -> { c.clearPendingBinds(); c.startBinding(); @@ -302,9 +286,6 @@ public abstract class BaseLauncherBinder { Executor pendingExecutor = pendingTasks::add; bindWorkspaceItems(otherWorkspaceItems, pendingExecutor); bindAppWidgets(otherAppWidgets, pendingExecutor); - if (TestProtocol.sDebugTracing) { - Log.d(TestProtocol.FLAKY_BINDING, "scheduling: finishBindingItems"); - } executeCallbacksTask(c -> c.finishBindingItems(currentScreenIds), pendingExecutor); pendingExecutor.execute( () -> { diff --git a/src/com/android/launcher3/model/ItemInstallQueue.java b/src/com/android/launcher3/model/ItemInstallQueue.java index 69f9b53090..fa0511cc56 100644 --- a/src/com/android/launcher3/model/ItemInstallQueue.java +++ b/src/com/android/launcher3/model/ItemInstallQueue.java @@ -49,7 +49,6 @@ import com.android.launcher3.model.data.LauncherAppWidgetInfo; import com.android.launcher3.model.data.WorkspaceItemInfo; import com.android.launcher3.shortcuts.ShortcutKey; import com.android.launcher3.shortcuts.ShortcutRequest; -import com.android.launcher3.testing.shared.TestProtocol; import com.android.launcher3.util.MainThreadInitializedObject; import com.android.launcher3.util.PersistedItemArray; import com.android.launcher3.util.Preconditions; @@ -119,18 +118,10 @@ public class ItemInstallQueue { Launcher launcher = Launcher.ACTIVITY_TRACKER.getCreatedActivity(); if (launcher == null) { // Launcher not loaded - if (TestProtocol.sDebugTracing) { - Log.d(TestProtocol.MISSING_PROMISE_ICON, - LOG + " flushQueueInBackground launcher not loaded"); - } return; } ensureQueueLoaded(); if (mItems.isEmpty()) { - if (TestProtocol.sDebugTracing) { - Log.d(TestProtocol.MISSING_PROMISE_ICON, - LOG + " flushQueueInBackground no items to load"); - } return; } @@ -140,10 +131,6 @@ public class ItemInstallQueue { // Add the items and clear queue if (!installQueue.isEmpty()) { - if (TestProtocol.sDebugTracing) { - Log.d(TestProtocol.MISSING_PROMISE_ICON, - LOG + " flushQueueInBackground launcher addAndBindAddedWorkspaceItems"); - } // add log launcher.getModel().addAndBindAddedWorkspaceItems(installQueue); } @@ -204,10 +191,6 @@ public class ItemInstallQueue { // Queue the item up for adding if launcher has not loaded properly yet MODEL_EXECUTOR.post(() -> { Pair itemInfo = info.getItemInfo(mContext); - if (TestProtocol.sDebugTracing) { - Log.d(TestProtocol.MISSING_PROMISE_ICON, LOG + " queuePendingShortcutInfo" - + ", itemInfo=" + itemInfo); - } if (itemInfo == null) { FileLog.d(LOG, "Adding PendingInstallShortcutInfo with no attached info to queue.", diff --git a/src/com/android/launcher3/model/ModelUtils.java b/src/com/android/launcher3/model/ModelUtils.java index 48fb537289..bc51c9bfad 100644 --- a/src/com/android/launcher3/model/ModelUtils.java +++ b/src/com/android/launcher3/model/ModelUtils.java @@ -15,11 +15,8 @@ */ package com.android.launcher3.model; -import android.util.Log; - import com.android.launcher3.LauncherSettings; 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.IntSet; @@ -34,8 +31,6 @@ import java.util.stream.IntStream; */ public class ModelUtils { - private static final String TAG = "ModelUtils"; - /** * Filters the set of items who are directly or indirectly (via another container) on the * specified screen. @@ -55,10 +50,6 @@ public class ModelUtils { (lhs, rhs) -> Integer.compare(lhs.container, rhs.container)); for (T info : allWorkspaceItems) { if (info.container == LauncherSettings.Favorites.CONTAINER_DESKTOP) { - if (TestProtocol.sDebugTracing) { - Log.d(TestProtocol.NULL_INT_SET, "filterCurrentWorkspaceItems: " - + currentScreenIds); - } if (currentScreenIds.contains(info.screenId)) { currentScreenItems.add(info); itemsOnScreen.add(info.id); diff --git a/src/com/android/launcher3/pm/InstallSessionHelper.java b/src/com/android/launcher3/pm/InstallSessionHelper.java index 47bfe85bb8..cb3c16c8aa 100644 --- a/src/com/android/launcher3/pm/InstallSessionHelper.java +++ b/src/com/android/launcher3/pm/InstallSessionHelper.java @@ -25,7 +25,6 @@ import android.content.pm.PackageManager; import android.os.Process; import android.os.UserHandle; import android.text.TextUtils; -import android.util.Log; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -36,7 +35,6 @@ import com.android.launcher3.SessionCommitReceiver; import com.android.launcher3.Utilities; import com.android.launcher3.logging.FileLog; import com.android.launcher3.model.ItemInstallQueue; -import com.android.launcher3.testing.shared.TestProtocol; import com.android.launcher3.util.IntArray; import com.android.launcher3.util.IntSet; import com.android.launcher3.util.MainThreadInitializedObject; @@ -156,16 +154,6 @@ public class InstallSessionHelper { if (sessionInfo == null || sessionInfo.getInstallerPackageName() == null || 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 isTrustedPackage(sessionInfo.getInstallerPackageName(), getUserHandle(sessionInfo)) @@ -224,13 +212,6 @@ public class InstallSessionHelper { */ @WorkerThread 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) && verifySessionInfo(sessionInfo) && !promiseIconAddedForId(sessionInfo.getSessionId())) { @@ -246,20 +227,6 @@ public class InstallSessionHelper { } 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 && sessionInfo.getInstallReason() == PackageManager.INSTALL_REASON_USER && sessionInfo.getAppIcon() != null diff --git a/src/com/android/launcher3/pm/InstallSessionTracker.java b/src/com/android/launcher3/pm/InstallSessionTracker.java index aeaa320ec9..41908d3496 100644 --- a/src/com/android/launcher3/pm/InstallSessionTracker.java +++ b/src/com/android/launcher3/pm/InstallSessionTracker.java @@ -25,14 +25,12 @@ import android.content.pm.PackageInstaller; import android.content.pm.PackageInstaller.SessionInfo; import android.os.Build; import android.os.UserHandle; -import android.util.Log; import android.util.SparseArray; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.WorkerThread; -import com.android.launcher3.testing.shared.TestProtocol; import com.android.launcher3.util.PackageUserKey; import java.lang.ref.WeakReference; @@ -70,19 +68,10 @@ public class InstallSessionTracker extends PackageInstaller.SessionCallback { public void onCreated(final int sessionId) { InstallSessionHelper helper = mWeakHelper.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) { return; } SessionInfo sessionInfo = pushSessionDisplayToLauncher(sessionId, helper, callback); - if (TestProtocol.sDebugTracing) { - Log.d(TestProtocol.MISSING_PROMISE_ICON, "Session created sessionId=" + sessionId - + ", sessionInfo=" + sessionInfo); - } if (sessionInfo != null) { callback.onInstallSessionCreated(PackageInstallInfo.fromInstallingState(sessionInfo)); } diff --git a/src/com/android/launcher3/secondarydisplay/SecondaryDragController.java b/src/com/android/launcher3/secondarydisplay/SecondaryDragController.java index 9bf27642ef..b1a9b868c3 100644 --- a/src/com/android/launcher3/secondarydisplay/SecondaryDragController.java +++ b/src/com/android/launcher3/secondarydisplay/SecondaryDragController.java @@ -20,7 +20,6 @@ import android.content.res.Resources; import android.graphics.Point; import android.graphics.Rect; import android.graphics.drawable.Drawable; -import android.util.Log; import android.view.HapticFeedbackConstants; 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.DraggableView; import com.android.launcher3.model.data.ItemInfo; -import com.android.launcher3.testing.shared.TestProtocol; /** * Drag controller for Secondary Launcher activity @@ -55,11 +53,6 @@ public class SecondaryDragController extends DragController @Override public boolean onLongClick(View v) { - if (TestProtocol.sDebugTracing) { - Log.d(TestProtocol.NO_DROP_TARGET, "1"); - } TestLogging.recordEvent(TestProtocol.SEQUENCE_MAIN, "Widgets.onLongClick"); v.cancelLongPress(); if (!ItemLongClickListener.canStartDrag(mActivityContext)) return false; @@ -220,9 +216,6 @@ public abstract class BaseWidgetSheet extends AbstractSlideInView } private boolean beginDraggingWidget(WidgetCell v) { - if (TestProtocol.sDebugTracing) { - Log.d(TestProtocol.NO_DROP_TARGET, "2"); - } // Get the widget preview as the drag representation WidgetImageView image = v.getWidgetView(); diff --git a/src/com/android/launcher3/widget/PendingItemDragHelper.java b/src/com/android/launcher3/widget/PendingItemDragHelper.java index 2dedd12450..410a555896 100644 --- a/src/com/android/launcher3/widget/PendingItemDragHelper.java +++ b/src/com/android/launcher3/widget/PendingItemDragHelper.java @@ -22,7 +22,6 @@ import android.graphics.Paint; import android.graphics.Point; import android.graphics.Rect; import android.graphics.drawable.Drawable; -import android.util.Log; import android.util.Size; import android.view.View; 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.LauncherIcons; 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.util.WidgetSizes; @@ -97,9 +95,6 @@ public class PendingItemDragHelper extends DragPreviewProvider { */ public void startDrag(Rect previewBounds, int previewBitmapWidth, int previewViewWidth, Point screenPos, DragSource source, DragOptions options) { - if (TestProtocol.sDebugTracing) { - Log.d(TestProtocol.NO_DROP_TARGET, "3"); - } final Launcher launcher = Launcher.getLauncher(mView.getContext()); LauncherAppState app = LauncherAppState.getInstance(launcher); diff --git a/tests/shared/com/android/launcher3/testing/shared/TestProtocol.java b/tests/shared/com/android/launcher3/testing/shared/TestProtocol.java index dc835e2485..c7331b2725 100644 --- a/tests/shared/com/android/launcher3/testing/shared/TestProtocol.java +++ b/tests/shared/com/android/launcher3/testing/shared/TestProtocol.java @@ -146,12 +146,6 @@ public final class TestProtocol { public static final String REQUEST_MOCK_SENSOR_ROTATION = "mock-sensor-rotation"; 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 WORK_TAB_MISSING = "b/243688989"; diff --git a/tests/src/com/android/launcher3/celllayout/ReorderWidgets.java b/tests/src/com/android/launcher3/celllayout/ReorderWidgets.java index e8dd3c0455..243edc3c58 100644 --- a/tests/src/com/android/launcher3/celllayout/ReorderWidgets.java +++ b/tests/src/com/android/launcher3/celllayout/ReorderWidgets.java @@ -28,7 +28,6 @@ import com.android.launcher3.InvariantDeviceProfile; import com.android.launcher3.celllayout.testcases.MultipleCellLayoutsSimpleReorder; import com.android.launcher3.tapl.Widget; import com.android.launcher3.tapl.WidgetResizeFrame; -import com.android.launcher3.testing.shared.TestProtocol; import com.android.launcher3.ui.AbstractLauncherUiTest; import com.android.launcher3.ui.TaplTestsLauncher3; 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 // always be true and it wouldn't wait for the changes to be applied. resetLoaderState(); - Log.d(TestProtocol.FLAKY_BINDING, "waiting for: isWorkspaceLoading=false"); - waitForLauncherCondition("Workspace didn't finish loading", l -> { - boolean isWorkspaceLoading = l.isWorkspaceLoading(); - - Log.d(TestProtocol.FLAKY_BINDING, "checking: isWorkspaceLoading=" + isWorkspaceLoading); - - return !isWorkspaceLoading; - }); + waitForLauncherCondition("Workspace didn't finish loading", l -> !l.isWorkspaceLoading()); Widget widget = mLauncher.getWorkspace().getWidgetAtCell(mainWidgetCellPos.getCellX(), mainWidgetCellPos.getCellY()); assertNotNull(widget);