Skip to content

Commit 0af39de

Browse files
Merge pull request #82 from wordpress-mobile/issue/81-fix-camera-permissions
Remove not-needed permissions for the Camera function
2 parents 62b29b9 + ae9b5f5 commit 0af39de

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

mediapicker/src/main/java/org/wordpress/android/mediapicker/util/MediaPickerPermissionUtils.kt

+2-12
Original file line numberDiff line numberDiff line change
@@ -55,28 +55,18 @@ internal class MediaPickerPermissionUtils @Inject constructor(
5555
}
5656

5757
fun hasPermissionsToTakePhotos(): Boolean {
58-
return hasCameraPermission() && (VERSION.SDK_INT > VERSION_CODES.P || hasWriteStoragePermission())
58+
return hasCameraPermission()
5959
}
6060

6161
val permissionsForTakingPhotos: List<PermissionsRequested>
62-
get() = if (VERSION.SDK_INT > VERSION_CODES.P) {
63-
listOf(CAMERA)
64-
} else {
65-
listOf(CAMERA, WRITE_STORAGE)
66-
}
62+
get() = listOf(CAMERA)
6763

6864
fun hasReadStoragePermission(): Boolean {
6965
return ContextCompat.checkSelfPermission(
7066
context, permission.READ_EXTERNAL_STORAGE
7167
) == PackageManager.PERMISSION_GRANTED
7268
}
7369

74-
private fun hasWriteStoragePermission(): Boolean {
75-
return ContextCompat.checkSelfPermission(
76-
context, permission.WRITE_EXTERNAL_STORAGE
77-
) == PackageManager.PERMISSION_GRANTED
78-
}
79-
8070
private fun hasCameraPermission(): Boolean {
8171
return ContextCompat.checkSelfPermission(
8272
context,

0 commit comments

Comments
 (0)