There are usually two services involved with implementing an Android authenticator – the Authentication service to return an authenticator, and the Sync service which provides a sync adapter. This question is specifically about the Authentication service, although in most examples both services are given the android:exported="true" attribute in the AndroidManifest.xml, eg:
<service
android:name=".authenticator.AuthenticationService"
android:exported="true">
<intent-filter>
<action
android:name="android.accounts.AccountAuthenticator" />
</intent-filter>
<meta-data
android:name="android.accounts.AccountAuthenticator"
android:resource="@xml/authenticator" />
</service>
Removing the attribute from the Authentication service seems to have no effect (tested Froyo, Gingerbread) – the auth code continues to work just fine – so is the flag actually necessary?
Ok, to answer this myself by reading the docs, the documentation for the
exportedattribute says:All Authentication services have an intent filter – the docs for AbstractAccountAuthenticator say:
This requires an intent filter, consequently the default value of exported for the service is
true. So the answer to this question is “No, the attribute is not necessary – because it’s true by default”.