Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changes/fix-android-min-sdk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"tauri": patch:bug
---

Update path plugin to use older dataDir API on SDK < 24.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
package app.tauri

import android.app.Activity
import android.os.Build
import android.os.Environment
import app.tauri.annotation.Command
import app.tauri.annotation.TauriPlugin
Expand Down Expand Up @@ -34,12 +35,20 @@ class PathPlugin(private val activity: Activity): Plugin(activity) {

@Command
fun getConfigDir(invoke: Invoke) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
resolvePath(invoke, activity.dataDir.absolutePath)
} else {
resolvePath(invoke, activity.applicationInfo.dataDir)
}
}

@Command
fun getDataDir(invoke: Invoke) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
resolvePath(invoke, activity.dataDir.absolutePath)
} else {
resolvePath(invoke, activity.applicationInfo.dataDir)
}
}

@Command
Expand Down