File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
ui/src/main/java/com/wireguard/android/activity Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -204,9 +204,9 @@ class TvMainActivity : AppCompatActivity() {
204
204
val storageManager: StorageManager = getSystemService() ? : return @withContext list
205
205
list.addAll(storageManager.storageVolumes.mapNotNull { volume ->
206
206
if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .R ) {
207
- volume.directory?.let { KeyedFile (it.canonicalPath) }
207
+ volume.directory?.let { KeyedFile (it.canonicalPath, volume.getDescription( this @TvMainActivity) ) }
208
208
} else {
209
- KeyedFile ((StorageVolume ::class .java.getMethod(" getPathFile" ).invoke(volume) as File ).canonicalPath)
209
+ KeyedFile ((StorageVolume ::class .java.getMethod(" getPathFile" ).invoke(volume) as File ).canonicalPath, volume.getDescription( this @TvMainActivity) )
210
210
}
211
211
})
212
212
} else {
@@ -319,9 +319,9 @@ class TvMainActivity : AppCompatActivity() {
319
319
}
320
320
}
321
321
322
- class KeyedFile (pathname : String ) : File(pathname), Keyed<String> {
322
+ class KeyedFile (pathname : String , private val forcedKey : String? = null ) : File(pathname), Keyed<String> {
323
323
override val key: String
324
- get() = if (isDirectory) " $name /" else name
324
+ get() = forcedKey ? : if (isDirectory) " $name /" else name
325
325
}
326
326
327
327
companion object {
You can’t perform that action at this time.
0 commit comments