Skip to content

Commit

Permalink
ensure we have proper place for logs
Browse files Browse the repository at this point in the history
  • Loading branch information
nift4 committed Jan 18, 2025
1 parent 41582c9 commit 7fd39bc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/src/main/java/org/andbootmgr/app/util/Terminal.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.andbootmgr.app.util

import android.os.Environment
import android.util.Log
import androidx.compose.foundation.horizontalScroll
import androidx.compose.foundation.layout.Column
Expand Down Expand Up @@ -172,7 +173,8 @@ fun TerminalWork(logFile: String? = null, action: suspend (TerminalList) -> Unit
val ctx = LocalContext.current.applicationContext
LaunchedEffect(Unit) {
val logDispatcher = Dispatchers.IO.limitedParallelism(1)
val log = logFile?.let { SuFileOutputStream.open(File(ctx.externalCacheDirs.first(), it)) }
val log = logFile?.let { SuFileOutputStream.open(File(ctx.externalCacheDirs
.filterNotNull().firstOrNull() ?: File(Environment.getExternalStorageDirectory(), "AbmLogs"), it)) }
val s = BudgetCallbackList(CoroutineScope(logDispatcher), log)
StayAliveConnection(ctx, {
withContext(Dispatchers.Default) {
Expand Down

0 comments on commit 7fd39bc

Please sign in to comment.