What does android:enabled mean for a service? The description says it’s whether it can be instantiated by the system. What does that mean? Can it be used at all? Can it only be used locally? If you can use a “disabled” service in some way then how do you start it? If it can’t be used at all then what in the world is the point? Can’t you just comment out the service tag instead?
I was looking into creating a service that isn’t to be used by other applications. Not sure if adroid:enabled can be used for this purpose.
It means whether it can run.
Not if it is disabled.
Not if it is disabled.
android:disabledis effectively inherited, and it definitely has use cases for activities and BroadcastReceivers. In the case of a service, it would be less likely to be used, but might still have merit (e.g., an API for third parties that the user can opt out of).Java code cannot do that at runtime. The value of
android:enabled, however, can be modified throughPackageManagerat runtime.