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
This commit is contained in:
Samuel Fufa
2020-02-27 16:59:19 -08:00
parent 9099dfcfb7
commit a579ddc9c8
18 changed files with 241 additions and 197 deletions

View File

@@ -17,6 +17,8 @@ package com.android.launcher3.allapps;
import static android.view.View.MeasureSpec.UNSPECIFIED;
import static com.android.launcher3.logging.LoggerUtils.newContainerTarget;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Canvas;
@@ -40,6 +42,7 @@ import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType;
import com.android.launcher3.userevent.nano.LauncherLogProto.Target;
import com.android.launcher3.views.RecyclerViewFastScroller;
import java.util.ArrayList;
import java.util.List;
/**
@@ -145,12 +148,10 @@ public class AllAppsRecyclerView extends BaseRecyclerView implements LogContaine
}
@Override
public void fillInLogContainerData(View v, ItemInfo info, Target target, Target targetParent) {
if (mApps.hasFilter()) {
targetParent.containerType = ContainerType.SEARCHRESULT;
} else {
targetParent.containerType = ContainerType.ALLAPPS;
}
public void fillInLogContainerData(ItemInfo childInfo, Target child,
ArrayList<Target> parents) {
parents.add(newContainerTarget(
getApps().hasFilter() ? ContainerType.SEARCHRESULT : ContainerType.ALLAPPS));
}
public void onSearchResultsChanged() {