summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorthiruram <thiruram@google.com>2020-03-23 20:26:44 (GMT)
committerThiru Ramasamy <thiruram@google.com>2020-03-23 23:11:41 (GMT)
commited538e53b0625c874fe549c67ed612e8c3028e68 (patch)
treea629cc985566698b7b20cd14fecb19a18cd89de0
parent3b5f2224c6b21d89d1962db2bee2d85efd406918 (diff)
downloadandroid_packages_apps_Trebuchet-ed538e53b0625c874fe549c67ed612e8c3028e68.zip
android_packages_apps_Trebuchet-ed538e53b0625c874fe549c67ed612e8c3028e68.tar.gz
android_packages_apps_Trebuchet-ed538e53b0625c874fe549c67ed612e8c3028e68.tar.bz2
[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 d684eddd9f47e97931c8960e11e4434c58270150)
-rw-r--r--protos/launcher_log.proto3
-rw-r--r--src/com/android/launcher3/folder/Folder.java41
-rw-r--r--src/com/android/launcher3/logging/LoggerUtils.java2
3 files changed, 44 insertions, 2 deletions
diff --git a/protos/launcher_log.proto b/protos/launcher_log.proto
index 055ade5..fd36d4b 100644
--- a/protos/launcher_log.proto
+++ b/protos/launcher_log.proto
@@ -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 {
diff --git a/src/com/android/launcher3/folder/Folder.java b/src/com/android/launcher3/folder/Folder.java
index 0bd2c9a..f483d78 100644
--- a/src/com/android/launcher3/folder/Folder.java
+++ b/src/com/android/launcher3/folder/Folder.java
@@ -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);
+ }
}
diff --git a/src/com/android/launcher3/logging/LoggerUtils.java b/src/com/android/launcher3/logging/LoggerUtils.java
index 598792a..925b7ba 100644
--- a/src/com/android/launcher3/logging/LoggerUtils.java
+++ b/src/com/android/launcher3/logging/LoggerUtils.java
@@ -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: