Log taps on PS container buttons

Log taps on space locked/unlocked, settings
buttons

PDD: https://eldar.corp.google.com/assessments/873128385/revisions/1

Test: logcat StatsLog, output
https://paste.googleplex.com/6250774946906112
Bug: 314933661
Flag: ACONFIG com.android.launcher3.Flags.enable_private_space TEAMFOOD
Change-Id: I528443ba56a0db144ce613ea8d41426b6ede434d
This commit is contained in:
Anna Zhuravleva
2023-12-05 12:15:31 +00:00
parent 4a6d4994c3
commit 2ef6704e61
3 changed files with 26 additions and 8 deletions
@@ -19,6 +19,9 @@ package com.android.launcher3.allapps;
import static com.android.launcher3.allapps.PrivateProfileManager.STATE_DISABLED;
import static com.android.launcher3.allapps.PrivateProfileManager.STATE_ENABLED;
import static com.android.launcher3.allapps.PrivateProfileManager.STATE_TRANSITION;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_PRIVATE_SPACE_LOCK_TAP;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_PRIVATE_SPACE_SETTINGS_TAP;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_PRIVATE_SPACE_UNLOCK_TAP;
import android.view.View;
import android.widget.ImageButton;
@@ -63,13 +66,19 @@ public class PrivateSpaceHeaderViewController {
quietModeButton.setVisibility(View.VISIBLE);
quietModeButton.setImageResource(R.drawable.bg_ps_lock_button);
quietModeButton.setOnClickListener(
view -> mPrivateProfileManager.lockPrivateProfile());
view -> {
mPrivateProfileManager.logEvents(LAUNCHER_PRIVATE_SPACE_LOCK_TAP);
mPrivateProfileManager.lockPrivateProfile();
});
}
case STATE_DISABLED -> {
quietModeButton.setVisibility(View.VISIBLE);
quietModeButton.setImageResource(R.drawable.bg_ps_unlock_button);
quietModeButton.setOnClickListener(
view -> mPrivateProfileManager.unlockPrivateProfile());
view -> {
mPrivateProfileManager.logEvents(LAUNCHER_PRIVATE_SPACE_UNLOCK_TAP);
mPrivateProfileManager.unlockPrivateProfile();
});
}
default -> quietModeButton.setVisibility(View.GONE);
}
@@ -79,8 +88,11 @@ public class PrivateSpaceHeaderViewController {
if (mPrivateProfileManager.getCurrentState() == STATE_ENABLED
&& mPrivateProfileManager.isPrivateSpaceSettingsAvailable()) {
settingsButton.setVisibility(View.VISIBLE);
settingsButton.setOnClickListener(view ->
mPrivateProfileManager.openPrivateSpaceSettings());
settingsButton.setOnClickListener(
view -> {
mPrivateProfileManager.logEvents(LAUNCHER_PRIVATE_SPACE_SETTINGS_TAP);
mPrivateProfileManager.openPrivateSpaceSettings();
});
} else {
settingsButton.setVisibility(View.GONE);
}