mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-18 12:28:40 +00:00
fix(desktop): expose readable removable volumes in Dolphin (#2671)
This commit is contained in:
1 parent
d7c03ba3ec
commit
1951bbc92a
3 files changed
+123
-7
No files matched your search
@@ -1428,6 +1428,28 @@ class SessionService : Service() {
|
||||
} catch (e: Exception) {
|
||||
Log.w(TAG, "steam library: the list could not be written; the card alone this session", e)
|
||||
}
|
||||
if (SessionState.mode == MODE_DESKTOP) {
|
||||
try {
|
||||
val listing = File(filesDir, "session/desktop-volumes.json").apply { parentFile?.mkdirs() }
|
||||
val volumes = org.json.JSONArray()
|
||||
var room = if (ProotFastPath.enabled(this)) {
|
||||
ProotFastPath.MAX_BINDS - LinuxRuntime.binds(this, sessionRoot, runtimeDir, Environment.getExternalStorageDirectory(), binds).size
|
||||
} else Int.MAX_VALUE
|
||||
for (root in com.droiddeck.launcher.files.StorageRoots.list(this)) {
|
||||
if (!root.removable || !root.readable) continue
|
||||
val path = root.dir.absolutePath
|
||||
if (':' in path || '|' in path || room <= 0) continue
|
||||
binds.add(path)
|
||||
room--
|
||||
volumes.put(org.json.JSONObject().put("path", path).put("label", root.label))
|
||||
}
|
||||
listing.writeText(volumes.toString())
|
||||
val envAt = guest.indexOf(LinuxRuntime.SESSION_SCRIPT).takeIf { it >= 0 } ?: guest.size
|
||||
guest.add(envAt, "BL_DESKTOP_VOLUMES=" + listing.path)
|
||||
} catch (e: Exception) {
|
||||
Log.w(TAG, "desktop volumes: the list could not be written", e)
|
||||
}
|
||||
}
|
||||
return binds
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user