Projects >> android_libcore >>5637884f8217dbf28de0913c06aceaf09c898510

Chunk
Conflicting content
            tagSocketFd(clientFd);
        }

<<<<<<< HEAD
=======
        public void bind(FileDescriptor aFD, InetAddress inetAddress, int port)
                throws SocketException {
            mNetwork.bind(aFD, inetAddress, port);
        }

>>>>>>> 1e8d508f2d97e19f2fc8a709330ea97e1e9f203a
        public int read(FileDescriptor aFD, byte[] data, int offset, int count) throws IOException {
            BlockGuard.getThreadPolicy().onNetwork();
            return mNetwork.read(aFD, data, offset, count);
Solution content
            tagSocketFd(clientFd);
        }

        public int read(FileDescriptor aFD, byte[] data, int offset, int count) throws IOException {
            BlockGuard.getThreadPolicy().onNetwork();
            return mNetwork.read(aFD, data, offset, count);
File
BlockGuard.java
Developer's decision
Version 1
Kind of conflict
Method declaration
Chunk
Conflicting content
import dalvik.system.BlockGuard;
import java.io.FileDescriptor;
<<<<<<< HEAD
import java.net.InetAddress;
=======
import java.net.SocketException;
>>>>>>> 1e8d508f2d97e19f2fc8a709330ea97e1e9f203a
import java.nio.ByteBuffer;
import static libcore.io.OsConstants.*;
Solution content
import dalvik.system.BlockGuard;
import java.io.FileDescriptor;
import java.net.InetAddress;
import java.net.SocketException;
import java.nio.ByteBuffer;
import static libcore.io.OsConstants.*;
File
BlockGuardOs.java
Developer's decision
Concatenation
Kind of conflict
Import
Chunk
Conflicting content
        super(os);
    }

<<<<<<< HEAD
    @Override public void connect(FileDescriptor fd, InetAddress address, int port) throws ErrnoException {
        BlockGuard.getThreadPolicy().onNetwork();
        os.connect(fd, address, port);
    }

    @Override public void fdatasync(FileDescriptor fd) throws ErrnoException {
=======
    @Override
    public void fdatasync(FileDescriptor fd) throws ErrnoException {
>>>>>>> 1e8d508f2d97e19f2fc8a709330ea97e1e9f203a
        BlockGuard.getThreadPolicy().onWriteToDisk();
        os.fdatasync(fd);
    }
Solution content
        super(os);
    }

    @Override public void connect(FileDescriptor fd, InetAddress address, int port) throws ErrnoException {
        BlockGuard.getThreadPolicy().onNetwork();
        os.connect(fd, address, port);
    }

    @Override public void fdatasync(FileDescriptor fd) throws ErrnoException {
        BlockGuard.getThreadPolicy().onWriteToDisk();
        os.fdatasync(fd);
    }
File
BlockGuardOs.java
Developer's decision
Version 1
Kind of conflict
Annotation
Method declaration
Method signature
Chunk
Conflicting content
        os.fdatasync(fd);
    }

<<<<<<< HEAD
    @Override public void fsync(FileDescriptor fd) throws ErrnoException {
=======
    @Override
    public void fsync(FileDescriptor fd) throws ErrnoException {
>>>>>>> 1e8d508f2d97e19f2fc8a709330ea97e1e9f203a
        BlockGuard.getThreadPolicy().onWriteToDisk();
        os.fsync(fd);
    }
Solution content
        os.fdatasync(fd);
    }

    @Override
    public void fsync(FileDescriptor fd) throws ErrnoException {
        BlockGuard.getThreadPolicy().onWriteToDisk();
        os.fsync(fd);
    }
File
BlockGuardOs.java
Developer's decision
Version 1
Kind of conflict
Annotation
Method signature
Chunk
Conflicting content
        os.fsync(fd);
    }

<<<<<<< HEAD
    @Override public void ftruncate(FileDescriptor fd, long length) throws ErrnoException {
=======
    @Override
    public void ftruncate(FileDescriptor fd, long length) throws ErrnoException {
>>>>>>> 1e8d508f2d97e19f2fc8a709330ea97e1e9f203a
        BlockGuard.getThreadPolicy().onWriteToDisk();
        os.ftruncate(fd, length);
    }
Solution content
        os.fsync(fd);
    }

    @Override
    public void ftruncate(FileDescriptor fd, long length) throws ErrnoException {
        BlockGuard.getThreadPolicy().onWriteToDisk();
        os.ftruncate(fd, length);
    }
File
BlockGuardOs.java
Developer's decision
Version 1
Kind of conflict
Annotation
Method signature
Chunk
Conflicting content
        os.ftruncate(fd, length);
    }

<<<<<<< HEAD
    @Override public FileDescriptor open(String path, int flags, int mode) throws ErrnoException {
=======
    @Override
    public FileDescriptor open(String path, int flags, int mode) throws ErrnoException {
>>>>>>> 1e8d508f2d97e19f2fc8a709330ea97e1e9f203a
        BlockGuard.getThreadPolicy().onReadFromDisk();
        if ((mode & O_ACCMODE) != O_RDONLY) {
            BlockGuard.getThreadPolicy().onWriteToDisk();
Solution content
        os.ftruncate(fd, length);
    }

    @Override
    public FileDescriptor open(String path, int flags, int mode) throws ErrnoException {
        BlockGuard.getThreadPolicy().onReadFromDisk();
        if ((mode & O_ACCMODE) != O_RDONLY) {
            BlockGuard.getThreadPolicy().onWriteToDisk();
File
BlockGuardOs.java
Developer's decision
Version 1
Kind of conflict
Annotation
Method signature
Chunk
Conflicting content
        return os.open(path, flags, mode);
    }

<<<<<<< HEAD
    @Override public int poll(StructPollfd[] fds, int timeoutMs) throws ErrnoException {
        // Greater than 0 is a timeout in milliseconds and -1 means "block forever",
        // but 0 means "poll and return immediately", which shouldn't be subject to BlockGuard.
        if (timeoutMs != 0) {
            BlockGuard.getThreadPolicy().onNetwork();
        }
        return os.poll(fds, timeoutMs);
    }

    @Override public int read(FileDescriptor fd, ByteBuffer buffer) throws ErrnoException {
=======
    @Override
    public int read(FileDescriptor fd, ByteBuffer buffer) throws ErrnoException {
>>>>>>> 1e8d508f2d97e19f2fc8a709330ea97e1e9f203a
        BlockGuard.getThreadPolicy().onReadFromDisk();
        return os.read(fd, buffer);
    }
Solution content
        return os.open(path, flags, mode);
    }

    @Override public int poll(StructPollfd[] fds, int timeoutMs) throws ErrnoException {
        // Greater than 0 is a timeout in milliseconds and -1 means "block forever",
        // but 0 means "poll and return immediately", which shouldn't be subject to BlockGuard.
        if (timeoutMs != 0) {
            BlockGuard.getThreadPolicy().onNetwork();
        }
        return os.poll(fds, timeoutMs);
    }

    @Override public int read(FileDescriptor fd, ByteBuffer buffer) throws ErrnoException {
        BlockGuard.getThreadPolicy().onReadFromDisk();
        return os.read(fd, buffer);
    }
File
BlockGuardOs.java
Developer's decision
Version 1
Kind of conflict
Annotation
Method declaration
Method signature
Chunk
Conflicting content
        return os.read(fd, buffer);
    }

<<<<<<< HEAD
    @Override public int read(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount) throws ErrnoException {
=======
    @Override
    public int read(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount) throws ErrnoException {
>>>>>>> 1e8d508f2d97e19f2fc8a709330ea97e1e9f203a
        BlockGuard.getThreadPolicy().onReadFromDisk();
        return os.read(fd, bytes, byteOffset, byteCount);
    }
Solution content
        return os.read(fd, buffer);
    }

    @Override
    public int read(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount) throws ErrnoException {
        BlockGuard.getThreadPolicy().onReadFromDisk();
        return os.read(fd, bytes, byteOffset, byteCount);
    }
File
BlockGuardOs.java
Developer's decision
Version 1
Kind of conflict
Annotation
Method signature
Chunk
Conflicting content
        return os.read(fd, bytes, byteOffset, byteCount);
    }

<<<<<<< HEAD
    @Override public int readv(FileDescriptor fd, Object[] buffers, int[] offsets, int[] byteCounts) throws ErrnoException {
=======
    @Override
    public int readv(FileDescriptor fd, Object[] buffers, int[] offsets, int[] byteCounts) throws ErrnoException {
>>>>>>> 1e8d508f2d97e19f2fc8a709330ea97e1e9f203a
        BlockGuard.getThreadPolicy().onReadFromDisk();
        return os.readv(fd, buffers, offsets, byteCounts);
    }
Solution content
        return os.read(fd, bytes, byteOffset, byteCount);
    }

    @Override
    public int readv(FileDescriptor fd, Object[] buffers, int[] offsets, int[] byteCounts) throws ErrnoException {
        BlockGuard.getThreadPolicy().onReadFromDisk();
        return os.readv(fd, buffers, offsets, byteCounts);
    }
File
BlockGuardOs.java
Developer's decision
Version 1
Kind of conflict
Annotation
Method signature
Chunk
Conflicting content
        return os.readv(fd, buffers, offsets, byteCounts);
    }

<<<<<<< HEAD
    @Override public int write(FileDescriptor fd, ByteBuffer buffer) throws ErrnoException {
=======
    @Override
    public FileDescriptor socket(int domain, int type, int protocol) throws ErrnoException {
        final FileDescriptor fd = os.socket(domain, type, protocol);
        try {
            BlockGuard.tagSocketFd(fd);
        } catch (SocketException e) {
            throw new ErrnoException("socket", EINVAL, e);
        }
        return fd;
    }

    @Override
    public int write(FileDescriptor fd, ByteBuffer buffer) throws ErrnoException {
>>>>>>> 1e8d508f2d97e19f2fc8a709330ea97e1e9f203a
        BlockGuard.getThreadPolicy().onWriteToDisk();
        return os.write(fd, buffer);
    }
Solution content
        return os.readv(fd, buffers, offsets, byteCounts);
    }

    @Override
    public FileDescriptor socket(int domain, int type, int protocol) throws ErrnoException {
        final FileDescriptor fd = os.socket(domain, type, protocol);
        try {
            BlockGuard.tagSocketFd(fd);
        } catch (SocketException e) {
            throw new ErrnoException("socket", EINVAL, e);
        }
        return fd;
    }

    @Override
    public int write(FileDescriptor fd, ByteBuffer buffer) throws ErrnoException {
        BlockGuard.getThreadPolicy().onWriteToDisk();
        return os.write(fd, buffer);
    }
File
BlockGuardOs.java
Developer's decision
Version 2
Kind of conflict
Annotation
Method declaration
Method signature
Chunk
Conflicting content
        return os.write(fd, buffer);
    }

<<<<<<< HEAD
    @Override public int write(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount) throws ErrnoException {
=======
    @Override
    public int write(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount) throws ErrnoException {
>>>>>>> 1e8d508f2d97e19f2fc8a709330ea97e1e9f203a
        BlockGuard.getThreadPolicy().onWriteToDisk();
        return os.write(fd, bytes, byteOffset, byteCount);
    }
Solution content
        return os.write(fd, buffer);
    }

    @Override
    public int write(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount) throws ErrnoException {
        BlockGuard.getThreadPolicy().onWriteToDisk();
        return os.write(fd, bytes, byteOffset, byteCount);
    }
File
BlockGuardOs.java
Developer's decision
Version 1
Kind of conflict
Annotation
Method signature
Chunk
Conflicting content
        return os.write(fd, bytes, byteOffset, byteCount);
    }

<<<<<<< HEAD
    @Override public int writev(FileDescriptor fd, Object[] buffers, int[] offsets, int[] byteCounts) throws ErrnoException {
=======
    @Override
    public int writev(FileDescriptor fd, Object[] buffers, int[] offsets, int[] byteCounts) throws ErrnoException {
>>>>>>> 1e8d508f2d97e19f2fc8a709330ea97e1e9f203a
        BlockGuard.getThreadPolicy().onWriteToDisk();
        return os.writev(fd, buffers, offsets, byteCounts);
    }
Solution content
        return os.write(fd, bytes, byteOffset, byteCount);
    }

    @Override
    public int writev(FileDescriptor fd, Object[] buffers, int[] offsets, int[] byteCounts) throws ErrnoException {
        BlockGuard.getThreadPolicy().onWriteToDisk();
        return os.writev(fd, buffers, offsets, byteCounts);
    }
File
BlockGuardOs.java
Developer's decision
Version 1
Kind of conflict
Annotation
Method signature