Merge "[AA+] Add LAUNCHER_ALLAPPS_ENTRY, LAUNCHER_ALLAPPS_EXIT events." into sc-dev
This commit is contained in:
commit
67171e2335
2 files changed
+25
No files matched your search
@@ -16,6 +16,8 @@
|
||||
package com.android.launcher3.allapps.search;
|
||||
|
||||
import static com.android.launcher3.LauncherState.ALL_APPS;
|
||||
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ALLAPPS_ENTRY;
|
||||
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ALLAPPS_EXIT;
|
||||
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
|
||||
import static com.android.launcher3.util.Executors.THREAD_POOL_EXECUTOR;
|
||||
import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
|
||||
@@ -46,6 +48,8 @@ import com.android.launcher3.Launcher;
|
||||
import com.android.launcher3.LauncherAppWidgetProviderInfo;
|
||||
import com.android.launcher3.LauncherState;
|
||||
import com.android.launcher3.logging.InstanceId;
|
||||
import com.android.launcher3.logging.InstanceIdSequence;
|
||||
import com.android.launcher3.logging.StatsLogManager.StatsLogger;
|
||||
import com.android.launcher3.statemanager.StateManager.StateListener;
|
||||
import com.android.launcher3.util.ComponentKey;
|
||||
import com.android.launcher3.util.SafeCloseable;
|
||||
@@ -71,6 +75,7 @@ public class LiveSearchManager implements StateListener<LauncherState> {
|
||||
new HashMap<>();
|
||||
private SearchWidgetHost mSearchWidgetHost;
|
||||
private InstanceId mLogInstanceId;
|
||||
private LauncherState mPrevLauncherState;
|
||||
|
||||
public LiveSearchManager(Launcher launcher) {
|
||||
mLauncher = launcher;
|
||||
@@ -133,6 +138,11 @@ public class LiveSearchManager implements StateListener<LauncherState> {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStateTransitionStart(LauncherState toState) {
|
||||
mPrevLauncherState = mLauncher.getStateManager().getCurrentStableState();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStateTransitionComplete(LauncherState finalState) {
|
||||
if (finalState != ALL_APPS) {
|
||||
@@ -142,6 +152,15 @@ public class LiveSearchManager implements StateListener<LauncherState> {
|
||||
|
||||
clearWidgetHost();
|
||||
}
|
||||
|
||||
StatsLogger logger = mLauncher.getStatsLogManager().logger();
|
||||
if (finalState.equals(ALL_APPS)) {
|
||||
mLogInstanceId = new InstanceIdSequence().newInstanceId();
|
||||
logger.withInstanceId(mLogInstanceId).log(LAUNCHER_ALLAPPS_ENTRY);
|
||||
} else if (mPrevLauncherState.equals(ALL_APPS)) {
|
||||
logger.withInstanceId(mLogInstanceId).log(LAUNCHER_ALLAPPS_EXIT);
|
||||
mLogInstanceId = null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -344,6 +344,12 @@ public class StatsLogManager implements ResourceBasedOverride {
|
||||
|
||||
@UiEvent(doc = "Current grid size is changed to 2.")
|
||||
LAUNCHER_GRID_SIZE_2(665),
|
||||
|
||||
@UiEvent(doc = "Launcher entered into AllApps state.")
|
||||
LAUNCHER_ALLAPPS_ENTRY(692),
|
||||
|
||||
@UiEvent(doc = "Launcher exited from AllApps state.")
|
||||
LAUNCHER_ALLAPPS_EXIT(693),
|
||||
;
|
||||
|
||||
// ADD MORE
|
||||
|
||||
Reference in new issue
Block a user