- This is for Tizen 4.0.
: Tizen 4.0 Configurability and Build Blocks require
to remove all profile-depending build options in spec files.
(No More profile macros)
- It is recommended to distinguish features/profiles at runtime.
unless it incurs too much overhead, which requires you to
create multiple binaries and subpackages.
Change-Id: I69bec406414f23086edd4ba4d0ccb173babf5953
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
ADD_DEFINITIONS("-DTARGET")
ENDIF("${ARCH}" STREQUAL "arm")
-IF("${PROFILE}" STREQUAL "wearable")
- ADD_DEFINITIONS("-DTIZEN_WEARABLE")
-ENDIF("${PROFILE}" STREQUAL "wearable")
-
ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
ADD_DEFINITIONS("-DEXPORT_API=__attribute__((visibility(\"default\")))")
#ADD_DEFINITIONS("-DTIZEN_DEBUG")
MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DMAJORVER=${MAJORVER} -DFULLVER=%{version} \
- -DLIBDIR=%{_libdir} -DPROFILE=%{?profile} -DTIZEN_VER=0x030000
+ -DLIBDIR=%{_libdir} -DTIZEN_VER=0x030000
make %{?jobs:-j%jobs}
%install
bool maps_condition_check_internet_feature(void)
{
static bool is_supported = true;
-#ifdef TIZEN_WEARABLE
static bool is_read = false;
- if (!is_read) {
+ if (_get_tizen_profile() == TIZEN_PROFILE_WEARABLE && !is_read) {
system_info_get_platform_bool(INTERNET_FEATURE, &is_supported);
MAPS_LOGD("internet feature is%ssupported", (is_supported ? " " : " not "));
is_read = true;
}
-#endif
return is_supported;
}
if (maps_service_provider_is_data_supported(maps, data, &supported) != MAPS_ERROR_NONE)
return false;
return supported;
-}
\ No newline at end of file
+}
#include "maps_error.h"
#include <glib.h>
#include <system_info.h>
+#include <stdlib.h>
#define DEFAULT_UNKNOWN_DPI 132
*dpi = __dpi;
return MAPS_ERROR_NONE;
}
+
+tizen_profile_t _get_tizen_profile()
+{
+ static tizen_profile_t profile = TIZEN_PROFILE_UNKNOWN;
+ if (__builtin_expect(profile != TIZEN_PROFILE_UNKNOWN, 1))
+ return profile;
+
+ char *profileName;
+ system_info_get_platform_string("http://tizen.org/feature/profile", &profileName);
+ switch (*profileName) {
+ case 'm':
+ case 'M':
+ profile = TIZEN_PROFILE_MOBILE;
+ break;
+ case 'w':
+ case 'W':
+ profile = TIZEN_PROFILE_WEARABLE;
+ break;
+ case 't':
+ case 'T':
+ profile = TIZEN_PROFILE_TV;
+ break;
+ case 'i':
+ case 'I':
+ profile = TIZEN_PROFILE_IVI;
+ break;
+ default: // common or unknown ==> ALL ARE COMMON.
+ profile = TIZEN_PROFILE_COMMON;
+ }
+ free(profileName);
+
+ return profile;
+}
}
};
+typedef enum {
+ TIZEN_PROFILE_UNKNOWN = 0,
+ TIZEN_PROFILE_MOBILE = 0x1,
+ TIZEN_PROFILE_WEARABLE = 0x2,
+ TIZEN_PROFILE_TV = 0x4,
+ TIZEN_PROFILE_IVI = 0x8,
+ TIZEN_PROFILE_COMMON = 0x10,
+} tizen_profile_t;
+extern tizen_profile_t _get_tizen_profile();
#endif /* __MAPS_UTIL_H__ */