diff options
author | Scott Lobdell <slobdell@google.com> | 2021-07-27 17:02:32 +0000 |
---|---|---|
committer | Scott Lobdell <slobdell@google.com> | 2021-07-27 17:02:32 +0000 |
commit | cb84bc77bfeb89a940d8439f7458fe5d9bef7bef (patch) | |
tree | d6e70908803e918eb485e058341ce55d0a957188 /media/jni/android_mtp_MtpDevice.cpp | |
parent | dc5ea9d31ab76ba378da9c550813e6b7d8be1e69 (diff) | |
parent | 6aa393b52cd7362100a2b3e9b0b1dece473cf6dd (diff) |
Merge SP1A.210723.002
Change-Id: I220cdfc5cb9db40162fd33f400a54591018d54cf
Diffstat (limited to 'media/jni/android_mtp_MtpDevice.cpp')
-rw-r--r-- | media/jni/android_mtp_MtpDevice.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/media/jni/android_mtp_MtpDevice.cpp b/media/jni/android_mtp_MtpDevice.cpp index ac89fecd9150..8436ba412b2d 100644 --- a/media/jni/android_mtp_MtpDevice.cpp +++ b/media/jni/android_mtp_MtpDevice.cpp @@ -416,20 +416,14 @@ android_mtp_MtpDevice_set_device_property_init_version(JNIEnv *env, jobject thiz return -1; } - MtpProperty* property = new MtpProperty(MTP_DEVICE_PROPERTY_SESSION_INITIATOR_VERSION_INFO, - MTP_TYPE_STR, true); - if (!property) { - env->ThrowNew(clazz_io_exception, "Failed to obtain property."); - return -1; - } - - if (property->getDataType() != MTP_TYPE_STR) { + MtpProperty property(MTP_DEVICE_PROPERTY_SESSION_INITIATOR_VERSION_INFO, MTP_TYPE_STR, true); + if (property.getDataType() != MTP_TYPE_STR) { env->ThrowNew(clazz_io_exception, "Unexpected property data type."); return -1; } - property->setCurrentValue(propertyStr); - if (!device->setDevicePropValueStr(property)) { + property.setCurrentValue(propertyStr); + if (!device->setDevicePropValueStr(&property)) { env->ThrowNew(clazz_io_exception, "Failed to obtain property value."); return -1; } |