Not create document under the device.
The structure of files in MtpDocumentsProvider looks like /device/storage/files. But MtpDocumentsProvider shows files just under the device if the device has only single storage. It causes a problem that MtpDocumentsProvider tries to create a file under the device. Previously it tries to create a file with storageId = 0, which means MTP device choose a storage to store the file. Because it only happens when the device has a single storage, the file is properly written to the device. But the database in MtpDocumentsProvider goes into the illegal state where the file is placed just under the device. Bug: 32561572 Test: adb shell am instrument -w -e class com.android.mtp.MtpDocumentsProviderTest com.android.mtp.tests/com.android.mtp.TestResultInstrumentation Change-Id: I47a373ceee8a64ba9995934317693e79d2497ee0 (cherry picked from commit 35b2ec55)
Loading
Please register or sign in to comment