android: fix startup crash (MediaStore rejects text/plain in DCIM); log sink fallback DCIM->Download->app-private, logging never throws

This commit is contained in:
ZXCLI
2026-09-10 00:48:56 +08:00
parent ee317c7b25
commit dbb4f24608
6 changed files with 142 additions and 73 deletions
@@ -10,8 +10,10 @@ import com.mag160c.thermal.ui.theme.Mag160cTheme
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// field-debug crash hook + logcat/file logger (file opens on connect)
// field-debug crash hook + log file (opened at startup so even
// early crashes are captured; logging never throws)
com.mag160c.thermal.media.DebugLog.init(applicationContext)
com.mag160c.thermal.media.DebugLog.startFile(applicationContext)
enableEdgeToEdge()
// immersive: hide the status bar (swipe to reveal)
window.insetsController?.let { c ->