#557 fixed permission confusion when removable volume changes
This commit is contained in:
parent
18e120a6d3
commit
b15f5832d9
2 changed files with 15 additions and 1 deletions
|
@ -6,6 +6,10 @@ All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
## <a id="v1.8.4"></a>[v1.8.4] - 2023-03-17
|
## <a id="v1.8.4"></a>[v1.8.4] - 2023-03-17
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- permission confusion when removable volume changes
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
- TV: improved support for Licenses
|
- TV: improved support for Licenses
|
||||||
|
|
|
@ -348,7 +348,17 @@ object StorageUtils {
|
||||||
|
|
||||||
// fallback when UUID does not appear in the SD card volume path
|
// fallback when UUID does not appear in the SD card volume path
|
||||||
val primaryVolumePath = getPrimaryVolumePath(context)
|
val primaryVolumePath = getPrimaryVolumePath(context)
|
||||||
getVolumePaths(context).firstOrNull { it != primaryVolumePath }?.let { return it }
|
getVolumePaths(context).firstOrNull { volumePath ->
|
||||||
|
if (volumePath == primaryVolumePath) {
|
||||||
|
false
|
||||||
|
} else {
|
||||||
|
// exclude volumes that use regular naming scheme with UUID in them
|
||||||
|
// to prevent returning path with the UUID of a new volume
|
||||||
|
// when the argument is the UUID of an obsolete volume
|
||||||
|
val volumeUuid = volumePath.split(File.separator).lastOrNull { it.isNotEmpty() }
|
||||||
|
!(volumeUuid == null || volumeUuid.matches(UUID_PATTERN))
|
||||||
|
}
|
||||||
|
}?.let { return it }
|
||||||
|
|
||||||
Log.e(LOG_TAG, "failed to find volume path for UUID=$uuid")
|
Log.e(LOG_TAG, "failed to find volume path for UUID=$uuid")
|
||||||
return null
|
return null
|
||||||
|
|
Loading…
Reference in a new issue