通常,实现 Android 身份验证器需要两个服务 - Authentication 服务返回身份验证器和提供同步适配器的 Sync 服务。这个问题特别涉及到 Authentication 服务,尽管在 大多数示例中,两个服务在 AndroidManifest.xml
中都被赋予了 android:exported="true"
属性,例如:
<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>
从身份验证服务中删除该属性似乎没有任何效果(在Froyo、Gingerbread上进行了测试)- 身份验证代码仍然可以正常工作 - 那么该标志是否真的是必需的?