Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2708)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebUma.java

Issue 2370943003: Use LibraryLoader to check for native library (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebUma.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebUma.java b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebUma.java
index e551b602fa6febe7d8a2bc60e61412dfffe7ba05..4212d7e31b8ade673532ad585933c8e5285b42c9 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebUma.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebUma.java
@@ -10,6 +10,7 @@ import android.os.AsyncTask;
import org.chromium.base.ContextUtils;
import org.chromium.base.Log;
+import org.chromium.base.library_loader.LibraryLoader;
import org.chromium.base.metrics.RecordHistogram;
import org.chromium.base.metrics.RecordUserAction;
import org.chromium.components.location.LocationUtils;
@@ -64,7 +65,6 @@ public class PhysicalWebUma {
private static final String PREFERENCE = "Preference";
private static final int BOOLEAN_BOUNDARY = 2;
private static final int TRISTATE_BOUNDARY = 3;
- private static boolean sUploadAllowed = false;
/**
* Records a URL selection.
@@ -169,7 +169,7 @@ public class PhysicalWebUma {
* @param numUrls The number of URLs displayed to a user.
*/
public static void onUrlsDisplayed(Context context, int numUrls) {
- if (sUploadAllowed) {
+ if (LibraryLoader.isInitialized()) {
RecordHistogram.recordCountHistogram(TOTAL_URLS_INITIAL_COUNTS, numUrls);
} else {
storeValue(context, TOTAL_URLS_INITIAL_COUNTS, numUrls);
@@ -181,7 +181,7 @@ public class PhysicalWebUma {
* @param numUrls The number of URLs displayed to a user.
*/
public static void onUrlsRefreshed(Context context, int numUrls) {
- if (sUploadAllowed) {
+ if (LibraryLoader.isInitialized()) {
RecordHistogram.recordCountHistogram(TOTAL_URLS_REFRESH_COUNTS, numUrls);
} else {
storeValue(context, TOTAL_URLS_REFRESH_COUNTS, numUrls);
@@ -246,13 +246,8 @@ public class PhysicalWebUma {
/**
* Uploads metrics that we have deferred for uploading.
- * Additionally, this method will cause future stat records not to be deferred and instead
- * uploaded immediately.
*/
public static void uploadDeferredMetrics() {
- // If uploads have been explicitely requested, they are now allowed.
- sUploadAllowed = true;
-
// Read the metrics.
SharedPreferences prefs = ContextUtils.getAppSharedPreferences();
if (prefs.getBoolean(HAS_DEFERRED_METRICS_KEY, false)) {
@@ -293,7 +288,7 @@ public class PhysicalWebUma {
}
private static void handleAction(Context context, String key) {
- if (sUploadAllowed) {
+ if (LibraryLoader.isInitialized()) {
RecordUserAction.record(key);
} else {
storeAction(context, key);
@@ -301,7 +296,7 @@ public class PhysicalWebUma {
}
private static void handleTime(Context context, String key, long duration, TimeUnit tu) {
- if (sUploadAllowed) {
+ if (LibraryLoader.isInitialized()) {
RecordHistogram.recordTimesHistogram(key, duration, tu);
} else {
storeValue(context, key, duration);
@@ -309,7 +304,7 @@ public class PhysicalWebUma {
}
private static void handleEnum(Context context, String key, int value, int boundary) {
- if (sUploadAllowed) {
+ if (LibraryLoader.isInitialized()) {
RecordHistogram.recordEnumeratedHistogram(key, value, boundary);
} else {
storeValue(context, key, value);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698