Index: chrome/android/java/src/org/chromium/chrome/browser/metrics/WebApkUma.java |
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/metrics/WebApkUma.java b/chrome/android/java/src/org/chromium/chrome/browser/metrics/WebApkUma.java |
index b91d1adc614e78ec0908c40a226aecd032f54c07..964b6ebfd409b2183a601b742d9e7377400df376 100644 |
--- a/chrome/android/java/src/org/chromium/chrome/browser/metrics/WebApkUma.java |
+++ b/chrome/android/java/src/org/chromium/chrome/browser/metrics/WebApkUma.java |
@@ -24,11 +24,28 @@ public class WebApkUma { |
public static final int UPDATE_REQUEST_QUEUED_THREE_TIMES = 2; |
public static final int UPDATE_REQUEST_QUEUED_MAX = 3; |
+ // This enum is used to back UMA histograms, and should therefore be treated as append-only. |
+ public static final int GOOGLE_PLAY_INSTALL_SUCCESS = 0; |
+ public static final int GOOGLE_PLAY_INSTALL_FAILED_NO_DELEGATE = 1; |
+ public static final int GOOGLE_PLAY_INSTALL_FAILED_TO_CONNECT_TO_SERVICE = 2; |
+ public static final int GOOGLE_PLAY_INSTALL_FAILED_CALLER_VERIFICATION_FAILURE = 3; |
+ public static final int GOOGLE_PLAY_INSTALL_FAILED_POLICY_VIOLATION = 4; |
+ public static final int GOOGLE_PLAY_INSTALL_FAILED_API_DISABLED = 5; |
+ public static final int GOOGLE_PLAY_INSTALL_FAILED_REQUEST_FAILED = 6; |
+ public static final int GOOGLE_PLAY_INSTALL_FAILED_DOWNLOAD_CANCELLED = 7; |
+ public static final int GOOGLE_PLAY_INSTALL_FAILED_DOWNLOAD_ERROR = 8; |
+ public static final int GOOGLE_PLAY_INSTALL_FAILED_INSTALL_ERROR = 9; |
+ public static final int GOOGLE_PLAY_INSTALL_FAILED_INSTALL_TIMEOUT = 10; |
+ public static final int GOOGLE_PLAY_INSTALL_RESULT_MAX = 11; |
+ |
public static final String HISTOGRAM_UPDATE_REQUEST_SENT = |
"WebApk.Update.RequestSent"; |
public static final String HISTOGRAM_UPDATE_REQUEST_QUEUED = "WebApk.Update.RequestQueued"; |
+ public static final String HISTOGRAM_GOOGLE_PLAY_INSTALL_RESULT = |
+ "WebApk.Install.GooglePlayInstallResult"; |
+ |
private static final int WEBAPK_OPEN_MAX = 3; |
public static final int WEBAPK_OPEN_LAUNCH_SUCCESS = 0; |
public static final int WEBAPK_OPEN_NO_LAUNCH_INTENT = 1; |
@@ -63,4 +80,14 @@ public class WebApkUma { |
assert type >= 0 && type < WEBAPK_OPEN_MAX; |
RecordHistogram.recordEnumeratedHistogram("WebApk.OpenFromMenu", type, WEBAPK_OPEN_MAX); |
} |
+ |
+ /** |
+ * Records whether installing WebAPKs from Google Play succeeded. If not, records the reason of |
+ * failures sent by Google Play. |
pkotwicz
2017/03/21 16:59:39
Nit: "the reason of failures" -> "the failure reas
Xi Han
2017/03/21 18:43:45
Done.
|
+ */ |
+ public static void recordGooglePlayIntallResult(int result) { |
+ assert result >= 0 && result < GOOGLE_PLAY_INSTALL_RESULT_MAX; |
+ RecordHistogram.recordEnumeratedHistogram( |
+ HISTOGRAM_GOOGLE_PLAY_INSTALL_RESULT, result, GOOGLE_PLAY_INSTALL_RESULT_MAX); |
pkotwicz
2017/03/21 16:59:39
Nit: You can just inline the histogram name ("WebA
Xi Han
2017/03/21 18:43:45
Done.
|
+ } |
} |