summaryrefslogtreecommitdiff
path: root/media/mtp/MtpServer.cpp
diff options
context:
space:
mode:
author Mike Lockwood <lockwood@google.com> 2011-12-02 08:17:33 -0800
committer Android (Google) Code Review <android-gerrit@google.com> 2011-12-02 08:17:33 -0800
commit6a5c1a9574e857a80c8e4ca13f3b5f0439d331c9 (patch)
tree2fe42989e2f0534bcb5ecea476ed64ab17d5d3b4 /media/mtp/MtpServer.cpp
parent09bd918c5d710cf500a3f16bc4021348c1677507 (diff)
parent73e56d935e7c9b8a06e4781c4995e407e118f93d (diff)
Merge "MTP: Add support for restricting PTP to only certain subdirectories of the storage"
Diffstat (limited to 'media/mtp/MtpServer.cpp')
-rw-r--r--media/mtp/MtpServer.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/media/mtp/MtpServer.cpp b/media/mtp/MtpServer.cpp
index 51eb97f87f38..1334e6c2c828 100644
--- a/media/mtp/MtpServer.cpp
+++ b/media/mtp/MtpServer.cpp
@@ -1053,11 +1053,14 @@ MtpResponseCode MtpServer::doDeleteObject() {
int result = mDatabase->getObjectFilePath(handle, filePath, fileLength, format);
if (result == MTP_RESPONSE_OK) {
ALOGV("deleting %s", (const char *)filePath);
- deletePath((const char *)filePath);
- return mDatabase->deleteFile(handle);
- } else {
- return result;
+ result = mDatabase->deleteFile(handle);
+ // Don't delete the actual files unless the database deletion is allowed
+ if (result == MTP_RESPONSE_OK) {
+ deletePath((const char *)filePath);
+ }
}
+
+ return result;
}
MtpResponseCode MtpServer::doGetObjectPropDesc() {