Merge "Deprecates LAUNCHER_ALL_APPS_RANKED event." into ub-launcher3-rvc-dev am: e49de265da
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/11889123 Change-Id: I52a9e7fa51257d1a1b02e96a00675a4afda6a291
This commit is contained in:
commit
a2339c5f51
|
@ -16,9 +16,11 @@
|
|||
|
||||
package com.android.launcher3.appprediction;
|
||||
|
||||
import static com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_APPLICATION;
|
||||
import static com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT;
|
||||
import static com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT;
|
||||
import static com.android.launcher3.LauncherState.BACKGROUND_APP;
|
||||
import static com.android.launcher3.LauncherState.OVERVIEW;
|
||||
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ALL_APPS_RANKED;
|
||||
|
||||
import android.app.prediction.AppPredictor;
|
||||
import android.app.prediction.AppTarget;
|
||||
|
@ -26,6 +28,7 @@ import android.content.ComponentName;
|
|||
import android.content.Context;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.android.launcher3.InvariantDeviceProfile;
|
||||
import com.android.launcher3.InvariantDeviceProfile.OnIDPChangeListener;
|
||||
|
@ -38,8 +41,6 @@ import com.android.launcher3.allapps.AllAppsContainerView;
|
|||
import com.android.launcher3.allapps.AllAppsStore.OnUpdateListener;
|
||||
import com.android.launcher3.hybridhotseat.HotseatPredictionController;
|
||||
import com.android.launcher3.icons.IconCache.ItemInfoUpdateReceiver;
|
||||
import com.android.launcher3.logger.LauncherAtom;
|
||||
import com.android.launcher3.logging.InstanceId;
|
||||
import com.android.launcher3.model.data.ItemInfo;
|
||||
import com.android.launcher3.model.data.ItemInfoWithIcon;
|
||||
import com.android.launcher3.shortcuts.ShortcutKey;
|
||||
|
@ -51,6 +52,7 @@ import com.android.launcher3.util.MainThreadInitializedObject;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.OptionalInt;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
|
@ -306,40 +308,25 @@ public class PredictionUiStateManager implements StateListener<LauncherState>,
|
|||
}
|
||||
|
||||
/**
|
||||
* Logs ranking info for launched app within all apps prediction.
|
||||
* Returns ranking info for the app within all apps prediction.
|
||||
* Only applicable when {@link ItemInfo#itemType} is one of the followings:
|
||||
* {@link LauncherSettings.Favorites#ITEM_TYPE_APPLICATION},
|
||||
* {@link LauncherSettings.Favorites#ITEM_TYPE_SHORTCUT},
|
||||
* {@link LauncherSettings.Favorites#ITEM_TYPE_DEEP_SHORTCUT}
|
||||
*/
|
||||
public void logLaunchedAppRankingInfo(@NonNull ItemInfo itemInfo, InstanceId instanceId) {
|
||||
if (itemInfo.getTargetComponent() == null || itemInfo.user == null
|
||||
|| (itemInfo.itemType != LauncherSettings.Favorites.ITEM_TYPE_APPLICATION
|
||||
&& itemInfo.itemType != LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT
|
||||
&& itemInfo.itemType != LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT)) {
|
||||
return;
|
||||
}
|
||||
public OptionalInt getAllAppsRank(@Nullable ItemInfo itemInfo) {
|
||||
Optional<ComponentKey> componentKey = Optional.ofNullable(itemInfo)
|
||||
.filter(item -> item.itemType == ITEM_TYPE_APPLICATION
|
||||
|| item.itemType == ITEM_TYPE_SHORTCUT
|
||||
|| item.itemType == ITEM_TYPE_DEEP_SHORTCUT)
|
||||
.map(ItemInfo::getTargetComponent)
|
||||
.map(componentName -> new ComponentKey(componentName, itemInfo.user));
|
||||
|
||||
Launcher launcher = Launcher.getLauncher(mAppsView.getContext());
|
||||
final ComponentKey k = new ComponentKey(itemInfo.getTargetComponent(), itemInfo.user);
|
||||
final List<ComponentKeyMapper> predictedApps = getCurrentState().apps;
|
||||
OptionalInt rank = IntStream.range(0, predictedApps.size())
|
||||
.filter((i) -> k.equals(predictedApps.get(i).getComponentKey()))
|
||||
.findFirst();
|
||||
if (!rank.isPresent()) {
|
||||
return;
|
||||
}
|
||||
|
||||
LauncherAtom.ItemInfo.Builder atomBuilder = LauncherAtom.ItemInfo.newBuilder();
|
||||
atomBuilder.setRank(rank.getAsInt());
|
||||
atomBuilder.setContainerInfo(
|
||||
LauncherAtom.ContainerInfo.newBuilder().setPredictionContainer(
|
||||
LauncherAtom.PredictionContainer.newBuilder().build()).build());
|
||||
launcher.getStatsLogManager().log(LAUNCHER_ALL_APPS_RANKED, instanceId,
|
||||
atomBuilder.build());
|
||||
return componentKey.map(key -> IntStream.range(0, getCurrentState().apps.size())
|
||||
.filter(index -> key.equals(getCurrentState().apps.get(index).getComponentKey()))
|
||||
.findFirst()).orElseGet(OptionalInt::empty);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Fill in predicted_rank field based on app prediction.
|
||||
* Only applicable when {@link ItemInfo#itemType} is one of the followings:
|
||||
|
|
|
@ -53,7 +53,8 @@ import com.android.launcher3.appprediction.DynamicItemCache;
|
|||
import com.android.launcher3.dragndrop.DragController;
|
||||
import com.android.launcher3.dragndrop.DragOptions;
|
||||
import com.android.launcher3.icons.IconCache;
|
||||
import com.android.launcher3.logger.LauncherAtom;
|
||||
import com.android.launcher3.logger.LauncherAtom.ContainerInfo;
|
||||
import com.android.launcher3.logger.LauncherAtom.PredictedHotseatContainer;
|
||||
import com.android.launcher3.logging.InstanceId;
|
||||
import com.android.launcher3.model.data.AppInfo;
|
||||
import com.android.launcher3.model.data.FolderInfo;
|
||||
|
@ -659,24 +660,25 @@ public class HotseatPredictionController implements DragController.DragListener,
|
|||
if (!rank.isPresent()) {
|
||||
return;
|
||||
}
|
||||
LauncherAtom.PredictedHotseatContainer.Builder containerBuilder =
|
||||
LauncherAtom.PredictedHotseatContainer.newBuilder();
|
||||
LauncherAtom.ItemInfo.Builder atomBuilder = LauncherAtom.ItemInfo.newBuilder();
|
||||
|
||||
int cardinality = 0;
|
||||
for (PredictedAppIcon icon : getPredictedIcons()) {
|
||||
ItemInfo info = (ItemInfo) icon.getTag();
|
||||
cardinality |= 1 << info.screenId;
|
||||
}
|
||||
|
||||
PredictedHotseatContainer.Builder containerBuilder = PredictedHotseatContainer.newBuilder();
|
||||
containerBuilder.setCardinality(cardinality);
|
||||
atomBuilder.setRank(rank.getAsInt());
|
||||
if (itemInfo.container == LauncherSettings.Favorites.CONTAINER_HOTSEAT_PREDICTION) {
|
||||
containerBuilder.setIndex(rank.getAsInt());
|
||||
}
|
||||
atomBuilder.setContainerInfo(
|
||||
LauncherAtom.ContainerInfo.newBuilder().setPredictedHotseatContainer(
|
||||
containerBuilder).build());
|
||||
mLauncher.getStatsLogManager().log(LAUNCHER_HOTSEAT_RANKED, instanceId,
|
||||
atomBuilder.build());
|
||||
mLauncher.getStatsLogManager().logger()
|
||||
.withInstanceId(instanceId)
|
||||
.withRank(rank.getAsInt())
|
||||
.withContainerInfo(ContainerInfo.newBuilder()
|
||||
.setPredictedHotseatContainer(containerBuilder)
|
||||
.build())
|
||||
.log(LAUNCHER_HOTSEAT_RANKED);
|
||||
}
|
||||
|
||||
private class PinPrediction extends SystemShortcut<QuickstepLauncher> {
|
||||
|
|
|
@ -21,6 +21,7 @@ import static com.android.launcher3.LauncherState.NORMAL;
|
|||
import static com.android.launcher3.LauncherState.OVERVIEW;
|
||||
import static com.android.launcher3.LauncherState.OVERVIEW_MODAL_TASK;
|
||||
import static com.android.launcher3.compat.AccessibilityManagerCompat.sendCustomAccessibilityEvent;
|
||||
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_APP_LAUNCH_TAP;
|
||||
import static com.android.launcher3.testing.TestProtocol.HINT_STATE_ORDINAL;
|
||||
import static com.android.launcher3.testing.TestProtocol.OVERVIEW_STATE_ORDINAL;
|
||||
import static com.android.launcher3.testing.TestProtocol.QUICK_SWITCH_STATE_ORDINAL;
|
||||
|
@ -48,6 +49,7 @@ import com.android.launcher3.folder.Folder;
|
|||
import com.android.launcher3.hybridhotseat.HotseatEduController;
|
||||
import com.android.launcher3.hybridhotseat.HotseatPredictionController;
|
||||
import com.android.launcher3.logging.InstanceId;
|
||||
import com.android.launcher3.logging.StatsLogManager.StatsLogger;
|
||||
import com.android.launcher3.model.data.AppInfo;
|
||||
import com.android.launcher3.model.data.ItemInfo;
|
||||
import com.android.launcher3.model.data.WorkspaceItemInfo;
|
||||
|
@ -80,6 +82,7 @@ import java.io.FileDescriptor;
|
|||
import java.io.PrintWriter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.OptionalInt;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
public class QuickstepLauncher extends BaseQuickstepLauncher {
|
||||
|
@ -123,11 +126,15 @@ public class QuickstepLauncher extends BaseQuickstepLauncher {
|
|||
|
||||
@Override
|
||||
protected void logAppLaunch(ItemInfo info, InstanceId instanceId) {
|
||||
super.logAppLaunch(info, instanceId);
|
||||
StatsLogger logger = getStatsLogManager()
|
||||
.logger().withItemInfo(info).withInstanceId(instanceId);
|
||||
OptionalInt allAppsRank = PredictionUiStateManager.INSTANCE.get(this).getAllAppsRank(info);
|
||||
allAppsRank.ifPresent(logger::withRank);
|
||||
logger.log(LAUNCHER_APP_LAUNCH_TAP);
|
||||
|
||||
if (mHotseatPredictionController != null) {
|
||||
mHotseatPredictionController.logLaunchedAppRankingInfo(info, instanceId);
|
||||
}
|
||||
PredictionUiStateManager.INSTANCE.get(this).logLaunchedAppRankingInfo(info, instanceId);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -33,6 +33,7 @@ import androidx.annotation.Nullable;
|
|||
import com.android.launcher3.LauncherAppState;
|
||||
import com.android.launcher3.Utilities;
|
||||
import com.android.launcher3.logger.LauncherAtom;
|
||||
import com.android.launcher3.logger.LauncherAtom.ContainerInfo;
|
||||
import com.android.launcher3.logging.InstanceId;
|
||||
import com.android.launcher3.logging.InstanceIdSequence;
|
||||
import com.android.launcher3.logging.StatsLogManager;
|
||||
|
@ -48,6 +49,7 @@ import com.android.launcher3.util.LogConfig;
|
|||
import com.android.systemui.shared.system.SysUiStatsLog;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Optional;
|
||||
import java.util.OptionalInt;
|
||||
|
||||
/**
|
||||
|
@ -80,38 +82,6 @@ public class StatsLogCompatManager extends StatsLogManager {
|
|||
return new StatsCompatLogger();
|
||||
}
|
||||
|
||||
/**
|
||||
* Logs an event.
|
||||
*
|
||||
* @param event an enum implementing EventEnum interface.
|
||||
* @param atomInfo item typically containing app or task launch related information.
|
||||
*/
|
||||
public void log(EventEnum event, InstanceId instanceId, LauncherAtom.ItemInfo atomInfo) {
|
||||
LauncherAppState.getInstance(sContext).getModel().enqueueModelUpdateTask(
|
||||
new BaseModelUpdateTask() {
|
||||
@Override
|
||||
public void execute(LauncherAppState app, BgDataModel dataModel,
|
||||
AllAppsList apps) {
|
||||
write(event, instanceId, atomInfo, LAUNCHER_UICHANGED__DST_STATE__HOME,
|
||||
LAUNCHER_UICHANGED__DST_STATE__BACKGROUND, OptionalInt.empty());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 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,
|
||||
srcState, dstState, OptionalInt.empty());
|
||||
}
|
||||
|
||||
/**
|
||||
* Logs a ranking event and accompanying {@link InstanceId} and package name.
|
||||
*/
|
||||
|
@ -125,49 +95,6 @@ public class StatsLogCompatManager extends StatsLogManager {
|
|||
position /* position_picked = 4; */);
|
||||
}
|
||||
|
||||
private void write(EventEnum event, InstanceId instanceId,
|
||||
LauncherAtom.ItemInfo atomInfo,
|
||||
int srcState, int dstState, OptionalInt mRank) {
|
||||
if (IS_VERBOSE) {
|
||||
String name = (event instanceof Enum) ? ((Enum) event).name() :
|
||||
event.getId() + "";
|
||||
|
||||
Log.d(TAG, instanceId == DEFAULT_INSTANCE_ID
|
||||
? String.format("\n%s (State:%s->%s)\n%s", name, getStateString(srcState),
|
||||
getStateString(dstState), atomInfo)
|
||||
: String.format("\n%s (State:%s->%s) (InstanceId:%s)\n%s", name,
|
||||
getStateString(srcState), getStateString(dstState), instanceId,
|
||||
atomInfo));
|
||||
}
|
||||
|
||||
SysUiStatsLog.write(
|
||||
SysUiStatsLog.LAUNCHER_EVENT,
|
||||
SysUiStatsLog.LAUNCHER_UICHANGED__ACTION__DEFAULT_ACTION /* deprecated */,
|
||||
srcState,
|
||||
dstState,
|
||||
null /* launcher extensions, deprecated */,
|
||||
false /* quickstep_enabled, deprecated */,
|
||||
event.getId() /* event_id */,
|
||||
atomInfo.getItemCase().getNumber() /* target_id */,
|
||||
instanceId.getId() /* instance_id TODO */,
|
||||
0 /* uid TODO */,
|
||||
getPackageName(atomInfo) /* package_name */,
|
||||
getComponentName(atomInfo) /* component_name */,
|
||||
getGridX(atomInfo, false) /* grid_x */,
|
||||
getGridY(atomInfo, false) /* grid_y */,
|
||||
getPageId(atomInfo, false) /* page_id */,
|
||||
getGridX(atomInfo, true) /* grid_x_parent */,
|
||||
getGridY(atomInfo, true) /* grid_y_parent */,
|
||||
getPageId(atomInfo, true) /* page_id_parent */,
|
||||
getHierarchy(atomInfo) /* hierarchy */,
|
||||
atomInfo.getIsWork() /* is_work_profile */,
|
||||
mRank.orElse(atomInfo.getRank()) /* rank */,
|
||||
atomInfo.getFolderIcon().getFromLabelState().getNumber() /* fromState */,
|
||||
atomInfo.getFolderIcon().getToLabelState().getNumber() /* toState */,
|
||||
atomInfo.getFolderIcon().getLabelInfo() /* edittext */,
|
||||
getCardinality(atomInfo) /* cardinality */);
|
||||
}
|
||||
|
||||
/**
|
||||
* Logs the workspace layout information on the model thread.
|
||||
*/
|
||||
|
@ -238,15 +165,22 @@ public class StatsLogCompatManager extends StatsLogManager {
|
|||
/**
|
||||
* Helps to construct and write statsd compatible log message.
|
||||
*/
|
||||
private class StatsCompatLogger implements StatsLogger {
|
||||
private ItemInfo mItemInfo = new ItemInfo();
|
||||
private static class StatsCompatLogger implements StatsLogger {
|
||||
|
||||
private static final ItemInfo DEFAULT_ITEM_INFO = new ItemInfo();
|
||||
private ItemInfo mItemInfo = DEFAULT_ITEM_INFO;
|
||||
private InstanceId mInstanceId = DEFAULT_INSTANCE_ID;
|
||||
private OptionalInt mRank = OptionalInt.empty();
|
||||
private Optional<ContainerInfo> mContainerInfo = Optional.empty();
|
||||
private int mSrcState = LAUNCHER_UICHANGED__SRC_STATE__HOME;
|
||||
private int mDstState = LAUNCHER_UICHANGED__DST_STATE__BACKGROUND;
|
||||
|
||||
@Override
|
||||
public StatsLogger withItemInfo(ItemInfo itemInfo) {
|
||||
if (mContainerInfo.isPresent()) {
|
||||
throw new IllegalArgumentException(
|
||||
"ItemInfo and ContainerInfo are mutual exclusive; cannot log both.");
|
||||
}
|
||||
this.mItemInfo = itemInfo;
|
||||
return this;
|
||||
}
|
||||
|
@ -275,15 +209,36 @@ public class StatsLogCompatManager extends StatsLogManager {
|
|||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StatsLogger withContainerInfo(ContainerInfo containerInfo) {
|
||||
if (mItemInfo != DEFAULT_ITEM_INFO) {
|
||||
throw new IllegalArgumentException(
|
||||
"ItemInfo and ContainerInfo are mutual exclusive; cannot log both.");
|
||||
}
|
||||
this.mContainerInfo = Optional.of(containerInfo);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void log(EventEnum event) {
|
||||
if (!Utilities.ATLEAST_R) {
|
||||
return;
|
||||
}
|
||||
|
||||
LauncherAtom.ItemInfo.Builder itemInfoBuilder =
|
||||
(LauncherAtom.ItemInfo.Builder) mItemInfo.buildProto().toBuilder();
|
||||
mRank.ifPresent(itemInfoBuilder::setRank);
|
||||
if (mContainerInfo.isPresent()) {
|
||||
// User already provided container info;
|
||||
// default container info from item info will be ignored.
|
||||
itemInfoBuilder.setContainerInfo(mContainerInfo.get());
|
||||
write(event, mInstanceId, itemInfoBuilder.build(), mSrcState, mDstState);
|
||||
return;
|
||||
}
|
||||
|
||||
if (mItemInfo.container < 0) {
|
||||
// Item is not within a folder. Write to StatsLog in same thread.
|
||||
write(event, mInstanceId, mItemInfo.buildProto(), mSrcState, mDstState, mRank);
|
||||
write(event, mInstanceId, itemInfoBuilder.build(), mSrcState, mDstState);
|
||||
} else {
|
||||
// Item is inside the folder, fetch folder info in a BG thread
|
||||
// and then write to StatsLog.
|
||||
|
@ -293,12 +248,58 @@ public class StatsLogCompatManager extends StatsLogManager {
|
|||
public void execute(LauncherAppState app, BgDataModel dataModel,
|
||||
AllAppsList apps) {
|
||||
FolderInfo folderInfo = dataModel.folders.get(mItemInfo.container);
|
||||
write(event, mInstanceId, mItemInfo.buildProto(folderInfo),
|
||||
mSrcState, mDstState, mRank);
|
||||
LauncherAtom.ItemInfo.Builder atomInfoBuilder =
|
||||
(LauncherAtom.ItemInfo.Builder) mItemInfo
|
||||
.buildProto(folderInfo).toBuilder();
|
||||
mRank.ifPresent(atomInfoBuilder::setRank);
|
||||
write(event, mInstanceId, atomInfoBuilder.build(), mSrcState,
|
||||
mDstState);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void write(EventEnum event, InstanceId instanceId, LauncherAtom.ItemInfo atomInfo,
|
||||
int srcState, int dstState) {
|
||||
if (IS_VERBOSE) {
|
||||
String name = (event instanceof Enum) ? ((Enum) event).name() :
|
||||
event.getId() + "";
|
||||
|
||||
Log.d(TAG, instanceId == DEFAULT_INSTANCE_ID
|
||||
? String.format("\n%s (State:%s->%s)\n%s", name, getStateString(srcState),
|
||||
getStateString(dstState), atomInfo)
|
||||
: String.format("\n%s (State:%s->%s) (InstanceId:%s)\n%s", name,
|
||||
getStateString(srcState), getStateString(dstState), instanceId,
|
||||
atomInfo));
|
||||
}
|
||||
|
||||
SysUiStatsLog.write(
|
||||
SysUiStatsLog.LAUNCHER_EVENT,
|
||||
SysUiStatsLog.LAUNCHER_UICHANGED__ACTION__DEFAULT_ACTION /* deprecated */,
|
||||
srcState,
|
||||
dstState,
|
||||
null /* launcher extensions, deprecated */,
|
||||
false /* quickstep_enabled, deprecated */,
|
||||
event.getId() /* event_id */,
|
||||
atomInfo.getItemCase().getNumber() /* target_id */,
|
||||
instanceId.getId() /* instance_id TODO */,
|
||||
0 /* uid TODO */,
|
||||
getPackageName(atomInfo) /* package_name */,
|
||||
getComponentName(atomInfo) /* component_name */,
|
||||
getGridX(atomInfo, false) /* grid_x */,
|
||||
getGridY(atomInfo, false) /* grid_y */,
|
||||
getPageId(atomInfo, false) /* page_id */,
|
||||
getGridX(atomInfo, true) /* grid_x_parent */,
|
||||
getGridY(atomInfo, true) /* grid_y_parent */,
|
||||
getPageId(atomInfo, true) /* page_id_parent */,
|
||||
getHierarchy(atomInfo) /* hierarchy */,
|
||||
atomInfo.getIsWork() /* is_work_profile */,
|
||||
atomInfo.getRank() /* rank */,
|
||||
atomInfo.getFolderIcon().getFromLabelState().getNumber() /* fromState */,
|
||||
atomInfo.getFolderIcon().getToLabelState().getNumber() /* toState */,
|
||||
atomInfo.getFolderIcon().getLabelInfo() /* edittext */,
|
||||
getCardinality(atomInfo) /* cardinality */);
|
||||
}
|
||||
}
|
||||
|
||||
private static int getCardinality(LauncherAtom.ItemInfo info) {
|
||||
|
|
|
@ -19,9 +19,8 @@ import android.content.Context;
|
|||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.android.launcher3.LauncherState;
|
||||
import com.android.launcher3.R;
|
||||
import com.android.launcher3.logger.LauncherAtom;
|
||||
import com.android.launcher3.logger.LauncherAtom.ContainerInfo;
|
||||
import com.android.launcher3.logging.StatsLogUtils.LogStateProvider;
|
||||
import com.android.launcher3.model.data.ItemInfo;
|
||||
import com.android.launcher3.util.ResourceBasedOverride;
|
||||
|
@ -145,6 +144,11 @@ public class StatsLogManager implements ResourceBasedOverride {
|
|||
@UiEvent(doc = "Hotseat education tip shown")
|
||||
LAUNCHER_HOTSEAT_EDU_ONLY_TIP(482),
|
||||
|
||||
/**
|
||||
* @deprecated LauncherUiChanged.rank field is repurposed to store all apps rank, so no
|
||||
* separate event is required.
|
||||
*/
|
||||
@Deprecated
|
||||
@UiEvent(doc = "App launch ranking logged for all apps predictions")
|
||||
LAUNCHER_ALL_APPS_RANKED(552),
|
||||
|
||||
|
@ -241,6 +245,16 @@ public class StatsLogManager implements ResourceBasedOverride {
|
|||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the final value for container related fields of log message.
|
||||
*
|
||||
* By default container related fields are derived from {@link ItemInfo}, this method would
|
||||
* override those values.
|
||||
*/
|
||||
default StatsLogger withContainerInfo(ContainerInfo containerInfo) {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the final message and logs it as {@link EventEnum}.
|
||||
*/
|
||||
|
@ -272,25 +286,6 @@ public class StatsLogManager implements ResourceBasedOverride {
|
|||
return mgr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Logs an event.
|
||||
*
|
||||
* @param event an enum implementing EventEnum interface.
|
||||
* @param atomInfo item typically containing app or task launch related information.
|
||||
*/
|
||||
public void log(EventEnum event, InstanceId instanceId, LauncherAtom.ItemInfo atomInfo) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 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) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Log an event with ranked-choice information along with package. Does nothing if event.getId()
|
||||
* <= 0.
|
||||
|
|
Loading…
Reference in New Issue