From cca16f63a03ef1b83838bd8a417fbb75df1a956d Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Tue, 22 Dec 2015 22:15:41 -0800 Subject: [PATCH 1/2] Fix ant build on Windows. --- android/custom_rules.xml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/android/custom_rules.xml b/android/custom_rules.xml index 596d687a23..e7edd4ff7e 100644 --- a/android/custom_rules.xml +++ b/android/custom_rules.xml @@ -1,14 +1,17 @@ + + + - + - + From 272d21d702a83882f8a11c911ab922246b021312 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Tue, 22 Dec 2015 22:29:11 -0800 Subject: [PATCH 2/2] Send initially held permission grants at start. This way we don't have to re-ask for things we already have. --- android/src/org/ppsspp/ppsspp/NativeActivity.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/android/src/org/ppsspp/ppsspp/NativeActivity.java b/android/src/org/ppsspp/ppsspp/NativeActivity.java index b8a135047a..b2130e91fe 100644 --- a/android/src/org/ppsspp/ppsspp/NativeActivity.java +++ b/android/src/org/ppsspp/ppsspp/NativeActivity.java @@ -172,6 +172,16 @@ public class NativeActivity extends Activity implements SurfaceHolder.Callback { } } + @TargetApi(23) + public void sendInitialGrants() { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + // Let's start out granted if it was granted already. + if (this.checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED) { + NativeApp.sendMessage("permission_granted", "storage"); + } + } + } + @Override public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) { @@ -239,6 +249,8 @@ public class NativeActivity extends Activity implements SurfaceHolder.Callback { NativeApp.sendMessage("cacheDir", getCacheDir().getAbsolutePath()); + sendInitialGrants(); + vibrator = (Vibrator)getSystemService(VIBRATOR_SERVICE); if (Build.VERSION.SDK_INT >= 11) { checkForVibrator();