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

Unified Diff: chromecast/browser/android/apk/src/org/chromium/chromecast/shell/CastCrashHandler.java

Issue 1180633002: Chromecast: don't try to upload crash immediately. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: rebase Created 5 years, 6 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
Index: chromecast/browser/android/apk/src/org/chromium/chromecast/shell/CastCrashHandler.java
diff --git a/chromecast/browser/android/apk/src/org/chromium/chromecast/shell/CastCrashHandler.java b/chromecast/browser/android/apk/src/org/chromium/chromecast/shell/CastCrashHandler.java
index d7cd644aa43037e751789237d115f435d63e9891..3919e7ce879ae35b11bf041d6c04706e8b61cd59 100644
--- a/chromecast/browser/android/apk/src/org/chromium/chromecast/shell/CastCrashHandler.java
+++ b/chromecast/browser/android/apk/src/org/chromium/chromecast/shell/CastCrashHandler.java
@@ -4,31 +4,29 @@
package org.chromium.chromecast.shell;
+import android.content.Context;
+
import org.chromium.base.CalledByNative;
import org.chromium.base.JNINamespace;
+import org.chromium.base.Log;
+import org.chromium.chromecast.base.ChromecastConfigAndroid;
/**
* JNI wrapper class for accessing CastCrashHandler.
*/
@JNINamespace("chromecast")
public final class CastCrashHandler {
- private static CastCrashUploader sCrashUploader;
+ private static final String TAG = "cr.CastCrashHandler";
@CalledByNative
- public static void initializeUploader(String crashDumpPath, boolean uploadCrashToStaging) {
- if (sCrashUploader == null) {
- sCrashUploader = new CastCrashUploader(crashDumpPath, uploadCrashToStaging);
- sCrashUploader.startPeriodicUpload();
+ public static void initializeUploader(Context context, String crashDumpPath,
+ boolean uploadCrashToStaging) {
+ CastCrashUploader uploader = new CastCrashUploader(crashDumpPath, uploadCrashToStaging);
+ if (ChromecastConfigAndroid.canSendUsageStats(context)) {
+ uploader.startPeriodicUpload();
+ } else {
+ Log.d(TAG, "Removing crash dumps instead of uploading");
+ uploader.removeCrashDumps();
}
}
-
- @CalledByNative
- public static void removeCrashDumps() {
- sCrashUploader.removeCrashDumps();
- }
-
- @CalledByNative
- public static void uploadCrashDumps(String logFilePath) {
- sCrashUploader.uploadCrashDumps(logFilePath);
- }
}

Powered by Google App Engine
This is Rietveld 408576698