breautek commented on code in PR #839:
URL: 
https://github.com/apache/cordova-plugin-camera/pull/839#discussion_r1299992711


##########
src/android/CameraLauncher.java:
##########
@@ -1312,20 +1312,39 @@ public void onScanCompleted(String path, Uri uri) {
     }
 
     public void onRequestPermissionResult(int requestCode, String[] 
permissions,
-                                          int[] grantResults) {
-        for (int r : grantResults) {
-            if (r == PackageManager.PERMISSION_DENIED) {
-                this.callbackContext.sendPluginResult(new 
PluginResult(PluginResult.Status.ERROR, PERMISSION_DENIED_ERROR));
-                return;
+                                          int[] grantResults) throws 
JSONException {
+        String version = android.os.Build.VERSION.RELEASE;
+        if(Integer.parseInt(version) <= 13)

Review Comment:
   This check may fail, you cannot assume that the user-visible will be number 
like or an integer.
   
   Instead it should use 
[Build.VERSION.SDK_INT](https://developer.android.com/reference/android/os/Build.VERSION#SDK_INT)
   
   Which refers to the API level. Android 13 is API 33, which has a constant 
[Build.VERSION_CODES.TIRAMISU](https://developer.android.com/reference/android/os/Build.VERSION_CODES#TIRAMISU)
   
   Can you also explain the rationale for adding in a version check for Android 
13 and earlier? This is effectively selecting all devies that we support, 
excluding any newer android versions in the future. So that seems strange to me.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to