I scanned a project using Fortify and it says I should replace checkCallingOrSelfPermission method with checkCallingPermission.
I could not figure out the security risk that checkCallingOrSelfPermission method presents.
This is the Fortify explanation:
The function checkCallingOrSelfPermission() or checkCallingOrSelfUriPermission() determine whether the calling program has the required permission to access a certain service or a given URI. However, these functions should be used with care as they can grant access to malicious applications, lacking the appropriate permissions, by assuming your applications permissions.
This means a malicious application, without appropriate permissions, can bypass its permission check by using your application's permission to get access to otherwise denied resources. This can result in what is known as the confused deputy attack.