summaryrefslogtreecommitdiff
path: root/libs/services/src
diff options
context:
space:
mode:
authorSami Kyostila <skyostil@google.com>2018-01-12 18:28:13 +0000
committerSami Kyostila <skyostil@google.com>2018-01-12 19:04:02 +0000
commit52c866eea41549d0efc4d09f95f0c6d401b78b82 (patch)
treed786c2fa47853888c11d0984133ae8315022cdff /libs/services/src
parent200cd63fb3ff5b4354773e9994f4340f18b39cbc (diff)
DropBoxManager: Allow adding a file using an fd
This patch adds an overload to DropBoxManager::addFile() which accepts an already-opened file as a file descriptor. This avoids the need for clients to create a filesystem-visible file when uploading data to DropBox. Test: Tested with perfetto using https://android-review.googlesource.com/c/platform/external/perfetto/+/587674 Change-Id: I076bfd3180fb9b4baff7e1bae2e611419061b2a7
Diffstat (limited to 'libs/services/src')
-rw-r--r--libs/services/src/os/DropBoxManager.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/libs/services/src/os/DropBoxManager.cpp b/libs/services/src/os/DropBoxManager.cpp
index 1c760e850e4f..f5685d9ca753 100644
--- a/libs/services/src/os/DropBoxManager.cpp
+++ b/libs/services/src/os/DropBoxManager.cpp
@@ -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);
}