Enable NFC service as an application service.
Uses ServiceManager.addService() to register the service.
Uses BOOT_COMPLETE to start the service.
Uses sharedUserId com.android.nfc so that it has a fixed uid.
Uses android:persistant so that the process is not killed.
Change-Id: If4264baf5dc457ee0a3ad5788c5945e84173b1ea
Signed-off-by: Nick Pelly <npelly@google.com>
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index ac6a6f0..9c4d969 100755
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -1,14 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.android.nfc" >
+ package="com.android.nfc"
+ android:sharedUserId="android.uid.nfc"
+ android:sharedUserLabel="@string/nfcUserLabel"
+>
<uses-permission android:name="android.permission.NFC_ADMIN" />
<uses-permission android:name="android.permission.NFC_RAW" />
<uses-permission android:name="android.permission.NFC_NOTIFY" />
<uses-permission android:name="android.permission.NFC_LLCP" />
+ <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
+ <uses-permission android:name="android.permission.WRITE_SETTINGS" />
+
<application android:icon="@drawable/icon"
- android:label="@string/app_name"
- android:persistent="true">
- <service android:name=".NfcService">
+ android:label="@string/app_name"
+ android:persistent="true" >
+ <service android:name=".NfcService" >
</service>
+ <receiver android:name=".NfcReceiver" >
+ <intent-filter>
+ <action android:name="android.intent.action.BOOT_COMPLETED" />
+ </intent-filter>
+ </receiver>
</application>
</manifest>