Merge "Remove unused debug logs" into udc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
8c1bffb24f
@@ -66,7 +66,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;
|
||||
@@ -1022,10 +1021,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 {
|
||||
@@ -1250,16 +1245,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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -184,13 +182,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) {
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1836,9 +1836,6 @@ public class Launcher extends StatefulActivity<LauncherState>
|
||||
}
|
||||
|
||||
private void setWorkspaceLoading(boolean value) {
|
||||
if (TestProtocol.sDebugTracing) {
|
||||
Log.d(TestProtocol.FLAKY_BINDING, "running: setWorkspaceLoading=" + value);
|
||||
}
|
||||
mWorkspaceLoading = value;
|
||||
}
|
||||
|
||||
@@ -2211,10 +2208,6 @@ public class Launcher extends StatefulActivity<LauncherState>
|
||||
|
||||
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()) {
|
||||
@@ -2235,10 +2228,6 @@ public class Launcher extends StatefulActivity<LauncherState>
|
||||
// pages being hidden in single panel.
|
||||
result.add(pairId);
|
||||
}
|
||||
if (TestProtocol.sDebugTracing) {
|
||||
Log.d(TestProtocol.NULL_INT_SET, "getPagesToBindSynchronously (2): "
|
||||
+ result);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -2260,14 +2249,11 @@ public class Launcher extends StatefulActivity<LauncherState>
|
||||
|
||||
/**
|
||||
* Refreshes the shortcuts shown on the workspace.
|
||||
*
|
||||
* <p>
|
||||
* 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.
|
||||
@@ -2452,10 +2438,6 @@ public class Launcher extends StatefulActivity<LauncherState>
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -2741,14 +2723,11 @@ public class Launcher extends StatefulActivity<LauncherState>
|
||||
|
||||
/**
|
||||
* Callback saying that there aren't any more items to bind.
|
||||
*
|
||||
* <p>
|
||||
* 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);
|
||||
|
||||
@@ -383,12 +383,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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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<T extends ActivityContext>
|
||||
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<T extends ActivityContext>
|
||||
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*/);
|
||||
}
|
||||
|
||||
@@ -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<Launcher> {
|
||||
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");
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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<LauncherAppWidgetInfo> currentAppWidgets = 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,
|
||||
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(
|
||||
() -> {
|
||||
|
||||
@@ -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, Object> 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.",
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
@@ -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<SecondaryDisplayLaun
|
||||
DraggableView originalView, int dragLayerX, int dragLayerY, DragSource source,
|
||||
ItemInfo dragInfo, Point dragOffset, Rect dragRegion, 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");
|
||||
}
|
||||
|
||||
@@ -16,13 +16,11 @@
|
||||
|
||||
package com.android.launcher3.util;
|
||||
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.View.OnAttachStateChangeListener;
|
||||
import android.view.ViewTreeObserver.OnDrawListener;
|
||||
|
||||
import com.android.launcher3.Launcher;
|
||||
import com.android.launcher3.testing.shared.TestProtocol;
|
||||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
@@ -44,9 +42,6 @@ public class ViewOnDrawExecutor implements OnDrawListener, Runnable,
|
||||
private boolean mCancelled;
|
||||
|
||||
public ViewOnDrawExecutor(RunnableList tasks) {
|
||||
if (TestProtocol.sDebugTracing) {
|
||||
Log.d(TestProtocol.FLAKY_BINDING, "Initialize ViewOnDrawExecutor");
|
||||
}
|
||||
mTasks = tasks;
|
||||
}
|
||||
|
||||
@@ -54,11 +49,6 @@ public class ViewOnDrawExecutor implements OnDrawListener, Runnable,
|
||||
mOnClearCallback = launcher::clearPendingExecutor;
|
||||
mAttachedView = launcher.getWorkspace();
|
||||
|
||||
if (TestProtocol.sDebugTracing) {
|
||||
Log.d(TestProtocol.FLAKY_BINDING, "ViewOnDrawExecutor.attachTo: launcher=" + launcher
|
||||
+ ", isAttachedToWindow=" + mAttachedView.isAttachedToWindow());
|
||||
}
|
||||
|
||||
mAttachedView.addOnAttachStateChangeListener(this);
|
||||
|
||||
if (mAttachedView.isAttachedToWindow()) {
|
||||
@@ -67,10 +57,6 @@ public class ViewOnDrawExecutor implements OnDrawListener, Runnable,
|
||||
}
|
||||
|
||||
private void attachObserver() {
|
||||
if (TestProtocol.sDebugTracing) {
|
||||
Log.d(TestProtocol.FLAKY_BINDING,
|
||||
"ViewOnDrawExecutor.attachObserver: mCompleted=" + mCompleted);
|
||||
}
|
||||
if (!mCompleted) {
|
||||
mAttachedView.getViewTreeObserver().addOnDrawListener(this);
|
||||
}
|
||||
@@ -78,9 +64,6 @@ public class ViewOnDrawExecutor implements OnDrawListener, Runnable,
|
||||
|
||||
@Override
|
||||
public void onViewAttachedToWindow(View v) {
|
||||
if (TestProtocol.sDebugTracing) {
|
||||
Log.d(TestProtocol.FLAKY_BINDING, "ViewOnDrawExecutor.onViewAttachedToWindow");
|
||||
}
|
||||
attachObserver();
|
||||
}
|
||||
|
||||
@@ -89,19 +72,11 @@ public class ViewOnDrawExecutor implements OnDrawListener, Runnable,
|
||||
|
||||
@Override
|
||||
public void onDraw() {
|
||||
if (TestProtocol.sDebugTracing) {
|
||||
Log.d(TestProtocol.FLAKY_BINDING, "ViewOnDrawExecutor.onDraw");
|
||||
}
|
||||
mFirstDrawCompleted = true;
|
||||
mAttachedView.post(this);
|
||||
}
|
||||
|
||||
public void onLoadAnimationCompleted() {
|
||||
if (TestProtocol.sDebugTracing) {
|
||||
Log.d(TestProtocol.FLAKY_BINDING,
|
||||
"ViewOnDrawExecutor.onLoadAnimationCompleted: mAttachedView != null="
|
||||
+ (mAttachedView != null));
|
||||
}
|
||||
mLoadAnimationCompleted = true;
|
||||
if (mAttachedView != null) {
|
||||
mAttachedView.post(this);
|
||||
@@ -110,12 +85,6 @@ public class ViewOnDrawExecutor implements OnDrawListener, Runnable,
|
||||
|
||||
@Override
|
||||
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.
|
||||
if (mLoadAnimationCompleted && mFirstDrawCompleted && !mCompleted) {
|
||||
markCompleted();
|
||||
@@ -126,12 +95,6 @@ public class ViewOnDrawExecutor implements OnDrawListener, Runnable,
|
||||
* Executes all tasks immediately
|
||||
*/
|
||||
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) {
|
||||
mTasks.executeAllAndDestroy();
|
||||
}
|
||||
@@ -146,9 +109,6 @@ public class ViewOnDrawExecutor implements OnDrawListener, Runnable,
|
||||
}
|
||||
|
||||
public void cancel() {
|
||||
if (TestProtocol.sDebugTracing) {
|
||||
Log.d(TestProtocol.FLAKY_BINDING, "ViewOnDrawExecutor.cancel");
|
||||
}
|
||||
mCancelled = true;
|
||||
markCompleted();
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@ import android.graphics.Paint;
|
||||
import android.graphics.Point;
|
||||
import android.graphics.Rect;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
import android.view.View.OnLongClickListener;
|
||||
@@ -136,9 +135,6 @@ public abstract class BaseWidgetSheet extends AbstractSlideInView<Launcher>
|
||||
|
||||
@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<Launcher>
|
||||
}
|
||||
|
||||
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();
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -147,12 +147,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";
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user