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

Commit 8552eb76 authored by Primiano Tucci's avatar Primiano Tucci Committed by android-build-merger
Browse files

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

am: 71411b87

Change-Id: I8c07b8650a508f03352075ac7bd6e7943f6cacb4
parents c8f0e0da 71411b87
Loading
Loading
Loading
Loading
+5 −1
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
@@ -179,7 +179,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);
}