-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check & request operation missing before using LocationManager.requestLocationUpdates() #27
Comments
@aper-project If you've actually tested that it's a problem, send a PR please. |
Hello, we have tested your application recently, and have the following information and questions, hope to get your reply and comments. Expected behaviorMy Location not crash when requests location update. Actual behaviorMy Location will crash when location permission is not granted and still requests location update. Steps to reproduce
Follow up video is start GetFixService again and crash again EnvironmentMy location version : v 1.3.3 Android API Level : API 29 Question
Logs
|
Issue description
Hi, in mylocation v1.3.1, we found a dangerous API usage (https://github.com/gjedeer/mylocation/blob/master/app/src/main/java/net/mypapit/mobile/myposition/GetFixService.java#L110) which requires Manifest.permission.ACCESS_COARSE_LOCATION or Manifest.permission.ACCESS_FINE_LOCATION in accordance to the Android official documentation (https://developer.android.com/reference/android/location/LocationManager).
However, it seems that it missed the “check” and “request” operation in the following call chain starting from the GetFixService.onStartCommand(Intent intent, int flags, int startId) activity if permission is not granted.
This may lead to a SecurityException or related functions unavailable if the user denies the location permission but still calls the API in this chain, resulting in bad user experience.
@gjedeer
Could you help me review this issue? Thx
The text was updated successfully, but these errors were encountered: