[Scummvm-git-logs] scummvm master -> aaef1c26a3eb2dc646103bde073566e26131329c

antoniou79 noreply at scummvm.org
Sun Mar 12 20:51:16 UTC 2023


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
95089b3704 ANDROID: Upgrade gradle plugin and dependencies version
aaef1c26a3 ANDROID: Fix deprecated Handler()


Commit: 95089b370495d21626631808ed1a4e18188574e9
    https://github.com/scummvm/scummvm/commit/95089b370495d21626631808ed1a4e18188574e9
Author: antoniou79 (a.antoniou79 at gmail.com)
Date: 2023-03-12T22:26:01+02:00

Commit Message:
ANDROID: Upgrade gradle plugin and dependencies version

Changed paths:
    dists/android/build.gradle


diff --git a/dists/android/build.gradle b/dists/android/build.gradle
index 2ca59b3f354..0bd7e449fdb 100644
--- a/dists/android/build.gradle
+++ b/dists/android/build.gradle
@@ -5,7 +5,7 @@ buildscript {
         mavenCentral()
     }
     dependencies {
-        classpath 'com.android.tools.build:gradle:7.3.1'
+        classpath 'com.android.tools.build:gradle:7.4.2'
     }
 }
 
@@ -18,13 +18,15 @@ dependencies {
 
 // Enable to see use of deprecated API
 tasks.withType(JavaCompile) {
-	 options.compilerArgs << "-Xlint:deprecation" << "-Xlint:unchecked"
+    options.compilerArgs << "-Xlint:deprecation" << "-Xlint:unchecked"
 }
 
+//gradle.startParameter.showStacktrace = ShowStacktrace.ALWAYS_FULL
+
 apply plugin: 'com.android.application'
 
 android {
-    compileSdkVersion 33
+    compileSdk 33
     buildToolsVersion "33.0.1"
     ndkVersion "21.3.6528147"
 
@@ -102,6 +104,6 @@ android {
 }
 
 dependencies {
-    implementation "androidx.annotation:annotation:1.1.0"
-    implementation "androidx.appcompat:appcompat:1.2.0"
+    implementation "androidx.annotation:annotation:1.5.0"
+    implementation "androidx.appcompat:appcompat:1.6.1"
 }


Commit: aaef1c26a3eb2dc646103bde073566e26131329c
    https://github.com/scummvm/scummvm/commit/aaef1c26a3eb2dc646103bde073566e26131329c
Author: antoniou79 (a.antoniou79 at gmail.com)
Date: 2023-03-12T22:44:29+02:00

Commit Message:
ANDROID: Fix deprecated Handler()

Also remove permission request for external storage from API 33 and above since it no longer works

Changed paths:
    backends/platform/android/org/scummvm/scummvm/CustomKeyboardView.java
    backends/platform/android/org/scummvm/scummvm/MultitouchHelper.java
    backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java
    backends/platform/android/org/scummvm/scummvm/ScummVMEventsBase.java
    backends/platform/android/org/scummvm/scummvm/SplashActivity.java


diff --git a/backends/platform/android/org/scummvm/scummvm/CustomKeyboardView.java b/backends/platform/android/org/scummvm/scummvm/CustomKeyboardView.java
index e55dab9f806..e7253f296bc 100755
--- a/backends/platform/android/org/scummvm/scummvm/CustomKeyboardView.java
+++ b/backends/platform/android/org/scummvm/scummvm/CustomKeyboardView.java
@@ -32,6 +32,7 @@ import android.graphics.drawable.Drawable;
 import android.media.AudioManager;
 //import android.os.Build;
 import android.os.Handler;
+import android.os.Looper;
 import android.os.Message;
 import android.util.AttributeSet;
 import android.util.Log;
@@ -277,6 +278,7 @@ public class CustomKeyboardView extends View implements View.OnClickListener {
         private final WeakReference<CustomKeyboardView> mListenerReference;
 
         public CustomKeyboardViewHandler(CustomKeyboardView listener) {
+            super(Looper.getMainLooper());
             mListenerReference = new WeakReference<>(listener);
         }
 
diff --git a/backends/platform/android/org/scummvm/scummvm/MultitouchHelper.java b/backends/platform/android/org/scummvm/scummvm/MultitouchHelper.java
index 6ecdb053bb7..dff7eeb7a86 100644
--- a/backends/platform/android/org/scummvm/scummvm/MultitouchHelper.java
+++ b/backends/platform/android/org/scummvm/scummvm/MultitouchHelper.java
@@ -1,6 +1,7 @@
 
 package org.scummvm.scummvm;
 
+import android.os.Looper;
 import android.os.Message;
 import android.util.Log;
 import android.view.MotionEvent;
@@ -237,6 +238,7 @@ public class MultitouchHelper {
 		private final WeakReference<MultitouchHelper> mListenerReference;
 
 		public MultitouchHelperHandler(MultitouchHelper listener) {
+			super(Looper.getMainLooper());
 			mListenerReference = new WeakReference<>(listener);
 		}
 
diff --git a/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java b/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java
index 56bf41b8aed..1b38547de32 100644
--- a/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java
+++ b/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java
@@ -800,9 +800,12 @@ public class ScummVMActivity extends Activity implements OnKeyboardVisibilityLis
 		@Override
 		protected String[] getAllStorageLocations() {
 			if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M
+			    && Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU
 			    && (checkSelfPermission(Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED
 			        || checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED)
 			) {
+				// In Tiramisu (API 33) and above, READ and WRITE external storage permissions have no effect,
+				// and they are automatically denied -- onRequestPermissionsResult() will be called without user's input
 				requestPermissions(MY_PERMISSIONS_STR_LIST, MY_PERMISSION_ALL);
 			} else {
 				return ExternalStorage.getAllStorageLocations(getApplicationContext()).toArray(new String[0]);
@@ -1072,15 +1075,13 @@ public class ScummVMActivity extends Activity implements OnKeyboardVisibilityLis
 	public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
 		if (requestCode == MY_PERMISSION_ALL) {
 			int numOfReqPermsGranted = 0;
-			// If request is cancelled, the result arrays are empty.
-			if (grantResults.length > 0) {
-				for (int iterGrantResult: grantResults) {
-					if (iterGrantResult == PackageManager.PERMISSION_GRANTED) {
-						Log.i(ScummVM.LOG_TAG, permissions[0] + " permission was granted at Runtime");
-						++numOfReqPermsGranted;
-					} else {
-						Log.i(ScummVM.LOG_TAG, permissions[0] + " permission was denied at Runtime");
-					}
+			// If request is canceled, the result arrays are empty.
+			for (int i = 0; i < grantResults.length; ++i) {
+				if (grantResults[i] == PackageManager.PERMISSION_GRANTED) {
+					Log.i(ScummVM.LOG_TAG, permissions[i] + " permission was granted at Runtime");
+					++numOfReqPermsGranted;
+				} else {
+					Log.i(ScummVM.LOG_TAG, permissions[i] + " permission was denied at Runtime");
 				}
 			}
 
diff --git a/backends/platform/android/org/scummvm/scummvm/ScummVMEventsBase.java b/backends/platform/android/org/scummvm/scummvm/ScummVMEventsBase.java
index 668fd3ddc44..d91cff529fd 100644
--- a/backends/platform/android/org/scummvm/scummvm/ScummVMEventsBase.java
+++ b/backends/platform/android/org/scummvm/scummvm/ScummVMEventsBase.java
@@ -2,6 +2,7 @@ package org.scummvm.scummvm;
 
 import android.os.Build;
 import android.os.Handler;
+import android.os.Looper;
 import android.os.Message;
 import android.content.Context;
 //import android.util.Log;
@@ -79,6 +80,7 @@ public class ScummVMEventsBase implements
 		private final WeakReference<ScummVMEventsBase> mListenerReference;
 
 		public ScummVMEventHandler(ScummVMEventsBase listener) {
+			super(Looper.getMainLooper());
 			mListenerReference = new WeakReference<>(listener);
 		}
 
diff --git a/backends/platform/android/org/scummvm/scummvm/SplashActivity.java b/backends/platform/android/org/scummvm/scummvm/SplashActivity.java
index 44fdadba372..d14c3e00ae7 100644
--- a/backends/platform/android/org/scummvm/scummvm/SplashActivity.java
+++ b/backends/platform/android/org/scummvm/scummvm/SplashActivity.java
@@ -35,9 +35,12 @@ public class SplashActivity extends Activity {
 		hideSystemUI();
 
 		if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M
+		    && Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU
 		    && (checkSelfPermission(Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED
 		        || checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED)
 		) {
+			// In Tiramisu (API 33) and above, READ and WRITE external storage permissions have no effect,
+			// and they are automatically denied -- onRequestPermissionsResult() will be called without user's input
 			requestPermissions(MY_PERMISSIONS_STR_LIST, MY_PERMISSION_ALL);
 		} else {
 			startActivity(new Intent(this, ScummVMActivity.class));
@@ -49,15 +52,13 @@ public class SplashActivity extends Activity {
 	public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
 		if (requestCode == MY_PERMISSION_ALL) {
 			int numOfReqPermsGranted = 0;
-			// If request is cancelled, the result arrays are empty.
-			if (grantResults.length > 0) {
-				for (int iterateGrantResult: grantResults) {
-					if (iterateGrantResult == PackageManager.PERMISSION_GRANTED) {
-						Log.i(ScummVM.LOG_TAG, permissions[0] + " permission was granted at Runtime");
-						++numOfReqPermsGranted;
-					} else {
-						Log.i(ScummVM.LOG_TAG, permissions[0] + " permission was denied at Runtime");
-					}
+			// If request is canceled, the result arrays are empty.
+			for (int i = 0; i < grantResults.length; ++i) {
+				if (grantResults[i] == PackageManager.PERMISSION_GRANTED) {
+					Log.i(ScummVM.LOG_TAG, permissions[i] + " permission was granted at Runtime");
+					++numOfReqPermsGranted;
+				} else {
+					Log.i(ScummVM.LOG_TAG, permissions[i] + " permission was denied at Runtime");
 				}
 			}
 




More information about the Scummvm-git-logs mailing list