File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
crates/tauri/mobile/android/src/main/java/app/tauri Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " tauri " : patch:bug
3
+ ---
4
+
5
+ Update path plugin to use older dataDir API on SDK < 24.
Original file line number Diff line number Diff line change 5
5
package app.tauri
6
6
7
7
import android.app.Activity
8
+ import android.os.Build
8
9
import android.os.Environment
9
10
import app.tauri.annotation.Command
10
11
import app.tauri.annotation.TauriPlugin
@@ -34,12 +35,20 @@ class PathPlugin(private val activity: Activity): Plugin(activity) {
34
35
35
36
@Command
36
37
fun getConfigDir (invoke : Invoke ) {
38
+ if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .N ) {
37
39
resolvePath(invoke, activity.dataDir.absolutePath)
40
+ } else {
41
+ resolvePath(invoke, activity.applicationInfo.dataDir)
42
+ }
38
43
}
39
44
40
45
@Command
41
46
fun getDataDir (invoke : Invoke ) {
47
+ if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .N ) {
42
48
resolvePath(invoke, activity.dataDir.absolutePath)
49
+ } else {
50
+ resolvePath(invoke, activity.applicationInfo.dataDir)
51
+ }
43
52
}
44
53
45
54
@Command
You can’t perform that action at this time.
0 commit comments