Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2ef6704e authored by Anna Zhuravleva's avatar Anna Zhuravleva
Browse files

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
parent 4a6d4994
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -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);
    }

@@ -101,7 +99,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);
+16 −4
Original line number Diff line number Diff line
@@ -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);
        }
+10 −1
Original line number Diff line number Diff line
@@ -687,7 +687,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
        ;