OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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; | 5 package org.chromium.android_webview; |
6 | 6 |
7 import android.content.ComponentName; | 7 import android.content.ComponentName; |
8 import android.content.Context; | 8 import android.content.Context; |
9 import android.content.Intent; | 9 import android.content.Intent; |
10 import android.content.ServiceConnection; | 10 import android.content.ServiceConnection; |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 } finally { | 151 } finally { |
152 StrictMode.setThreadPolicy(oldPolicy); | 152 StrictMode.setThreadPolicy(oldPolicy); |
153 } | 153 } |
154 } | 154 } |
155 | 155 |
156 public static void setWebViewPackageName(String webViewPackageName) { | 156 public static void setWebViewPackageName(String webViewPackageName) { |
157 assert sWebViewPackageName == null || sWebViewPackageName.equals(webView
PackageName); | 157 assert sWebViewPackageName == null || sWebViewPackageName.equals(webView
PackageName); |
158 sWebViewPackageName = webViewPackageName; | 158 sWebViewPackageName = webViewPackageName; |
159 } | 159 } |
160 | 160 |
| 161 public static String getWebViewPackageName() { |
| 162 if (sWebViewPackageName == null) return ""; // May be null in testing. |
| 163 return sWebViewPackageName; |
| 164 } |
| 165 |
161 /** | 166 /** |
162 * Trigger minidump copying, which in turn triggers minidump uploading. | 167 * Trigger minidump copying, which in turn triggers minidump uploading. |
163 */ | 168 */ |
164 @CalledByNative | 169 @CalledByNative |
165 private static void triggerMinidumpUploading() { | 170 private static void triggerMinidumpUploading() { |
166 handleMinidumpsAndSetMetricsConsent(sWebViewPackageName, false /* update
MetricsConsent */); | 171 handleMinidumpsAndSetMetricsConsent(sWebViewPackageName, false /* update
MetricsConsent */); |
167 } | 172 } |
168 | 173 |
169 /** | 174 /** |
170 * Trigger minidump uploading, and optionaly also update the metrics-consent
value depending on | 175 * Trigger minidump uploading, and optionaly also update the metrics-consent
value depending on |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 Log.w(TAG, "Could not bind to Minidump-copying Service " + i
ntent); | 288 Log.w(TAG, "Could not bind to Minidump-copying Service " + i
ntent); |
284 } | 289 } |
285 return null; | 290 return null; |
286 } | 291 } |
287 // To avoid any potential synchronization issues we post all minidum
p-copying actions to | 292 // To avoid any potential synchronization issues we post all minidum
p-copying actions to |
288 // the same thread to be run serially. | 293 // the same thread to be run serially. |
289 } | 294 } |
290 .executeOnExecutor(AsyncTask.SERIAL_EXECUTOR); | 295 .executeOnExecutor(AsyncTask.SERIAL_EXECUTOR); |
291 } | 296 } |
292 } | 297 } |
OLD | NEW |