+%bcond_with wrt_option_bluetooth
+%bcond_with wrt_option_call_history
+%bcond_with wrt_option_nbs
+%bcond_with wrt_option_nfc
+%bcond_with wrt_option_push
+%bcond_with wrt_option_se
+%bcond_with wrt_option_sysinfo_tel_sim_mngt
+%bcond_with wrt_option_sysinfo_cellular_network_mngt
+%bcond_with wrt_option_msg_port
Name: wrt-plugins-tizen
Summary: JavaScript plugins for WebRuntime
Version: 0.4.32
BuildRequires: pkgconfig(wrt-plugins-plugin-manager)
BuildRequires: pkgconfig(capi-appfw-application)
BuildRequires: pkgconfig(capi-appfw-app-manager)
+%if %{with wrt_option_nfc}
BuildRequires: pkgconfig(capi-network-nfc)
+%endif
BuildRequires: pkgconfig(capi-location-geocoder)
BuildRequires: pkgconfig(capi-location-manager)
BuildRequires: pkgconfig(capi-location-poi)
BuildRequires: pkgconfig(capi-location-route)
+%if %{with wrt_option_bluetooth}
BuildRequires: pkgconfig(capi-network-bluetooth)
+%endif
BuildRequires: pkgconfig(capi-network-connection)
+%if %{with wrt_option_call_history}
BuildRequires: pkgconfig(capi-telephony-call)
+%endif
+%if %{with wrt_option_sysinfo_tel_sim_mngt}
BuildRequires: pkgconfig(capi-telephony-sim)
+%endif
BuildRequires: pkgconfig(capi-system-info)
BuildRequires: pkgconfig(capi-system-runtime-info)
BuildRequires: pkgconfig(sensor)
BuildRequires: pkgconfig(pkgmgr-info)
BuildRequires: pkgconfig(capi-appfw-package-manager)
BuildRequires: pkgconfig(capi-web-url-download)
+%if %{with wrt_option_push}
BuildRequires: pkgconfig(push)
+%endif
BuildRequires: pkgconfig(notification)
+%if %{with wrt_option_msg_port}
BuildRequires: pkgconfig(message-port)
+%endif
BuildRequires: pkgconfig(sync-agent)
BuildRequires: pkgconfig(security-server)
BuildRequires: expat-devel
export LDFLAGS+="-Wl,--rpath=%{PREFIX} -Wl,--as-needed"
%cmake \
--DENABLE_OPTIONAL_BT=YES \
--DENABLE_OPTIONAL_CALL_HISTORY=YES \
--DENABLE_OPTIONAL_NBS=YES \
--DENABLE_OPTIONAL_NFC=YES \
--DENABLE_OPTIONAL_PUSH=YES \
--DENABLE_OPTIONAL_SE=YES \
+%if %{with wrt_option_bluetooth}
+ -DENABLE_OPTIONAL_BT=YES \
+%endif
+%if %{with wrt_option_call_history}
+ -DENABLE_OPTIONAL_CALL_HISTORY=YES \
+%endif
+%if %{with wrt_option_nbs}
+ -DENABLE_OPTIONAL_NBS=YES \
+%endif
+%if %{with wrt_option_nfc}
+ -DENABLE_OPTIONAL_NFC=YES \
+%endif
+%if %{with wrt_option_push}
+ -DENABLE_OPTIONAL_PUSH=YES \
+%endif
+%if %{with wrt_option_se}
+ -DENABLE_OPTIONAL_SE=YES \
+%endif
+%if %{with wrt_option_sysinfo_tel_sim_mngt}
+ -DENABLE_OPTIONAL_SYSINFO_TEL_SIM_MNGT=YES \
+%endif
+%if %{with wrt_option_sysinfo_cellular_network_mngt}
+ -DENABLE_OPTIONAL_SYSINFO_CELLULAR_NETWORK_MNGT=YES \
+%endif
+%if %{with wrt_option_msg_port}
+ -DENABLE_OPTIONAL_MSG_PORT=YES \
+%endif
. -DCMAKE_INSTALL_PREFIX=%{_prefix} -DDPL_LOG="ON" -DENABLE_TIME_TRACER="OFF"
make %{?jobs:-j%jobs}
((Systeminfo*)event_ptr)->getWatchValue(WATCH_TYPE_PERIPHERAL);
}
}
-
+#ifdef ENABLE_OPTIONAL_SYSINFO_CELLULAR_NETWORK_MNGT
void CellularNetworkValueCallback(keynode_t *node, void *event_ptr)
{
if(event_ptr) {
((Systeminfo*)event_ptr)->getWatchValue(WATCH_TYPE_CELLULARNETWORK);
}
}
-
+#endif
void DisplayValueCallback(keynode_t *node, void* event_ptr)
{
if(event_ptr) {
(*m_Property)["DISPLAY"] = BasePropertyPtr(new Display());
(*m_Property)["NETWORK"] = BasePropertyPtr(new Network());
(*m_Property)["WIFI_NETWORK"] = BasePropertyPtr(new WifiNetwork());
+#ifdef ENABLE_OPTIONAL_SYSINFO_CELLULAR_NETWORK_MNGT
(*m_Property)["CELLULAR_NETWORK"] = BasePropertyPtr(new CellularNetwork());
+#endif
+#ifdef ENABLE_OPTIONAL_SYSINFO_TEL_SIM
(*m_Property)["SIM"] = BasePropertyPtr(new SIM());
+#endif
(*m_Property)["DEVICE_ORIENTATION"] = BasePropertyPtr(new DeviceOrientation());
(*m_Property)["BUILD"] = BasePropertyPtr(new Build());
(*m_Property)["LOCALE"] = BasePropertyPtr(new Locale());
if (m_networkRegist == REGIST_WIFI) {
connection_unset_ip_address_changed_cb(m_connectionHandle);
m_networkRegist = REGIST_NOT;
+#ifdef ENABLE_OPTIONAL_SYSINFO_CELLULAR_NETWORK_MNGT
} else if (m_networkRegist== REGIST_ALL) {
m_networkRegist = REGIST_CELLULAR;
+#endif
}
}
break;
+#ifdef ENABLE_OPTIONAL_SYSINFO_CELLULAR_NETWORK_MNGT
case WATCH_TYPE_CELLULARNETWORK:
if ((m_EventMgrPtr->getEventCellularNetworkList()).size() == 1) {
vconf_ignore_key_changed(VCONFKEY_TELEPHONY_FLIGHT_MODE, CellularNetworkValueCallback);
}
}
break;
+#endif
case WATCH_TYPE_STORAGE:
if ((m_EventMgrPtr->getEventStorageList()).size() == 1) {
if (m_storageTimer) {
}
} else if (watchType == WATCH_TYPE_NETWORK_ALL) {
EventWifiNetworkList eventListWifi = m_EventMgrPtr->getEventWifiNetworkList();
+#ifdef ENABLE_OPTIONAL_SYSINFO_CELLULAR_NETWORK_MNGT
EventWifiNetworkList eventListCellular = m_EventMgrPtr->getEventCellularNetworkList();
+#endif
if (eventListWifi.size() > 0) {
for (EventWifiNetworkList::iterator it = eventListWifi.begin(); it != eventListWifi.end(); it++) {
(*it)->getWatchValue();
}
}
+#ifdef ENABLE_OPTIONAL_SYSINFO_CELLULAR_NETWORK_MNGT
if (eventListCellular.size() > 0) {
for (EventCellularNetworkList::iterator it = eventListCellular.begin(); it != eventListCellular.end(); it++) {
(*it)->getWatchValue();
}
+
}
+#endif
} else if (watchType == WATCH_TYPE_CPU) {
EventCpuList eventList = m_EventMgrPtr->getEventCpuList();
for (EventCpuList::iterator it = eventList.begin(); it != eventList.end(); it++) {
for (EventPeripheralList::iterator it = eventList.begin(); it != eventList.end(); it++) {
(*it)->getWatchValue();
}
+#ifdef ENABLE_OPTIONAL_SYSINFO_CELLULAR_NETWORK_MNGT
} else if (watchType == WATCH_TYPE_CELLULARNETWORK) {
EventWifiNetworkList eventListCellular = m_EventMgrPtr->getEventCellularNetworkList();
if (eventListCellular.size() > 0) {
(*it)->getWatchValue();
}
}
+#endif
}
}
if (m_networkRegist == REGIST_NOT) {
connection_set_ip_address_changed_cb(m_connectionHandle, NetworkValueCallback, (void *)this);
m_networkRegist = REGIST_WIFI;
+#ifdef ENABLE_OPTIONAL_SYSINFO_CELLULAR_NETWORK_MNGT
} else if (m_networkRegist== REGIST_CELLULAR) {
m_networkRegist = REGIST_ALL;
+#endif
}
}
break;
+#ifdef ENABLE_OPTIONAL_SYSINFO_CELLULAR_NETWORK_MNGT
case WATCH_TYPE_CELLULARNETWORK:
if ((m_EventMgrPtr->getEventCellularNetworkList()).size() == 1) {
vconf_notify_key_changed(VCONFKEY_TELEPHONY_FLIGHT_MODE, CellularNetworkValueCallback, (void *)this);
}
}
break;
+#endif
case WATCH_TYPE_STORAGE:
if ((m_EventMgrPtr->getEventStorageList()).size() == 1) {
if (!m_storageTimer) {
event->clearWatch();
m_eventWifiNetworkList.pop_front();
}
+#ifdef ENABLE_OPTIONAL_SYSINFO_CELLULAR_NETWORK_MNGT
while (!m_eventCelluarNetworkList.empty()) {
EventWatchSysteminfoPtr event = m_eventCelluarNetworkList.front();
LoggerD("removing EventId=" << event->getId());
event->clearWatch();
m_eventCelluarNetworkList.pop_front();
}
+#endif
while (!m_eventStorageList.empty()) {
EventWatchSysteminfoPtr event = m_eventStorageList.front();
LoggerD("removing EventId=" << event->getId());
event->clearWatch();
m_eventCpuList.pop_front();
}
+#ifdef ENABLE_OPTIONAL_SYSINFO_TEL_SIM_MNGT
while (!m_eventSimList.empty()) {
EventWatchSysteminfoPtr event = m_eventSimList.front();
LoggerD("removing EventId=" << event->getId());
event->clearWatch();
m_eventSimList.pop_front();
}
+#endif
while (!m_eventDeviceOrientationList.empty()) {
EventWatchSysteminfoPtr event = m_eventDeviceOrientationList.front();
LoggerD("removing EventId=" << event->getId());
} else if (watchType == WATCH_TYPE_WIFINETWORK) {
m_eventWifiNetworkList.push_back(arg);
LoggerD("Event wifi network list size=" << m_eventWifiNetworkList.size());
+#ifdef ENABLE_OPTIONAL_SYSINFO_CELLULAR_NETWORK_MNGT
} else if (watchType == WATCH_TYPE_CELLULARNETWORK) {
m_eventCelluarNetworkList.push_back(arg);
LoggerD("Event cellular network list size=" << m_eventCelluarNetworkList.size());
+#endif
} else if (watchType == WATCH_TYPE_STORAGE) {
m_eventStorageList.push_back(arg);
LoggerD("Event storage list size=" << m_eventStorageList.size());
} else if (watchType == WATCH_TYPE_CPU) {
m_eventCpuList.push_back(arg);
LoggerD("Event cpu list size=" << m_eventCpuList.size());
+#ifdef ENABLE_OPTIONAL_SYSINFO_TEL_SIM_MNGT
} else if (watchType == WATCH_TYPE_SIM) {
m_eventSimList.push_back(arg);
LoggerD("Event sim list size=" << m_eventSimList.size());
+#endif
} else if (watchType == WATCH_TYPE_DEVICE_ORIENTATION) {
m_eventDeviceOrientationList.push_back(arg);
LoggerD("Event device orientation list size=" << m_eventDeviceOrientationList.size());
LoggerD("event wifi network list size=" << m_eventWifiNetworkList.size());
m_eventWifiNetworkList.remove(event);
+#ifdef ENABLE_OPTIONAL_SYSINFO_CELLULAR_NETWORK_MNGT
LoggerD( "event removed, event wifi network list size=" << m_eventCelluarNetworkList.size());
} else if (watchType == WATCH_TYPE_CELLULARNETWORK) {
for (EventCellularNetworkList::iterator it = m_eventCelluarNetworkList.begin(); it != m_eventCelluarNetworkList.end(); it++) {
LoggerD("event cellular network list size=" << m_eventCelluarNetworkList.size());
m_eventCelluarNetworkList.remove(event);
LoggerD( "event removed, event cellular network list size=" << m_eventCelluarNetworkList.size());
+#endif
} else if (watchType == WATCH_TYPE_STORAGE) {
for (EventStorageList::iterator it = m_eventStorageList.begin(); it != m_eventStorageList.end(); it++) {
if (id == (*it)->getId()) {
LoggerD("event cpu list size=" << m_eventCpuList.size());
m_eventCpuList.remove(event);
LoggerD( "event removed, event cpu list size=" << m_eventCpuList.size());
+#ifdef ENABLE_OPTIONAL_SYSINFO_TEL_SIM_MNGT
} else if (watchType == WATCH_TYPE_SIM) {
for (EventSimList::iterator it = m_eventSimList.begin(); it != m_eventSimList.end(); it++) {
if (id == (*it)->getId()) {
LoggerD("event device orientation list size=" << m_eventDeviceOrientationList.size());
m_eventDeviceOrientationList.remove(event);
LoggerD( "event removed, event device orientation list size=" << m_eventDeviceOrientationList.size());
+#endif
} else if (watchType == WATCH_TYPE_NETWORK) {
for (EventNetworkList::iterator it = m_eventNetworkList.begin(); it != m_eventNetworkList.end(); it++) {
if (id == (*it)->getId()) {
}
}
+
+#ifdef ENABLE_OPTIONAL_SYSINFO_CELLULAR_NETWORK_MNGT
for (EventCellularNetworkList::iterator it = m_eventCelluarNetworkList.begin(); it != m_eventCelluarNetworkList.end(); it++) {
if (id == (*it)->getId()) {
event = *it;
break;
}
}
-
+#endif
for (EventStorageList::iterator it = m_eventStorageList.begin(); it != m_eventStorageList.end(); it++) {
if (id == (*it)->getId()) {
event = *it;
break;
}
}
-
+#ifdef ENABLE_OPTIONAL_SYSINFO_TEL_SIM_MNGT
for (EventSimList::iterator it = m_eventSimList.begin(); it != m_eventSimList.end(); it++) {
if (id == (*it)->getId()) {
event = *it;
break;
}
}
-
+#endif
for (EventDeviceOrientationList::iterator it = m_eventDeviceOrientationList.begin(); it != m_eventDeviceOrientationList.end(); it++) {
if (id == (*it)->getId()) {
event = *it;
}
}
+#ifdef ENABLE_OPTIONAL_SYSINFO_TEL_SIM_MNGT
for (EventSimList::iterator it = m_eventSimList.begin(); it != m_eventSimList.end(); it++) {
if (id == (*it)->getId()) {
event = *it;
break;
}
}
+#endif
for (EventLocaleList::iterator it = m_eventLocaleList.begin(); it != m_eventLocaleList.end(); it++) {
if (id == (*it)->getId()) {
return m_eventWifiNetworkList;
}
+#ifdef ENABLE_OPTIONAL_SYSINFO_CELLULAR_NETWORK_MNGT
EventCellularNetworkList Systeminfo::EventMgr::getEventCellularNetworkList()
{
return m_eventCelluarNetworkList;
}
-
+#endif
EventStorageList Systeminfo::EventMgr::getEventStorageList()
{
return m_eventStorageList;
{
return m_eventDeviceOrientationList;
}
-
+#ifdef ENABLE_OPTIONAL_SYSINFO_TEL_SIM_MNGT
EventSimList Systeminfo::EventMgr::getEventSimList()
{
return m_eventSimList;
}
-
+#endif
EventLocaleList Systeminfo::EventMgr::getEventLocaleList()
{
return m_eventLocaleList;
if (connectionType == CONNECTION_TYPE_WIFI) {
LoggerD("wifi network");
Network->networkType= "WIFI";
+#ifdef ENABLE_OPTIONAL_SYSINFO_CELLULAR_NETWORK_MNGT
} else if (connectionType == CONNECTION_TYPE_CELLULAR) {
if (vconf_get_int(VCONFKEY_TELEPHONY_SVCTYPE, &networkType) == 0) {
if (networkType < VCONFKEY_TELEPHONY_SVCTYPE_2G) {
Network->networkType= "NONE";
}
}
+#endif
} else {
Network->networkType= "NONE";
}
return JSWifiNetworkInfo::createJSObject(context, wifiNetwork);
}
-
+#ifdef ENABLE_OPTIONAL_SYSINFO_CELLULAR_NETWORK_MNGT
PROPERTY_GET_SYSTEMINFO_DEFINITION(CellularNetwork) {
Converter converter(context);
CellularNetworkPropertiesPtr cellularNetwork(new CellularNetworkProperties());
if (connection_get_type(connectionHandle, &connectionType) != CONNECTION_ERROR_NONE) {
return JSCellularNetworkInfo::createJSObject(context, cellularNetwork);
}
-
if (connectionType == CONNECTION_TYPE_CELLULAR) {
cellularNetwork->status = "ON";
if (connection_get_current_profile(connectionHandle, &profileHandle) == CONNECTION_ERROR_NONE) {
return JSCellularNetworkInfo::createJSObject(context, cellularNetwork);
}
+#endif
+#ifdef ENABLE_OPTIONAL_SYSINFO_TEL_SIM_MNGT
PROPERTY_GET_SYSTEMINFO_DEFINITION(SIM) {
Converter converter(context);
SIMPropertiesPtr SIM(new SIMProperties());
return JSSIMInfo::createJSObject(context, SIM);
}
-
+#endif
PROPERTY_GET_SYSTEMINFO_DEFINITION(DeviceOrientation) {
LoggerD("enter");
Converter converter(context);
WATCH_TYPE_BATTERY = 1,
WATCH_TYPE_DISPLAY = 2,
WATCH_TYPE_WIFINETWORK = 3,
+#ifdef ENABLE_OPTIONAL_SYSINFO_CELLULAR_NETWORK_MNGT
WATCH_TYPE_CELLULARNETWORK = 4,
+#endif
WATCH_TYPE_NETWORK = 5,
WATCH_TYPE_STORAGE = 6,
WATCH_TYPE_CPU = 8,
+#ifdef ENABLE_OPTIONAL_SYSINFO_TEL_SIM_MNGT
WATCH_TYPE_SIM = 9,
+#endif
WATCH_TYPE_DEVICE_ORIENTATION = 10,
WATCH_TYPE_PERIPHERAL = 11,
WATCH_TYPE_LOCALE = 12,
enum {
REGIST_NOT = 0,
REGIST_WIFI = 1,
+#ifdef ENABLE_OPTIONAL_SYSINFO_CELLULAR_NETWORK_MNGT
REGIST_CELLULAR =2,
+#endif
REGIST_ALL = 3
};
PROPERTY_DECLARATION(Display, "DISPLAY", WATCH_TYPE_DISPLAY)
PROPERTY_DECLARATION(Network, "NETWORK", WATCH_TYPE_NETWORK)
PROPERTY_DECLARATION(WifiNetwork, "WIFI_NETWORK", WATCH_TYPE_WIFINETWORK)
+#ifdef ENABLE_OPTIONAL_SYSINFO_CELLULAR_NETWORK_MNGT
PROPERTY_DECLARATION(CellularNetwork, "CELLULAR_NETWORK", WATCH_TYPE_CELLULARNETWORK)
+#endif
+#ifdef ENABLE_OPTIONAL_SYSINFO_TEL_SIM_MNGT
PROPERTY_DECLARATION(SIM, "SIM", WATCH_TYPE_SIM)
+#endif
PROPERTY_DECLARATION(DeviceOrientation, "DEVICE_ORIENTATION", WATCH_TYPE_DEVICE_ORIENTATION)
PROPERTY_DECLARATION(Build, "BUILD", WATCH_TYPE_UNKNOWN)
PROPERTY_DECLARATION(Locale, "LOCALE", WATCH_TYPE_LOCALE)
typedef std::list<EventWatchSysteminfoPtr> EventDisplayList;
typedef std::list<EventWatchSysteminfoPtr> EventNetworkList;
typedef std::list<EventWatchSysteminfoPtr> EventWifiNetworkList;
+#ifdef ENABLE_OPTIONAL_SYSINFO_CELLULAR_NETWORK_MNGT
typedef std::list<EventWatchSysteminfoPtr> EventCellularNetworkList;
+#endif
typedef std::list<EventWatchSysteminfoPtr> EventStorageList;
typedef std::list<EventWatchSysteminfoPtr> EventCpuList;
+#ifdef ENABLE_OPTIONAL_SYSINFO_TEL_SIM_MNGT
typedef std::list<EventWatchSysteminfoPtr> EventSimList;
+#endif
typedef std::list<EventWatchSysteminfoPtr> EventDeviceOrientationList;
typedef std::list<EventWatchSysteminfoPtr> EventLocaleList;
typedef std::list<EventWatchSysteminfoPtr> EventPeripheralList;
EventDisplayList getEventDisplayList();
EventNetworkList getEventNetworkList();
EventWifiNetworkList getEventWifiNetworkList();
+#ifdef ENABLE_OPTIONAL_SYSINFO_CELLULAR_NETWORK_MNGT
EventCellularNetworkList getEventCellularNetworkList();
+#endif
EventStorageList getEventStorageList();
EventCpuList getEventCpuList();
+#ifdef ENABLE_OPTIONAL_SYSINFO_TEL_SIM_MNGT
EventSimList getEventSimList();
+#endif
EventDeviceOrientationList getEventDeviceOrientationList();
EventLocaleList getEventLocaleList();
EventPeripheralList getEventPeripheralList();
EventDisplayList m_eventDisplayList;
EventNetworkList m_eventNetworkList;
EventWifiNetworkList m_eventWifiNetworkList;
+#ifdef ENABLE_OPTIONAL_SYSINFO_CELLULAR_NETWORK_MNGT
EventCellularNetworkList m_eventCelluarNetworkList;
+#endif
EventStorageList m_eventStorageList;
EventCpuList m_eventCpuList;
+#ifdef ENABLE_OPTIONAL_SYSINFO_TEL_SIM_MNGT
EventSimList m_eventSimList;
+#endif
EventDeviceOrientationList m_eventDeviceOrientationList;
EventLocaleList m_eventLocaleList;
EventPeripheralList m_eventPeripheralList;