Merge "[OneSearch] Add packageId as an int for latency logging." into tm-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
f0758df1b8
@@ -442,6 +442,7 @@ public class StatsLogCompatManager extends StatsLogManager {
|
||||
private final Optional<ActivityContext> mActivityContext;
|
||||
private InstanceId mInstanceId = DEFAULT_INSTANCE_ID;
|
||||
private LatencyType mType = LatencyType.UNKNOWN;
|
||||
private int mPackageId = 0;
|
||||
private long mLatencyInMillis;
|
||||
|
||||
StatsCompatLatencyLogger(Context context, ActivityContext activityContext) {
|
||||
@@ -461,6 +462,12 @@ public class StatsLogCompatManager extends StatsLogManager {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StatsLatencyLogger withPackageId(int packageId) {
|
||||
this.mPackageId = packageId;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StatsLatencyLogger withLatency(long latencyInMillis) {
|
||||
this.mLatencyInMillis = latencyInMillis;
|
||||
@@ -482,7 +489,7 @@ public class StatsLogCompatManager extends StatsLogManager {
|
||||
SysUiStatsLog.write(SysUiStatsLog.LAUNCHER_LATENCY,
|
||||
event.getId(), // event_id
|
||||
mInstanceId.getId(), // instance_id
|
||||
0, // package_id
|
||||
mPackageId, // package_id
|
||||
mLatencyInMillis, // latency_in_millis
|
||||
mType.getId() //type
|
||||
);
|
||||
|
||||
@@ -705,6 +705,12 @@ public class StatsLogManager implements ResourceBasedOverride {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets packageId of log message.
|
||||
*/
|
||||
default StatsLatencyLogger withPackageId(int packageId) {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the final message and logs it as {@link EventEnum}.
|
||||
|
||||
Reference in New Issue
Block a user