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

Commit 88a6b165 authored by Doris Ling's avatar Doris Ling
Browse files

Add metrics logging for Settings -> Help & Feedback

Add new metrics event constant for Settings->Help & Feedback, and log it
whenever user selects the help option menu, passing the context extra for
the corresponding settings preference where the help menu is launched.

Change-Id: I971e8e50b959a5451ed085e5da5fd8504111e6c3
Fixes: 30140281
parent 3d6eda1f
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -33,6 +33,8 @@ import android.util.TypedValue;
import android.view.Menu;
import android.view.MenuItem;
import android.view.MenuItem.OnMenuItemClickListener;
import com.android.internal.logging.MetricsLogger;
import com.android.internal.logging.MetricsProto.MetricsEvent;

import java.net.URISyntaxException;
import java.util.Locale;
@@ -111,6 +113,9 @@ public class HelpUtils {
                helpMenuItem.setOnMenuItemClickListener(new OnMenuItemClickListener() {
                    @Override
                    public boolean onMenuItemClick(MenuItem item) {
                        MetricsLogger.action(activity,
                            MetricsEvent.ACTION_SETTING_HELP_AND_FEEDBACK,
                            intent.getStringExtra(EXTRA_CONTEXT));
                        try {
                            activity.startActivityForResult(intent, 0);
                        } catch (ActivityNotFoundException exc) {
+4 −0
Original line number Diff line number Diff line
@@ -2266,6 +2266,10 @@ message MetricsEvent {
    // Package: Package of print service
    ACTION_PRINT_RECOMMENDED_SERVICE_INSTALL = 512;

    // ACTION: Settings -> [sub settings activity] -> Options menu -> Help & Support
    //   SUBTYPE: sub settings classname
    ACTION_SETTING_HELP_AND_FEEDBACK = 513;

    // ---- End O Constants, all O constants go above this line ----

    // Add new aosp constants above this line.