Pages

Service Permissions

This didn't work:

<service android:name=".MyInputService" android:permission="android.permission.BIND_INPUT_METHOD>
</service>

and gave this runtime error:
Permission Denial: Accessing service ComponentInfo{com.powerplain/com.powerplain.MyInputService} requires android.permission.BIND_INPUT_METHOD

whereas this technique did work:
<service android:name=".MyInputService">
</service>
<uses-permission android:name="android.permission.BIND_INPUT_METHOD" />