From 326236366492204732bf4f02ca29edfc87c332e4 Mon Sep 17 00:00:00 2001 From: Lyuma Date: Tue, 19 Mar 2024 23:35:17 -0700 Subject: [PATCH] android: Fix UnsupportedOperationException remove from non-ArrayList --- .../src/org/godotengine/godot/utils/PermissionsUtil.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/platform/android/java/lib/src/org/godotengine/godot/utils/PermissionsUtil.java b/platform/android/java/lib/src/org/godotengine/godot/utils/PermissionsUtil.java index 9a6b6d5037f..9df890e6bda 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/utils/PermissionsUtil.java +++ b/platform/android/java/lib/src/org/godotengine/godot/utils/PermissionsUtil.java @@ -293,15 +293,15 @@ public final class PermissionsUtil { /** * Returns the permissions defined in the AndroidManifest.xml file. * @param context the caller context for this method. - * @return manifest permissions list + * @return mutable copy of manifest permissions list * @throws PackageManager.NameNotFoundException the exception is thrown when a given package, application, or component name cannot be found. */ - public static List getManifestPermissions(Context context) throws PackageManager.NameNotFoundException { + public static ArrayList getManifestPermissions(Context context) throws PackageManager.NameNotFoundException { PackageManager packageManager = context.getPackageManager(); PackageInfo packageInfo = packageManager.getPackageInfo(context.getPackageName(), PackageManager.GET_PERMISSIONS); if (packageInfo.requestedPermissions == null) - return Collections.emptyList(); - return Arrays.asList(packageInfo.requestedPermissions); + return new ArrayList(); + return new ArrayList<>(Arrays.asList(packageInfo.requestedPermissions)); } /**