bool NoSleepExtension::start( IOService * provider ) { #ifdef DEBUG IOLog("%s[%p]::%s(%p)\n", getName(), this, __FUNCTION__, provider); #endif if( !super::start( provider )) return( false ); //task_t x = current_task(); //IOLog("task: %p, %p\n", x, bootstrap_port); delayTimer = thread_call_allocate(_switchOffUserSleepDisabled, (thread_call_param_t) this); isSleepStateInitialized = false; acSleepSuppressionState = kNoSleepStateDisabled; batterySleepSuppressionState = kNoSleepStateDisabled; forceClientMessage = false; isOnAC = true; pPowerSource = NULL; // This should be done ASAP, cause pRootDomain // is used later in other methods pRootDomain = getPMRootDomain(); UInt8 loadedState; OSReturn ret = readNVRAM(&loadedState); if(ret == kOSReturnSuccess) { unpackSleepState(loadedState, &batterySleepSuppressionState, &acSleepSuppressionState); } /// NoSleep will be activeted after matching with the IOPMPowerSource //updateSleepPowerState(); clamshellStateInterestNotifier = pRootDomain->registerInterest(gIOGeneralInterest, NoSleepExtension::_clamshellEventInterestHandler, this); registerService(); startPM(provider); IOLog("%s: successfully started\n", getName()); return true; }
bool Insomnia::start(IOService* provider) { DLog(""); if (!super::start(provider)) { DLog("super::start failed"); return false; } _last_lid_state = true; // Technically it could be closed... startPM(provider); Insomnia::send_event(kIOPMDisableClamshell);// | kIOPMPreventSleep); return true; }
void RoomWindow::on_listUsers_doubleClicked(const QModelIndex &index) { QString userid = ui->listUsers->currentItem()->text(); emit startPM(userid); }