Merge "Fixes NPE with LAUNCHER_ALLAPPS_EXIT log event." into sc-dev

This commit is contained in:
Thiru Ramasamy authored and Android (Google) Code Review committed 2021-02-09 23:37:17 +00:00
commit 9012515fef
1 file changed
+4 -1
@@ -157,7 +157,10 @@ public class LiveSearchManager implements StateListener<LauncherState> {
if (finalState.equals(ALL_APPS)) {
mLogInstanceId = new InstanceIdSequence().newInstanceId();
logger.withInstanceId(mLogInstanceId).log(LAUNCHER_ALLAPPS_ENTRY);
} else if (mPrevLauncherState.equals(ALL_APPS)) {
} 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);
mLogInstanceId = null;
}