Move internal libcore.os users over to android.system.

Change-Id: I84e1ace19ba3b4e58d7bb24f3ecda1bdf5dc75a5
This commit is contained in:
Elliott Hughes
2014-04-28 16:38:43 -07:00
parent 54dacbe7ca
commit f97c63350a
3 changed files with 12 additions and 13 deletions

View File

@@ -26,6 +26,9 @@ import android.content.pm.PackageInfo;
import android.os.Environment;
import android.os.ParcelFileDescriptor;
import android.os.SELinux;
import android.system.ErrnoException;
import android.system.Os;
import android.system.StructStat;
import android.util.Log;
import com.android.org.bouncycastle.util.encoders.Base64;
@@ -37,10 +40,7 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import libcore.io.ErrnoException;
import libcore.io.Libcore;
import libcore.io.StructStat;
import static libcore.io.OsConstants.*;
import static android.system.OsConstants.*;
/**
* Backup transport for stashing stuff into a known location on disk, and
@@ -109,7 +109,7 @@ public class LocalTransport extends IBackupTransport.Stub {
public int performBackup(PackageInfo packageInfo, ParcelFileDescriptor data) {
if (DEBUG) {
try {
StructStat ss = Libcore.os.fstat(data.getFileDescriptor());
StructStat ss = Os.fstat(data.getFileDescriptor());
Log.v(TAG, "performBackup() pkg=" + packageInfo.packageName
+ " size=" + ss.st_size);
} catch (ErrnoException e) {
@@ -152,7 +152,7 @@ public class LocalTransport extends IBackupTransport.Stub {
changeSet.readEntityData(buf, 0, dataSize);
if (DEBUG) {
try {
long cur = Libcore.os.lseek(data.getFileDescriptor(), 0, SEEK_CUR);
long cur = Os.lseek(data.getFileDescriptor(), 0, SEEK_CUR);
Log.v(TAG, " read entity data; new pos=" + cur);
}
catch (ErrnoException e) {

View File

@@ -21,11 +21,11 @@ import static android.drm.DrmManagerClient.INVALID_SESSION;
import static libcore.io.OsConstants.SEEK_SET;
import android.os.ParcelFileDescriptor;
import android.system.ErrnoException;
import android.system.Os;
import android.util.Log;
import libcore.io.ErrnoException;
import libcore.io.IoBridge;
import libcore.io.Libcore;
import libcore.io.Streams;
import java.io.FileDescriptor;
@@ -69,7 +69,7 @@ public class DrmOutputStream extends OutputStream {
final DrmConvertedStatus status = mClient.closeConvertSession(mSessionId);
if (status.statusCode == STATUS_OK) {
try {
Libcore.os.lseek(mFd, status.offset, SEEK_SET);
Os.lseek(mFd, status.offset, SEEK_SET);
} catch (ErrnoException e) {
e.rethrowAsIOException();
}

View File

@@ -74,6 +74,8 @@ import android.os.WorkSource;
import android.os.Environment.UserEnvironment;
import android.os.storage.IMountService;
import android.provider.Settings;
import android.system.ErrnoException;
import android.system.Os;
import android.util.EventLog;
import android.util.Log;
import android.util.Slog;
@@ -142,9 +144,6 @@ import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.PBEKeySpec;
import javax.crypto.spec.SecretKeySpec;
import libcore.io.ErrnoException;
import libcore.io.Libcore;
public class BackupManagerService extends IBackupManager.Stub {
private static final String TAG = "BackupManagerService";
@@ -2471,7 +2470,7 @@ public class BackupManagerService extends IBackupManager.Stub {
// operations any more during this pass).
Slog.w(TAG, "Unable to save widget state for " + pkgName);
try {
Libcore.os.ftruncate(fd, filepos);
Os.ftruncate(fd, filepos);
} catch (ErrnoException ee) {
Slog.w(TAG, "Unable to roll back!");
}