Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » checkWakeLocks caught Exception (checkWakeLocks caught Exception when phone goes to sleep)
checkWakeLocks caught Exception [message #977910] Fri, 09 November 2012 17:32 Go to next message
Michael McDonald is currently offline Michael McDonaldFriend
Messages: 1
Registered: November 2012
Junior Member
I have an app that calls a class from the receiver below. It works fine when the phone is awake, but as soon as it is put to sleep, it returns the following error from logcat:
E/DeepSleepService(745): checkWakeLocks caught Exception /sys/power/active_wake_lock: open failed: ENOENT (No such file or directory)

I can find nothing on the internet regarding that exception.

Here is the the receiver class:
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.PowerManager;
import android.util.Log;

public class OnAlarmReceiver extends BroadcastReceiver {
public void onReceive(Context context, Intent intent) {
PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "wakelock");
context.startService(new Intent(context, Track.class));




Here is the AlarmAlertWakeLock class:
import android.content.Context;
import android.os.PowerManager;
import android.util.Log;

class AlarmAlertWakeLock {
private static PowerManager.WakeLock sCpuWakeLock;

static void acquireCpuWakeLock(Context context) {
if (sCpuWakeLock != null) {
PowerManager pm =
(PowerManager) context.getSystemService(Context.POWER_SERVICE);

sCpuWakeLock = pm.newWakeLock(
PowerManager.PARTIAL_WAKE_LOCK, "AlarmAlertWakeLock");

static void releaseCpuLock() {
if (sCpuWakeLock != null) {
sCpuWakeLock = null;

I have registered the receiver and added permission in my manifest:
<uses-permission android:name="android.permission.WAKE_LOCK" />

<receiver android:name="com.myApp.OnAlarmReceiver"

Any idea what is causing this error when the phone is put to sleep, and how to fix?

[Updated on: Fri, 09 November 2012 21:48]

Report message to a moderator

Re: checkWakeLocks caught Exception [message #978131 is a reply to message #977910] Fri, 09 November 2012 21:38 Go to previous message
David Wegener is currently offline David WegenerFriend
Messages: 1442
Registered: July 2009
Senior Member
This isn't an Android development forum. It is for questions related to Eclipse tools. You'll need to find an Android specific forum and ask your question there.
Previous Topic:ECLIPSE JUNO RCP application.e4xmi eventBroker
Next Topic:Flash Builder Folding Key Binding not working
Goto Forum:

Current Time: Fri May 27 01:06:04 GMT 2022

Powered by FUDForum. Page generated in 0.03261 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top