When you ask a permission, android shows a popup, if at this moment app go to background and than back to foreground
PermissionCallback will trigger permissionsGranted but actually not. It happens because at this moment will call onRequestPermissionsResult with empty grantResults.
How we can see, method verifyPermissions return true by default, and how result wrong trigger of permissionGranted.
I think this method should return false by default.
fun verifyPermissions(grantResults: IntArray): Boolean {
for (result in grantResults) {
if (result != PackageManager.PERMISSION_GRANTED) {
return false
}
}
return true
}