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

Unified Diff: base/android/java/src/org/chromium/base/ApiCompatibilityUtils.java

Issue 2063983002: [Downloads] Fill in the drawer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@download_activity
Patch Set: Comments Created 4 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
« no previous file with comments | « no previous file | chrome/android/java/res/drawable-hdpi/ic_drive_file_white.png » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/android/java/src/org/chromium/base/ApiCompatibilityUtils.java
diff --git a/base/android/java/src/org/chromium/base/ApiCompatibilityUtils.java b/base/android/java/src/org/chromium/base/ApiCompatibilityUtils.java
index 04b647b2dac6b5277b3f830ae651c07f7301e7e2..bb91aa77ce9ad3e39bac45d9f998df0fd33efff5 100644
--- a/base/android/java/src/org/chromium/base/ApiCompatibilityUtils.java
+++ b/base/android/java/src/org/chromium/base/ApiCompatibilityUtils.java
@@ -24,6 +24,7 @@ import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.PowerManager;
import android.os.Process;
+import android.os.StatFs;
import android.provider.Settings;
import android.view.View;
import android.view.ViewGroup.MarginLayoutParams;
@@ -498,4 +499,28 @@ public class ApiCompatibilityUtils {
view.setTextAppearance(view.getContext(), id);
}
}
+
+ /**
+ * See {@link android.os.StatFs#getBlockCount()}.
+ */
+ @SuppressWarnings("deprecation")
+ public static long getBlockCount(StatFs statFs) {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
+ return statFs.getBlockCountLong();
+ } else {
+ return statFs.getBlockCount();
+ }
+ }
+
+ /**
+ * See {@link android.os.StatFs#getBlockSize()}.
+ */
+ @SuppressWarnings("deprecation")
+ public static long getBlockSize(StatFs statFs) {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
+ return statFs.getBlockSizeLong();
+ } else {
+ return statFs.getBlockSize();
+ }
+ }
}
« no previous file with comments | « no previous file | chrome/android/java/res/drawable-hdpi/ic_drive_file_white.png » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698