fix(android): Use VERSION_CODES instead of hard-coded API literals (#904)

This commit is contained in:
Norman Breau 2024-10-25 13:10:05 -03:00 committed by GitHub
parent 44480300d9
commit feb7643bc3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -518,7 +518,7 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect
if (this.allowEdit && this.croppedUri != null) { if (this.allowEdit && this.croppedUri != null) {
writeUncompressedImage(croppedUri, galleryUri); writeUncompressedImage(croppedUri, galleryUri);
} else { } else {
if (Build.VERSION.SDK_INT <= 28) { // Between LOLLIPOP_MR1 and P, can be changed later to the constant Build.VERSION_CODES.P if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.P) {
writeTakenPictureToGalleryLowerThanAndroidQ(galleryUri); writeTakenPictureToGalleryLowerThanAndroidQ(galleryUri);
} else { // Android Q or higher } else { // Android Q or higher
writeTakenPictureToGalleryStartingFromAndroidQ(galleryPathVO); writeTakenPictureToGalleryStartingFromAndroidQ(galleryPathVO);