summaryrefslogtreecommitdiffstats
path: root/src/com/android/providers/downloads/StorageUtils.java
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2014-04-28 16:49:06 -0700
committerElliott Hughes <enh@google.com>2014-04-28 16:50:00 -0700
commit5dcbf701c9077e62ca8c1ee0079b4cbffaf57d14 (patch)
treeeda9df38ef0d49939587b02236b35b9650ac5acc /src/com/android/providers/downloads/StorageUtils.java
parent3a203e4a58bf5ee03c3303df6a04e43a4eefb1eb (diff)
downloadandroid_packages_providers_DownloadProvider-5dcbf701c9077e62ca8c1ee0079b4cbffaf57d14.tar.gz
android_packages_providers_DownloadProvider-5dcbf701c9077e62ca8c1ee0079b4cbffaf57d14.tar.bz2
android_packages_providers_DownloadProvider-5dcbf701c9077e62ca8c1ee0079b4cbffaf57d14.zip
Move internal DownloadProvider code off libcore.os.
(As much as possible. There are no plans to make the mocking API public.) Change-Id: I348877b850d6d34572d5a19e67952254bc4f12ef
Diffstat (limited to 'src/com/android/providers/downloads/StorageUtils.java')
-rw-r--r--src/com/android/providers/downloads/StorageUtils.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/com/android/providers/downloads/StorageUtils.java b/src/com/android/providers/downloads/StorageUtils.java
index ad08c5d8..1817c758 100644
--- a/src/com/android/providers/downloads/StorageUtils.java
+++ b/src/com/android/providers/downloads/StorageUtils.java
@@ -30,6 +30,10 @@ import android.content.pm.PackageManager;
import android.database.Cursor;
import android.os.Environment;
import android.provider.Downloads;
+import android.system.ErrnoException;
+import android.system.Os;
+import android.system.StructStat;
+import android.system.StructStatVfs;
import android.text.TextUtils;
import android.util.Slog;
@@ -37,11 +41,7 @@ import com.android.internal.annotations.VisibleForTesting;
import com.google.android.collect.Lists;
import com.google.android.collect.Sets;
-import libcore.io.ErrnoException;
import libcore.io.IoUtils;
-import libcore.io.Libcore;
-import libcore.io.StructStat;
-import libcore.io.StructStatVfs;
import java.io.File;
import java.io.FileDescriptor;
@@ -100,7 +100,7 @@ public class StorageUtils {
// the backing partition.
final long dev;
try {
- dev = Libcore.os.fstat(fd).st_dev;
+ dev = Os.fstat(fd).st_dev;
} catch (ErrnoException e) {
throw e.rethrowAsIOException();
}
@@ -178,7 +178,7 @@ public class StorageUtils {
*/
private static long getAvailableBytes(FileDescriptor fd) throws IOException {
try {
- final StructStatVfs stat = Libcore.os.fstatvfs(fd);
+ final StructStatVfs stat = Os.fstatvfs(fd);
return (stat.f_bavail * stat.f_bsize) - RESERVED_BYTES;
} catch (ErrnoException e) {
throw e.rethrowAsIOException();
@@ -187,7 +187,7 @@ public class StorageUtils {
private static long getDeviceId(File file) {
try {
- return Libcore.os.stat(file.getAbsolutePath()).st_dev;
+ return Os.stat(file.getAbsolutePath()).st_dev;
} catch (ErrnoException e) {
// Safe since dev_t is uint
return -1;
@@ -239,7 +239,7 @@ public class StorageUtils {
public ConcreteFile(File file) throws ErrnoException {
this.file = file;
- this.stat = Libcore.os.lstat(file.getAbsolutePath());
+ this.stat = Os.lstat(file.getAbsolutePath());
}
@Override