Add method to set start source info from launcher

Bug: 166614700
Test: Enable statsd log: "adb shell cmd stats print-logs"
      Launch app from launcher check logcat ((48)0x10000).
Change-Id: Ifc944c5ae9f33147eb7e8768d3e6d1548d20a95a
This commit is contained in:
Riddle Hsu
2020-09-22 18:40:40 +08:00
parent 1e64ab97a1
commit 80f83cc288

View File

@@ -86,4 +86,12 @@ public abstract class ActivityOptionsCompat {
opts.setFreezeRecentTasksReordering();
return opts;
}
/**
* Sets the launch event time from launcher.
*/
public static ActivityOptions setLauncherSourceInfo(ActivityOptions opts, long uptimeMillis) {
opts.setSourceInfo(ActivityOptions.SourceInfo.TYPE_LAUNCHER, uptimeMillis);
return opts;
}
}