- OCFile downloadedFile = mStorageManager.getFileByPath(downloadedRemotePath); // if null, the file is not in the current account, OR WAS DELETED before the download finished \r
- \r
- if (accountName.equals(AccountUtils.getCurrentOwnCloudAccount(context).name) &&\r
- mCurrentDir != null && downloadedFile != null &&\r
- mCurrentDir.getFileId() == downloadedFile.getParentId()) {\r
+ boolean sameAccount = accountName.equals(AccountUtils.getCurrentOwnCloudAccount(context).name);\r
+ boolean isDescendant = (mCurrentDir != null) && (downloadedRemotePath != null) && (downloadedRemotePath.startsWith(mCurrentDir.getRemotePath()));\r
+ if (sameAccount && isDescendant) {\r