This is an automated email from the ASF dual-hosted git repository.

GitToTheHub pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-android.git


The following commit(s) were added to refs/heads/master by this push:
     new 8c839764 Deprecate `PermissionHelper` (#1857)
8c839764 is described below

commit 8c83976486067d3a71161b3c37d03d6581038eaf
Author: Manuel Beck <[email protected]>
AuthorDate: Mon Apr 20 18:04:26 2026 +0200

    Deprecate `PermissionHelper` (#1857)
    
    - The `PermissionHelper` was for cordova-android versions pre 5.0.0. Since 
cordova-anroid 5.0.0 the relevant permission methods can be called directly on 
`CordovaInterface`.
---
 framework/src/org/apache/cordova/PermissionHelper.java | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/framework/src/org/apache/cordova/PermissionHelper.java 
b/framework/src/org/apache/cordova/PermissionHelper.java
index 5c6e777c..90c6e169 100644
--- a/framework/src/org/apache/cordova/PermissionHelper.java
+++ b/framework/src/org/apache/cordova/PermissionHelper.java
@@ -25,8 +25,18 @@ import org.json.JSONException;
 import android.content.pm.PackageManager;
 
 /**
- * This class provides reflective methods for permission requesting and 
checking so that plugins
+ * 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
  * written for cordova-android 5.0.0+ can still compile with earlier 
cordova-android versions.
+ * 
+ * Some Cordova plugins still use this class, for example:
+ * - 
https://github.com/apache/cordova-plugin-file/blob/master/src/android/FileUtils.java#L42
+ * - 
https://github.com/apache/cordova-plugin-geolocation/blob/master/src/android/Geolocation.java#L27
+ * - 
https://github.com/apache/cordova-plugin-camera/blob/master/src/android/CameraLauncher.java#L52
+ * Before this class can be removed, those plugins need to be updated to call 
{@link CordovaInterface} methods directly.
+ *
+ * @deprecated As of cordova-android 5.0.0, this class is no longer needed and 
will be removed in a future release.
+ * You can call directly into {@link CordovaInterface} methods instead with 
{@link CordovaPlugin#cordova}.
  */
 public class PermissionHelper {
     /**
@@ -38,6 +48,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.
      */
     public static void requestPermission(CordovaPlugin plugin, int 
requestCode, String permission) {
         PermissionHelper.requestPermissions(plugin, requestCode, new String[] 
{permission});
@@ -52,6 +63,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.
      */
     public static void requestPermissions(CordovaPlugin plugin, int 
requestCode, String[] permissions) {
         plugin.cordova.requestPermissions(plugin, requestCode, permissions);
@@ -65,6 +77,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.
      */
     public static boolean hasPermission(CordovaPlugin plugin, String 
permission) {
         return plugin.cordova.hasPermission(permission);


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to