Skip to content

Commit

Permalink
Fix Android app Permission denied error on Android 10 (#1175)
Browse files Browse the repository at this point in the history
Use scoped storage instead of Downloads directory

Co-authored-by: Animesh Bohara <abohara@cs.cmu.edu>
  • Loading branch information
anibohara2000 and Animesh Bohara authored Nov 1, 2023
1 parent 200653a commit 9831135
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ class AppViewModel(application: Application) : AndroidViewModel(application) {
val url = URL("${modelUrl}${ModelUrlSuffix}${ModelConfigFilename}")
val tempId = UUID.randomUUID().toString()
val tempFile = File(
Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS),
application.getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS),
tempId
)
url.openStream().use {
Expand Down

0 comments on commit 9831135

Please sign in to comment.