Refine delay polling control flow
Bug: 231411134
Test: manual
Change-Id: I3371d1b321b0cc37f7deaabbc743cdf456bd2b23
diff --git a/src/com/android/nfc/NfcService.java b/src/com/android/nfc/NfcService.java
index 573c5ca..75a3549 100644
--- a/src/com/android/nfc/NfcService.java
+++ b/src/com/android/nfc/NfcService.java
@@ -3108,10 +3108,10 @@
unregisterObject(tagEndpoint.getHandle());
if (mPollDelay > NO_POLL_DELAY) {
tagEndpoint.stopPresenceChecking();
- mDeviceHost.startStopPolling(false);
synchronized (NfcService.this) {
if (!mPollingDelayed) {
mPollingDelayed = true;
+ mDeviceHost.startStopPolling(false);
if (DBG) Log.d(TAG, "Polling delayed");
mHandler.sendMessageDelayed(
mHandler.obtainMessage(MSG_DELAY_POLLING), mPollDelay);