[Contextual Edu] Update Edu stats when going to overview and all apps from home

Update education stats when
- go overview and all apps by swiping up at homepage (AbstractStateChangeTouchController)
- go home from all apps by swiping down the all apps panel (AbstractStateChangeTouchController)
- go home from all apps or overview by swiping up from the bottom nav bar (NavBarToHomeTouchController)
- in 3 button navgiation mode (TaskbarNavButtonController)

NavBarToHomeTouchController does not inherit from AbstractStateChangeTouchController so logic are added separately.

Bug: 363480554
Test: TaskbarNavButtonControllerTest
Flag: com.android.systemui.keyboard_touchpad_contextual_education
Change-Id: I0662704a9093b9f5a4d2f086a8297429fbc49881
This commit is contained in:
helencheuk committed 2024-09-17 16:00:24 +01:00
1 parent 6138138d99
commit 5012640ab2
6 files changed
+72 -1

No files matched your search

@@ -45,12 +45,14 @@ import androidx.annotation.Nullable;
import androidx.annotation.StringRes;
import com.android.launcher3.R;
import com.android.launcher3.contextualeducation.ContextualEduStatsManager;
import com.android.launcher3.logging.StatsLogManager;
import com.android.launcher3.testing.TestLogging;
import com.android.launcher3.testing.shared.TestProtocol;
import com.android.quickstep.SystemUiProxy;
import com.android.quickstep.TaskUtils;
import com.android.quickstep.util.AssistUtils;
import com.android.systemui.contextualeducation.GestureType;
import com.android.systemui.shared.system.QuickStepContract.SystemUiStateFlags;
import java.io.PrintWriter;
@@ -109,6 +111,7 @@ public class TaskbarNavButtonController implements TaskbarControllers.LoggableTa
private final Context mContext;
private final TaskbarNavButtonCallbacks mCallbacks;
private final SystemUiProxy mSystemUiProxy;
private final ContextualEduStatsManager mContextualEduStatsManager;
private final Handler mHandler;
private final AssistUtils mAssistUtils;
@Nullable private StatsLogManager mStatsLogManager;
@@ -119,11 +122,13 @@ public class TaskbarNavButtonController implements TaskbarControllers.LoggableTa
Context context,
TaskbarNavButtonCallbacks callbacks,
SystemUiProxy systemUiProxy,
ContextualEduStatsManager contextualEduStatsManager,
Handler handler,
AssistUtils assistUtils) {
mContext = context;
mCallbacks = callbacks;
mSystemUiProxy = systemUiProxy;
mContextualEduStatsManager = contextualEduStatsManager;
mHandler = handler;
mAssistUtils = assistUtils;
}
@@ -137,14 +142,20 @@ public class TaskbarNavButtonController implements TaskbarControllers.LoggableTa
switch (buttonType) {
case BUTTON_BACK:
logEvent(LAUNCHER_TASKBAR_BACK_BUTTON_TAP);
mContextualEduStatsManager.updateEduStats(/* isTrackpadGesture= */ false,
GestureType.BACK);
executeBack();
break;
case BUTTON_HOME:
logEvent(LAUNCHER_TASKBAR_HOME_BUTTON_TAP);
mContextualEduStatsManager.updateEduStats(/* isTrackpadGesture= */ false,
GestureType.HOME);
navigateHome();
break;
case BUTTON_RECENTS:
logEvent(LAUNCHER_TASKBAR_OVERVIEW_BUTTON_TAP);
mContextualEduStatsManager.updateEduStats(/* isTrackpadGesture= */ false,
GestureType.OVERVIEW);
navigateToOverview();
break;
case BUTTON_IME_SWITCH: