With respect to Marshmallow, how do I tell which operating system calls in Android require a permission check? For some of the Location Manager calls, the compiler will show an error if I don't check permissions before the call. But there are lots and lots of other operating system calls for which permissions are required but which do not generate a compiler error if the permission is not checked before the call.
For example, I have a call to the Location Manager's sendExtraCommand method in one of my apps. The compiler doesn't give any indication that a permission check is required before the call, so I didn't have one. When I mouse over the call in Android Studio, the information in the documentation window doesn't give any indication that permissions are required for the call. But when Marshmallow users started using my app, they were getting security exceptions.
Is it just me, or is the Marshmallow security thing extremely poorly thought out?
There is a similar question here, but it doesn't have any good answers, so I have created this one in the hope that the issue will get more attention: How to find required Android Marshmallow runtime permissions in code?