summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartijn Coenen <maco@google.com>2012-10-12 15:06:36 -0700
committerMartijn Coenen <maco@google.com>2012-10-12 15:10:01 -0700
commit81aa9898af2f99506cb025e9d8e37252d80c42fa (patch)
tree37171cee55fa4dd7f4da95bd2097ebae439690ba
parent59f43aefee220afd41baa97ce2043017c171be73 (diff)
downloadpackages_apps_nfc-81aa9898af2f99506cb025e9d8e37252d80c42fa.zip
packages_apps_nfc-81aa9898af2f99506cb025e9d8e37252d80c42fa.tar.gz
packages_apps_nfc-81aa9898af2f99506cb025e9d8e37252d80c42fa.tar.bz2
Don't hold a timed wakelock.
We used to acquire a timed wakelock when either resuming or suspending. We don't want to take a timed wakelock when suspending, since we want to suspend asap, but also don't want to underlock the wakelock. Instead of taking a timed wakelock, just abort the process in case the NFC controller hangs. Bug: 7341879 Change-Id: Ibd2f468264f60a39db3cb271a6f05c50dfb559bf
-rwxr-xr-xnci/jni/NativeNfcManager.cpp3
-rwxr-xr-xsrc/com/android/nfc/NfcService.java6
2 files changed, 3 insertions, 6 deletions
diff --git a/nci/jni/NativeNfcManager.cpp b/nci/jni/NativeNfcManager.cpp
index 81bb6b2..814f49b 100755
--- a/nci/jni/NativeNfcManager.cpp
+++ b/nci/jni/NativeNfcManager.cpp
@@ -1385,7 +1385,8 @@ static jboolean nfcManager_doActivateLlcp(JNIEnv *e, jobject o)
*******************************************************************************/
static void nfcManager_doAbort(JNIEnv *e, jobject o)
{
- ALOGD("%s", __FUNCTION__);
+ ALOGE("%s: abort()", __FUNCTION__);
+ abort();
}
diff --git a/src/com/android/nfc/NfcService.java b/src/com/android/nfc/NfcService.java
index 0514160..c7b0bba 100755
--- a/src/com/android/nfc/NfcService.java
+++ b/src/com/android/nfc/NfcService.java
@@ -1883,11 +1883,7 @@ public class NfcService implements DeviceHostListener {
}
mScreenState = params[0].intValue();
- // HACK: We've seen applying the routing configuration
- // getting stuck. The operation should normally easily
- // complete within a minute, so don't hold the wakelock
- // any longer than that.
- mRoutingWakeLock.acquire(60000);
+ mRoutingWakeLock.acquire();
try {
applyRouting(false);
} finally {