Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 34385d35 authored by Elliott Hughes's avatar Elliott Hughes
Browse files

Track libcore.os' move to android.system.

(This is partial, but should cover everything in AOSP master except
for the zygote.)

Change-Id: I1042c99245765746a744c44e714095cb2c6cb75d
parent 3f4867f4
Loading
Loading
Loading
Loading
+6 −6
Original line number Original line Diff line number Diff line
@@ -19,6 +19,9 @@ package android.app;
import android.content.SharedPreferences;
import android.content.SharedPreferences;
import android.os.FileUtils;
import android.os.FileUtils;
import android.os.Looper;
import android.os.Looper;
import android.system.ErrnoException;
import android.system.Os;
import android.system.StructStat;
import android.util.Log;
import android.util.Log;


import com.google.android.collect.Maps;
import com.google.android.collect.Maps;
@@ -44,10 +47,7 @@ import java.util.WeakHashMap;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.ExecutorService;


import libcore.io.ErrnoException;
import libcore.io.IoUtils;
import libcore.io.IoUtils;
import libcore.io.Libcore;
import libcore.io.StructStat;


final class SharedPreferencesImpl implements SharedPreferences {
final class SharedPreferencesImpl implements SharedPreferences {
    private static final String TAG = "SharedPreferencesImpl";
    private static final String TAG = "SharedPreferencesImpl";
@@ -111,7 +111,7 @@ final class SharedPreferencesImpl implements SharedPreferences {
        Map map = null;
        Map map = null;
        StructStat stat = null;
        StructStat stat = null;
        try {
        try {
            stat = Libcore.os.stat(mFile.getPath());
            stat = Os.stat(mFile.getPath());
            if (mFile.canRead()) {
            if (mFile.canRead()) {
                BufferedInputStream str = null;
                BufferedInputStream str = null;
                try {
                try {
@@ -173,7 +173,7 @@ final class SharedPreferencesImpl implements SharedPreferences {
             * violation, but we explicitly want this one.
             * violation, but we explicitly want this one.
             */
             */
            BlockGuard.getThreadPolicy().onReadFromDisk();
            BlockGuard.getThreadPolicy().onReadFromDisk();
            stat = Libcore.os.stat(mFile.getPath());
            stat = Os.stat(mFile.getPath());
        } catch (ErrnoException e) {
        } catch (ErrnoException e) {
            return true;
            return true;
        }
        }
@@ -600,7 +600,7 @@ final class SharedPreferencesImpl implements SharedPreferences {
            str.close();
            str.close();
            ContextImpl.setFilePermissionsFromMode(mFile.getPath(), mMode, 0);
            ContextImpl.setFilePermissionsFromMode(mFile.getPath(), mMode, 0);
            try {
            try {
                final StructStat stat = Libcore.os.stat(mFile.getPath());
                final StructStat stat = Os.stat(mFile.getPath());
                synchronized (this) {
                synchronized (this) {
                    mStatTimestamp = stat.st_mtime;
                    mStatTimestamp = stat.st_mtime;
                    mStatSize = stat.st_size;
                    mStatSize = stat.st_size;
+7 −8
Original line number Original line Diff line number Diff line
@@ -29,6 +29,10 @@ import android.os.Looper;
import android.os.ParcelFileDescriptor;
import android.os.ParcelFileDescriptor;
import android.os.Process;
import android.os.Process;
import android.os.RemoteException;
import android.os.RemoteException;
import android.system.ErrnoException;
import android.system.Os;
import android.system.OsConstants;
import android.system.StructStat;
import android.util.Log;
import android.util.Log;


import java.io.File;
import java.io.File;
@@ -38,11 +42,6 @@ import java.util.HashSet;
import java.util.LinkedList;
import java.util.LinkedList;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.CountDownLatch;


import libcore.io.ErrnoException;
import libcore.io.Libcore;
import libcore.io.OsConstants;
import libcore.io.StructStat;

/**
/**
 * Provides the central interface between an
 * Provides the central interface between an
 * application and Android's data backup infrastructure.  An application that wishes
 * application and Android's data backup infrastructure.  An application that wishes
@@ -412,7 +411,7 @@ public abstract class BackupAgent extends ContextWrapper {
                    }
                    }


                    // If it's a directory, enqueue its contents for scanning.
                    // If it's a directory, enqueue its contents for scanning.
                    StructStat stat = Libcore.os.lstat(filePath);
                    StructStat stat = Os.lstat(filePath);
                    if (OsConstants.S_ISLNK(stat.st_mode)) {
                    if (OsConstants.S_ISLNK(stat.st_mode)) {
                        if (DEBUG) Log.i(TAG, "Symlink (skipping)!: " + file);
                        if (DEBUG) Log.i(TAG, "Symlink (skipping)!: " + file);
                        continue;
                        continue;
+3 −4
Original line number Original line Diff line number Diff line
@@ -20,6 +20,8 @@ import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager;
import android.os.ParcelFileDescriptor;
import android.os.ParcelFileDescriptor;
import android.system.ErrnoException;
import android.system.Os;
import android.util.Log;
import android.util.Log;


import java.io.File;
import java.io.File;
@@ -27,9 +29,6 @@ import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.IOException;


import libcore.io.ErrnoException;
import libcore.io.Libcore;

/**
/**
 * Global constant definitions et cetera related to the full-backup-to-fd
 * Global constant definitions et cetera related to the full-backup-to-fd
 * binary format.  Nothing in this namespace is part of any API; it's all
 * binary format.  Nothing in this namespace is part of any API; it's all
@@ -150,7 +149,7 @@ public class FullBackup {
            try {
            try {
                // explicitly prevent emplacement of files accessible by outside apps
                // explicitly prevent emplacement of files accessible by outside apps
                mode &= 0700;
                mode &= 0700;
                Libcore.os.chmod(outFile.getPath(), (int)mode);
                Os.chmod(outFile.getPath(), (int)mode);
            } catch (ErrnoException e) {
            } catch (ErrnoException e) {
                e.rethrowAsIOException();
                e.rethrowAsIOException();
            }
            }
+7 −7
Original line number Original line Diff line number Diff line
@@ -24,13 +24,13 @@ import java.net.InetAddress;
import java.net.InterfaceAddress;
import java.net.InterfaceAddress;
import java.net.UnknownHostException;
import java.net.UnknownHostException;


import static libcore.io.OsConstants.IFA_F_DADFAILED;
import static android.system.OsConstants.IFA_F_DADFAILED;
import static libcore.io.OsConstants.IFA_F_DEPRECATED;
import static android.system.OsConstants.IFA_F_DEPRECATED;
import static libcore.io.OsConstants.IFA_F_TENTATIVE;
import static android.system.OsConstants.IFA_F_TENTATIVE;
import static libcore.io.OsConstants.RT_SCOPE_HOST;
import static android.system.OsConstants.RT_SCOPE_HOST;
import static libcore.io.OsConstants.RT_SCOPE_LINK;
import static android.system.OsConstants.RT_SCOPE_LINK;
import static libcore.io.OsConstants.RT_SCOPE_SITE;
import static android.system.OsConstants.RT_SCOPE_SITE;
import static libcore.io.OsConstants.RT_SCOPE_UNIVERSE;
import static android.system.OsConstants.RT_SCOPE_UNIVERSE;


/**
/**
 * Identifies an IP address on a network link.
 * Identifies an IP address on a network link.
+5 −5
Original line number Original line Diff line number Diff line
@@ -22,9 +22,9 @@ import java.io.InputStream;
import java.io.FileDescriptor;
import java.io.FileDescriptor;
import java.net.SocketOptions;
import java.net.SocketOptions;


import libcore.io.ErrnoException;
import android.system.ErrnoException;
import libcore.io.Libcore;
import android.system.Os;
import libcore.io.OsConstants;
import android.system.OsConstants;


/**
/**
 * Socket implementation used for android.net.LocalSocket and
 * Socket implementation used for android.net.LocalSocket and
@@ -248,7 +248,7 @@ class LocalSocketImpl
                    throw new IllegalStateException("unknown sockType");
                    throw new IllegalStateException("unknown sockType");
            }
            }
            try {
            try {
                fd = Libcore.os.socket(OsConstants.AF_UNIX, osType, 0);
                fd = Os.socket(OsConstants.AF_UNIX, osType, 0);
                mFdCreatedInternally = true;
                mFdCreatedInternally = true;
            } catch (ErrnoException e) {
            } catch (ErrnoException e) {
                e.rethrowAsIOException();
                e.rethrowAsIOException();
@@ -268,7 +268,7 @@ class LocalSocketImpl
                return;
                return;
            }
            }
            try {
            try {
                Libcore.os.close(fd);
                Os.close(fd);
            } catch (ErrnoException e) {
            } catch (ErrnoException e) {
                e.rethrowAsIOException();
                e.rethrowAsIOException();
            }
            }
Loading