2 * Copyright (c) 2013, TOYOTA MOTOR CORPORATION.
4 * This program is licensed under the terms and conditions of the
5 * Apache License, version 2.0. The full text of the Apache License is at
6 * http://www.apache.org/licenses/LICENSE-2.0
10 //==========================================================================
12 * @file CicoSCPolicyManager.cpp
14 * @brief This file implementation of CicoSCPolicyManager class
16 //==========================================================================
18 #include "CicoSCPolicyManager.h"
19 #include "CicoStateMachine.h"
20 #include "CicoState.h"
21 #include "CicoHistoryState.h"
22 #include "CicoStateMachineCreator.h"
23 #include "CicoSCPolicyDef.h"
24 #include "CicoSCResourceManager.h"
26 #include "ico_syc_error.h"
27 #include "CicoSCServer.h"
28 #include "CicoSCMessage.h"
29 #include "ico_syc_msg_cmd_def.h"
30 #include "ico_syc_type.h"
32 //==========================================================================
34 //==========================================================================
36 // Defines of D-Bus target.
37 #define DBUS_SERVICE "org.automotive.message.broker"
38 #define DBUS_INTERFACE "org.freedesktop.DBus.Properties"
39 #define DBUS_METHOD "Get"
41 // Defines of maximum number.
42 #define AMB_MAX_VHCLINFO 10 /**< maximum number of vehicle info */
44 // Enumerations of Vehicle information key.
46 AMB_VHCL_SPEED = 1, /**< Vehicle speed */
47 AMB_SHIFT_POSITION, /**< Shift position */
48 AMB_LIGHT_LEFT, /**< Light left(Turn left) */
49 AMB_LIGHT_RIGHT, /**< Light right(Turn right) */
50 AMB_NIGHT_MODE, /**< Night mode */
51 AMB_MAX_INFO /**< Maximum number of type */
55 typedef struct _vehicle_info_property_t {
56 int key; /* Vehicle Information key */
57 const char *property; /* D-Bus property name */
58 const char *path; /* D-Bus path name */
59 const char *interface; /* D-Bus interface name */
62 // structure of Vehicle information data.
63 typedef struct _vehicle_info_data {
64 int key; /* Vehicle Information key */
65 DBusPendingCall *pending;
70 _vhcldata_t vhcl_data[AMB_MAX_INFO];
72 //*========================================================================
74 //========================================================================
76 static const vhcl_info_prop_t apf_vhcl_info[] = {
80 "/org/automotive/runningstatus/VehicleSpeed",
81 "org.automotive.VehicleSpeed"
86 "/org/automotive/runningstatus/Transmission",
87 "org.automotive.Transmission"
89 #if 0 // use LightStatus
90 /* use LightStatus, because AMB not support access of TurnSignal by D-Bus */
92 ICO_SYC_VEHICLEINFO_TURN_SIGNAL,
94 "/org/automotive/runningstatus/TurnSignal",
95 "org.automotive.TurnSignal"
97 #else // use LightStatus
101 "/org/automotive/runningstatus/LightStatus",
102 "org.automotive.LightStatus"
107 "/org/automotive/runningstatus/LightStatus",
108 "org.automotive.LightStatus"
110 #endif // use LightStatus
114 "/org/automotive/custom/NightMode",
115 "org.automotive.NightMode"
117 { 0, "\0", "\0", "\0" }
120 //--------------------------------------------------------------------------
122 * @brief default constructor
124 //--------------------------------------------------------------------------
125 CicoSCPolicyManager::CicoSCPolicyManager(CicoSCResourceManager* resourceMgr)
126 : m_initialized(false),
127 m_dbusConnection(NULL),
129 m_stateMachine(NULL),
130 m_resourceMgr(resourceMgr)
134 //--------------------------------------------------------------------------
138 //--------------------------------------------------------------------------
139 CicoSCPolicyManager::~CicoSCPolicyManager()
143 //--------------------------------------------------------------------------
145 * @brief initialize policy manager
147 //--------------------------------------------------------------------------
149 CicoSCPolicyManager::initialize(void)
151 ICO_DBG("CicoSCPolicyManager::initialize Enter");
153 int ret = ICO_SYC_EOK;
155 if (ICO_SYC_EOK != ret) {
159 ret = initStateMachine();
160 if (ICO_SYC_EOK != ret) {
164 ICO_DBG("CicoSCPolicyManager::initialize Leave");
168 //--------------------------------------------------------------------------
170 * @brief terminate policy manager
172 //--------------------------------------------------------------------------
174 CicoSCPolicyManager::terminate(void)
176 ICO_DBG("CicoSCPolicyManager::terminate Enter");
177 ICO_DBG("CicoSCPolicyManager::terminate Leave");
180 //--------------------------------------------------------------------------
182 * @brief initialize amb connection
184 //--------------------------------------------------------------------------
186 CicoSCPolicyManager::initAMB(void)
188 ICO_DBG("CicoSCPolicyManager::initAMB Enter");
191 DBusError dbus_error;
193 if (true == m_initialized) {
194 ICO_DBG("CicoSCPolicyManager::initAMB Leave(EOK)");
198 /* Zero clear vhcl_data */
199 memset(vhcl_data, 0, sizeof(vhcl_data));
201 /* Reset D-Bus error */
202 dbus_error_init(&dbus_error);
204 /* Get D-Bus connection */
205 m_dbusConnection = dbus_bus_get(DBUS_BUS_SYSTEM, &dbus_error);
206 if (! m_dbusConnection) {
207 ICO_ERR("dbus_bus_get failed.");
208 ICO_ERR("CicoSCPolicyManager::initAMB Leave(EIO)");
212 /* send request to AMB */
215 /* recv response from AMB timer start */
218 ICO_ERR("ecore_init");
219 ICO_ERR("CicoSCPolicyManager::initAMB Leave(ENOSYS)");
220 return ICO_SYC_ENOSYS;
223 m_ecoreTimer = ecore_timer_add(0.2, //TODO
224 CicoSCPolicyManager::ecoreTimerCB, this);
225 if (! m_ecoreTimer) {
226 ICO_ERR("ecore_timer_add failed.");
227 ICO_ERR("CicoSCPolicyManager::initAMB Leave(ENOSYS)");
228 return ICO_SYC_ENOSYS;
231 m_initialized = true;
233 ICO_DBG("CicoSCPolicyManager::initAMB Leave(EOK)");
237 //--------------------------------------------------------------------------
239 * @brief send AMB request
241 //--------------------------------------------------------------------------
243 CicoSCPolicyManager::sendAMBRequest(void)
245 // ICO_DBG("CicoSCPolicyManager::sendAMBRequest Enter");
247 DBusMessage *dbus_message = NULL;
249 int ret = ICO_SYC_EOK;
251 for (idx = 0; apf_vhcl_info[idx].key; idx++) {
252 /* set vehicle info key */
253 vhcl_data[idx].key = apf_vhcl_info[idx].key;
255 /* status is pending ? */
256 if (vhcl_data[idx].pending) {
257 ICO_WRN("(%s) not complete", apf_vhcl_info[idx].property);
261 if (apf_vhcl_info[idx].path[0] == 0) {
262 /* currently not support this vehicle information */
266 /* Create send message */
267 dbus_message = dbus_message_new_method_call(DBUS_SERVICE,
268 apf_vhcl_info[idx].path,
271 if (! dbus_message) {
272 ICO_ERR("dbus_message_new_method_call");
275 /* Set parameters into message */
276 else if (! dbus_message_append_args(dbus_message,
278 &apf_vhcl_info[idx].interface,
280 &apf_vhcl_info[idx].property,
281 DBUS_TYPE_INVALID)) {
282 ICO_ERR("dbus_message_append_args");
285 /* Set destination */
286 else if (! dbus_message_set_destination(dbus_message,
288 ICO_ERR("dbus_message_set_destination");
292 else if (! dbus_connection_send_with_reply(m_dbusConnection,
294 &vhcl_data[idx].pending,
296 ICO_ERR("dbus_connection_send");
297 vhcl_data[idx].pending = NULL;
301 //ICO_DBG("REQUEST req (%s)", apf_vhcl_info[idx].property);
305 /* Release message */
306 dbus_message_unref(dbus_message);
310 /* dispatch if data queue exist */
312 dbus_connection_read_write_dispatch(m_dbusConnection, 0);
313 } while (dbus_connection_get_dispatch_status(m_dbusConnection)
314 == DBUS_DISPATCH_DATA_REMAINS);
316 //ICO_DBG("CicoSCPolicyManager::sendAMBRequest Leave");
320 //--------------------------------------------------------------------------
322 * @brief get vehicle information
324 //--------------------------------------------------------------------------
326 CicoSCPolicyManager::getVehicleInfo(void)
328 DBusMessage *dbus_message = NULL;
329 DBusMessageIter iter_head;
330 DBusMessageIter iter;
341 /* dispatch if data queue exist */
343 dbus_connection_read_write_dispatch(m_dbusConnection, 0);
344 } while (dbus_connection_get_dispatch_status(m_dbusConnection)
345 == DBUS_DISPATCH_DATA_REMAINS);
347 /* analyze reply data */
348 for (idx = 0; apf_vhcl_info[idx].key; idx++) {
349 if (! vhcl_data[idx].pending) {
352 if (! dbus_pending_call_get_completed(vhcl_data[idx].pending)) {
353 //ICO_WRN("(%s) NOT complete", apf_vhcl_info[idx].property);
357 dbus_message = dbus_pending_call_steal_reply(vhcl_data[idx].pending);
358 if (! dbus_message) {
359 //ICO_WRN("(%s) NO reply", apf_vhcl_info[idx].property);
363 if (dbus_message_get_type(dbus_message) == DBUS_MESSAGE_TYPE_ERROR) {
364 dbus_message_unref(dbus_message);
365 dbus_pending_call_cancel(vhcl_data[idx].pending);
366 vhcl_data[idx].pending = NULL;
367 //ICO_ERR("(%s) reply error", apf_vhcl_info[idx].property);
371 dbus_message_iter_init(dbus_message, &iter_head);
372 dbus_message_iter_recurse(&iter_head, &iter);
374 type = dbus_message_iter_get_arg_type(&iter);
376 case DBUS_TYPE_INT32:
377 dbus_message_iter_get_basic(&iter, &i32);
378 vhcl_data[idx].val = (double)i32;
380 case DBUS_TYPE_INT16:
381 dbus_message_iter_get_basic(&iter, &i16);
382 vhcl_data[idx].val = (double)i16;
384 case DBUS_TYPE_UINT32:
385 dbus_message_iter_get_basic(&iter, &u32);
387 case DBUS_TYPE_UINT16:
388 dbus_message_iter_get_basic(&iter, &u16);
389 vhcl_data[idx].val = (double)u16;
391 case DBUS_TYPE_BOOLEAN:
392 dbus_message_iter_get_basic(&iter, &b);
393 if (b) vhcl_data[idx].val = (double)1.0;
394 else vhcl_data[idx].val = (double)0.0;
397 dbus_message_iter_get_basic(&iter, &u8);
398 vhcl_data[idx].val = (double)u8;
400 case DBUS_TYPE_DOUBLE:
401 dbus_message_iter_get_basic(&iter, &d64);
402 vhcl_data[idx].val = (double)d64;
405 ICO_ERR("(%s) illegal data type(0x%02x)",
406 apf_vhcl_info[idx].property, ((int)type) & 0x0ff);
409 //ICO_DBG("REQUEST ans (%s) = %.2f",
410 // apf_vhcl_info[idx].property, vhcl_data[idx].val);
412 /* free message and pending */
413 dbus_message_unref(dbus_message);
414 dbus_pending_call_cancel(vhcl_data[idx].pending);
415 vhcl_data[idx].pending = NULL;
421 //--------------------------------------------------------------------------
423 * @brief ecore timer callback
425 //--------------------------------------------------------------------------
427 CicoSCPolicyManager::ecoreTimerCB(void *user_data)
429 CicoSCPolicyManager *policyMgr =
430 static_cast<CicoSCPolicyManager*>(user_data);
431 policyMgr->recvAMBVehicleInfo();
433 return ECORE_CALLBACK_RENEW;
436 //--------------------------------------------------------------------------
438 * @brief receive AMB vehicle information
440 //--------------------------------------------------------------------------
442 CicoSCPolicyManager::recvAMBVehicleInfo(void)
444 // ICO_DBG("CicoSCPolicyManager::recvAMBVehicleInfo Enter");
448 bool chgCamera = false;
449 bool chgRegulation = false;
450 bool chgNightMode = false;
454 /* get vehicle info values */
455 for (idx = 0; idx < AMB_MAX_VHCLINFO; idx++) {
456 if (vhcl_data[idx].key == 0) break;
457 key = vhcl_data[idx].key;
460 (void)sendSMEvent(EVID_VELOCTY, (int)vhcl_data[idx].val);
461 if (true == sendSMEvent(EVID_DRVREGULATION)) {
462 chgRegulation = true;
465 case AMB_SHIFT_POSITION:
466 (void)sendSMEvent(EVID_SHIFTPOS, (int)vhcl_data[idx].val);
467 if (true == sendSMEvent(EVID_CAMERA)) {
472 if (0.0 == vhcl_data[idx].val) {
473 (void)sendSMEvent(EVID_TURN_OFF);
476 (void)sendSMEvent(EVID_TURN_LEFT);
478 if (true == sendSMEvent(EVID_CAMERA)) {
482 case AMB_LIGHT_RIGHT:
483 if (0.0 == vhcl_data[idx].val) {
484 (void)sendSMEvent(EVID_TURN_OFF);
487 (void)sendSMEvent(EVID_TURN_LEFT);
489 if (true == sendSMEvent(EVID_CAMERA)) {
494 chgNightMode = sendSMEvent(EVID_NIGHTMODE, (int)vhcl_data[idx].val);
497 ICO_WRN("not such key (%d)", key);
502 if (true == chgRegulation) {
503 ICO_DBG("true == chgRegulation");
504 // notify changed state to resource manager
506 (CicoState*)m_stateMachine->getState(STID_DRVREGULATION);
508 vector<const CicoState*> currents;
509 state->getCurrentState(currents, CicoStateCore::ELvlTop);
510 if (0 != currents.size()) {
511 ICO_DBG("current=%s", currents[0]->getName().c_str());
512 notifyChangedState(currents[0]->getValue());
516 // Notify regulation changed state
517 CicoSCMessage *message = new CicoSCMessage();
518 message->addRootObject("command", MSG_CMD_NOTIFY_CHANGED_STATE);
519 message->addArgObject(MSG_PRMKEY_STATEID, ICO_SYC_STATE_REGULATION);
520 if (true == m_policyStates[STID_DRVREGULATION_ON]->isActive()) {
521 message->addArgObject(MSG_PRMKEY_STATE, ICO_SYC_STATE_ON);
524 message->addArgObject(MSG_PRMKEY_STATE, ICO_SYC_STATE_OFF);
526 CicoSCServer::getInstance()->sendMessageToHomeScreen(message);
529 if (true == chgCamera) {
530 ICO_DBG("true == chgCamera");
531 // notify changed state to resource manager
532 CicoState* state = (CicoState*)m_stateMachine->getState(STID_CAMERA);
534 vector<const CicoState*> currents;
535 state->getCurrentState(currents, CicoStateCore::ELvlTop);
536 if (0 != currents.size()) {
537 ICO_DBG("current=%s", currents[0]->getName().c_str());
538 notifyChangedState(currents[0]->getValue());
543 if (true == chgNightMode) {
544 ICO_DBG("true == chgNightMode");
545 // Notify NightMode changed state
546 CicoSCMessage *message = new CicoSCMessage();
547 message->addRootObject("command", MSG_CMD_NOTIFY_CHANGED_STATE);
548 message->addArgObject(MSG_PRMKEY_STATEID, ICO_SYC_STATE_NIGHTMODE);
549 if (true == m_policyStates[STID_NIGHTMODE_ON]->isActive()) {
550 message->addArgObject(MSG_PRMKEY_STATE, ICO_SYC_STATE_ON);
553 message->addArgObject(MSG_PRMKEY_STATE, ICO_SYC_STATE_OFF);
555 CicoSCServer::getInstance()->sendMessageToHomeScreen(message);
558 /* send request to AMB */
561 // ICO_DBG("CicoSCPolicyManager::recvAMBVehicleInfo Leave");
564 //--------------------------------------------------------------------------
566 * @brief get policy states
568 //--------------------------------------------------------------------------
569 const std::map<int, const CicoState*>&
570 CicoSCPolicyManager::getPolicyStates(void)
572 return m_policyStates;
575 //--------------------------------------------------------------------------
577 * @brief initialize state machine
579 //--------------------------------------------------------------------------
581 CicoSCPolicyManager::initStateMachine(void)
583 ICO_DBG("CicoSCPolicyManager::initStateMachine Enter");
585 CicoStateMachineCreator creator;
588 m_stateMachine = creator.createFile("/usr/apps/org.tizen.ico.system-controller/res/config/policy.json");
589 if (NULL == m_stateMachine) {
590 ICO_ERR("CicoStateMachineCreator::createFile failed.(reason:%s)",
591 creator.getError().c_str());
592 return ICO_SYC_ENOSYS;
595 int ret = m_stateMachine->start();
597 ICO_ERR("CicoStateMachine::start failed.");
598 return ICO_SYC_ENOSYS;
601 vector<CicoStateCore*> objects;
602 m_stateMachine->getObjects(objects);
603 vector<CicoStateCore*>::iterator itr;
604 itr = objects.begin();
605 for (; itr != objects.end(); ++itr) {
606 const CicoState* state = static_cast<const CicoState*>(*itr);
607 m_policyStates[state->getValue()] = state;
608 #if 1 //-- { debug dump
609 ICO_DBG("State=[%-45s] Active=%s",
610 state->getName().c_str(),
611 state->isActive() ? "true" : "false");
612 #endif //-- } debug dump
615 m_dispZoneStates.push_back(NULL);
616 m_dispZoneStates.push_back(m_policyStates[STID_DISPLAY0_ZONE1]);
617 m_dispZoneStates.push_back(m_policyStates[STID_DISPLAY0_ZONE2]);
618 m_dispZoneStates.push_back(m_policyStates[STID_DISPLAY0_ZONE3]);
620 m_soundZoneStates.push_back(NULL);
621 m_soundZoneStates.push_back(m_policyStates[STID_SOUND_ZONE1]);
622 m_soundZoneStates.push_back(m_policyStates[STID_SOUND_ZONE2]);
623 m_soundZoneStates.push_back(m_policyStates[STID_SOUND_ZONE3]);
625 m_inputStates.push_back(NULL);
626 m_inputStates.push_back(m_policyStates[STID_INPUT1_USING]);
627 m_inputStates.push_back(m_policyStates[STID_INPUT2_USING]);
629 ICO_DBG("CicoSCPolicyManager::initStateMachine Leave");
633 //--------------------------------------------------------------------------
635 * @brief query whether a state transition
637 * @param [in] event_id trigger event id
639 * @return true on test success, false on test failed
641 //--------------------------------------------------------------------------
643 CicoSCPolicyManager::testSMEvent(unsigned short event_id)
645 CicoEvent event(event_id);
646 return m_stateMachine->eventTest(event);
649 //--------------------------------------------------------------------------
651 * @brief query whether a state transition
653 * @param [in] event_id trigger event id
654 * @param [in] value trigger optional integer value
656 * @return true on test success, false on test failed
658 //--------------------------------------------------------------------------
660 CicoSCPolicyManager::testSMEvent(unsigned short event_id, int value)
662 CicoEvent event(event_id, value);
663 return m_stateMachine->eventTest(event);
666 //--------------------------------------------------------------------------
668 * @brief send tigger event
670 * @param [in] event_id trigger event id
672 * @return true on state transition, false on not state transition
674 //--------------------------------------------------------------------------
676 CicoSCPolicyManager::sendSMEvent(unsigned short event_id)
678 CicoEvent event(event_id);
679 return m_stateMachine->eventEntry(event);
682 //--------------------------------------------------------------------------
684 * @brief send tigger event
686 * @param [in] event_id trigger event id
687 * @param [in] value trigger optional integer value
689 * @return true on state transition, false on not state transition
691 //--------------------------------------------------------------------------
693 CicoSCPolicyManager::sendSMEvent(unsigned short event_id, int value)
695 CicoEvent event(event_id, value);
696 return m_stateMachine->eventEntry(event);
700 CicoSCPolicyManager::acquireDisplayResource(int type, int zoneid, int priority)
702 ICO_DBG("CicoSCPolicyManager::acquireDisplayResource Enter"
703 "(type=0x%08X zoneid=%d priority=%d)", type, zoneid, priority);
707 if (RESID_TYPE_BASIC == type) {
708 bool zoneChg = testSMEvent(EVID_DISPLAY0_ZONE, zoneid);
709 bool cateChg = testSMEvent(EVID_DISPLAY0_CATEGORY, priority);
710 ICO_DBG("zoneChg=%d cateChg=%d", zoneChg, cateChg);
711 if ((true == zoneChg) && (true == cateChg)) {
712 sendSMEvent(EVID_DISPLAY0_ZONE, zoneid);
713 sendSMEvent(EVID_DISPLAY0_CATEGORY, priority);
717 else if (RESID_TYPE_INTERRUPT == type) {
719 chg = sendSMEvent(EVID_INTTERPUT_D0_Z1, priority);
721 else if (2 == zoneid) {
722 chg = sendSMEvent(EVID_INTTERPUT_D0_Z2, priority);
724 else if (3 == zoneid) {
725 chg = sendSMEvent(EVID_INTTERPUT_D0_Z3, priority);
728 else if (RESID_TYPE_ONSCREEN == type) {
729 chg = sendSMEvent(EVID_ONSCREEN, priority);
731 ICO_DBG("CicoSCPolicyManager::acquireDisplayResource Leave(%s)",
732 chg ? "true" : "false");
737 CicoSCPolicyManager::releaseDisplayResource(int zoneid, int priority)
743 CicoSCPolicyManager::acquireSoundResource(int type, int zoneid, int priority)
745 ICO_DBG("CicoSCPolicyManager::acquireSoundResource Enter"
746 "(type=0x%08X zoneid=%d priority=%d)", type, zoneid, priority);
750 if (RESID_TYPE_BASIC == type) {
751 bool zoneChg = testSMEvent(EVID_SOUND_ZONE, zoneid);
752 bool cateChg = testSMEvent(EVID_SOUND_CATEGORY, priority);
753 ICO_DBG("zoneChg=%d cateChg=%d", zoneChg, cateChg);
754 if ((true == zoneChg) && (true == cateChg)) {
755 sendSMEvent(EVID_SOUND_ZONE, zoneid);
756 sendSMEvent(EVID_SOUND_CATEGORY, priority);
760 else if (RESID_TYPE_INTERRUPT == type) {
762 chg = sendSMEvent(EVID_INTTERPUT_S_Z1, priority);
764 else if (2 == zoneid) {
765 chg = sendSMEvent(EVID_INTTERPUT_S_Z2, priority);
767 else if (3 == zoneid) {
768 chg = sendSMEvent(EVID_INTTERPUT_S_Z3, priority);
772 ICO_DBG("CicoSCPolicyManager::acquireSoundResource Leave(%s)",
773 chg ? "true" : "false");
778 CicoSCPolicyManager::releaseSoundResource(int type, int zoneid)
780 ICO_DBG("CicoSCPolicyManager::acquireSoundResource Enter"
781 "(type=%d zoneid=%d)", type, zoneid);
784 if (RESID_TYPE_BASIC == type) {
785 chg = sendSMEvent(EVID_SOUND_ZONE_NOUSE);
786 chg = sendSMEvent(EVID_SOUND_CATEGORY_UNKNOWN);
788 else if (RESID_TYPE_INTERRUPT == type) {
790 chg = sendSMEvent(EVID_INTTERPUT_S_Z1_NOOUTPUT);
792 else if (2 == zoneid) {
793 chg = sendSMEvent(EVID_INTTERPUT_S_Z2_NOOUTPUT);
795 else if (3 == zoneid) {
796 chg = sendSMEvent(EVID_INTTERPUT_S_Z3_NOOUTPUT);
800 ICO_DBG("CicoSCPolicyManager::acquireSoundResource Leave(%s)",
801 chg ? "true" : "false");
807 CicoSCPolicyManager::acquireInputResource(int input, int priority)
809 ICO_DBG("CicoSCPolicyManager::acquireInputResource Enter"
810 "input=%d priority=%d", input, priority);
815 chg = sendSMEvent(EVID_INPUT1_ACQUIRE, input);
817 else if (2 == input) {
818 chg = sendSMEvent(EVID_INPUT2_ACQUIRE, input);
821 ICO_DBG("CicoSCPolicyManager::acquireInputResource Leave(%s)",
822 chg ? "true" : "false");
827 CicoSCPolicyManager::releaseInputResource(int input)
830 (void)sendSMEvent(EVID_INPUT1_RELEASE, input);
832 else if (2 == input) {
833 (void)sendSMEvent(EVID_INPUT2_RELEASE, input);
839 CicoSCPolicyManager::notifyChangedState(int state)
841 m_resourceMgr->receiveChangedState(state);
845 CicoSCPolicyManager::getDispZoneState(int zoneid) const
847 if ((0 < zoneid) && ((int)m_dispZoneStates.size()-1 > zoneid)) {
848 return m_dispZoneStates[zoneid]->isActive();
854 CicoSCPolicyManager::getSoundZoneState(int zoneid) const
856 if ((0 < zoneid) && ((int)m_soundZoneStates.size()-1 > zoneid)) {
857 return m_soundZoneStates[zoneid]->isActive();
863 CicoSCPolicyManager::getInputState(int input) const
865 if ((0 < input) && ((int)m_inputStates.size()-1 > input)) {
866 return m_inputStates[input]->isActive();
870 // vim:set expandtab ts=4 sw=4: