| Index: android_webview/java/src/org/chromium/android_webview/AwBrowserProcess.java
|
| diff --git a/android_webview/java/src/org/chromium/android_webview/AwBrowserProcess.java b/android_webview/java/src/org/chromium/android_webview/AwBrowserProcess.java
|
| index f657e5bbb6f437d041446d611dca2479de9a6107..eeb7daf1b3250edfe9f51320a08a919c820c61e1 100644
|
| --- a/android_webview/java/src/org/chromium/android_webview/AwBrowserProcess.java
|
| +++ b/android_webview/java/src/org/chromium/android_webview/AwBrowserProcess.java
|
| @@ -157,8 +157,11 @@ public abstract class AwBrowserProcess {
|
| * Pass Minidumps to a separate Service declared in the WebView provider package.
|
| * That Service will copy the Minidumps to its own data directory - at which point we can delete
|
| * our copies in the app directory.
|
| + * @param userApproved whether we have user consent to upload crash data - if we do, copy the
|
| + * minidumps, if we don't, delete them.
|
| */
|
| - public static void handleMinidumps(final String webViewPackageName) {
|
| + public static void handleMinidumps(
|
| + final String webViewPackageName, final boolean userApproved) {
|
| new AsyncTask<Void, Void, Void>() {
|
| @Override
|
| protected Void doInBackground(Void... params) {
|
| @@ -170,6 +173,16 @@ public abstract class AwBrowserProcess {
|
| crashFileManager.getAllMinidumpFiles(MAX_MINIDUMP_UPLOAD_TRIES);
|
| if (minidumpFiles.length == 0) return null;
|
|
|
| + // Delete the minidumps if the user doesn't allow crash data uploading.
|
| + if (!userApproved) {
|
| + for (File minidump : minidumpFiles) {
|
| + if (!minidump.delete()) {
|
| + Log.w(TAG, "Couldn't delete file " + minidump.getAbsolutePath());
|
| + }
|
| + }
|
| + return null;
|
| + }
|
| +
|
| final Intent intent = new Intent();
|
| intent.setClassName(webViewPackageName, CrashReceiverService.class.getName());
|
|
|
|
|