[AA+] Add LAUNCHER_ALLAPPS_KEYBOARD_CLOSED event. am: aafa8a44a3

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/13486540

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I653a985980cb85bf81ec83244e35b932697ad437
This commit is contained in:
thiruram authored and Automerger Merge Worker committed 2021-02-10 03:42:21 +00:00
commit 3df56602be
4 files changed
+30 -4

No files matched your search

@@ -213,10 +213,14 @@ public class AllAppsContainerView extends SpringRelativeLayout implements DragSo
if (insets == null) return;
if (insets.isVisible(WindowInsets.Type.ime())) {
getWindowInsetsController().hide(WindowInsets.Type.ime());
hideIme();
}
}
protected void hideIme() {
getWindowInsetsController().hide(WindowInsets.Type.ime());
}
/**
* Returns whether the view itself will handle the touch event or not.
*/
@@ -15,6 +15,8 @@
*/
package com.android.launcher3.allapps;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ALLAPPS_KEYBOARD_CLOSED;
import android.content.Context;
import android.graphics.Rect;
import android.util.AttributeSet;
@@ -93,4 +95,10 @@ public class LauncherAllAppsContainerView extends AllAppsContainerView {
}
}
}
@Override
protected void hideIme() {
super.hideIme();
mLauncher.getLiveSearchManager().allAppsLogger().log(LAUNCHER_ALLAPPS_KEYBOARD_CLOSED);
}
}
@@ -153,15 +153,15 @@ public class LiveSearchManager implements StateListener<LauncherState> {
clearWidgetHost();
}
StatsLogger logger = mLauncher.getStatsLogManager().logger();
if (finalState.equals(ALL_APPS)) {
// creates new instance ID since new all apps session is started.
mLogInstanceId = new InstanceIdSequence().newInstanceId();
logger.withInstanceId(mLogInstanceId).log(LAUNCHER_ALLAPPS_ENTRY);
allAppsLogger().log(LAUNCHER_ALLAPPS_ENTRY);
} else if (mPrevLauncherState.equals(ALL_APPS)
// Check if mLogInstanceId is not null; to avoid NPE when LAUNCHER_ALLAPPS_EXIT is
// triggered multiple times
&& mLogInstanceId != null) {
logger.withInstanceId(mLogInstanceId).log(LAUNCHER_ALLAPPS_EXIT);
allAppsLogger().log(LAUNCHER_ALLAPPS_EXIT);
mLogInstanceId = null;
}
}
@@ -316,4 +316,15 @@ public class LiveSearchManager implements StateListener<LauncherState> {
@Override
public void onActivitySaveInstanceState(Activity activity, Bundle bundle) { }
}
/**
* Returns new instance of {@link StatsLogger} pre-populated with details required to log
* AllApps specific user events.
*/
public StatsLogger allAppsLogger() {
return getLogInstanceId()
.map(instanceId -> mLauncher.getStatsLogManager().logger()
.withInstanceId(instanceId))
.orElse(mLauncher.getStatsLogManager().logger());
}
}
@@ -350,6 +350,9 @@ public class StatsLogManager implements ResourceBasedOverride {
@UiEvent(doc = "Launcher exited from AllApps state.")
LAUNCHER_ALLAPPS_EXIT(693),
@UiEvent(doc = "User closed the AllApps keyboard.")
LAUNCHER_ALLAPPS_KEYBOARD_CLOSED(694),
;
// ADD MORE