Skip to content

Commit 3262363

Browse files
committed
android: Fix UnsupportedOperationException remove from non-ArrayList
1 parent fe01776 commit 3262363

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

platform/android/java/lib/src/org/godotengine/godot/utils/PermissionsUtil.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -293,15 +293,15 @@ public static boolean hasManifestPermission(Context context, String permission)
293293
/**
294294
* Returns the permissions defined in the AndroidManifest.xml file.
295295
* @param context the caller context for this method.
296-
* @return manifest permissions list
296+
* @return mutable copy of manifest permissions list
297297
* @throws PackageManager.NameNotFoundException the exception is thrown when a given package, application, or component name cannot be found.
298298
*/
299-
public static List<String> getManifestPermissions(Context context) throws PackageManager.NameNotFoundException {
299+
public static ArrayList<String> getManifestPermissions(Context context) throws PackageManager.NameNotFoundException {
300300
PackageManager packageManager = context.getPackageManager();
301301
PackageInfo packageInfo = packageManager.getPackageInfo(context.getPackageName(), PackageManager.GET_PERMISSIONS);
302302
if (packageInfo.requestedPermissions == null)
303-
return Collections.emptyList();
304-
return Arrays.asList(packageInfo.requestedPermissions);
303+
return new ArrayList<String>();
304+
return new ArrayList<>(Arrays.asList(packageInfo.requestedPermissions));
305305
}
306306

307307
/**

0 commit comments

Comments
 (0)