int sensors_poll_context_t::activate(int handle, int enabled) {
int err = -1;
NativeSensorManager& sm(NativeSensorManager::getInstance());
Mutex::Autolock _l(mLock);
err = sm.activate(handle, enabled);
if (enabled && !err) {
const char wakeMessage(WAKE_MESSAGE);
int result = write(mWritePipeFd, &wakeMessage, 1);
}
return err;
}