DaedalusDev commented on code in PR #814:
URL: 
https://github.com/apache/cordova-plugin-camera/pull/814#discussion_r1243650007


##########
src/android/CameraLauncher.java:
##########
@@ -245,8 +276,14 @@ private String getTempDirectoryPath() {
      * @param encodingType           Compression quality hint (0-100: 0=low 
quality & high compression, 100=compress of max quality)
      */
     public void callTakePicture(int returnType, int encodingType) {
-        boolean saveAlbumPermission = PermissionHelper.hasPermission(this, 
Manifest.permission.READ_EXTERNAL_STORAGE)
-                && PermissionHelper.hasPermission(this, 
Manifest.permission.WRITE_EXTERNAL_STORAGE);
+        String[] storagePermissions = getPermissions(true, mediaType);
+        boolean saveAlbumPermission;
+        if (this.saveToPhotoAlbum) {
+            saveAlbumPermission = hasPermissions(storagePermissions);
+        } else {
+            saveAlbumPermission = true;
+        }

Review Comment:
   Will produce an issue with Android < 8.0. I've replace the code above with 
this and it works.
   
   ```diff
           boolean saveAlbumPermission = hasPermissions(storagePermissions);
   ```



-- 
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