This is an automated email from the ASF dual-hosted git repository.
erisu 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 1d01ea1f doc: improve documentation of `onRequestPermissionResult` and
`onRequestPermissionsResult` (#1920)
1d01ea1f is described below
commit 1d01ea1fc00bf30fcc51f11da1c22768b1d3a613
Author: Manuel Beck <[email protected]>
AuthorDate: Tue Jun 30 08:49:31 2026 +0200
doc: improve documentation of `onRequestPermissionResult` and
`onRequestPermissionsResult` (#1920)
* doc: improve documentation of `onRequestPermissionResult` and
`onRequestPermissionsResult`
- Make clear, that these methods are not only called, when the user grants
permissions, but also when he denies them or the request was interrupted.
- Add note, how the call chain ist
- Make clear, that `onRequestPermissionResult` is legacy and should not be
used anymore
- Add Android Developer documentation link for the new
`onRequestPermissionsResult`
* doc: improve documentation
- Forgot to commit everything
---
framework/src/org/apache/cordova/CordovaPlugin.java | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/framework/src/org/apache/cordova/CordovaPlugin.java
b/framework/src/org/apache/cordova/CordovaPlugin.java
index 6cd9b056..ff5cad4c 100644
--- a/framework/src/org/apache/cordova/CordovaPlugin.java
+++ b/framework/src/org/apache/cordova/CordovaPlugin.java
@@ -416,7 +416,14 @@ public class CordovaPlugin {
}
/**
- * Called by the system when the user grants permissions
+ * Forwarded system call to the plugin when the user grants permissions,
+ * denies them or the request was interrupted.
+ * This is a legacy method and should not be used anymore.
+ * Instead {@link #onRequestPermissionsResult} should be used.
+ *
+ * Note: The system calls {@link
CordovaActivity#onRequestPermissionsResult(int, String[], int[])},
+ * which calls {@link CordovaInterfaceImpl#onRequestPermissionsResult(int,
String[], int[])},
+ * and finally this method.
*
* @param requestCode
* @param permissions
@@ -430,11 +437,17 @@ public class CordovaPlugin {
}
/**
- * Called by the system when the user grants permissions
+ * Forwarded system call to the plugin when the user grants permissions,
+ * denies them or the request was interrupted.
+ *
+ * Note: The system calls {@link
CordovaActivity#onRequestPermissionsResult(int, String[], int[])},
+ * which calls {@link CordovaInterfaceImpl#onRequestPermissionsResult(int,
String[], int[])},
+ * and finally this method.
*
* @param requestCode
* @param permissions
* @param grantResults
+ * @see
https://developer.android.com/reference/android/app/Activity#onRequestPermissionsResult(int,%20java.lang.String[],%20int[])
*/
public void onRequestPermissionsResult(int requestCode, String[]
permissions,
int[] grantResults) throws
JSONException {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]