//в Activity
override fun onStart() {
super.onStart()
val res = ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)== PackageManager.PERMISSION_GRANTED
Log.d(TAG, "ACCESS_FINE_LOCATION: $res") //<=== тут false
var fusedLocationProviderClient: FusedLocationProviderClient? = null
val locationCallback = LocationCallback()
try {
fusedLocationProviderClient= LocationServices.getFusedLocationProviderClient(this)
fusedLocationProviderClient.requestLocationUpdates(LocationRequest(), locationCallback, Looper.myLooper())
} catch (e: Throwable) { //<==== почему нет SecurityException? (и вообще любого Exception?)
Log.d(TAG, e.javaClass.name)
} finally {
fusedLocationProviderClient?.removeLocationUpdates(locationCallback)
fusedLocationProviderClient = null
}
}