fix: crash after accepting permission on Android 13+
This commit is contained in:
parent
57d93f8c31
commit
815287b9b2
|
@ -251,9 +251,7 @@ class MainActivity : SimpleActivity(), PhotoProcessor.MediaSavedListener, Camera
|
||||||
if (isTiramisuPlus()) {
|
if (isTiramisuPlus()) {
|
||||||
handlePermission(PERMISSION_READ_MEDIA_IMAGES) { grantedReadImages ->
|
handlePermission(PERMISSION_READ_MEDIA_IMAGES) { grantedReadImages ->
|
||||||
if (grantedReadImages) {
|
if (grantedReadImages) {
|
||||||
handlePermission(PERMISSION_READ_MEDIA_VIDEO) { grantedReadVideos ->
|
handlePermission(PERMISSION_READ_MEDIA_VIDEO, callback)
|
||||||
callback.invoke(grantedReadVideos)
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
callback.invoke(false)
|
callback.invoke(false)
|
||||||
}
|
}
|
||||||
|
@ -553,7 +551,7 @@ class MainActivity : SimpleActivity(), PhotoProcessor.MediaSavedListener, Camera
|
||||||
|
|
||||||
private fun hasPhotoModePermissions(): Boolean {
|
private fun hasPhotoModePermissions(): Boolean {
|
||||||
return if (isTiramisuPlus()) {
|
return if (isTiramisuPlus()) {
|
||||||
hasPermission(PERMISSION_READ_MEDIA_IMAGES) && hasPermission(PERMISSION_CAMERA)
|
hasPermission(PERMISSION_READ_MEDIA_IMAGES) && hasPermission(PERMISSION_READ_MEDIA_VIDEO) && hasPermission(PERMISSION_CAMERA)
|
||||||
} else {
|
} else {
|
||||||
hasPermission(PERMISSION_WRITE_STORAGE) && hasPermission(PERMISSION_CAMERA)
|
hasPermission(PERMISSION_WRITE_STORAGE) && hasPermission(PERMISSION_CAMERA)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue