You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ma...@apache.org on 2026/05/15 10:19:18 UTC
(cordova-android) 01/01: chore: cleanup PermissionHelper
This is an automated email from the ASF dual-hosted git repository.
GitToTheHub pushed a commit to branch pr-cleanup-PermissionHelper
in repository https://gitbox.apache.org/repos/asf/cordova-android.git
commit 6b4addad66b5a12a90cfd22f8f87505a3ec3b9e3
Author: Manuel Beck <ma...@outlook.de>
AuthorDate: Fri May 15 12:19:06 2026 +0200
chore: cleanup PermissionHelper
- AndroidStudio complained about methods not found linked in JavaDoc for the class CordovaInterface: requestPermission(), requestPermissions() and hasPermission(). The parameter types were missing and were added.
- Removing unused imports
---
framework/src/org/apache/cordova/PermissionHelper.java | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/framework/src/org/apache/cordova/PermissionHelper.java b/framework/src/org/apache/cordova/PermissionHelper.java
index 90c6e169..e054e943 100644
--- a/framework/src/org/apache/cordova/PermissionHelper.java
+++ b/framework/src/org/apache/cordova/PermissionHelper.java
@@ -18,12 +18,6 @@
*/
package org.apache.cordova;
-import java.util.Arrays;
-
-import org.json.JSONException;
-
-import android.content.pm.PackageManager;
-
/**
* This class is permission helper class when compiling against older versions of cordova-android pre 5.0.0
* and provides reflective methods for permission requesting and checking so that plugins
@@ -48,7 +42,7 @@ public class PermissionHelper {
* @param requestCode A requestCode to be passed to the plugin's onRequestPermissionResult()
* along with the result of the permission request
* @param permission The permission to be requested
- * @deprecated As of cordova-android 5.0.0, use {@link CordovaInterface#requestPermission()} instead.
+ * @deprecated As of cordova-android 5.0.0, use {@link CordovaInterface#requestPermission(CordovaPlugin, int, String)} instead.
*/
public static void requestPermission(CordovaPlugin plugin, int requestCode, String permission) {
PermissionHelper.requestPermissions(plugin, requestCode, new String[] {permission});
@@ -63,7 +57,7 @@ public class PermissionHelper {
* @param requestCode A requestCode to be passed to the plugin's onRequestPermissionResult()
* along with the result of the permissions request
* @param permissions The permissions to be requested
- * @deprecated As of cordova-android 5.0.0, use {@link CordovaInterface#requestPermissions()} instead.
+ * @deprecated As of cordova-android 5.0.0, use {@link CordovaInterface#requestPermissions(CordovaPlugin, int, String[])} instead.
*/
public static void requestPermissions(CordovaPlugin plugin, int requestCode, String[] permissions) {
plugin.cordova.requestPermissions(plugin, requestCode, permissions);
@@ -77,7 +71,7 @@ public class PermissionHelper {
* @param plugin The plugin the permission is being checked against
* @param permission The permission to be checked
* @return True if the permission has already been granted and false otherwise
- * @deprecated As of cordova-android 5.0.0, use {@link CordovaInterface#hasPermission()} instead.
+ * @deprecated As of cordova-android 5.0.0, use {@link CordovaInterface#hasPermission(String)} instead.
*/
public static boolean hasPermission(CordovaPlugin plugin, String permission) {
return plugin.cordova.hasPermission(permission);
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org