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
@@ -5,11 +5,13 @@ import static com.android.launcher3.userevent.nano.LauncherLogProto.ContainerTyp
import android.view.View;
import android.view.ViewParent;
import androidx.annotation.Nullable;
import com.android.launcher3.ItemInfo;
import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType;
import com.android.launcher3.userevent.nano.LauncherLogProto.Target;
import androidx.annotation.Nullable;
import java.util.ArrayList;
public class StatsLogUtils {
@@ -35,14 +37,9 @@ public class StatsLogUtils {
public interface LogContainerProvider {
/**
* Copies data from the source to the destination proto.
*
* @param v source of the data
* @param info source of the data
* @param target dest of the data
* @param targetParent dest of the data
* Populates parent container targets for an item
*/
void fillInLogContainerData(View v, ItemInfo info, Target target, Target targetParent);
void fillInLogContainerData(ItemInfo childInfo, Target child, ArrayList<Target> parents);
}
/**