版权声明:本文为博主打劫来的文章!!!未经允许可以随便转载。 May you do good and not evil. May you share freely, never taking more than you give. https://blog.csdn.net/hunter___/article/details/80365178

1.

2.2修改后的预期错误log

357:I/GeckoConsole(  180): While creating services from category 'profile-after-change', could not create service for entry 'Nfc', contract ID '@mozilla.org/nfc;1'
358:I/GeckoConsole(  180): While creating services from category 'profile-after-change', could not create service for entry 'NfcContentHelper', contract ID '@mozilla.org/nfc/content-helper;1'

 

 

 

(1)

vim xpcom/components/nsCategoryManager.cpp

 

(2)同2.5,两个manifest 文件有问题。

NfcContentHelper.manifest:7:category profile-after-change NfcContentHelper @mozilla.org/nfc/content-helper;1
gonk/Nfc.manifest:10:category profile-after-change Nfc @mozilla.org/nfc;1

 

nfc.manifest

 

推理猜测:

执行了某个js 文件然后log出来了。

 

 

就是认为没开启任何东西,他们就建立好连接了。

一开机就有连接好

./adblogcat.sh: line 5: [: nfc: unary operator expected
50:I/nfcd    (  173): halo,nfc ,***** File:system/nfcd/src/NfcService.cpp,****** Line:416, ******* Function:-NfcService::Instance ******
51:I/nfcd    (  173): halo,nfc ,***** File:system/nfcd/src/NfcService.cpp,****** Line:93, ******* Function:-NfcService::NfcService ******
52:I/nfcd    (  173): halo,nfc ,***** File:system/nfcd/src/NfcService.cpp,****** Line:112, ******* Function:-NfcService::initialize ******
63:I/nfcd    (  173): halo,nfc ,***** File:system/nfcd/src/NfcService.cpp,****** Line:104, ******* Function:-NfcService::serviceThreadFunc ******
64:D/nfcd    (  173): void* NfcService::eventLoop(): NFCService started
65:I/nfcd    (  173): halo,nfc ,***** File:system/nfcd/src/NfcService.cpp,****** Line:345, ******* Function:-NfcService::eventLoop ******
365:I/Gecko   (  171): -*- Nfc.js:: Starting Nfc() function
366:I/        (  171): halo,im 3,********** NfcService::FactoryCreate  ************* in gecko/dom/nfc/gonk/NfcService.cpp:   File: ../../../gecko/dom/nfc/gonk/NfcService.cpp, Line: 287, Function: FactoryCreate
367:I/        (  171): halo,nfc ,***NfcConsumer***  File:../../../gecko/ipc/nfc/Nfc.cpp,****** Line:184, ******* Function:NfcConsumer ******
368:I/        (  171): halo,nfc ,创建服务连接,往nfcd去,***NfcConnector***  File:../../../gecko/ipc/nfc/Nfc.cpp,****** Line:90, ******* Function:Create ******
369:I/        (  171): halo,nfc ,***NfcConnector***  File:../../../gecko/ipc/nfc/Nfc.cpp,****** Line:154, ******* Function:SetUp ******
370:I/        (  171): halo,nfc ,***NfcConnector***  File:../../../gecko/ipc/nfc/Nfc.cpp,****** Line:119, ******* Function:CreateAddr ******
371:I/        (  171): halo,nfc ,***NfcConnector***  File:../../../gecko/ipc/nfc/Nfc.cpp,****** Line:154, ******* Function:SetUp ******
372:D/nfcd    (  173): Socket connected
373:I/nfcd    (  173): halo,nfc ,***** File:system/nfcd/src/NfcService.cpp,****** Line:522, ******* Function:-NfcService::onConnected ******
374:D/nfcd    (  173): void* NfcService::eventLoop(): NFCService msg=10
375:D/nfcd    (  173): processNotificaton notification=2000
376:D/nfcd    (  173): void NfcIpcSocket::writeToOutgoingQueue(uint8_t*, size_t) enter, data=0xb82f6e68, dataLen=20
377:D/nfcd    (  173): Writing 20 bytes to gecko 
378:I/        (  171): halo,im 3,********** NfcService: File: ../../../gecko/dom/nfc/gonk/NfcService.cpp, Line: 274, Function: NfcService
379:I/        (  171): halo,im 3,********** NfcService::Start  ************* in gecko/dom/nfc/gonk/NfcService.cpp:
380:I/Gecko   (  171): -*- Nfc.js:: hahaha,Nfc(464) after start()
381:I/Gecko   (  171): -*- Nfc.js:: init ,defineLazyGetter æä¸é¢
382:I/Gecko   (  171): -*- Nfc.js:: hahaha,Nfc(466) after init()
383:I/Gecko   (  171): -*- NfcContentHelper.js :: hahaha NfcContentHelper() in NfcContentHelper.js.
428:I/        (  171): halo,nfc ,***NfcConsumer***  File:../../../gecko/ipc/nfc/Nfc.cpp,****** Line:226, ******* Function:OnConnectSuccess ******
429:I/        (  171): halo,nfc ,***NfcConsumer***  File:../../../gecko/ipc/nfc/Nfc.cpp,****** Line:215, ******* Function:ReceiveSocketData ******
430:I/        (  171): halo,im 3,********** NfcService: File: ../../../gecko/dom/nfc/gonk/NfcService.cpp, Line: 384, Function: ReceiveSocketData
431:I/        (  171): halo,im 3,********** NfcService: File: ../../../gecko/dom/nfc/gonk/NfcService.cpp, Line: 53, Function: assertIsNfcServiceThread
432:I/        (  171): halo,nfc ,*** MessageHandler: File: ../../../gecko/dom/nfc/gonk/NfcMessageHandler.cpp, Line: 73,******* Function: Unmarshall******
433:I/        (  171): halo,nfc ,*** MessageHandler: File: ../../../gecko/dom/nfc/gonk/NfcMessageHandler.cpp, Line: 92,******* Function: Unmarshall******
434:I/        (  171): halo,nfc ,*** MessageHandler: File: ../../../gecko/dom/nfc/gonk/NfcMessageHandler.cpp, Line: 270,******* Function: InitializeNotification******
435:I/        (  171): halo,im 3,********** NfcService: File: ../../../gecko/dom/nfc/gonk/NfcService.cpp, Line: 53, Function: assertIsNfcServiceThread
442:I/        (  171): halo,im 3,********** NfcService::DispatchNfcEvent  ************* in gecko/dom/nfc/gonk/NfcService.cpp
443:I/Gecko   (  171): -*- Nfc.js:: onEvent in nfc.js 
444:I/Gecko   (  171): -*- Nfc.js:: Received message from NFC Service: {"majorVersion":1,"minorVersion":20,"status":0,"type":"InitializedNotification"}
572:I/Gecko   (  171): -*- nsNfc.js DOM: In MozNFCImpl Constructor
573:I/Gecko   (  171): -*- nsNfc.js DOM: hahaha MozNFCImpl.prototype in nsNfc.js.
574:I/Gecko   (  171): -*- nsNfc.js DOM: MozNFCImpl init called
575:I/Gecko   (  171): -*- nsNfc.js DOM: hahaha MozNFCImpl.prototype.init() in nsNfc.js.
576:I/Gecko   (  171): -*- NfcContentHelper.js :: hahaha addEventListener() in NfcContentHelper.js.
577:I/Gecko   (  171): -*- Nfc.js:: Received message from content process: {"target":{},"name":"NFC:AddEventListener","sync":false,"json":{"tabId":0},"data":{"tabId":0},"objects":{}}
578:I/Gecko   (  171): -*- Nfc.js:: Received message from content process: {"target":{},"name":"NFC:QueryInfo","sync":true,"json":null,"data":null,"objects":{}}
746:I/Gecko   (  171): -*- Nfc.js:: Received message from content process: {"target":{},"name":"NFC:SetFocusApp","sync":false,"json":{"tabId":2,"isFocus":true},"data":{"tabId":2,"isFocus":true},"objects":{}}
758:I/Gecko   (  171): -*- Nfc.js:: Received message from content process: {"target":{},"name":"child-process-shutdown","sync":false,"json":null,"data":null,"objects":{}}

 

./adblogcat.sh: line 5: [: nfc: unary operator expected
63:I/nfcd    (  172): halo,nfc ,***** File:system/nfcd/src/NfcService.cpp,****** Line:416, ******* Function:-NfcService::Instance ******
64:I/nfcd    (  172): halo,nfc ,***** File:system/nfcd/src/NfcService.cpp,****** Line:93, ******* Function:-NfcService::NfcService ******
65:I/nfcd    (  172): halo,nfc ,***** File:system/nfcd/src/NfcService.cpp,****** Line:112, ******* Function:-NfcService::initialize ******
74:I/nfcd    (  172): halo,nfc ,***** File:system/nfcd/src/NfcService.cpp,****** Line:104, ******* Function:-NfcService::serviceThreadFunc ******
75:D/nfcd    (  172): void* NfcService::eventLoop(): NFCService started
76:I/nfcd    (  172): halo,nfc ,***** File:system/nfcd/src/NfcService.cpp,****** Line:345, ******* Function:-NfcService::eventLoop ******
356:I/Gecko   (  170): -*- Nfc.js:: Starting Nfc() function in nfc.js
357:I/        (  170): halo,im 3,********** NfcService::FactoryCreate  ************* in gecko/dom/nfc/gonk/NfcService.cpp:   File: ../../../gecko/dom/nfc/gonk/NfcService.cpp, Line: 287, Function: FactoryCreate
358:I/        (  170): halo,nfc ,***NfcConsumer***  File:../../../gecko/ipc/nfc/Nfc.cpp,****** Line:184, ******* Function:NfcConsumer ******
359:I/        (  170): halo,nfc ,创建服务连接,往nfcd去,***NfcConnector***  File:../../../gecko/ipc/nfc/Nfc.cpp,****** Line:90, ******* Function:Create ******
360:I/        (  170): halo,nfc ,***NfcConnector***  File:../../../gecko/ipc/nfc/Nfc.cpp,****** Line:154, ******* Function:SetUp ******
361:I/        (  170): halo,nfc ,***NfcConnector***  File:../../../gecko/ipc/nfc/Nfc.cpp,****** Line:119, ******* Function:CreateAddr ******
362:I/        (  170): halo,nfc ,***NfcConnector***  File:../../../gecko/ipc/nfc/Nfc.cpp,****** Line:154, ******* Function:SetUp ******
363:D/nfcd    (  172): Socket connected
364:I/nfcd    (  172): halo,nfc ,***** File:system/nfcd/src/NfcService.cpp,****** Line:522, ******* Function:-NfcService::onConnected ******
365:D/nfcd    (  172): void* NfcService::eventLoop(): NFCService msg=10
366:D/nfcd    (  172): processNotificaton notification=2000
367:D/nfcd    (  172): void NfcIpcSocket::writeToOutgoingQueue(uint8_t*, size_t) enter, data=0xb8ebbe68, dataLen=20
368:D/nfcd    (  172): Writing 20 bytes to gecko 
369:I/        (  170): halo,im 3,********** NfcService: File: ../../../gecko/dom/nfc/gonk/NfcService.cpp, Line: 274, Function: NfcService
370:I/        (  170): halo,im 3,********** NfcService::Start  ************* in gecko/dom/nfc/gonk/NfcService.cpp:
371:I/Gecko   (  170): -*- Nfc.js:: hahaha,Nfc(464) after start()
372:I/Gecko   (  170): -*- Nfc.js:: init ,defineLazyGetter æä¸é¢
373:I/Gecko   (  170): -*- Nfc.js:: hahaha,Nfc(466) after init()
374:I/Gecko   (  170): -*- NfcContentHelper.js :: hahaha NfcContentHelper() in NfcContentHelper.js.
419:I/        (  170): halo,nfc ,***NfcConsumer***  File:../../../gecko/ipc/nfc/Nfc.cpp,****** Line:226, ******* Function:OnConnectSuccess ******
420:I/        (  170): halo,nfc ,***NfcConsumer***  File:../../../gecko/ipc/nfc/Nfc.cpp,****** Line:215, ******* Function:ReceiveSocketData ******
421:I/        (  170): halo,im 3,********** NfcService: File: ../../../gecko/dom/nfc/gonk/NfcService.cpp, Line: 384, Function: ReceiveSocketData
422:I/        (  170): halo,im 3,********** NfcService: File: ../../../gecko/dom/nfc/gonk/NfcService.cpp, Line: 53, Function: assertIsNfcServiceThread
423:I/        (  170): halo,nfc ,*** MessageHandler: File: ../../../gecko/dom/nfc/gonk/NfcMessageHandler.cpp, Line: 73,******* Function: Unmarshall******
424:I/        (  170): halo,nfc ,*** MessageHandler: File: ../../../gecko/dom/nfc/gonk/NfcMessageHandler.cpp, Line: 92,******* Function: Unmarshall******
425:I/        (  170): halo,nfc ,*** MessageHandler: File: ../../../gecko/dom/nfc/gonk/NfcMessageHandler.cpp, Line: 270,******* Function: InitializeNotification******
426:I/        (  170): halo,im 3,********** NfcService: File: ../../../gecko/dom/nfc/gonk/NfcService.cpp, Line: 53, Function: assertIsNfcServiceThread
433:I/        (  170): halo,im 3,********** NfcService::DispatchNfcEvent  ************* in gecko/dom/nfc/gonk/NfcService.cpp
434:I/Gecko   (  170): -*- Nfc.js:: onEvent in nfc.js 
435:I/Gecko   (  170): -*- Nfc.js:: Received message from NFC Service: {"majorVersion":1,"minorVersion":20,"status":0,"type":"InitializedNotification"}
563:I/Gecko   (  170): -*- nsNfc.js DOM: In MozNFCImpl Constructor
564:I/Gecko   (  170): -*- nsNfc.js DOM: hahaha MozNFCImpl.prototype in nsNfc.js.
565:I/Gecko   (  170): -*- nsNfc.js DOM: MozNFCImpl init called
566:I/Gecko   (  170): -*- nsNfc.js DOM: hahaha MozNFCImpl.prototype.init() in nsNfc.js.
567:I/Gecko   (  170): -*- NfcContentHelper.js :: hahaha addEventListener() in NfcContentHelper.js.
568:I/Gecko   (  170): -*- Nfc.js:: Received message from content process: {"target":{},"name":"NFC:AddEventListener","sync":false,"json":{"tabId":0},"data":{"tabId":0},"objects":{}}
569:I/Gecko   (  170): -*- Nfc.js:: Received message from content process: {"target":{},"name":"NFC:QueryInfo","sync":true,"json":null,"data":null,"objects":{}}
737:I/Gecko   (  170): -*- Nfc.js:: Received message from content process: {"target":{},"name":"NFC:SetFocusApp","sync":false,"json":{"tabId":2,"isFocus":true},"data":{"tabId":2,"isFocus":true},"objects":{}}
749:I/Gecko   (  170): -*- Nfc.js:: Received message from content process: {"target":{},"name":"child-process-shutdown","sync":false,"json":null,"data":null,"objects":{}}

 

disable 掉nfcd ,ipc client 空运转,不断向nfcd发连接请求。当然连接失败。

 

I/        (  171): halo,nfc ,创建服务连接,往nfcd去,***NfcConnector***  File:../../../gecko/ipc/nfc/Nfc.cpp,****** Line:90, ******* Function:Create ******
I/        (  171): halo,nfc ,***NfcConnector***  File:../../../gecko/ipc/nfc/Nfc.cpp,****** Line:154, ******* Function:SetUp ******
I/        (  171): halo,nfc ,***NfcConnector***  File:../../../gecko/ipc/nfc/Nfc.cpp,****** Line:119, ******* Function:CreateAddr ******
I/        (  171): halo,nfc ,***NfcConsumer***  File:../../../gecko/ipc/nfc/Nfc.cpp,****** Line:234, ******* Function:OnConnectError ******
I/        (  171): halo,nfc ,***NfcConsumer***  File:../../../gecko/ipc/nfc/Nfc.cpp,****** Line:242, ******* Function:OnDisconnect ******
I/Settings( 2733): Content JS LOG: pfx ,nfc_item.js :: NFCItem,return ctor_nfcItem 
I/Settings( 2733):     at ctor_nfcItem (app://settings.gaiamobile.org/js/panels/root/low_priority_items.js:192:8)
I/Settings( 2733): Content JS LOG: pfx ,nfc_item.js :: NFCItem() 
I/Settings( 2733): Content JS LOG: pfx ,nfc 如何改变下层nfc状态 
I/Settings( 2733): Content JS LOG: pfx ,nfc_item.js :: NFCItem.prototype 
I/        (  171): halo,nfc ,创建服务连接,往nfcd去,***NfcConnector***  File:../../../gecko/ipc/nfc/Nfc.cpp,****** Line:90, ******* Function:Create ******
I/        (  171): halo,nfc ,***NfcConnector***  File:../../../gecko/ipc/nfc/Nfc.cpp,****** Line:154, ******* Function:SetUp ******
I/        (  171): halo,nfc ,***NfcConnector***  File:../../../gecko/ipc/nfc/Nfc.cpp,****** Line:119, ******* Function:CreateAddr ******
I/        (  171): halo,nfc ,***NfcConsumer***  File:../../../gecko/ipc/nfc/Nfc.cpp,****** Line:234, ******* Function:OnConnectError ******
I/        (  171): halo,nfc ,***NfcConsumer***  File:../../../gecko/ipc/nfc/Nfc.cpp,****** Line:242, ******* Function:OnDisconnect ******