diff --git a/loaders/android/bootstrap.java.in b/loaders/android/bootstrap.java.in index 7a27b643..fe55ef6e 100644 --- a/loaders/android/bootstrap.java.in +++ b/loaders/android/bootstrap.java.in @@ -75,6 +75,7 @@ public class @SYS_APPNAME@ extends Activity implements @ANDROID_JAVA_IMPLEMENTS@ //Variable declarations needed for modules, e.g. gps @ANDROID_JAVA_VARIABLES@ + int idle_tmScheduleRate = 250; Timer idle_tm = new Timer(); TimerTask idle_task = new TimerTask() { public void run() { @@ -109,11 +110,20 @@ public class @SYS_APPNAME@ extends Activity implements @ANDROID_JAVA_IMPLEMENTS@ mGLView = new xGLSurfaceView(this); setContentView(mGLView); mSensorManager = (SensorManager)getSystemService(Context.SENSOR_SERVICE); + + @IF_ANDROIDAPI_GT_22@ + if (getApplicationContext().checkCallingOrSelfPermission(android.Manifest.permission.WRITE_EXTERNAL_STORAGE) + != android.content.pm.PackageManager.PERMISSION_GRANTED) { + requestPermissions(new String[] { android.Manifest.permission.WRITE_EXTERNAL_STORAGE }, 1); + // startActivity(new Intent(android.provider.Settings.ACTION_MEMORY_CARD_SETTINGS).setData(Uri.parse("package:"+"@SYS_PACKAGE_DOT@"))); + } + /* end of IF_ANDROIDAPI_GT_22 */ + // Additions needed by modules, e.g. gps @ANDROID_JAVA_ONCREATE@ // start EVENT_IDLE - idle_tm.scheduleAtFixedRate(idle_task, 0, 250); + if(idle_tmScheduleRate > 0) idle_tm.scheduleAtFixedRate(idle_task, 0, idle_tmScheduleRate); nativeInstanceInit(); } diff --git a/make.sh b/make.sh index 4226df4f..27c3f7c7 100755 --- a/make.sh +++ b/make.sh @@ -1032,6 +1032,7 @@ make_setup_target() ac_subst SYS_APPVERSION ac_subst SYS_APPVERSIONCODE ac_subst SYS_ANDROIDAPI + ac_subst IF_ANDROIDAPI_GT_22 "`if [ $SYS_ANDROIDAPI -lt 23 ]; then echo '/* IF_ANDROIDAPI_GT_22 commented out:'; else echo '/* IF_ANDROIDAPI_GT_22 active here:*/'; fi`" ac_subst SYS_ANDROIDSDK ac_subst SYS_ANDROIDNDK ac_subst SYS_ANDROIDARCH diff --git a/modules/ln_core/packtool.scm b/modules/ln_core/packtool.scm index 2952c3e4..8b6f8dff 100644 --- a/modules/ln_core/packtool.scm +++ b/modules/ln_core/packtool.scm @@ -56,6 +56,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ;; extract an embedded file (define (packtool-unpack file cdata overwrite) + (let ((rootpath (system-directory))) + (if (not (file-exists? rootpath)) (create-directory rootpath))) (let ((path (packtool:prep file))) (if (or overwrite (not (file-exists? path))) (let ((data (u8vector-decompress cdata)))