nfc: remove dead wake lock code
com.android.nfc doesn't have unix or selinux permissions to
/sys/power/wake_[un]lock, i.e. all requests for wake locks are no-ops.
Bug: 79940526
Test: walleye boots without this error:
E power : fatal error opening "/sys/power/wake_lock": Permission denied
Change-Id: I470941788d3d7ca9c8f43df69dc7f873b0814a4f
diff --git a/src/Android.bp b/src/Android.bp
index 2bc753e..0f91998 100644
--- a/src/Android.bp
+++ b/src/Android.bp
@@ -11,7 +11,6 @@
"libdl",
"libhardware",
"libmetricslogger",
- "libpower",
"libz",
"libchrome",
"libbase",
diff --git a/src/gki/ulinux/gki_int.h b/src/gki/ulinux/gki_int.h
index 27ff76e..6736b62 100644
--- a/src/gki/ulinux/gki_int.h
+++ b/src/gki/ulinux/gki_int.h
@@ -38,7 +38,6 @@
int no_timer_suspend; /* 1: no suspend, 0 stop calling GKI_timer_update() */
pthread_mutex_t gki_timer_mutex;
pthread_cond_t gki_timer_cond;
- int gki_timer_wake_lock_on;
} tGKI_OS;
/* condition to exit or continue GKI_run() timer loop */
diff --git a/src/gki/ulinux/gki_ulinux.cc b/src/gki/ulinux/gki_ulinux.cc
index 5aff8ab..fc3b5c6 100644
--- a/src/gki/ulinux/gki_ulinux.cc
+++ b/src/gki/ulinux/gki_ulinux.cc
@@ -278,11 +278,6 @@
** Returns void
**
*******************************************************************************/
-#define WAKE_LOCK_ID "brcm_nfca"
-#define PARTIAL_WAKE_LOCK 1
-extern "C" int acquire_wake_lock(int lock, const char* id);
-extern "C" int release_wake_lock(const char* id);
-
void GKI_shutdown(void) {
uint8_t task_id;
volatile int* p_run_cond = &gki_cb.os.no_timer_suspend;
@@ -337,12 +332,6 @@
#ifdef NO_GKI_RUN_RETURN
shutdown_timer = 1;
#endif
- if (gki_cb.os.gki_timer_wake_lock_on) {
- DLOG_IF(INFO, nfc_debug_enabled)
- << StringPrintf("GKI_shutdown : release_wake_lock(brcm_btld)");
- release_wake_lock(WAKE_LOCK_ID);
- gki_cb.os.gki_timer_wake_lock_on = 0;
- }
oldCOnd = *p_run_cond;
*p_run_cond = GKI_TIMER_TICK_EXIT_COND;
if (oldCOnd == GKI_TIMER_TICK_STOP_COND)
@@ -363,9 +352,6 @@
void gki_system_tick_start_stop_cback(bool start) {
tGKI_OS* p_os = &gki_cb.os;
volatile int* p_run_cond = &p_os->no_timer_suspend;
-#ifdef GKI_TICK_TIMER_DEBUG
- static volatile int wake_lock_count;
-#endif
if (start == false) {
/* this can lead to a race condition. however as we only read this variable
* in the timer loop
@@ -374,25 +360,12 @@
/* GKI_disable(); */
*p_run_cond = GKI_TIMER_TICK_STOP_COND;
/* GKI_enable(); */
-#ifdef GKI_TICK_TIMER_DEBUG
- DLOG_IF(INFO, nfc_debug_enabled)
- << StringPrintf(">>> STOP wake_lock_count:%d", --wake_lock_count);
-#endif
- release_wake_lock(WAKE_LOCK_ID);
- gki_cb.os.gki_timer_wake_lock_on = 0;
} else {
/* restart GKI_timer_update() loop */
- acquire_wake_lock(PARTIAL_WAKE_LOCK, WAKE_LOCK_ID);
- gki_cb.os.gki_timer_wake_lock_on = 1;
*p_run_cond = GKI_TIMER_TICK_RUN_COND;
pthread_mutex_lock(&p_os->gki_timer_mutex);
pthread_cond_signal(&p_os->gki_timer_cond);
pthread_mutex_unlock(&p_os->gki_timer_mutex);
-
-#ifdef GKI_TICK_TIMER_DEBUG
- DLOG_IF(INFO, nfc_debug_enabled)
- << StringPrintf(">>> START wake_lock_count:%d", ++wake_lock_count);
-#endif
}
}