MTP: enable new cancel behavior in short packet handling
Since short packet handling still use older cancel bahavior,
the cancel may be failed if users copy specific files to the
PC.
This patch will send batchcancel flag to cancelEvents in
short packet handling so that cancelEvents function will
select the cancel behavior by batchcancel flag.
Bug: 181729410
Test: verified with specific files
Signed-off-by: sekaiacg <sekaiacg@gmail.com>
Change-Id: I21b4fef854330e39f0ad8fe0a299b7194242967d
diff --git a/mtp/ffs/MtpFfsHandle.cpp b/mtp/ffs/MtpFfsHandle.cpp
index 9356d4c..a46cf1f 100644
--- a/mtp/ffs/MtpFfsHandle.cpp
+++ b/mtp/ffs/MtpFfsHandle.cpp
@@ -518,7 +518,8 @@
}
}
if (short_packet) {
- if (cancelEvents(mIobuf[i].iocb.data(), ioevs, short_i, mIobuf[i].actual, false)) {
+ if (cancelEvents(mIobuf[i].iocb.data(), ioevs, short_i, mIobuf[i].actual,
+ mBatchCancel)) {
write_error = true;
}
}