OSDN Git Service

Add metrics logging for Settings -> Help & Feedback
authorDoris Ling <dling@google.com>
Mon, 8 Aug 2016 23:17:43 +0000 (16:17 -0700)
committerDoris Ling <dling@google.com>
Tue, 9 Aug 2016 21:54:01 +0000 (14:54 -0700)
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

packages/SettingsLib/src/com/android/settingslib/HelpUtils.java
proto/src/metrics_constants.proto

index 21116b8..78e8ea8 100644 (file)
@@ -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) {
index 29d1e7a..8c8b391 100644 (file)
@@ -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.