summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorMike Lockwood <lockwood@google.com>2011-12-01 16:58:41 -0500
committerMike Lockwood <lockwood@google.com>2011-12-02 15:12:47 -0500
commitfed8bb604c31bf6a60ca84aafed016d21d3e0f90 (patch)
treeb6241932aebde1c0f71c9d52d63bb2ea7ef5adf7 /media
parent8af4c7d02fc484ed1bdc082fc2a5383bc50f2180 (diff)
downloadframeworks_av-fed8bb604c31bf6a60ca84aafed016d21d3e0f90.zip
frameworks_av-fed8bb604c31bf6a60ca84aafed016d21d3e0f90.tar.gz
frameworks_av-fed8bb604c31bf6a60ca84aafed016d21d3e0f90.tar.bz2
MTP: Add support for restricting PTP to only certain subdirectories of the storage DO NOT MERGE
Bug: 5527220 Change-Id: I81d6de590ea3002118ba46eb4b6d5fe9061c998c Signed-off-by: Mike Lockwood <lockwood@google.com>
Diffstat (limited to 'media')
-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 dc6c011..1dcfb74 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) {
LOGV("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() {