1
0

kivy/android: ask for STORAGE permission at runtime

This commit is contained in:
SomberNight
2020-02-14 19:02:43 +01:00
committed by ThomasV
parent d5dc8d1ab2
commit 497d6019e1
2 changed files with 20 additions and 6 deletions

View File

@@ -426,12 +426,11 @@ def profiler(func):
def android_ext_dir():
import jnius
env = jnius.autoclass('android.os.Environment')
return env.getExternalStorageDirectory().getPath()
from android.storage import primary_external_storage_path
return primary_external_storage_path()
def android_backup_dir():
d = android_ext_dir() + '/org.electrum.electrum'
d = os.path.join(android_ext_dir(), 'org.electrum.electrum')
if not os.path.exists(d):
os.mkdir(d)
return d