[DMA] Add withFeature API in StatsLogManager.
Bug: 297405016 Test: manual Flag: ENABLE_OSE_CUSTOMIZATIONS Change-Id: I4b36f7ce98ad0370bc1e73f60d8d7f98a50e1ea3
This commit is contained in:
@@ -224,6 +224,7 @@ public class StatsLogCompatManager extends StatsLogManager {
|
||||
private LauncherAtom.Slice mSlice;
|
||||
private Optional<Integer> mCardinality = Optional.empty();
|
||||
private int mInputType = SysUiStatsLog.LAUNCHER_UICHANGED__INPUT_TYPE__UNKNOWN;
|
||||
private Optional<Integer> mFeatures = Optional.empty();
|
||||
|
||||
StatsCompatLogger(Context context, ActivityContext activityContext) {
|
||||
mContext = context;
|
||||
@@ -322,6 +323,12 @@ public class StatsLogCompatManager extends StatsLogManager {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StatsLogger withFeatures(int feature) {
|
||||
this.mFeatures = Optional.of(feature);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void log(EventEnum event) {
|
||||
if (!Utilities.ATLEAST_R) {
|
||||
@@ -451,6 +458,7 @@ public class StatsLogCompatManager extends StatsLogManager {
|
||||
return;
|
||||
}
|
||||
int cardinality = mCardinality.orElseGet(() -> getCardinality(atomInfo));
|
||||
int features = mFeatures.orElseGet(() -> getFeatures(atomInfo));
|
||||
SysUiStatsLog.write(
|
||||
SysUiStatsLog.LAUNCHER_EVENT,
|
||||
SysUiStatsLog.LAUNCHER_UICHANGED__ACTION__DEFAULT_ACTION /* deprecated */,
|
||||
@@ -477,7 +485,7 @@ public class StatsLogCompatManager extends StatsLogManager {
|
||||
atomInfo.getFolderIcon().getToLabelState().getNumber() /* toState */,
|
||||
atomInfo.getFolderIcon().getLabelInfo() /* edittext */,
|
||||
cardinality /* cardinality */,
|
||||
getFeatures(atomInfo) /* features */,
|
||||
features /* features */,
|
||||
getSearchAttributes(atomInfo) /* searchAttributes */,
|
||||
getAttributes(atomInfo) /* attributes */,
|
||||
inputType /* input_type */
|
||||
|
||||
@@ -834,6 +834,13 @@ public class StatsLogManager implements ResourceBasedOverride {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the features of the log message.
|
||||
*/
|
||||
default StatsLogger withFeatures(int feature) {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the final message and logs it as {@link EventEnum}.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user