diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DwnldDelegate.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DwnldDelegate.java index b17cc33e5..de7c8c7fd 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DwnldDelegate.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DwnldDelegate.java @@ -139,7 +139,7 @@ public class DwnldDelegate extends ListDelegateBase { InputStream is = conn.getInputStream(); String name = basename( m_uri.getPath() ); if ( m_isApp ) { - m_appFile = saveToDownloads( is, name, this ); + m_appFile = saveToPrivate( is, name, this ); } else { m_savedDict = saveDict( is, name, this ); } @@ -200,14 +200,18 @@ public class DwnldDelegate extends ListDelegateBase { }); } - private File saveToDownloads( InputStream is, String name, - DictUtils.DownProgListener dpl ) + private File saveToPrivate( InputStream is, String name, + DictUtils.DownProgListener dpl) { + File appFile = null; boolean success = false; - File appFile = new File( DictUtils.getDownloadDir( m_activity ), name ); - byte[] buf = new byte[1024*4]; + try { + // directory first + appFile = new File(m_activity.getFilesDir(), "apks"); + appFile.mkdirs(); + appFile = new File( appFile, name ); FileOutputStream fos = new FileOutputStream( appFile ); boolean cancelled = false; for ( ; ; ) { @@ -325,7 +329,9 @@ public class DwnldDelegate extends ListDelegateBase { DictUtils.DictLoc loc = XWPrefs.getDefaultLoc( m_activity ); for ( DownloadFilesTask task : m_dfts ) { - if ( task.forApp() || DictUtils.DictLoc.DOWNLOAD == loc ) { + if ( task.forApp() ) { + // Needn't do anything + } else if ( DictUtils.DictLoc.DOWNLOAD == loc ) { result = true; break; } diff --git a/xwords4/android/app/src/main/res/xml/provider_paths.xml b/xwords4/android/app/src/main/res/xml/provider_paths.xml index ed52e8162..e2a61b1f1 100644 --- a/xwords4/android/app/src/main/res/xml/provider_paths.xml +++ b/xwords4/android/app/src/main/res/xml/provider_paths.xml @@ -1,4 +1,5 @@ +