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

Commit 71411b87 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

Change-Id: Ie7a7071264cb91d26eb380b3155a5ed71667fb46
parents c4905215 a946cc9f
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);
}