diff options
author | Mike Lockwood <lockwood@google.com> | 2011-12-02 13:22:17 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-12-02 13:22:17 -0800 |
commit | fa845c6d4637fee51b34d9c1cf06db42b97ac0f4 (patch) | |
tree | b6241932aebde1c0f71c9d52d63bb2ea7ef5adf7 | |
parent | 7570af16ad9ad892d9cff6d733d29a25d736586d (diff) | |
parent | fed8bb604c31bf6a60ca84aafed016d21d3e0f90 (diff) | |
download | frameworks_av-fa845c6d4637fee51b34d9c1cf06db42b97ac0f4.zip frameworks_av-fa845c6d4637fee51b34d9c1cf06db42b97ac0f4.tar.gz frameworks_av-fa845c6d4637fee51b34d9c1cf06db42b97ac0f4.tar.bz2 |
am 1a3ece9f: Merge "MTP: Add support for restricting PTP to only certain subdirectories of the storage DO NOT MERGE" into ics-mr1
* commit '1a3ece9f871c94eb524543ae618a2a1c88cab2cd':
MTP: Add support for restricting PTP to only certain subdirectories of the storage DO NOT MERGE
-rw-r--r-- | media/mtp/MtpServer.cpp | 11 |
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() { |