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

Commit 0cccde6b authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "DropBoxManager: Allow adding a file using an fd"

parents 27507d86 52c866ee
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -58,6 +58,10 @@ public:
    // are required from the system process.  Returns NULL if the file can't be opened.
    Status addFile(const String16& tag, const string& filename, int flags);

    // Create a new Entry from an already opened file. Takes ownership of the
    // file descriptor.
    Status addFile(const String16& tag, int fd, int flags);

    class Entry : public virtual RefBase, public Parcelable {
    public:
        Entry();
+5 −0
Original line number Diff line number Diff line
@@ -202,7 +202,12 @@ DropBoxManager::addFile(const String16& tag, const string& filename, int flags)
        ALOGW("DropboxManager: %s", message.c_str());
        return Status::fromExceptionCode(Status::EX_ILLEGAL_STATE, message.c_str());
    }
    return addFile(tag, fd, flags);
}

Status
DropBoxManager::addFile(const String16& tag, int fd, int flags)
{
    Entry entry(tag, flags, fd);
    return add(entry);
}