- This is for Tizen 4.0.
- Please later consider removing TM1 conditions (like next year? :D )
Change-Id: Ia27027290910ecf9abe97b5c2034646a95a12f78
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
INCLUDE(FindPkgConfig)
pkg_check_modules(pkgs REQUIRED gio-2.0 gio-unix-2.0 dbus-1 dlog deviced vconf notification capi-network-connection capi-network-bluetooth syspopup-caller
- appcore-common capi-network-wifi capi-network-wifi-direct alarm-service appsvc libcrypto key-manager libtzplatform-config dpm)
+ appcore-common capi-network-wifi capi-network-wifi-direct alarm-service appsvc libcrypto key-manager libtzplatform-config dpm
+ capi-system-info)
FOREACH(flag ${pkgs_CFLAGS})
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
mobile_ap_station_info_t sta_info[MOBILE_AP_MAX_CONNECTED_STA];
} mobile_ap_device_info_t;
+
+typedef enum {
+ _PROFILE_UNKNOWN = 0,
+ _PROFILE_MOBILE = 0x1,
+ _PROFILE_WEARABLE = 0x2,
+ _PROFILE_TV = 0x4,
+ _PROFILE_IVI = 0x8,
+ _PROFILE_COMMON = 0x10,
+} tizen_profile_t;
+extern tizen_profile_t _get_tizen_profile();
+#define TIZEN_PROFILE_TV (_get_tizen_profile() == _PROFILE_TV)
+
#ifdef __cplusplus
}
#endif
BuildRequires: pkgconfig(appcore-common)
BuildRequires: pkgconfig(capi-network-wifi-direct)
BuildRequires: pkgconfig(capi-network-wifi)
+BuildRequires: pkgconfig(capi-system-info)
BuildRequires: pkgconfig(alarm-service)
BuildRequires: pkgconfig(appsvc)
BuildRequires: pkgconfig(libcrypto)
%cmake -DCMAKE_BUILD_TYPE="" \
-DTIZEN_FEATURE_MULTICAST=1 \
-%if "%{?profile}" == "tv"
- -DTIZEN_PROFILE_TV=1 \
-%endif
%if "%{?tizen_target_name}" == "TM1"
-DTIZEN_FEATURE_WLAN_BOARD_SPRD=1 \
%endif
err = MOBILE_AP_ERROR_ALREADY_ENABLED;
break;
-#ifndef TIZEN_PROFILE_TV
case CONNECTION_ERROR_PERMISSION_DENIED:
- err = MOBILE_AP_ERROR_PERMISSION_DENIED;
- break;
-#endif
+ if (!TIZEN_PROFILE_TV) {
+ err = MOBILE_AP_ERROR_PERMISSION_DENIED;
+ break;
+ } else {
+ goto _default_;
+ }
case CONNECTION_ERROR_DHCP_FAILED:
err = MOBILE_AP_ERROR_DHCP;
case CONNECTION_ERROR_NOW_IN_PROGRESS:
err = MOBILE_AP_ERROR_IN_PROGRESS;
break;
-
+_default_:
default:
ERR("Not defined error : %d\n", conn_error);
err = MOBILE_AP_ERROR_INTERNAL;
return TRUE;
}
+
+tizen_profile_t _get_tizen_profile()
+{
+ static tizen_profile_t profile = _PROFILE_UNKNOWN;
+
+ if (__builtin_expect(profile == _PROFILE_UNKNOWN, 0)) {
+ char *profileName;
+
+ system_info_get_platform_string("http://tizen.org/feature/profile", &profileName);
+ switch (*profileName) {
+ case 'm':
+ case 'M':
+ profile = _PROFILE_MOBILE;
+ break;
+ case 'w':
+ case 'W':
+ profile = _PROFILE_WEARABLE;
+ break;
+ case 't':
+ case 'T':
+ profile = _PROFILE_TV;
+ break;
+ case 'i':
+ case 'I':
+ profile = _PROFILE_IVI;
+ break;
+ default: // common or unknown ==> ALL ARE COMMON.
+ profile = _PROFILE_COMMON;
+ }
+ free(profileName);
+ }
+
+ return profile;
+}
#include <bundle.h>
#include <bundle_internal.h>
#include <syspopup_caller.h>
-#ifndef TIZEN_PROFILE_TV
#include <appsvc.h>
-#endif
#include "mobileap.h"
#include "mobileap_softap.h"
b = bundle_create();
bundle_add(b, "caller", "notification");
-#ifndef TIZEN_PROFILE_TV
- appsvc_set_pkgname(b, "ug-setting-mobileap-efl");
-#endif
+ if (!TIZEN_PROFILE_TV)
+ appsvc_set_pkgname(b, "ug-setting-mobileap-efl");
ret = notification_set_execute_option(noti,
NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH, "Launch", NULL, b);