在机器开机过程中,可以抓取到以下的正常logcat信息:
//setp1
I/NfcService( 3809): Starting NFC service
D/NFCJNI ( 3809): NFC Service : loading JNI
I/RegisteredComponentCache( 3809): ComponentInfo: ResolveInfo{41344108
com.android.apps.tag.TagViewer p=0 o=0 m=0x108000}, techs: android.nfc.tech.Ndef,
W/NfceeAccess( 3809): could not find /etc/nfcee_access.xml, no NFCEE access allowed
I/NfceeAccess( 3809): read 0 signature(s) for NFCEE access
D/NfcService( 3809): checking on firmware download
下面是硬件不支持NFC的异常logcat信息:
I/NfcService( 3485): Starting NFC service
D/NFCJNI ( 3485): NFC Service : loading JNI
W/NfceeAccess( 3485): could not find /etc/nfcee_access.xml, no NFCEE access allowed
I/NfceeAccess( 3485): read 0 signature(s) for NFCEE access
D/NfcService( 3485): checking on firmware download
D/NfcService( 3485): NFC is on. Doing normal stuff
I/NfcService( 3485): Enabling NFC
D/NFCJNI ( 3485): Start Initialization
E/NFCJNI ( 3485): hw_get_module() failed.
D/NFCJNI ( 3485): Terminating client thread...
W/NfcService( 3485): Error enabling NFC
来看正常logcat信息setp1,NfcService 是application,它的onCreate()方法:
@Override
public void onCreate() {
super.onCreate();
mNfcTagService = new TagService();
mNfcAdapter = new NfcAdapterService();
mExtrasService = new NfcAdapterExtrasService();
Log.i(TAG, "Starting NFC service");
//setp2:NFC Service : loading JNI
mDeviceHost = new NativeNfcManager(this, this);
HandoverManager handoverManager = new HandoverManager(mContext);
//NfcDispatcher主要负责tag消息处理,并派发Intent消息,启动Activity。
mNfcDispatcher = new NfcDispatcher(this, handoverManager);
mP2pLinkManager = new P2pLinkManager(mContext, handoverManager);
mSecureElement = new NativeNfcSecureElement(mContext);
//setp3:could not find /etc/nfcee_access.xml, no NFCEE access allowed
mNfceeAccessControl = new NfceeAccessControl(this);
//把mNfcAdapter 作为Service 添加到系统服务中,ServiceManager.getService("nfc