Merge "DropBoxManager: Allow adding a file using an fd"
This commit is contained in:
@@ -57,7 +57,11 @@ public:
|
||||
// and a handle will be passed to the system process, so no additional permissions
|
||||
// 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();
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user