| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.chrome.browser.metrics; | 5 package org.chromium.chrome.browser.metrics; |
| 6 | 6 |
| 7 import org.chromium.base.metrics.RecordHistogram; | 7 import org.chromium.base.metrics.RecordHistogram; |
| 8 import org.chromium.webapk.lib.common.WebApkConstants; | 8 import org.chromium.webapk.lib.common.WebApkConstants; |
| 9 | 9 |
| 10 import java.util.concurrent.TimeUnit; | 10 import java.util.concurrent.TimeUnit; |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 "WebApk.Install.GooglePlayBindDuration", durationMs, TimeUnit.MI
LLISECONDS); | 125 "WebApk.Install.GooglePlayBindDuration", durationMs, TimeUnit.MI
LLISECONDS); |
| 126 } | 126 } |
| 127 | 127 |
| 128 /** Records the current Shell APK version. */ | 128 /** Records the current Shell APK version. */ |
| 129 public static void recordShellApkVersion(int shellApkVersion, String package
Name) { | 129 public static void recordShellApkVersion(int shellApkVersion, String package
Name) { |
| 130 String name = packageName.startsWith(WebApkConstants.WEBAPK_PACKAGE_PREF
IX) | 130 String name = packageName.startsWith(WebApkConstants.WEBAPK_PACKAGE_PREF
IX) |
| 131 ? "WebApk.ShellApkVersion.BrowserApk" | 131 ? "WebApk.ShellApkVersion.BrowserApk" |
| 132 : "WebApk.ShellApkVersion.UnboundApk"; | 132 : "WebApk.ShellApkVersion.UnboundApk"; |
| 133 RecordHistogram.recordSparseSlowlyHistogram(name, shellApkVersion); | 133 RecordHistogram.recordSparseSlowlyHistogram(name, shellApkVersion); |
| 134 } | 134 } |
| 135 |
| 136 /** |
| 137 * Recorded when a WebAPK is launched from the homescreen. Records the time
elapsed since the |
| 138 * previous WebAPK launch. Not recorded the first time that a WebAPK is laun
ched. |
| 139 */ |
| 140 public static void recordLaunchInterval(long intervalMs) { |
| 141 RecordHistogram.recordCustomTimesHistogram("WebApk.LaunchInterval", inte
rvalMs, |
| 142 TimeUnit.HOURS.toMillis(1), TimeUnit.DAYS.toMillis(30), TimeUnit
.MILLISECONDS, 50); |
| 143 } |
| 135 } | 144 } |
| OLD | NEW |