Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6707ddd0 authored by fbaron's avatar fbaron
Browse files

Add logs around hotseat suggested apps

Bug: 295892343
Test: n/a
Flag: no flag
Change-Id: Id6f464c8614317f58f6886734ad1f9b9709d6aa3
parent 72731c4b
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -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<QuickstepLauncher>, 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<WorkspaceItemInfo> 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();
    }

+5 −0
Original line number Diff line number Diff line
@@ -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);
+1 −0
Original line number Diff line number Diff line
@@ -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);