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

Commit ed538e53 authored by thiruram's avatar thiruram Committed by Thiru Ramasamy
Browse files

[DO NOT MERGE] Adds basic smart-folder logging.

This would allow collecting trimmed down version of smart-folder logs from QPR devices.

Change-Id: Ida332bd969774cabcfd72def5bed0e6409d6c8e1
(cherry picked from commit d684eddd)
parent 3b5f2224
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -137,7 +137,8 @@ message Action {
    AUTOMATED = 1;
    COMMAND = 2;
    TIP = 3;
    // SOFT_KEYBOARD, HARD_KEYBOARD, ASSIST
    SOFT_KEYBOARD = 4;
    // HARD_KEYBOARD, ASSIST
  }

  enum Touch {
+41 −0
Original line number Diff line number Diff line
@@ -17,6 +17,8 @@
package com.android.launcher3.folder;

import static com.android.launcher3.LauncherAnimUtils.SPRING_LOADED_EXIT_DELAY;
import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER_DESKTOP;
import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER_HOTSEAT;
import static com.android.launcher3.LauncherState.NORMAL;
import static com.android.launcher3.compat.AccessibilityManagerCompat.sendCustomAccessibilityEvent;

@@ -74,6 +76,7 @@ import com.android.launcher3.dragndrop.DragLayer;
import com.android.launcher3.dragndrop.DragOptions;
import com.android.launcher3.logging.LoggerUtils;
import com.android.launcher3.pageindicators.PageIndicatorDots;
import com.android.launcher3.userevent.nano.LauncherLogProto;
import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Direction;
import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Touch;
import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType;
@@ -1340,6 +1343,9 @@ public class Folder extends AbstractFloatingView implements ClipPathView, DragSo
            if (hasFocus) {
                startEditingFolderName();
            } else {
                if (isEditingName()) {
                    logEditFolderLabel();
                }
                mFolderName.dispatchBackKey();
            }
        }
@@ -1517,4 +1523,39 @@ public class Folder extends AbstractFloatingView implements ClipPathView, DragSo
            super.draw(canvas);
        }
    }

    private void logEditFolderLabel() {
        LauncherLogProto.LauncherEvent ev = new LauncherLogProto.LauncherEvent();
        LauncherLogProto.Action action = new LauncherLogProto.Action();
        action.type = LauncherLogProto.Action.Type.SOFT_KEYBOARD;
        ev.action = action;

        LauncherLogProto.Target edittext_target = new LauncherLogProto.Target();
        edittext_target.type = LauncherLogProto.Target.Type.ITEM;
        edittext_target.itemType = LauncherLogProto.ItemType.EDITTEXT;

        LauncherLogProto.Target folder_target = new LauncherLogProto.Target();
        folder_target.type = LauncherLogProto.Target.Type.CONTAINER;
        folder_target.containerType = LauncherLogProto.ContainerType.FOLDER;
        folder_target.pageIndex = mInfo.screenId;
        folder_target.gridX = mInfo.cellX;
        folder_target.gridY = mInfo.cellY;
        folder_target.cardinality = mInfo.contents.size();

        LauncherLogProto.Target parent_target = new LauncherLogProto.Target();
        parent_target.type = LauncherLogProto.Target.Type.CONTAINER;
        switch (mInfo.container) {
            case CONTAINER_HOTSEAT:
                parent_target.containerType = LauncherLogProto.ContainerType.HOTSEAT;
                break;
            case CONTAINER_DESKTOP:
                parent_target.containerType = LauncherLogProto.ContainerType.WORKSPACE;
                break;
            default:
                Log.e(TAG, String.format("Expected container to be either %s or %s but found %s.",
                        CONTAINER_HOTSEAT, CONTAINER_DESKTOP, mInfo.container));
        }
        ev.srcTarget = new LauncherLogProto.Target[]{edittext_target, folder_target, parent_target};
        mLauncher.getUserEventDispatcher().dispatchUserEvent(ev, null);
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -109,7 +109,7 @@ public class LoggerUtils {
                        t.containerType == NAVBAR) {
                    str += " id=" + t.pageIndex;
                } else if (t.containerType == ContainerType.FOLDER) {
                    str += " grid(" + t.gridX + "," + t.gridY + ")";
                    str += "[PageIndex=" + t.pageIndex + ", grid(" + t.gridX + "," + t.gridY + ")]";
                }
                break;
            default: