public final class SysUtil
extends java.lang.Object
| Constructor and Description |
|---|
SysUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
deleteOrThrow(java.io.File file) |
static void |
dumbDeleteRecursive(java.io.File file)
Delete a directory and its contents.
|
static void |
fallocateIfSupported(java.io.FileDescriptor fd,
long length)
Pre-allocate disk space for a file if we can do that on this version of the OS.
|
static int |
findAbiScore(java.lang.String[] supportedAbis,
java.lang.String abi)
Determine how preferred a given ABI is on this system.
|
static int |
getAppVersionCode(Context context) |
static java.lang.String[] |
getSupportedAbis()
Return an list of ABIs we supported on this device ordered according to preference.
|
static boolean |
is64Bit() |
static byte[] |
makeApkDepBlock(java.io.File apkFile,
Context context) |
public static int findAbiScore(java.lang.String[] supportedAbis,
java.lang.String abi)
supportedAbis - ABIs on this systemabi - ABI of a shared library we might want to unpackpublic static void deleteOrThrow(java.io.File file)
throws java.io.IOException
java.io.IOExceptionpublic static java.lang.String[] getSupportedAbis()
public static void fallocateIfSupported(java.io.FileDescriptor fd,
long length)
throws java.io.IOException
fd - File descriptor for filelength - Number of bytes to allocate.java.io.IOExceptionpublic static void dumbDeleteRecursive(java.io.File file)
throws java.io.IOException
WARNING: Java APIs do not let us distinguish directories from symbolic links to directories. Consequently, if the directory contains symbolic links to directories, we will attempt to delete the contents of pointed-to directories.
file - File or directory to deletejava.io.IOExceptionpublic static byte[] makeApkDepBlock(java.io.File apkFile,
Context context)
throws java.io.IOException
java.io.IOExceptionpublic static int getAppVersionCode(Context context)
public static boolean is64Bit()