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

Commit a194cc7d authored by Mike Lockwood's avatar Mike Lockwood
Browse files

MTP: Support format argument in host GetObjectPropDesc command



Change-Id: Ic14313c0f95bea1d1d475cc6a001b256fccb91c8
Signed-off-by: default avatarMike Lockwood <lockwood@android.com>
parent bf1dbd19
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -110,7 +110,7 @@ void MtpDevice::print() {
            if (props) {
                for (int j = 0; j < props->size(); j++) {
                    MtpObjectProperty prop = (*props)[j];
                    MtpProperty* property = getObjectPropDesc(prop);
                    MtpProperty* property = getObjectPropDesc(prop, format);
                    if (property)
                        property->print();
                    else
@@ -400,11 +400,12 @@ MtpProperty* MtpDevice::getDevicePropDesc(MtpDeviceProperty code) {
    return NULL;
}

MtpProperty* MtpDevice::getObjectPropDesc(MtpObjectProperty code) {
MtpProperty* MtpDevice::getObjectPropDesc(MtpObjectProperty code, MtpObjectFormat format) {
    Mutex::Autolock autoLock(mMutex);

    mRequest.reset();
    mRequest.setParameter(1, code);
    mRequest.setParameter(2, format);
    if (!sendRequest(MTP_OPERATION_GET_OBJECT_PROP_DESC))
        return NULL;
    if (!readData())
+1 −1
Original line number Diff line number Diff line
@@ -89,7 +89,7 @@ public:
    MtpObjectPropertyList*  getObjectPropsSupported(MtpObjectFormat format);

    MtpProperty*            getDevicePropDesc(MtpDeviceProperty code);
    MtpProperty*            getObjectPropDesc(MtpObjectProperty code);
    MtpProperty*            getObjectPropDesc(MtpObjectProperty code, MtpObjectFormat format);

    bool                   readObject(MtpObjectHandle handle, const char* destPath, int group,
                                    int perm);