use updated mStorage for new MtpObject when copy file between storages

copy file from sdcard to internal storage through MTP,
then the file can't be renamed

bug: 147715888

Change-Id: Iffeeeb1372e0ecf305cf0c70edb601a4b2001342
This commit is contained in:
joker.yang
2020-01-16 08:16:05 +08:00
committed by joker yang
parent 2b0ac97d95
commit 5be80641b7

View File

@@ -229,9 +229,16 @@ public class MtpStorageManager {
}
private void setParent(MtpObject parent) {
if (this.getStorageId() != parent.getStorageId()) {
mStorage = Preconditions.checkNotNull(parent.getStorage());
}
mParent = parent;
}
private MtpStorage getStorage() {
return mStorage;
}
private void setDir(boolean dir) {
if (dir != mIsDir) {
mIsDir = dir;