# Common Options
INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/shared
)
ADD_DEFINITIONS(-O2 -Wall -fPIC -fdata-sections -ffunction-sections -fvisibility=hidden)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fPIC -Wl,--as-needed -Wl,--gc-section -Wl,--print-gc-section")
* limitations under the License.
*/
-#include <system_info.h>
+#include <Util.h>
#include "ActivityTypes.h"
#include "ActivityBase.h"
bool UserActivityBase::isSupported()
{
- return getSystemInfoBool("tizen.org/feature/sensor.activity_recognition");
+ return util::getSystemInfoBool("tizen.org/feature/sensor.activity_recognition");
}
void UserActivityBase::submitTriggerItem()
* limitations under the License.
*/
+#include <Util.h>
#include "Call.h"
#define TELEPHONY_NOTI_ID_CNT 8
bool SocialStatusCall::isSupported()
{
- return getSystemInfoBool("tizen.org/feature/network.telephony");
+ return util::getSystemInfoBool("tizen.org/feature/network.telephony");
}
void SocialStatusCall::submitTriggerItem()
*/
#include <email-api-etc.h>
+#include <Util.h>
#include "Email.h"
using namespace ctx;
bool SocialStatusEmail::isSupported()
{
- return getSystemInfoBool("tizen.org/feature/network.telephony");
+ return util::getSystemInfoBool("tizen.org/feature/network.telephony");
}
void SocialStatusEmail::submitTriggerItem()
* limitations under the License.
*/
+#include <Util.h>
#include "Message.h"
#define MAX_ADDR_SIZE 20
bool SocialStatusMessage::isSupported()
{
- return getSystemInfoBool("tizen.org/feature/network.telephony");
+ return util::getSystemInfoBool("tizen.org/feature/network.telephony");
}
void SocialStatusMessage::submitTriggerItem()
{
return ERR_NOT_SUPPORTED;
}
-
-bool BasicProvider::getSystemInfoBool(const char *key)
-{
- bool supported = false;
- int ret = system_info_get_platform_bool(key, &supported);
- IF_FAIL_RETURN_TAG(ret == SYSTEM_INFO_ERROR_NONE, false, _E, "system_info_get_platform_bool() failed");
- return supported;
-}
virtual int unsubscribe();
virtual int read();
virtual int write(Json &data);
-
- /* TODO: This function needs to be removed from here */
- static bool getSystemInfoBool(const char *key);
};
}
--- /dev/null
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <system_info.h>
+#include <Types.h>
+#include "Util.h"
+
+bool ctx::util::getSystemInfoBool(const char * key)
+{
+ bool supported = false;
+ int ret = system_info_get_platform_bool(key, &supported);
+ IF_FAIL_RETURN_TAG(ret == SYSTEM_INFO_ERROR_NONE, false, _E, "system_info_get_platform_bool() failed");
+ return supported;
+}
--- /dev/null
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _CONTEXT_UTIL_H_
+#define _CONTEXT_UTIL_H_
+
+namespace ctx {
+namespace util {
+
+ bool getSystemInfoBool(const char *key);
+
+} /* namespace util */
+} /* namespace ctx */
+
+#endif /* _CONTEXT_UTIL_H_ */
* limitations under the License.
*/
+#include <Util.h>
#include "Gps.h"
using namespace ctx;
bool DeviceStatusGps::isSupported()
{
- return getSystemInfoBool("tizen.org/feature/location.gps");
+ return util::getSystemInfoBool("tizen.org/feature/location.gps");
}
void DeviceStatusGps::submitTriggerItem()
* limitations under the License.
*/
+#include <Util.h>
#include "Usb.h"
using namespace ctx;
bool DeviceStatusUsb::isSupported()
{
- return getSystemInfoBool("tizen.org/feature/usb.host");
+ return util::getSystemInfoBool("tizen.org/feature/usb.host");
}
void DeviceStatusUsb::submitTriggerItem()
*/
#include <SharedVars.h>
+#include <Util.h>
#include "Wifi.h"
using namespace ctx;
bool DeviceStatusWifi::isSupported()
{
- return getSystemInfoBool("tizen.org/feature/network.wifi");
+ return util::getSystemInfoBool("tizen.org/feature/network.wifi");
}
void DeviceStatusWifi::submitTriggerItem()