Updates StatsLogManager to log LauncherAtom.ItemInfo directly.
This method is requied for logging tap on QSB with just container info. Bug: 154717227 Change-Id: I0c61c86724b4faafe4073a578b92a654ca23727a
This commit is contained in:
@@ -97,6 +97,22 @@ public class StatsLogCompatManager extends StatsLogManager {
|
||||
log(event, DEFAULT_INSTANCE_ID, info);
|
||||
}
|
||||
|
||||
/**
|
||||
* Logs an event.
|
||||
*
|
||||
* @param event an enum implementing EventEnum interface.
|
||||
* @param atomItemInfo item typically containing app or task launch related information.
|
||||
*/
|
||||
@Override
|
||||
public void log(EventEnum event, @Nullable LauncherAtom.ItemInfo atomItemInfo, int srcState,
|
||||
int dstState) {
|
||||
write(event, DEFAULT_INSTANCE_ID,
|
||||
atomItemInfo == null ? LauncherAtom.ItemInfo.getDefaultInstance() : atomItemInfo,
|
||||
null,
|
||||
srcState,
|
||||
dstState);
|
||||
}
|
||||
|
||||
/**
|
||||
* Logs an event and accompanying {@link InstanceId} and {@link LauncherAtom.ItemInfo}.
|
||||
*/
|
||||
@@ -171,7 +187,13 @@ public class StatsLogCompatManager extends StatsLogManager {
|
||||
)).build();
|
||||
}
|
||||
}
|
||||
write(event, instanceId, atomInfo, info, srcState, dstState);
|
||||
}
|
||||
|
||||
private static void write(EventEnum event, InstanceId instanceId,
|
||||
LauncherAtom.ItemInfo atomInfo,
|
||||
@Nullable ItemInfo info,
|
||||
int srcState, int dstState) {
|
||||
if (IS_VERBOSE) {
|
||||
String name = (event instanceof Enum) ? ((Enum) event).name() :
|
||||
event.getId() + "";
|
||||
|
||||
@@ -21,6 +21,7 @@ import androidx.annotation.Nullable;
|
||||
|
||||
import com.android.launcher3.LauncherState;
|
||||
import com.android.launcher3.R;
|
||||
import com.android.launcher3.logger.LauncherAtom;
|
||||
import com.android.launcher3.logging.StatsLogUtils.LogStateProvider;
|
||||
import com.android.launcher3.model.data.ItemInfo;
|
||||
import com.android.launcher3.util.ResourceBasedOverride;
|
||||
@@ -216,6 +217,16 @@ public class StatsLogManager implements ResourceBasedOverride {
|
||||
public void log(EventEnum event, @Nullable ItemInfo itemInfo) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Logs an event and accompanying {@link LauncherState}s.
|
||||
*
|
||||
* @param event an enum implementing EventEnum interface.
|
||||
* @param launcherAtomItemInfo item typically containing app or task launch related information.
|
||||
*/
|
||||
public void log(EventEnum event, @Nullable LauncherAtom.ItemInfo launcherAtomItemInfo,
|
||||
int srcState, int dstState) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Logs an event.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user