Replace TIZEN_MOBILE definitions for TIZEN, change spec file to test on the %profile
variable for ivi and mobile (defined in build.xml and propagated to build.conf)
instead of _with_ivi. In the gyp files, 'extension_host_os' tests have been replaced
with testing 'tizen'. In source code, TIZEN_MOBILE used to be assumed to work with
IVI, considering mobile equal to IVI, which is not the case with every extension.
With this change, 'extension_host_os' is set to 'desktop' by default.
If a tizen repository is present, TIZEN will be defined to 1. In addition, TIZEN_IVI
is defined for IVI and TIZEN_MOBILE is defined for mobile. All extensions which
should work on all Tizen profiles, should use TIZEN, others should use the more
specific TIZEN_MOBILE and TIZEN_IVI.
'application_instance.h',
],
'conditions': [
- ['extension_host_os == "mobile"', {
+ ['tizen == 1', {
'includes': [
'../common/pkg-config.gypi',
],
'defines': ['BLUEZ_4'],
}
],
- [ 'extension_host_os == "mobile"', {
+ [ 'tizen == 1', {
'variables': { 'packages': ['capi-network-bluetooth'] },
}],
],
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#if defined(TIZEN_MOBILE)
+#if defined(TIZEN)
#include <bluetooth.h>
#endif
#include "common/picojson.h"
int32_t XW_Initialize(XW_Extension extension, XW_GetInterface get_interface) {
-#if defined(TIZEN_MOBILE)
+#if defined(TIZEN)
int init = bt_initialize();
if (init != BT_ERROR_NONE)
g_printerr("\n\nCouldn't initialize Bluetooth module.");
#include "bluetooth/bluetooth_context.h"
-#if defined(TIZEN_MOBILE)
+#if defined(TIZEN)
#include <bluetooth.h>
#endif
bool powered = msg.get("value").get<bool>();
int error = 0;
-#if defined(TIZEN_MOBILE)
+#if defined(TIZEN)
if (powered)
error = bt_adapter_enable();
else
g_bus_unwatch_name(name_watch_id_);
-#if defined(TIZEN_MOBILE)
+#if defined(TIZEN)
bt_deinitialize();
#endif
}
# Evas.h is used in favorites.h.
'conditions': [
- [ 'extension_host_os == "mobile"', {
+ [ 'tizen == 1', {
'variables': { 'packages': ['capi-web-favorites', 'evas'] },
}],
],
#ifndef BOOKMARK_BOOKMARK_INSTANCE_H_
#define BOOKMARK_BOOKMARK_INSTANCE_H_
-#if defined(TIZEN_MOBILE)
+#if defined(TIZEN)
#include <favorites.h>
#endif
{
'variables': {
- # If capi-system-power package exists, the host is considered to be Tizen Mobile.
- # Note, the spec file requires this package: BuildRequires: pkgconfig(capi-system-power).
- 'extension_host_os%': '<!(pkg-config --exists capi-system-power; if [ $? = 0 ]; then echo mobile; else echo desktop; fi)',
+ 'extension_host_os%': 'desktop',
+ 'tizen%': '0',
'telephony_sim_available%': '<!(pkg-config --exists capi-telephony-sim; if [ $? = 0 ]; then echo true; else echo false; fi)',
'extension_build_type%': '<(extension_build_type)',
'extension_build_type%': 'Debug',
'sources/': [['exclude', '_desktop\\.cc$|desktop/']],
'includes/': [['exclude', '_desktop\\.gypi$|desktop/']],
}],
+ ['tizen == 1', { 'defines': ['TIZEN'] } ],
['extension_host_os == "mobile"', { 'defines': ['TIZEN_MOBILE'] } ],
+ ['extension_host_os == "ivi"', { 'defines': ['TIZEN_IVI'] } ],
['extension_host_os == "desktop"', { 'defines': ['GENERIC_DESKTOP'] } ],
['telephony_sim_available == "true"', { 'defines': ['SYSTEMINFO_SIM_ACCESS'] } ],
['extension_build_type== "Debug"', {
'download_utils.h',
],
'conditions': [
- ['extension_host_os=="mobile"', {
+ ['tizen == 1', {
'includes': [
'../common/pkg-config.gypi',
],
'network_bearer_selection_request.h',
],
'conditions': [
- [ 'extension_host_os=="mobile"', {
+ [ 'tizen == 1', {
'includes': [
'../common/pkg-config.gypi',
],
[ 'extension_host_os == "desktop"', {
'variables': { 'packages': ['libnotify'] },
}],
- [ 'extension_host_os == "mobile"', {
+ [ 'tizen == 1', {
'variables': { 'packages': ['notification'] },
}],
],
#if defined(GENERIC_DESKTOP)
#include <libnotify/notify.h>
#include "notification/notification_instance_desktop.h"
-#elif defined(TIZEN_MOBILE)
+#elif defined(TIZEN)
#include "notification/notification_instance_mobile.h"
#endif
common::Instance* NotificationExtension::CreateInstance() {
#if defined(GENERIC_DESKTOP)
return new NotificationInstanceDesktop;
-#elif defined(TIZEN_MOBILE)
+#elif defined(TIZEN)
return new NotificationInstanceMobile(&manager_);
#endif
return NULL;
#include "common/extension.h"
-#if defined(TIZEN_MOBILE)
+#if defined(TIZEN)
#include "notification/mobile/notification_manager.h"
#endif
// common::Extension implementation.
virtual common::Instance* CreateInstance();
-#if defined(TIZEN_MOBILE)
+#if defined(TIZEN)
NotificationManager manager_;
#endif
};
BuildRequires: pkgconfig(capi-system-sensor)
BuildRequires: pkgconfig(capi-system-system-settings)
# For IVI, it doesn't need sim package.
-%bcond_with ivi
-%if !%{with ivi}
+%if "%{profile}" != "ivi"
BuildRequires: pkgconfig(capi-telephony-sim)
%endif
BuildRequires: pkgconfig(capi-web-favorites)
%build
export GYP_GENERATORS='make'
-./tools/gyp/gyp \
---depth=. \
--Dextension_build_type=Debug \
+GYP_OPTIONS="--depth=. -Dtizen=1 -Dextension_build_type=Debug"
+
%if %{with wayland}
--Ddisplay_type=wayland \
+GYP_OPTIONS="$GYP_OPTIONS -Ddisplay_type=wayland"
+%else
+GYP_OPTIONS="$GYP_OPTIONS -Ddisplay_type=x11"
+%endif
+
+%if "%{profile}" == "mobile"
+GYP_OPTIONS="$GYP_OPTIONS -Dextension_host_os=mobile"
%else
--Ddisplay_type=x11 \
+%if "%{profile}" == "ivi"
+GYP_OPTIONS="$GYP_OPTIONS -Dextension_host_os=ivi"
+%endif
%endif
-tizen-wrt.gyp
+
+./tools/gyp/gyp $GYP_OPTIONS tizen-wrt.gyp
make %{?_smp_mflags}
'../common/pkg-config.gypi',
],
'conditions': [
- ['extension_host_os=="mobile"', {
+ ['tizen == 1', {
'variables': {
'packages': [
'glib-2.0',
#if defined(GENERIC_DESKTOP)
#include "power/power_instance_desktop.h"
-#elif defined(TIZEN_MOBILE)
+#elif defined(TIZEN)
#include "power/power_instance_mobile.h"
#endif
common::Instance* PowerExtension::CreateInstance() {
#if defined(GENERIC_DESKTOP)
return new PowerInstanceDesktop;
-#elif defined(TIZEN_MOBILE)
+#elif defined(TIZEN)
return new PowerInstanceMobile(&power_event_source_);
#endif
return NULL;
#include "common/extension.h"
-#if defined(TIZEN_MOBILE)
+#if defined(TIZEN)
#include "power/mobile/power_event_source.h"
#endif
// common::Extension implementation.
virtual common::Instance* CreateInstance();
-#if defined(TIZEN_MOBILE)
+#if defined(TIZEN)
PowerEventSource power_event_source_;
#endif
};
'system_info_sim_mobile.cc',
]
}],
- [ 'extension_host_os == "mobile"', {
+ [ 'tizen == 1', {
'variables': {
'packages': [
'appcore-common',
#include <glib.h>
#include <libudev.h>
-#if defined(TIZEN_MOBILE)
+#if defined(TIZEN)
#include <vconf.h>
#include <vconf-keys.h>
#endif
udev* udev_;
int timeout_cb_id_;
-#elif defined(TIZEN_MOBILE)
+#elif defined(TIZEN)
void UpdateLevel(double level);
void UpdateCharging(bool charging);
static void OnLevelChanged(keynode_t* node, void* user_data);
#include "system_info/system_info_build.h"
#include <stdlib.h>
-#if defined(TIZEN_MOBILE)
+#if defined(TIZEN)
#include <system_info.h>
#endif
#ifndef SYSTEM_INFO_SYSTEM_INFO_CELLULAR_NETWORK_H_
#define SYSTEM_INFO_SYSTEM_INFO_CELLULAR_NETWORK_H_
-#if defined(TIZEN_MOBILE)
+#if defined(TIZEN)
#include <vconf-keys.h>
#include <vconf.h>
#endif
private:
explicit SysInfoCellularNetwork() {}
-#if defined(TIZEN_MOBILE)
+#if defined(TIZEN)
void SendUpdate();
void SetData(picojson::value& data);
#ifndef SYSTEM_INFO_SYSTEM_INFO_DEVICE_ORIENTATION_H_
#define SYSTEM_INFO_SYSTEM_INFO_DEVICE_ORIENTATION_H_
-#if defined(TIZEN_MOBILE)
+#if defined(TIZEN)
#include <sensor.h>
#include <vconf.h>
#endif
: status_(PORTRAIT_PRIMARY),
sensorHandle_(0) {}
-#if defined(TIZEN_MOBILE)
+#if defined(TIZEN)
void SetStatus();
bool SetAutoRotation();
void SendUpdate();
#if defined(GENERIC_DESKTOP)
#define ACPI_BACKLIGHT_DIR "/sys/class/backlight/acpi_video0"
-#elif defined(TIZEN_MOBILE)
+#elif defined(TIZEN)
#define ACPI_BACKLIGHT_DIR "/sys/class/backlight/psb-bl"
#else
#error "Unsupported platform"
#if defined(GENERIC_DESKTOP)
#define ACPI_BACKLIGHT_DIR "/sys/class/backlight/acpi_video0"
-#elif defined(TIZEN_MOBILE)
+#elif defined(TIZEN)
#define ACPI_BACKLIGHT_DIR "/sys/class/backlight/psb-bl"
#else
#error "Unsupported platform"
#include <dlfcn.h>
#include <stdlib.h>
-#if defined(TIZEN_MOBILE)
+#if defined(TIZEN)
#include <pkgmgr-info.h>
#include <sensors.h>
#include <system_info.h>
void SystemInfoInstance::HandleGetCapabilities() {
picojson::value::object o;
-#if defined(TIZEN_MOBILE)
+#if defined(TIZEN)
bool b;
int i;
char* s = NULL;
#ifndef SYSTEM_INFO_SYSTEM_INFO_LOCALE_H_
#define SYSTEM_INFO_SYSTEM_INFO_LOCALE_H_
-#if defined(TIZEN_MOBILE)
+#if defined(TIZEN)
#include <vconf.h>
#include <vconf-keys.h>
#endif
static gboolean OnUpdateTimeout(gpointer user_data);
int timeout_cb_id_;
-#elif defined(TIZEN_MOBILE)
+#elif defined(TIZEN)
static void OnCountryChanged(keynode_t* node, void* user_data);
static void OnLanguageChanged(keynode_t* node, void* user_data);
void Update();
#if defined(GENERIC_DESKTOP)
#include <gio/gio.h>
-#elif defined(TIZEN_MOBILE)
+#elif defined(TIZEN)
#include <net_connection.h>
#endif
#include <string>
std::string active_connection_;
std::string active_device_;
guint device_type_;
-#elif defined(TIZEN_MOBILE)
+#elif defined(TIZEN)
bool GetNetworkType();
static void OnTypeChanged(connection_type_e type, void* user_data);
#ifndef SYSTEM_INFO_SYSTEM_INFO_PERIPHERAL_H_
#define SYSTEM_INFO_SYSTEM_INFO_PERIPHERAL_H_
-#if defined(TIZEN_MOBILE)
+#if defined(TIZEN)
#include <vconf.h>
#include <vconf-keys.h>
#endif
private:
explicit SysInfoPeripheral() {}
-#if defined(TIZEN_MOBILE)
+#if defined(TIZEN)
void SetWFD(int wfd);
void SetHDMI(int hdmi);
#ifndef SYSTEM_INFO_SYSTEM_INFO_SIM_H_
#define SYSTEM_INFO_SYSTEM_INFO_SIM_H_
-#if defined(TIZEN_MOBILE)
+#if defined(TIZEN)
#include <errno.h>
#include <sim.h>
#include <stdlib.h>
SYSTEM_INFO_SIM_UNKNOWN
};
-#if defined(TIZEN_MOBILE)
+#if defined(TIZEN)
typedef int (*SIMGetterFunction1)(char** out);
typedef int (*SIMGetterFunction2)(char** out1, char** out2);
msin_(""),
spn_("") {}
-#if defined(TIZEN_MOBILE)
+#if defined(TIZEN)
bool QuerySIMStatus();
bool QuerySIM(SIMGetterFunction1 getter,
std::string& member,
std::string GetDevPathFromMountPath(const std::string& mnt_path);
struct udev* udev_;
-#elif defined(TIZEN_MOBILE)
+#elif defined(TIZEN)
bool GetInternal(picojson::value& error, picojson::value& unit);
bool GetMMC(picojson::value& error, picojson::value& unit);
#endif
#if defined(GENERIC_DESKTOP)
#include <gio/gio.h>
-#elif defined(TIZEN_MOBILE)
+#elif defined(TIZEN)
#include <net_connection.h>
#endif
#include <string>
std::string active_device_;
std::string ipv6_config_;
unsigned int ip_address_desktop_;
-#elif defined(TIZEN_MOBILE)
+#elif defined(TIZEN)
bool GetIPv4Address();
bool GetIPv6Address();
bool GetSignalStrength();
'../common/extension.cc',
],
'conditions': [
- ['extension_host_os=="mobile"', {
+ ['tizen == 1', {
'includes': [
'../common/pkg-config.gypi',
],
'../common/extension.cc',
],
'conditions': [
- [ 'extension_host_os == "mobile"', {
+ [ 'tizen == 1', {
'variables': { 'packages': ['vconf'] },
}],
],
#include "time/time_instance.h"
-#if defined(TIZEN_MOBILE)
+#if defined(TIZEN)
#include <vconf.h>
#endif
if (type != TIME_FORMAT)
skeleton = UDAT_YEAR_MONTH_WEEKDAY_DAY;
-#if defined(TIZEN_MOBILE)
+#if defined(TIZEN)
int value = 0;
if (vconf_get_int(VCONFKEY_REGIONFORMAT_TIME1224, &value) == -1)
skeleton += "hhmmss";
'tizen/tizen.gyp:*',
],
'conditions': [
- [ 'extension_host_os == "mobile"', {
+ [ 'tizen == 1', {
'dependencies': [
'application/application.gyp:*',
'download/download.gyp:*',
'type': 'none',
'conditions': [
- [ 'extension_host_os == "mobile"', {
+ [ 'tizen == 1', {
'actions': [
{
'variables': {