Merge "DropboxManager: Add err message if passing an invalid fd to addFile()" am: 90529d212a am: 13d6ac4a35

am: 72b12e4222

Change-Id: Icfe984f46cb6e6cdc216d7182285c7e55abe93ab
This commit is contained in:
Primiano Tucci
2018-01-30 18:55:57 +00:00
committed by android-build-merger

View File

@@ -208,6 +208,11 @@ DropBoxManager::addFile(const String16& tag, const string& filename, int flags)
Status
DropBoxManager::addFile(const String16& tag, int fd, int flags)
{
if (fd == -1) {
string message("invalid fd (-1) passed to to addFile");
ALOGW("DropboxManager: %s", message.c_str());
return Status::fromExceptionCode(Status::EX_ILLEGAL_STATE, message.c_str());
}
Entry entry(tag, flags, fd);
return add(entry);
}
@@ -235,4 +240,3 @@ DropBoxManager::getNextEntry(const String16& tag, long msec, Entry* entry)
}
}} // namespace android::os