| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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.android_webview.crash; | 5 package org.chromium.android_webview.crash; |
| 6 | 6 |
| 7 import android.annotation.TargetApi; | 7 import android.annotation.TargetApi; |
| 8 import android.app.Service; | 8 import android.app.Service; |
| 9 import android.app.job.JobInfo; | 9 import android.app.job.JobInfo; |
| 10 import android.content.ComponentName; | 10 import android.content.ComponentName; |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 Log.e(TAG, "Was interrupted when waiting to copy minidumps",
e); | 92 Log.e(TAG, "Was interrupted when waiting to copy minidumps",
e); |
| 93 return false; | 93 return false; |
| 94 } | 94 } |
| 95 } | 95 } |
| 96 mIsCopying = true; | 96 mIsCopying = true; |
| 97 return true; | 97 return true; |
| 98 } | 98 } |
| 99 } | 99 } |
| 100 | 100 |
| 101 private void scheduleNewJob() { | 101 private void scheduleNewJob() { |
| 102 JobInfo.Builder builder = | 102 JobInfo.Builder builder = new JobInfo.Builder(TaskIds.WEBVIEW_MINIDUMP_U
PLOADING_JOB_ID, |
| 103 new JobInfo | 103 new ComponentName(this, AwMinidumpUploadJobService.class)); |
| 104 .Builder(TaskIds.WEBVIEW_MINIDUMP_UPLOADING_JOB_ID, | |
| 105 new ComponentName(this, AwMinidumpUploadJobServi
ce.class)) | |
| 106 .setRequiredNetworkType(JobInfo.NETWORK_TYPE_UNMETERED); | |
| 107 MinidumpUploadJobService.scheduleUpload(this, builder); | 104 MinidumpUploadJobService.scheduleUpload(this, builder); |
| 108 } | 105 } |
| 109 | 106 |
| 110 /** | 107 /** |
| 111 * Copy minidumps from the {@param fileDescriptors} to the directory where W
ebView stores its | 108 * Copy minidumps from the {@param fileDescriptors} to the directory where W
ebView stores its |
| 112 * minidump files. {@param context} is used to look up the directory in whic
h the files will be | 109 * minidump files. {@param context} is used to look up the directory in whic
h the files will be |
| 113 * saved. | 110 * saved. |
| 114 * @return whether any minidump was copied. | 111 * @return whether any minidump was copied. |
| 115 */ | 112 */ |
| 116 @VisibleForTesting | 113 @VisibleForTesting |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 @VisibleForTesting | 196 @VisibleForTesting |
| 200 public static File getWebViewTmpCrashDir(Context context) { | 197 public static File getWebViewTmpCrashDir(Context context) { |
| 201 return new File(context.getCacheDir(), WEBVIEW_TMP_CRASH_DIR); | 198 return new File(context.getCacheDir(), WEBVIEW_TMP_CRASH_DIR); |
| 202 } | 199 } |
| 203 | 200 |
| 204 @Override | 201 @Override |
| 205 public IBinder onBind(Intent intent) { | 202 public IBinder onBind(Intent intent) { |
| 206 return mBinder; | 203 return mBinder; |
| 207 } | 204 } |
| 208 } | 205 } |
| OLD | NEW |