//==========================================================================
#include <string>
-using namespace std;
+
+#include <Ecore.h>
#include "CicoSCPolicyManager.h"
#include "CicoStateMachine.h"
#include "CicoSCMessage.h"
#include "ico_syc_msg_cmd_def.h"
#include "ico_syc_type.h"
-#include "CicoSCCommonDef.h"
-
-//==========================================================================
-// define
-//==========================================================================
-
-// Defines of D-Bus target.
-#define DBUS_SERVICE "org.automotive.message.broker"
-#define DBUS_INTERFACE "org.freedesktop.DBus.Properties"
-#define DBUS_METHOD "Get"
-
-// Defines of maximum number.
-#define AMB_MAX_VHCLINFO 10 /**< maximum number of vehicle info */
-
-// Enumerations of Vehicle information key.
-typedef enum {
- AMB_VHCL_SPEED = 1, /**< Vehicle speed */
- AMB_SHIFT_POSITION, /**< Shift position */
- AMB_LIGHT_LEFT, /**< Light left(Turn left) */
- AMB_LIGHT_RIGHT, /**< Light right(Turn right) */
- AMB_NIGHT_MODE, /**< Night mode */
- AMB_MAX_INFO /**< Maximum number of type */
-} _amb_vhcl_key_e;
-
-//
-typedef struct _vehicle_info_property_t {
- int key; /* Vehicle Information key */
- const char *property; /* D-Bus property name */
- const char *path; /* D-Bus path name */
- const char *interface; /* D-Bus interface name */
-} vhcl_info_prop_t;
-
-// structure of Vehicle information data.
-typedef struct _vehicle_info_data {
- int key; /* Vehicle Information key */
- DBusPendingCall *pending;
- E_DBus_Signal_Handler *handler;
- int request;
- double val;
-} _vhcldata_t;
-
-_vhcldata_t vhcl_data[AMB_MAX_INFO];
-
-//*========================================================================
-// global variable
-//========================================================================
-
-static const vhcl_info_prop_t apf_vhcl_info[] = {
- {
- AMB_VHCL_SPEED,
- "VehicleSpeed",
- "/org/automotive/runningstatus/VehicleSpeed",
- "org.automotive.VehicleSpeed"
- },
- {
- AMB_SHIFT_POSITION,
- "ShiftPosition",
- "/org/automotive/runningstatus/Transmission",
- "org.automotive.Transmission"
- },
-#if 0 // use LightStatus
-/* use LightStatus, because AMB not support access of TurnSignal by D-Bus */
- {
- ICO_SYC_VEHICLEINFO_TURN_SIGNAL,
- "TurnSignal",
- "/org/automotive/runningstatus/TurnSignal",
- "org.automotive.TurnSignal"
- },
-#else // use LightStatus
- {
- AMB_LIGHT_LEFT,
- "LeftTurn",
- "/org/automotive/runningstatus/LightStatus",
- "org.automotive.LightStatus"
- },
- {
- AMB_LIGHT_RIGHT,
- "RightTurn",
- "/org/automotive/runningstatus/LightStatus",
- "org.automotive.LightStatus"
- },
-#endif // use LightStatus
- {
- AMB_NIGHT_MODE,
- "NightMode",
- "/org/automotive/custom/NightMode",
- "org.automotive.NightMode"
- },
- { 0, "\0", "\0", "\0" }
-};
+#include "CicoCommonDef.h"
+#include "CicoSCVInfoManager.h"
+#include "CicoSCVInfo.h"
//--------------------------------------------------------------------------
/**
//--------------------------------------------------------------------------
CicoSCPolicyManager::CicoSCPolicyManager(CicoSCResourceManager* resourceMgr)
: m_initialized(false),
- m_dbusConnection(NULL),
- m_ecoreTimer(NULL),
+ m_ecoreEvHandler(NULL),
m_stateMachine(NULL),
m_resourceMgr(resourceMgr)
{
int
CicoSCPolicyManager::initialize(void)
{
- ICO_DBG("CicoSCPolicyManager::initialize Enter");
+ ICO_TRA("CicoSCPolicyManager::initialize Enter");
- int ret = ICO_SYC_EOK;
- ret = initAMB();
+ int ret = initStateMachine();
if (ICO_SYC_EOK != ret) {
return ret;
}
- ret = initStateMachine();
- if (ICO_SYC_EOK != ret) {
- return ret;
- }
+ CicoSCVInfoManager* vinfomgr = CicoSCVInfoManager::getInstance();
+ m_ecoreEvHandler = ecore_event_handler_add(
+ vinfomgr->getEcoreEvType(),
+ CicoSCPolicyManager::changedVehicleInfoCB,
+ this);
- ICO_DBG("CicoSCPolicyManager::initialize Leave");
+ vinfomgr->getVehicleInfo(ICO_VINFO_NIGHT_MODE);
+ vinfomgr->getVehicleInfo(ICO_VINFO_DRIVING_MODE);
+
+ ICO_TRA("CicoSCPolicyManager::initialize Leave");
return ret;
}
void
CicoSCPolicyManager::terminate(void)
{
- int idx = 0;
-
- ICO_DBG("CicoSCPolicyManager::terminate Enter");
-
- for (idx = 0; vhcl_data[idx].key; idx++) {
- if (vhcl_data[idx].handler != NULL) {
- e_dbus_signal_handler_del(m_dbusConnection,
- vhcl_data[idx].handler);
- }
- }
-
- ICO_DBG("CicoSCPolicyManager::terminate Leave");
+ ICO_TRA("CicoSCPolicyManager::terminate Enter");
+ ICO_TRA("CicoSCPolicyManager::terminate Leave");
}
//--------------------------------------------------------------------------
/**
- * @brief initialize amb connection
+ * @brief
*/
//--------------------------------------------------------------------------
-int
-CicoSCPolicyManager::initAMB(void)
+void
+CicoSCPolicyManager::onChangedVehicleInfo(int type, void *event)
{
- ICO_DBG("CicoSCPolicyManager::initAMB Enter");
-
- int ret = 0;
- int idx;
- char signalname[64];
-
- if (true == m_initialized) {
- ICO_DBG("CicoSCPolicyManager::initAMB Leave(EOK)");
- return ICO_SYC_EOK;
- }
-
- /* Zero clear vhcl_data */
- memset(vhcl_data, 0, sizeof(vhcl_data));
-
- e_dbus_init();
-
- /* Get D-Bus connection */
- m_dbusConnection = e_dbus_bus_get(DBUS_BUS_SYSTEM);
- if (! m_dbusConnection) {
- ICO_ERR("dbus_bus_get failed.");
- ICO_ERR("CicoSCPolicyManager::initAMB Leave(EIO)");
- return ICO_SYC_EIO;
- }
-
- /* receive propertychanged request to AMB */
- for (idx = 0; apf_vhcl_info[idx].key; idx++) {
- memset(signalname, 0, sizeof(signalname));
- /* set vehicleinfo set key */
- vhcl_data[idx].key = apf_vhcl_info[idx].key;
-
- if (apf_vhcl_info[idx].path[0] == 0) {
- /* currently not support this vehicle information */
- continue;
- }
-
- strcpy(signalname, apf_vhcl_info[idx].property);
- strcat(signalname, "Changed");
- vhcl_data[idx].handler = e_dbus_signal_handler_add(m_dbusConnection,
- DBUS_SERVICE, NULL,
- apf_vhcl_info[idx].interface,
- signalname,
- AMBpropertyChanged,
- (void*)&vhcl_data[idx].key);
+ ICO_TRA("CicoSCPolicyManager::onChangedVehicleInfo Enter");
+ if (NULL == event) {
+ ICO_WRN("data is null");
+ return;
}
- /* recv response from AMB timer start */
- ret = ecore_init();
- if (ret == 0) {
- ICO_ERR("ecore_init");
- ICO_ERR("CicoSCPolicyManager::initAMB Leave(ENOSYS)");
- return ICO_SYC_ENOSYS;
- }
-
- m_ecoreTimer = ecore_timer_add(0.2, //TODO
- CicoSCPolicyManager::ecoreTimerCB, this);
- if (! m_ecoreTimer) {
- ICO_ERR("ecore_timer_add failed.");
- ICO_ERR("CicoSCPolicyManager::initAMB Leave(ENOSYS)");
- return ICO_SYC_ENOSYS;
+ if (CicoSCVInfoManager::getInstance()->getEcoreEvType() != type) {
+ ICO_WRN("unknown ecore event type(%d)", type);
+ return;
}
- m_initialized = true;
-
- ICO_DBG("CicoSCPolicyManager::initAMB Leave(EOK)");
- return ICO_SYC_EOK;
-}
-
-//--------------------------------------------------------------------------
-/**
- * @brief send AMB request
- */
-//--------------------------------------------------------------------------
-int
-CicoSCPolicyManager::sendAMBRequest(void)
-{
-#if 0
-// ICO_DBG("CicoSCPolicyManager::sendAMBRequest Enter");
-
- DBusMessage *dbus_message = NULL;
- int idx;
- int ret = ICO_SYC_EOK;
-
- for (idx = 0; apf_vhcl_info[idx].key; idx++) {
- /* set vehicle info key */
- vhcl_data[idx].key = apf_vhcl_info[idx].key;
-
- /* status is pending ? */
- if (vhcl_data[idx].pending) {
- ICO_WRN("(%s) not complete", apf_vhcl_info[idx].property);
- continue;
- }
-
- if (apf_vhcl_info[idx].path[0] == 0) {
- /* currently not support this vehicle information */
- continue;
- }
+ bool chgCamera = false;
+ bool chgRegulation = false;
+ bool chgNightMode = false;
- /* Create send message */
- dbus_message = dbus_message_new_method_call(DBUS_SERVICE,
- apf_vhcl_info[idx].path,
- DBUS_INTERFACE,
- DBUS_METHOD);
- if (! dbus_message) {
- ICO_ERR("dbus_message_new_method_call");
- ret = ICO_SYC_EIO;
- }
- /* Set parameters into message */
- else if (! dbus_message_append_args(dbus_message,
- DBUS_TYPE_STRING,
- &apf_vhcl_info[idx].interface,
- DBUS_TYPE_STRING,
- &apf_vhcl_info[idx].property,
- DBUS_TYPE_INVALID)) {
- ICO_ERR("dbus_message_append_args");
- ret = ICO_SYC_EIO;
- }
- /* Set destination */
- else if (! dbus_message_set_destination(dbus_message,
- DBUS_SERVICE)) {
- ICO_ERR("dbus_message_set_destination");
- ret = ICO_SYC_EIO;
+ CicoSCVInfo* vinfo = static_cast<CicoSCVInfo*>(event);
+ switch (vinfo->getProperty()) {
+ case ICO_VINFO_VEHICLE_SPEED:
+ ICO_DBG("ICO_VINFO_VEHICLE_SPEED : %d", vinfo->getInt32Value());
+// (void)sendSMEvent(EVID_VELOCTY, (int)vinfo->getInt32Value());
+// if (true == sendSMEvent(EVID_DRVREGULATION)) {
+// chgRegulation = true;
+// }
+ break;
+ case ICO_VINFO_SHIFT_POSITION:
+ ICO_DBG("ICO_VINFO_SHIFT_POSITION : %d", vinfo->getUint8Value());
+ (void)sendSMEvent(EVID_SHIFTPOS, (int)vinfo->getUint8Value());
+ if (true == sendSMEvent(EVID_CAMERA)) {
+ chgCamera = true;
}
- /* Send message */
- else if (! dbus_connection_send_with_reply(m_dbusConnection,
- dbus_message,
- &vhcl_data[idx].pending,
- 200)) {
- ICO_ERR("dbus_connection_send");
- vhcl_data[idx].pending = NULL;
- ret = ICO_SYC_EIO;
+ break;
+ case ICO_VINFO_LIGHT_LEFT:
+ ICO_DBG("ICO_VINFO_LIGHT_LEFT : %s",
+ vinfo->getBooleanValue() ? "true" : "false");
+ if (false == vinfo->getBooleanValue()) {
+ (void)sendSMEvent(EVID_TURN_OFF);
}
else {
- //ICO_DBG("REQUEST req (%s)", apf_vhcl_info[idx].property);
- }
-
- if (dbus_message) {
- /* Release message */
- dbus_message_unref(dbus_message);
- }
- }
-
- /* dispatch if data queue exist */
- do {
- dbus_connection_read_write_dispatch(m_dbusConnection, 0);
- } while (dbus_connection_get_dispatch_status(m_dbusConnection)
- == DBUS_DISPATCH_DATA_REMAINS);
-
- //ICO_DBG("CicoSCPolicyManager::sendAMBRequest Leave");
- return ret;
-#endif
- return 0;
-}
-
-//--------------------------------------------------------------------------
-/**
- * @brief get vehicle information
- */
-//--------------------------------------------------------------------------
-int
-CicoSCPolicyManager::getVehicleInfo(void)
-{
- #if 0
- DBusMessage *dbus_message = NULL;
- DBusMessageIter iter_head;
- DBusMessageIter iter;
- int idx;
- char type;
- int32_t i32;
- int16_t i16;
- uint32_t u32;
- uint16_t u16;
- dbus_bool_t b;
- uint8_t u8;
- double d64;
-
- /* dispatch if data queue exist */
- do {
- dbus_connection_read_write_dispatch(m_dbusConnection, 0);
- } while (dbus_connection_get_dispatch_status(m_dbusConnection)
- == DBUS_DISPATCH_DATA_REMAINS);
-
- /* analyze reply data */
- for (idx = 0; apf_vhcl_info[idx].key; idx++) {
- if (! vhcl_data[idx].pending) {
- continue;
+ (void)sendSMEvent(EVID_TURN_LEFT);
}
- if (! dbus_pending_call_get_completed(vhcl_data[idx].pending)) {
- //ICO_WRN("(%s) NOT complete", apf_vhcl_info[idx].property);
- continue;
- }
-
- dbus_message = dbus_pending_call_steal_reply(vhcl_data[idx].pending);
- if (! dbus_message) {
- //ICO_WRN("(%s) NO reply", apf_vhcl_info[idx].property);
- continue;
+ if (true == sendSMEvent(EVID_CAMERA)) {
+ chgCamera = true;
}
-
- if (dbus_message_get_type(dbus_message) == DBUS_MESSAGE_TYPE_ERROR) {
- dbus_message_unref(dbus_message);
- dbus_pending_call_cancel(vhcl_data[idx].pending);
- vhcl_data[idx].pending = NULL;
- //ICO_ERR("(%s) reply error", apf_vhcl_info[idx].property);
- continue;
+ break;
+ case ICO_VINFO_LIGHT_RIGHT:
+ ICO_DBG("ICO_VINFO_LIGHT_RIGHT: %s",
+ vinfo->getBooleanValue() ? "true" : "false");
+ if (false == vinfo->getBooleanValue()) {
+ (void)sendSMEvent(EVID_TURN_OFF);
}
-
- dbus_message_iter_init(dbus_message, &iter_head);
- dbus_message_iter_recurse(&iter_head, &iter);
-
- type = dbus_message_iter_get_arg_type(&iter);
- switch (type) {
- case DBUS_TYPE_INT32:
- dbus_message_iter_get_basic(&iter, &i32);
- vhcl_data[idx].val = (double)i32;
- break;
- case DBUS_TYPE_INT16:
- dbus_message_iter_get_basic(&iter, &i16);
- vhcl_data[idx].val = (double)i16;
- break;
- case DBUS_TYPE_UINT32:
- dbus_message_iter_get_basic(&iter, &u32);
- break;
- case DBUS_TYPE_UINT16:
- dbus_message_iter_get_basic(&iter, &u16);
- vhcl_data[idx].val = (double)u16;
- break;
- case DBUS_TYPE_BOOLEAN:
- dbus_message_iter_get_basic(&iter, &b);
- if (b) vhcl_data[idx].val = (double)1.0;
- else vhcl_data[idx].val = (double)0.0;
- break;
- case DBUS_TYPE_BYTE:
- dbus_message_iter_get_basic(&iter, &u8);
- vhcl_data[idx].val = (double)u8;
- break;
- case DBUS_TYPE_DOUBLE:
- dbus_message_iter_get_basic(&iter, &d64);
- vhcl_data[idx].val = (double)d64;
- break;
- default:
- ICO_ERR("(%s) illegal data type(0x%02x)",
- apf_vhcl_info[idx].property, ((int)type) & 0x0ff);
- break;
+ else {
+ (void)sendSMEvent(EVID_TURN_RIGHT);
}
- //ICO_DBG("REQUEST ans (%s) = %.2f",
- // apf_vhcl_info[idx].property, vhcl_data[idx].val);
-
- /* free message and pending */
- dbus_message_unref(dbus_message);
- dbus_pending_call_cancel(vhcl_data[idx].pending);
- vhcl_data[idx].pending = NULL;
- };
-
- return ICO_SYC_EOK;
-#endif
- return ICO_SYC_EOK;
-}
-
-//--------------------------------------------------------------------------
-/**
- * @brief ecore timer callback
- */
-//--------------------------------------------------------------------------
-Eina_Bool
-CicoSCPolicyManager::ecoreTimerCB(void *user_data)
-{
- CicoSCPolicyManager *policyMgr =
- static_cast<CicoSCPolicyManager*>(user_data);
- policyMgr->recvAMBVehicleInfo();
-
- return ECORE_CALLBACK_RENEW;
-}
-//--------------------------------------------------------------------------
-/**
- * @brief receive AMB vehicle information
- */
-//--------------------------------------------------------------------------
-void
-CicoSCPolicyManager::AMBpropertyChanged(void *data, DBusMessage *msg)
-{
- DBusMessageIter iter, variant;
- int idx;
- char type;
- int32_t i32;
- int16_t i16;
- uint32_t u32;
- uint16_t u16;
- dbus_bool_t b;
- uint8_t u8;
- double d64;
-
- int key;
- key = *((int *)data);
-
- if (!msg || !dbus_message_iter_init(msg, &iter)) {
- ICO_ERR("received illegal message.");
- return;
- }
-
- for (idx = 0; vhcl_data[idx].key; idx++) {
- if (vhcl_data[idx].key == key) {
- break;
+ if (true == sendSMEvent(EVID_CAMERA)) {
+ chgCamera = true;
}
- }
- if (idx == AMB_MAX_INFO) {
- return;
- }
-
- dbus_message_iter_recurse(&iter, &variant);
- type = dbus_message_iter_get_arg_type(&variant);
- switch (type) {
- case DBUS_TYPE_INT32:
- dbus_message_iter_get_basic(&variant, &i32);
- vhcl_data[idx].val = (double)i32;
- break;
- case DBUS_TYPE_INT16:
- dbus_message_iter_get_basic(&variant, &i16);
- vhcl_data[idx].val = (double)i16;
- break;
- case DBUS_TYPE_UINT32:
- dbus_message_iter_get_basic(&variant, &u32);
- break;
- case DBUS_TYPE_UINT16:
- dbus_message_iter_get_basic(&variant, &u16);
- vhcl_data[idx].val = (double)u16;
break;
- case DBUS_TYPE_BOOLEAN:
- dbus_message_iter_get_basic(&variant, &b);
- if (b) vhcl_data[idx].val = (double)1.0;
- else vhcl_data[idx].val = (double)0.0;
+ case ICO_VINFO_NIGHT_MODE:
+ ICO_DBG("ICO_VINFO_NIGHT_MODE : %d", vinfo->getUint32Value());
+ chgNightMode = sendSMEvent(EVID_NIGHTMODE, (int)vinfo->getUint32Value());
break;
- case DBUS_TYPE_BYTE:
- dbus_message_iter_get_basic(&variant, &u8);
- vhcl_data[idx].val = (double)u8;
- break;
- case DBUS_TYPE_DOUBLE:
- dbus_message_iter_get_basic(&variant, &d64);
- vhcl_data[idx].val = (double)d64;
+ case ICO_VINFO_DRIVING_MODE:
+ ICO_DBG("ICO_VINFO_DRIVING_MODE : %d", vinfo->getUint32Value());
+ chgRegulation = sendSMEvent(EVID_DRVREGULATION, (int)vinfo->getUint32Value());
break;
default:
- ICO_ERR("(%s) illegal data type(0x%02x)",
- apf_vhcl_info[idx].property, ((int)type) & 0x0ff);
+ ICO_WRN("not such key (%d)", vinfo->getProperty());
break;
}
-}
-
-//--------------------------------------------------------------------------
-/**
- * @brief receive AMB vehicle information
- */
-//--------------------------------------------------------------------------
-void
-CicoSCPolicyManager::recvAMBVehicleInfo(void)
-{
-// ICO_DBG("CicoSCPolicyManager::recvAMBVehicleInfo Enter");
-
- int idx = 0;
- int key = 0;
- bool chgCamera = false;
- bool chgRegulation = false;
- bool chgNightMode = false;
-
- //getVehicleInfo();
-
- /* get vehicle info values */
- for (idx = 0; idx < AMB_MAX_VHCLINFO; idx++) {
- if (vhcl_data[idx].key == 0) break;
- key = vhcl_data[idx].key;
- switch (key) {
- case AMB_VHCL_SPEED:
- (void)sendSMEvent(EVID_VELOCTY, (int)vhcl_data[idx].val);
- if (true == sendSMEvent(EVID_DRVREGULATION)) {
- chgRegulation = true;
- }
- break;
- case AMB_SHIFT_POSITION:
- (void)sendSMEvent(EVID_SHIFTPOS, (int)vhcl_data[idx].val);
- if (true == sendSMEvent(EVID_CAMERA)) {
- chgCamera = true;
- }
- break;
- case AMB_LIGHT_LEFT:
- if (0.0 == vhcl_data[idx].val) {
- (void)sendSMEvent(EVID_TURN_OFF);
- }
- else {
- (void)sendSMEvent(EVID_TURN_LEFT);
- }
- if (true == sendSMEvent(EVID_CAMERA)) {
- chgCamera = true;
- }
- break;
- case AMB_LIGHT_RIGHT:
- if (0.0 == vhcl_data[idx].val) {
- (void)sendSMEvent(EVID_TURN_OFF);
- }
- else {
- (void)sendSMEvent(EVID_TURN_LEFT);
- }
- if (true == sendSMEvent(EVID_CAMERA)) {
- chgCamera = true;
- }
- break;
- case AMB_NIGHT_MODE:
- chgNightMode = sendSMEvent(EVID_NIGHTMODE, (int)vhcl_data[idx].val);
- break;
- default:
- ICO_WRN("not such key (%d)", key);
- break;
- }
- }
if (true == chgRegulation) {
ICO_DBG("true == chgRegulation");
}
CicoSCServer::getInstance()->sendMessageToHomeScreen(message);
}
-
- /* send request to AMB */
- //sendAMBRequest();
-// ICO_DBG("CicoSCPolicyManager::recvAMBVehicleInfo Leave");
+ ICO_TRA("CicoSCPolicyManager::onChangedVehicleInfo Leave");
+}
+
+//--------------------------------------------------------------------------
+/**
+ * @brief
+ */
+//--------------------------------------------------------------------------
+Eina_Bool
+CicoSCPolicyManager::changedVehicleInfoCB(void *data, int type, void *event)
+{
+ static_cast<CicoSCPolicyManager*>(data)->onChangedVehicleInfo(type, event);
+ return EINA_TRUE;
}
//--------------------------------------------------------------------------
int
CicoSCPolicyManager::initStateMachine(void)
{
- ICO_DBG("CicoSCPolicyManager::initStateMachine Enter");
+ ICO_TRA("CicoSCPolicyManager::initStateMachine Enter");
CicoStateMachineCreator creator;
int ret = m_stateMachine->start();
if (ret == 0) {
ICO_ERR("CicoStateMachine::start failed.");
+ ICO_TRA("CicoSCPolicyManager::initStateMachine Leave(ENOSYS)");
return ICO_SYC_ENOSYS;
}
m_inputStates.push_back(m_policyStates[STID_INPUT1_USING]);
m_inputStates.push_back(m_policyStates[STID_INPUT2_USING]);
- ICO_DBG("CicoSCPolicyManager::initStateMachine Leave");
+ ICO_TRA("CicoSCPolicyManager::initStateMachine Leave(EOK)");
return ICO_SYC_EOK;
}
bool
CicoSCPolicyManager::acquireDisplayResource(int type, int zoneid, int priority)
{
- ICO_DBG("CicoSCPolicyManager::acquireDisplayResource Enter"
+ ICO_TRA("CicoSCPolicyManager::acquireDisplayResource Enter"
"(type=0x%08X zoneid=%d priority=%d)", type, zoneid, priority);
bool chg = false;
if (RESID_TYPE_BASIC == type) {
+#if 1
+ unsigned short category_ev = EVID_DISPLAY0_CATEGORY;
+ if (ZONEID_CENTER_UPPER == zoneid) {
+ category_ev = EVID_DISP0_ZONE2_CATEGORY;
+
+ }
+ else if (ZONEID_CENTER_LOWER == zoneid) {
+ category_ev = EVID_DISP0_ZONE3_CATEGORY;
+ }
+
+ bool zoneChg = testSMEvent(EVID_DISPLAY_ZONE_ACQUIRE, zoneid);
+ bool cateChg = testSMEvent(category_ev, priority);
+ ICO_DBG("zoneChg=%d cateChg=%d", zoneChg, cateChg);
+ if ((true == zoneChg) && (true == cateChg)) {
+ sendSMEvent(EVID_DISPLAY_ZONE_ACQUIRE, zoneid);
+ sendSMEvent(category_ev, priority);
+ chg = true;
+ }
+#else
bool zoneChg = testSMEvent(EVID_DISPLAY_ZONE_ACQUIRE, zoneid);
bool cateChg = testSMEvent(EVID_DISPLAY0_CATEGORY, priority);
ICO_DBG("zoneChg=%d cateChg=%d", zoneChg, cateChg);
sendSMEvent(EVID_DISPLAY0_CATEGORY, priority);
chg = true;
}
+#endif
#if 0 //-- { debug dump
else {
std::map<int, const CicoState*>::iterator itr;
else if (RESID_TYPE_ONSCREEN == type) {
chg = sendSMEvent(EVID_ONSCREEN, priority);
}
- ICO_DBG("CicoSCPolicyManager::acquireDisplayResource Leave(%s)",
+ ICO_TRA("CicoSCPolicyManager::acquireDisplayResource Leave(%s)",
chg ? "true" : "false");
return chg;
}
bool
CicoSCPolicyManager::acquireSoundResource(int type, int zoneid, int priority)
{
- ICO_DBG("CicoSCPolicyManager::acquireSoundResource Enter"
+ ICO_TRA("CicoSCPolicyManager::acquireSoundResource Enter"
"(type=0x%08X zoneid=%d priority=%d)", type, zoneid, priority);
bool chg = false;
}
}
- ICO_DBG("CicoSCPolicyManager::acquireSoundResource Leave(%s)",
+ ICO_TRA("CicoSCPolicyManager::acquireSoundResource Leave(%s)",
chg ? "true" : "false");
return chg;
}
bool
CicoSCPolicyManager::releaseSoundResource(int type, int zoneid)
{
- ICO_DBG("CicoSCPolicyManager::acquireSoundResource Enter"
+ ICO_TRA("CicoSCPolicyManager::acquireSoundResource Enter"
"(type=%d zoneid=%d)", type, zoneid);
bool chg = false;
}
}
- ICO_DBG("CicoSCPolicyManager::acquireSoundResource Leave(%s)",
+ ICO_TRA("CicoSCPolicyManager::acquireSoundResource Leave(%s)",
chg ? "true" : "false");
return true;
bool
CicoSCPolicyManager::acquireInputResource(int input, int priority)
{
- ICO_DBG("CicoSCPolicyManager::acquireInputResource Enter"
- "input=%d priority=%d", input, priority);
+ ICO_TRA("CicoSCPolicyManager::acquireInputResource Enter"
+ "(input=%d priority=%d)", input, priority);
bool chg = false;
if (1 == input) {
- chg = sendSMEvent(EVID_INPUT1_ACQUIRE, input);
+ chg = testSMEvent(EVID_INPUT1_ACQUIRE, input);
+ if (true == chg) {
+ sendSMEvent(EVID_INPUT1_ACQUIRE, input);
+ }
}
else if (2 == input) {
- chg = sendSMEvent(EVID_INPUT2_ACQUIRE, input);
+ chg = testSMEvent(EVID_INPUT2_ACQUIRE, input);
+ if (true == chg) {
+ sendSMEvent(EVID_INPUT2_ACQUIRE, input);
+ }
}
- ICO_DBG("CicoSCPolicyManager::acquireInputResource Leave(%s)",
+ ICO_TRA("CicoSCPolicyManager::acquireInputResource Leave(%s)",
chg ? "true" : "false");
return chg;
}
*/
//--------------------------------------------------------------------------
void
-CicoSCPolicyManager::notifyConnected(const string & appid)
+CicoSCPolicyManager::notifyConnected(const std::string & appid)
{
// Notify regulation changed state
CicoSCMessage *message = new CicoSCMessage();