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

Commit 63d9cee7 authored by Anna Zhuravleva's avatar Anna Zhuravleva Committed by Android (Google) Code Review
Browse files

Merge "Log taps on PS container buttons" into main

parents aa84ba76 2ef6704e
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);
    }

@@ -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);
+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
@@ -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
        ;