From 7bbabb2deebbc498c635f690c5283201da549247 Mon Sep 17 00:00:00 2001 From: Martijn Coenen Date: Wed, 19 Oct 2011 08:54:08 -0700 Subject: Fix crash when turning screen off and NFC is off. Bug: 5480404 Change-Id: I52add3c89fc535bfc37bc8c12ed0f8f905cbe304 --- src/com/android/nfc/NfcService.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/com/android/nfc/NfcService.java b/src/com/android/nfc/NfcService.java index 2ad957e..1b56648 100755 --- a/src/com/android/nfc/NfcService.java +++ b/src/com/android/nfc/NfcService.java @@ -1633,14 +1633,12 @@ public class NfcService extends Application implements DeviceHostListener { * manipulation code is overwriting globals it relies on. This hack should * be removed when the LLCP stack is fixed. */ - Log.d(TAG, "NFC-C polling OFF"); - mDeviceHost.disableDiscovery(); - maybeDisconnectTarget(); - if (mOpenEe == null) { + if (isNfcEnabled() && mOpenEe == null) { + Log.d(TAG, "NFC-C polling OFF"); + mDeviceHost.disableDiscovery(); + maybeDisconnectTarget(); Log.d(TAG, "NFC-EE routing OFF"); mDeviceHost.doDeselectSecureElement(); - } else { - Log.d(TAG, "Skipping request for NFC-EE routing OFF"); } } else { if (DBG) Log.d(TAG, "Ignoring disable request"); -- cgit v1.1