Actually, I do not think the NFC service is disabled. When the screen has a lower value, then the SCREEN_STATE_ON_UNLOCKED
device stops requesting NFC tags. You can see this from this code:
// configure NFC-C polling if (mScreenState >= POLLING_MODE) { if (force || !mNfcPollingEnabled) { Log.d(TAG, "NFC-C ON"); mNfcPollingEnabled = true; mDeviceHost.enableDiscovery(); } } else { if (force || mNfcPollingEnabled) { Log.d(TAG, "NFC-C OFF"); mNfcPollingEnabled = false; mDeviceHost.disableDiscovery(); } }
But NFC-EE routing is enabled, and the on-screen state is higher than SCREEN_STATE_ON_LOCKED
:
// configure NFC-EE routing if (mScreenState >= SCREEN_STATE_ON_LOCKED && mEeRoutingState == ROUTE_ON_WHEN_SCREEN_ON) { if (force || !mNfceeRouteEnabled) { Log.d(TAG, "NFC-EE ON"); mNfceeRouteEnabled = true; mDeviceHost.doSelectSecureElement(); } } else { if (force || mNfceeRouteEnabled) { Log.d(TAG, "NFC-EE OFF"); mNfceeRouteEnabled = false; mDeviceHost.doDeselectSecureElement(); } }
The service itself starts and stops in other parts of this class.
source share