I am working on a app which tries to bind with a service, but it fails to do so because service it is trying bind is not exported for other apps to bind. This made me think if there is a way to know before hand if a specified service class accepts binding or not programmatically.
I know by checking element of AndroidManifest.xml will suggest if exported = false or true. But I want to know the same by a API call or something like that.
Sorry,
ServiceRecordcontains this exported’ information, which Android has provided no way of getting access to.Your best bet is to check for a
SecurityExceptionwhen you try to bind to the Service.