Initial draft of smart folder logging to clearcut pipeline.

* Adds additional fields to launcher_log.proto to capture smart folder related information.
* Uses ProtoLite to generate log object using builder pattern and converts to nano version before writing to clearcut. Hence not making drastic change to existing logging pattern.

Change-Id: I89b10da8d4e35e3abc7ddb553046946f91b43445
This commit is contained in:
thiruram committed 2020-02-13 13:32:21 -08:00
1 parent 421946a8e1
commit c1c2bfa7fb
6 files changed
+219 -31

No files matched your search

@@ -69,8 +69,7 @@ import java.util.UUID;
public class UserEventDispatcher implements ResourceBasedOverride {
private static final String TAG = "UserEvent";
private static final boolean IS_VERBOSE =
FeatureFlags.IS_DOGFOOD_BUILD && Utilities.isPropertyEnabled(LogConfig.USEREVENT);
private static final boolean IS_VERBOSE = Utilities.isPropertyEnabled(LogConfig.USEREVENT);
private static final String UUID_STORAGE = "uuid";
public static UserEventDispatcher newInstance(Context context,
@@ -372,6 +371,25 @@ public class UserEventDispatcher implements ResourceBasedOverride {
dispatchUserEvent(event, null);
}
/**
* Logs proto lite version of LauncherEvent object to clearcut.
*/
public void logLauncherEvent(
com.android.launcher3.userevent.LauncherLogProto.LauncherEvent launcherEvent) {
if (mPreviousHomeGesture) {
mPreviousHomeGesture = false;
}
mAppOrTaskLaunch = false;
launcherEvent.toBuilder()
.setElapsedContainerMillis(SystemClock.uptimeMillis() - mElapsedContainerMillis)
.setElapsedSessionMillis(SystemClock.uptimeMillis() - mElapsedSessionMillis).build();
if (!IS_VERBOSE) {
return;
}
Log.d(TAG, launcherEvent.toString());
}
public void logDeepShortcutsOpen(View icon) {
LogContainerProvider provider = StatsLogUtils.getLaunchProviderRecursive(icon);
if (icon == null || !(icon.getTag() instanceof ItemInfo || provider == null)) {