You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "ath0mas (via GitHub)" <gi...@apache.org> on 2023/12/24 18:16:20 UTC

Re: [PR] fix(android): hasWritePermission for SDK 33 [cordova-plugin-file]

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


##########
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:
   What is happening here in the `else` case?
   Mostly asking because `getWritePermission` is always called providing a `callbackContext`.
   Are we sure it does not wait indefinitely?
   Is doing nothing really fine, or should `callbackContext` be called in every case, to guarantee the execution flow continues?



-- 
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: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org