ath0mas commented on code in PR #608:
URL: 
https://github.com/apache/cordova-plugin-file/pull/608#discussion_r1435867321


##########
src/android/FileUtils.java:
##########
@@ -543,8 +543,10 @@ private void getReadPermission(String rawArgs, int action, 
CallbackContext callb
     }
 
     private void getWritePermission(String rawArgs, int action, 
CallbackContext callbackContext) {
-        int requestCode = pendingRequests.createRequest(rawArgs, action, 
callbackContext);
-        PermissionHelper.requestPermission(this, requestCode, 
Manifest.permission.WRITE_EXTERNAL_STORAGE);
+        if (android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) {
+            int requestCode = pendingRequests.createRequest(rawArgs, action, 
callbackContext);
+            PermissionHelper.requestPermission(this, requestCode, 
Manifest.permission.WRITE_EXTERNAL_STORAGE);
+        }

Review Comment:
   I think I "found" my own answer:
   in current code, in the case of `Build.VERSION.SDK_INT >= 
Build.VERSION_CODES.TIRAMISU`, `getWritePermission` is never called ...
   So my question does not really mater, even if strictly speaking it is 
probably a problem for the execution flow, indefinitely waiting for the 
`callbackContext`.
   
   Details:
   `getWritePermission` calls are always preceded by a check for 
`needPermission(nativeURL, WRITE)`, that will return `false` in this same given 
versions condition, because `hasWritePermission` was changed to always return 
`true` for it.
   So, the `if (android.os.Build.VERSION.SDK_INT < 
Build.VERSION_CODES.TIRAMISU) {` added in `getWritePermission` is mostly 
useless, and should whether be removed or be fixed.



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