From 6707ddd016e416dbe071b7a0822b649ab120381c Mon Sep 17 00:00:00 2001 From: fbaron Date: Wed, 23 Aug 2023 12:11:41 -0700 Subject: [PATCH] Add logs around hotseat suggested apps Bug: 295892343 Test: n/a Flag: no flag Change-Id: Id6f464c8614317f58f6886734ad1f9b9709d6aa3 --- .../HotseatPredictionController.java | 15 +++++++++++++++ .../launcher3/uioverrides/QuickstepLauncher.java | 5 +++++ .../android/launcher3/WorkspaceLayoutManager.java | 1 + 3 files changed, 21 insertions(+) diff --git a/quickstep/src/com/android/launcher3/hybridhotseat/HotseatPredictionController.java b/quickstep/src/com/android/launcher3/hybridhotseat/HotseatPredictionController.java index 619bef21b3..87a9ecb9f1 100644 --- a/quickstep/src/com/android/launcher3/hybridhotseat/HotseatPredictionController.java +++ b/quickstep/src/com/android/launcher3/hybridhotseat/HotseatPredictionController.java @@ -27,6 +27,7 @@ import android.animation.Animator; import android.animation.AnimatorSet; import android.animation.ObjectAnimator; import android.content.ComponentName; +import android.util.Log; import android.view.HapticFeedbackConstants; import android.view.View; import android.view.ViewGroup; @@ -74,6 +75,7 @@ public class HotseatPredictionController implements DragController.DragListener, SystemShortcut.Factory, DeviceProfile.OnDeviceProfileChangeListener, DragSource, ViewGroup.OnHierarchyChangeListener { + private static final String TAG = "HotseatPredictionController"; private static final int FLAG_UPDATE_PAUSED = 1 << 0; private static final int FLAG_DRAG_IN_PROGRESS = 1 << 1; private static final int FLAG_FILL_IN_PROGRESS = 1 << 2; @@ -183,6 +185,7 @@ public class HotseatPredictionController implements DragController.DragListener, } private void fillGapsWithPrediction(boolean animate) { + Log.d(TAG, "fillGapsWithPrediction"); if (mPauseFlags != 0) { return; } @@ -207,12 +210,16 @@ public class HotseatPredictionController implements DragController.DragListener, View child = mHotseat.getChildAt( mHotseat.getCellXFromOrder(rank), mHotseat.getCellYFromOrder(rank)); + Log.d(TAG, "Hotseat app child is: " + child + " and isPredictedIcon() evaluates to" + + ": " + isPredictedIcon(child)); if (child != null && !isPredictedIcon(child)) { continue; } if (mPredictedItems.size() <= predictionIndex) { // Remove predicted apps from the past + Log.d(TAG, "Remove predicted apps from the past\nPrediction Index: " + + predictionIndex); if (isPredictedIcon(child)) { mHotseat.removeView(child); } @@ -220,6 +227,11 @@ public class HotseatPredictionController implements DragController.DragListener, } WorkspaceItemInfo predictedItem = (WorkspaceItemInfo) mPredictedItems.get(predictionIndex++); + Log.d(TAG, "Predicted item is: " + predictedItem); + if (child != null) { + Log.d(TAG, "Predicted item is enabled: " + child.isEnabled()); + } + if (isPredictedIcon(child) && child.isEnabled()) { PredictedAppIcon icon = (PredictedAppIcon) child; boolean animateIconChange = icon.shouldAnimateIconChange(predictedItem); @@ -239,6 +251,7 @@ public class HotseatPredictionController implements DragController.DragListener, } private void bindItems(List itemsToAdd, boolean animate) { + Log.d(TAG, "bindItems to hotseat: " + itemsToAdd); AnimatorSet animationSet = new AnimatorSet(); for (WorkspaceItemInfo item : itemsToAdd) { PredictedAppIcon icon = PredictedAppIcon.createIcon(mHotseat, item); @@ -292,8 +305,10 @@ public class HotseatPredictionController implements DragController.DragListener, public void setPredictedItems(FixedContainerItems items) { mPredictedItems = new ArrayList(items.items); if (mPredictedItems.isEmpty()) { + Log.d(TAG, "Predicted items is initially empty"); HotseatRestoreHelper.restoreBackup(mLauncher); } + Log.d(TAG, "Predicted items: " + mPredictedItems); fillGapsWithPrediction(); } diff --git a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java index d74a13b40f..9f255253b2 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java +++ b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java @@ -77,6 +77,7 @@ import android.os.Bundle; import android.os.IBinder; import android.os.SystemProperties; import android.os.Trace; +import android.util.Log; import android.view.Display; import android.view.HapticFeedbackConstants; import android.view.View; @@ -198,6 +199,8 @@ public class QuickstepLauncher extends Launcher { private static final String TRACE_RELAYOUT_CLASS = SystemProperties.get("persist.debug.trace_request_layout_class", null); + private static final String TAG = "QuickstepLauncher"; + public static final boolean GO_LOW_RAM_RECENTS_ENABLED = false; protected static final String RING_APPEAR_ANIMATION_PREFIX = "RingAppearAnimation\t"; @@ -442,6 +445,7 @@ public class QuickstepLauncher extends Launcher { @Override public void bindExtraContainerItems(FixedContainerItems item) { + Log.d(TAG, "Bind extra container items"); if (item.containerId == Favorites.CONTAINER_PREDICTION) { mAllAppsPredictions = item; PredictionRowView predictionRowView = @@ -449,6 +453,7 @@ public class QuickstepLauncher extends Launcher { PredictionRowView.class); predictionRowView.setPredictedApps(item.items); } else if (item.containerId == Favorites.CONTAINER_HOTSEAT_PREDICTION) { + Log.d(TAG, "Bind extra container item is hotseat prediction"); mHotseatPredictionController.setPredictedItems(item); } else if (item.containerId == Favorites.CONTAINER_WIDGETS_PREDICTION) { getPopupDataProvider().setRecommendedWidgets(item.items); diff --git a/src/com/android/launcher3/WorkspaceLayoutManager.java b/src/com/android/launcher3/WorkspaceLayoutManager.java index 4768773813..c6c38fcddb 100644 --- a/src/com/android/launcher3/WorkspaceLayoutManager.java +++ b/src/com/android/launcher3/WorkspaceLayoutManager.java @@ -55,6 +55,7 @@ public interface WorkspaceLayoutManager { int y = presenterPos.cellY; if (info.container == LauncherSettings.Favorites.CONTAINER_HOTSEAT || info.container == LauncherSettings.Favorites.CONTAINER_HOTSEAT_PREDICTION) { + Log.d(TAG, "add predicted icon " + child.getTag().toString() + " to home screen"); int screenId = presenterPos.screenId; x = getHotseat().getCellXFromOrder(screenId); y = getHotseat().getCellYFromOrder(screenId);