Projects >> platform_frameworks_base >>1272c8b76b91103648dda7a8ac30f3f14e16782d

Chunk
Conflicting content
    private static native int createPipeNative(FileDescriptor[] outFds);

    /**
<<<<<<< HEAD
     * Gets a file descriptor for a read-only copy of the given data.
     *
     * @param data Data to copy.
     * @param name Name for the shared memory area that may back the file descriptor.
     *        This is purely informative and may be {@code null}.
     * @return A ParcelFileDescriptor.
     * @throws IOException if there is an error while creating the shared memory area.
     */
    public static ParcelFileDescriptor fromData(byte[] data, String name) throws IOException {
        if (data == null) return null;
        MemoryFile file = new MemoryFile(name, data.length);
        if (data.length > 0) {
            file.writeBytes(data, 0, 0, data.length);
        }
        file.deactivate();
        FileDescriptor fd = file.getFileDescriptor();
        return fd != null ? new ParcelFileDescriptor(fd) : null;
    }

    /**
=======
>>>>>>> de8635e4c4c9f674b52cb6041380c3ef2812630c
     * Retrieve the actual FileDescriptor associated with this object.
     * 
     * @return Returns the FileDescriptor associated with this object.
Solution content
    private static native int createPipeNative(FileDescriptor[] outFds);

    /**
     * Gets a file descriptor for a read-only copy of the given data.
     *
     * @param data Data to copy.
     * @param name Name for the shared memory area that may back the file descriptor.
     *        This is purely informative and may be {@code null}.
     * @return A ParcelFileDescriptor.
     * @throws IOException if there is an error while creating the shared memory area.
     */
    public static ParcelFileDescriptor fromData(byte[] data, String name) throws IOException {
        if (data == null) return null;
        MemoryFile file = new MemoryFile(name, data.length);
        if (data.length > 0) {
            file.writeBytes(data, 0, 0, data.length);
        }
        file.deactivate();
        FileDescriptor fd = file.getFileDescriptor();
        return fd != null ? new ParcelFileDescriptor(fd) : null;
    }

    /**
     * Retrieve the actual FileDescriptor associated with this object.
     * 
     * @return Returns the FileDescriptor associated with this object.
File
ParcelFileDescriptor.java
Developer's decision
Version 1
Kind of conflict
Comment
Method declaration