SET(SRCS
${CMAKE_SOURCE_DIR}/src/net-popup.c
+ ${CMAKE_SOURCE_DIR}/src/net-popup-w.c
${CMAKE_SOURCE_DIR}/src/net-popup-vpn.c)
vconf
efl-extension
capi-vpnsvc
- capi-network-stc)
+ capi-network-stc
+ capi-system-info)
FOREACH(flag ${pkgs_CFLAGS})
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
--- /dev/null
+/*
+* net-popup
+*
+* Copyright 2012 Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.1 (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.tizenopensource.org/license
+*
+* 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 __DEF_NET_POPUP_W_H__
+#define __DEF_NET_POPUP_W_H__
+
+#include <dlog.h>
+#include <app_control.h>
+
+#define PACKAGE "net-popup"
+#define NET_POPUP_W "NET_POPUP_W"
+#define LOCALEDIR "/usr/share/locale"
+#define log_print(MID, format, args...) \
+ SLOG(LOG_INFO, MID, "\033[0m[%s:%d]\033[0m " format, __func__, __LINE__, ##args)
+
+bool net_popup_w_create(void *data);
+void net_popup_w_terminate(void *data);
+void net_popup_w_pause(void *data);
+void net_popup_w_resume(void *data);
+void net_popup_w_service_cb(app_control_h request, void *data);
+
+#endif /* __DEF_NET_POPUP_W_H__ */
#define secure_log_print(tag, format, args...) SECURE_SLOG(LOG_DEBUG, \
tag, "%s:%d "format, __func__, __LINE__, ##args)
+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;
+
#endif /* __DEF_NET_POPUP_H__ */
Name: net.netpopup
Summary: Network Notification Popup application
-Version: 0.2.89
+Version: 0.2.90
Release: 1
Group: App/Network
License: Flora-1.1
BuildRequires: pkgconfig(libtzplatform-config)
BuildRequires: pkgconfig(capi-vpnsvc)
BuildRequires: pkgconfig(capi-network-stc)
+BuildRequires: pkgconfig(capi-system-info)
BuildRequires: gettext
BuildRequires: edje-tools
--- /dev/null
+/*
+* net-popup
+*
+* Copyright 2012 Samsung Electronics Co., Ltd
+*
+* Licensed under the Flora License, Version 1.1 (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.tizenopensource.org/license
+*
+* 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 "net-popup-w.h"
+#include "net-popup-strings.h"
+
+bool net_popup_w_create(void *data)
+{
+ log_print(NET_POPUP_W, "net_popup_w_create()\n");
+
+ bindtextdomain(PACKAGE, LOCALEDIR);
+
+ return true;
+}
+
+void net_popup_w_terminate(void *data)
+{
+ log_print(NET_POPUP_W, "net_popup_w_terminate()\n");
+
+ return;
+}
+
+void net_popup_w_pause(void *data)
+{
+ log_print(NET_POPUP_W, "net_popup_w_pause()\n");
+
+ return;
+}
+
+void net_popup_w_resume(void *data)
+{
+ log_print(NET_POPUP_W, "net_popup_w_resume()\n");
+
+ return;
+}
+
+void net_popup_w_service_cb(app_control_h request, void *data)
+{
+ log_print(NET_POPUP_W, "net_popup_w_service_cb()\n");
+
+ return;
+}
#include <vpn_service_internal.h>
#include <stc.h>
#include <stc_internal.h>
+#include <system_info.h>
#include "net-popup.h"
+#include "net-popup-w.h"
#include "net-popup-vpn.h"
#include "net-popup-strings.h"
long sizes[] = {1073741824, 1048576, 1024, 0};
char *units[] = {"GB", "MB", "KB", "B"};
+static tizen_profile_t g_profile = TIZEN_PROFILE_UNKNOWN;
+
static app_control_h g_req_handle = NULL;
static char *resp_popup_mode = NULL;
static void __net_popup_add_ip_conflict_noti(app_control_h request);
static void __net_popup_del_ip_conflict_noti(void);
+static void __net_popup_get_tizen_profile(void)
+{
+ char *profile_name;
+
+ system_info_get_platform_string("http://tizen.org/feature/profile", &profile_name);
+
+ switch (*profile_name) {
+ case 'm':
+ case 'M':
+ g_profile = TIZEN_PROFILE_MOBILE;
+ break;
+ case 'w':
+ case 'W':
+ g_profile = TIZEN_PROFILE_WEARABLE;
+ break;
+ case 't':
+ case 'T':
+ g_profile = TIZEN_PROFILE_TV;
+ break;
+ case 'i':
+ case 'I':
+ g_profile = TIZEN_PROFILE_IVI;
+ break;
+ default:
+ g_profile = TIZEN_PROFILE_COMMON;
+ }
+}
+
GDBusProxy *__net_popup_init_dbus(void)
{
log_print(NET_POPUP, "__net_popup_init_dbus()\n");
{
log_print(NET_POPUP, "main()\n");
- ui_app_lifecycle_callback_s app_callback = {
- .create = __net_popup_create,
- .terminate = __net_popup_terminate,
- .pause = __net_popup_pause,
- .resume = __net_popup_resume,
- .app_control = __net_popup_service_cb,
- };
+ __net_popup_get_tizen_profile();
- return ui_app_main(argc, argv, &app_callback, NULL);
-}
+ if (g_profile == TIZEN_PROFILE_MOBILE) {
+ ui_app_lifecycle_callback_s app_callback = {
+ .create = __net_popup_create,
+ .terminate = __net_popup_terminate,
+ .pause = __net_popup_pause,
+ .resume = __net_popup_resume,
+ .app_control = __net_popup_service_cb,
+ };
+ return ui_app_main(argc, argv, &app_callback, NULL);
+ } else if (g_profile == TIZEN_PROFILE_WEARABLE) {
+ ui_app_lifecycle_callback_s app_callback = {
+ .create = net_popup_w_create,
+ .terminate = net_popup_w_terminate,
+ .pause = net_popup_w_pause,
+ .resume = net_popup_w_resume,
+ .app_control = net_popup_w_service_cb,
+ };
+
+ return ui_app_main(argc, argv, &app_callback, NULL);
+ }
+
+ return 0;
+}