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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateMenuItemHelper.java

Issue 1560013002: Don't launch a new AsyncTask to log internal storage size (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add assert !ThreadUtils.runningOnUiThread(); Created 4 years, 12 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/omaha/UpdateMenuItemHelper.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateMenuItemHelper.java b/chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateMenuItemHelper.java
index 7c726e5969fbd1bc9af425e48912b2e6a1e24e44..f88610e556275a8a935967f863c373dc1ba12cc7 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateMenuItemHelper.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateMenuItemHelper.java
@@ -325,22 +325,18 @@ public class UpdateMenuItemHelper {
}
private void recordInternalStorageSize() {
- new AsyncTask<Void, Void, Void>() {
- @Override
- protected Void doInBackground(Void... params) {
- File path = Environment.getDataDirectory();
- StatFs statFs = new StatFs(path.getAbsolutePath());
- int size;
- if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2) {
- size = getSize(statFs);
- } else {
- size = getSizeUpdatedApi(statFs);
- }
- RecordHistogram.recordLinearCountHistogram(
- "GoogleUpdate.InfoBar.InternalStorageSizeAvailable", size, 1, 200, 100);
- return null;
- }
- }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
+ assert !ThreadUtils.runningOnUiThread();
+
+ File path = Environment.getDataDirectory();
+ StatFs statFs = new StatFs(path.getAbsolutePath());
+ int size;
+ if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2) {
+ size = getSize(statFs);
+ } else {
+ size = getSizeUpdatedApi(statFs);
+ }
+ RecordHistogram.recordLinearCountHistogram(
+ "GoogleUpdate.InfoBar.InternalStorageSizeAvailable", size, 1, 200, 100);
}
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2)
« 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