mozilla-magnet / magnet-scanner-android

An Android library that scans for URLs around you
3 stars 6 forks source link

Add catch for location permissions exception (closes #23) #24

Closed wilsonpage closed 7 years ago

wilsonpage commented 7 years ago

@arcturus r?

arcturus commented 7 years ago

Do you think that makes sense to ask for permissions if we 'catch' the exception? I'm thinking that will conflict with our mechanism to ask for permissions right?

Anyway, shiiiiip.ly

wilsonpage commented 7 years ago

I admit it's a lazy fix. We could put the checks in our app code before running any scanner related logic. This particular catch was for the background scanner that triggers onPause when the location permission prompt comes up on app start.

arcturus commented 7 years ago

Lets land it and open a follow up for proper fixing.

wilsonpage commented 7 years ago

I think it's still good to have this catch in the library as we should protect the library from crashing apps. Following Android M we can't be sure if/when the user has granted location permissions. But we should protect our background scanner from running before all required permission checks have been granted.