Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6c11077d authored by kyle_tso's avatar kyle_tso Committed by android-build-merger
Browse files

Merge "Add support of directory copy"

am: 63131439

Change-Id: I1cd990c87f0de15e642713602183e14e672b7ff9
parents 15b0a63b 63131439
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -45,6 +45,8 @@ public:
                                            MtpObjectFormat format,
                                            bool succeeded) = 0;

    virtual void                    doScanDirectory(const char* path) = 0;

    virtual MtpObjectHandleList*    getObjectList(MtpStorageID storageID,
                                            MtpObjectFormat format,
                                            MtpObjectHandle parent) = 0;
+3 −0
Original line number Diff line number Diff line
@@ -1148,6 +1148,7 @@ MtpResponseCode MtpServer::doCopyObject() {
    ALOGV("Copying file from %s to %s", (const char*)fromPath, (const char*)path);
    if (format == MTP_FORMAT_ASSOCIATION) {
        int ret = makeFolder((const char *)path);
        ret += copyRecursive(fromPath, path);
        if (ret) {
            result = MTP_RESPONSE_GENERAL_ERROR;
        }
@@ -1158,6 +1159,8 @@ MtpResponseCode MtpServer::doCopyObject() {
    }

    mDatabase->endSendObject(path, handle, format, result);
    if (format == MTP_FORMAT_ASSOCIATION)
        mDatabase->doScanDirectory(path);
    mResponse.setParameter(1, handle);
    return result;
}