Skip to content

Commit

Permalink
lights: hold a partial wakelock
Browse files Browse the repository at this point in the history
btw this is all a temporary hack until Huawei's crap is reversed
  • Loading branch information
Daz Jones committed Jan 5, 2013
1 parent 05b4acd commit 21610d5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lights/Android.mk
Expand Up @@ -25,7 +25,7 @@ LOCAL_SRC_FILES := lights.c
LOCAL_PRELINK_MODULE := false
LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw

LOCAL_SHARED_LIBRARIES := liblog
LOCAL_SHARED_LIBRARIES := libhardware_legacy liblog

LOCAL_MODULE := lights.u8815

Expand Down
3 changes: 3 additions & 0 deletions lights/lights.c
Expand Up @@ -31,6 +31,7 @@
#include <sys/types.h>

#include <hardware/lights.h>
#include <hardware_legacy/power.h>

/******************************************************************************/

Expand Down Expand Up @@ -156,6 +157,7 @@ void
usleep(offMS * 1000);
}
}
release_wake_lock("blink");
return 0;
}

Expand Down Expand Up @@ -213,6 +215,7 @@ set_speaker_light_locked(struct light_device_t* dev,
}

if(blink) {
acquire_wake_lock(PARTIAL_WAKE_LOCK, "blink");
pthread_create(&t_led_blink, NULL, led_blink, NULL);
} else {
write_int(RED_LED_FILE, red);
Expand Down

0 comments on commit 21610d5

Please sign in to comment.