Refactor logging to capture Target hierarchy
Instead of creating a fixed number of targets, we now pass an ArrayList
of targets to. Any class implementing
LogContainerProviders#fillInLogContainerData can setup it's own target
and add it to the ArrayList, It can also pass the ArrayList to other
LogContainerProvider to capture full Target hierarchy.
Bug: 147305863
Change-Id: I0063c692120fb9e1cff2d8902c5da972d0623418
diff --git a/src/com/android/launcher3/Hotseat.java b/src/com/android/launcher3/Hotseat.java
index b89e727..76cfe1c 100644
--- a/src/com/android/launcher3/Hotseat.java
+++ b/src/com/android/launcher3/Hotseat.java
@@ -16,12 +16,13 @@
package com.android.launcher3;
+import static com.android.launcher3.logging.LoggerUtils.newContainerTarget;
+
import android.content.Context;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.view.Gravity;
import android.view.MotionEvent;
-import android.view.View;
import android.view.ViewDebug;
import android.view.ViewGroup;
import android.widget.FrameLayout;
@@ -32,6 +33,8 @@
import com.android.launcher3.userevent.nano.LauncherLogProto.Target;
import com.android.launcher3.views.Transposable;
+import java.util.ArrayList;
+
public class Hotseat extends CellLayout implements LogContainerProvider, Insettable, Transposable {
@ViewDebug.ExportedProperty(category = "launcher")
@@ -75,10 +78,12 @@
}
@Override
- public void fillInLogContainerData(View v, ItemInfo info, Target target, Target targetParent) {
- target.gridX = info.cellX;
- target.gridY = info.cellY;
- targetParent.containerType = LauncherLogProto.ContainerType.HOTSEAT;
+ public void fillInLogContainerData(ItemInfo childInfo, Target child,
+ ArrayList<Target> parents) {
+ child.rank = childInfo.rank;
+ child.gridX = childInfo.cellX;
+ child.gridY = childInfo.cellY;
+ parents.add(newContainerTarget(LauncherLogProto.ContainerType.HOTSEAT));
}
@Override