diff --git a/src/com/android/launcher3/allapps/PrivateProfileManager.java b/src/com/android/launcher3/allapps/PrivateProfileManager.java index 77eb07e2d3..334d5c15d3 100644 --- a/src/com/android/launcher3/allapps/PrivateProfileManager.java +++ b/src/com/android/launcher3/allapps/PrivateProfileManager.java @@ -71,13 +71,11 @@ public class PrivateProfileManager extends UserProfileManager { /** Disables quiet mode for Private Space User Profile. */ public void unlockPrivateProfile() { - // TODO (b/302666597): Log this event to WW. enableQuietMode(false); } /** Enables quiet mode for Private Space User Profile. */ public void lockPrivateProfile() { - // TODO (b/302666597): Log this event to WW. enableQuietMode(true); } @@ -98,7 +96,6 @@ public class PrivateProfileManager extends UserProfileManager { /** Opens the Private Space Settings Entry Point. */ public void openPrivateSpaceSettings() { - // TODO (b/302666597): Log this event to WW. Intent psSettingsIntent = new Intent(SAFETY_CENTER_INTENT); psSettingsIntent.putExtra(PS_SETTINGS_FRAGMENT_KEY, PS_SETTINGS_FRAGMENT_VALUE); mAllApps.getContext().startActivity(psSettingsIntent); diff --git a/src/com/android/launcher3/allapps/PrivateSpaceHeaderViewController.java b/src/com/android/launcher3/allapps/PrivateSpaceHeaderViewController.java index 79e0ccef75..e0ca9476b0 100644 --- a/src/com/android/launcher3/allapps/PrivateSpaceHeaderViewController.java +++ b/src/com/android/launcher3/allapps/PrivateSpaceHeaderViewController.java @@ -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); } diff --git a/src/com/android/launcher3/logging/StatsLogManager.java b/src/com/android/launcher3/logging/StatsLogManager.java index f90779c725..7c422cd479 100644 --- a/src/com/android/launcher3/logging/StatsLogManager.java +++ b/src/com/android/launcher3/logging/StatsLogManager.java @@ -693,7 +693,16 @@ public class StatsLogManager implements ResourceBasedOverride { LAUNCHER_TASKBAR_PINNED(1490), @UiEvent(doc = "User has unpinned taskbar using taskbar divider menu") - LAUNCHER_TASKBAR_UNPINNED(1491) + LAUNCHER_TASKBAR_UNPINNED(1491), + + @UiEvent(doc = "User tapped private space lock button") + LAUNCHER_PRIVATE_SPACE_LOCK_TAP(1548), + + @UiEvent(doc = "User tapped private space unlock button") + LAUNCHER_PRIVATE_SPACE_UNLOCK_TAP(1549), + + @UiEvent(doc = "User tapped private space settings button") + LAUNCHER_PRIVATE_SPACE_SETTINGS_TAP(1550), // ADD MORE ;