void MusicServiceAccessMsgReceiver::shutdown() { // unsubscribe to system messages if (GetMessenger() != NULL) { GetMessenger()->UnsubscribeSysMsg(*this); } }
void MusicServiceAccessMsgReceiver::startup(GtfPluginLoader& rLoader) { GtfMsgExtReceiver::Init(rLoader); if (m_pWorkLoop == NULL) { m_pWorkLoop = static_cast<GtfMainWorkLoop*>( rLoader.getInterface( static_cast<uint32_t>(GtfMainWorkLoop::cm_gtfInterfaceId), static_cast<uint32_t>(GtfMainWorkLoop::cm_gtfInterfaceVersion))); } // subscribe to system messages if (GetMessenger() != NULL) { GetMessenger()->SubscribeSysMsg(*this); } }
void MusicServiceAccessMsgReceiver::RequestShutdownOnFailure() { // send the system failure message GtfMsgHandle handle = GetMessenger()->CreateMsg(GTF_MID_SYSTEM_FAILURE); GetMessenger()->PublishMsg(handle); GetMessenger()->DestroyMsg(handle); // request shutdown handle = GetMessenger()->CreateMsg(GTF_MID_RUN_SHUTDOWN); GetMessenger()->PublishMsg(handle); GetMessenger()->DestroyMsg(handle); }
status_t SendMessageToReplicant(int32 index, BMessage *msg) { BMessage aReply; status_t aErr = B_OK; msg->AddInt32( "what2", msg->what ); msg->what = B_SET_PROPERTY; BMessage uid_specifier(B_ID_SPECIFIER); msg->AddSpecifier("View"); uid_specifier.AddInt32("id", index); uid_specifier.AddString("property", "Replicant"); msg->AddSpecifier(&uid_specifier); aErr = GetMessenger().SendMessage( msg, (BHandler*)NULL, 1000000 ); return aErr; }
void MusicServiceAccessMsgReceiver::UnlockRunlevel() { GtfMsgHandle msg = GetMessenger()->CreateMsg(GTF_MID_RUN_RUNLEVEL_UNLOCK); GetMessenger()->PublishMsg(msg); GetMessenger()->DestroyMsg(msg); }