[AA+] Log app launches with AllApps session InstanceId when current state is ALL_APPS.

Bug: 178562918
Test: Manual
Change-Id: I65b264cc37079280b59179d5b2f29b67e7a12cc5
This commit is contained in:
thiruram authored and Thiru Ramasamy committed 2021-02-12 20:02:41 +00:00
1 parent 1216e5999e
commit 6600860f0f
1 file changed
+5 -7
@@ -21,12 +21,11 @@ import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER_HOTSEAT
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.ALL_APPS;
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.logger.LauncherAtom.ContainerInfo.ContainerCase.EXTENDED_CONTAINERS;
import static com.android.launcher3.logger.LauncherAtomExtensions.ExtendedContainers.ContainerCase.DEVICE_SEARCH_RESULT_CONTAINER;
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;
@@ -105,12 +104,11 @@ public class QuickstepLauncher extends BaseQuickstepLauncher {
@Override
protected void logAppLaunch(ItemInfo info, InstanceId instanceId) {
// If the app launch is from DeviceSearchResultContainer then add the InstanceId from
// LiveSearchManager to recreate the AllApps search session on the server side.
// If the app launch is from any of the surfaces in AllApps then add the InstanceId from
// LiveSearchManager to recreate the AllApps session on the server side.
Optional<InstanceId> logInstanceId = this.getLiveSearchManager().getLogInstanceId();
if (info.getContainerInfo().getContainerCase() == EXTENDED_CONTAINERS
&& info.getContainerInfo().getExtendedContainers().getContainerCase()
== DEVICE_SEARCH_RESULT_CONTAINER && logInstanceId.isPresent()) {
if (logInstanceId.isPresent() && ALL_APPS.equals(
getStateManager().getCurrentStableState())) {
instanceId = logInstanceId.get();
}