Moved exception list to plugin
[platform/core/connectivity/stc-manager.git] / plugin / stc-plugin-popup.c
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #include <errno.h>
18 #include <stdio.h>
19 #include <stdlib.h>
20 #include <string.h>
21 #include <syspopup_caller.h>
22 #include <bundle.h>
23 #include <bundle_internal.h>
24 #include <dlog.h>
25 #include <gio/gio.h>
26
27 #include "stc-plugin.h"
28
29 //LCOV_EXCL_START
30 int stc_plugin_popup_send_warn_message(const char *content,
31                 const char *type, const char *app_id, const char *iftype, const char *warn)
32 {
33         int ret = 0;
34         bundle *b = bundle_create();
35
36         STC_LOGD("Warn message : content[%s] type[%s] app_id[%s] warn[%s]",
37                 content, type, app_id, warn);
38
39         bundle_add(b, "_SYSPOPUP_CONTENT_", content);
40         bundle_add(b, "_SYSPOPUP_TYPE_", type);
41         bundle_add(b, "_APP_ID_", app_id);
42         bundle_add(b, "_IF_TYPE_", iftype);
43         bundle_add(b, "_WARN_LIMIT_", warn);
44
45         ret = syspopup_launch("net-popup", b);
46
47         bundle_free(b);
48
49         return ret;
50 }
51
52 int stc_plugin_popup_send_restriction_message(const char *content,
53                 const char *type, const char *app_id, const char *iftype, const char *limit)
54 {
55         int ret = 0;
56         bundle *b = bundle_create();
57
58         STC_LOGD("Restriction message : content[%s] type[%s] app_id[%s] limit[%s]",
59                 content, type, app_id, limit);
60
61         bundle_add(b, "_SYSPOPUP_CONTENT_", content);
62         bundle_add(b, "_SYSPOPUP_TYPE_", type);
63         bundle_add(b, "_APP_ID_", app_id);
64         bundle_add(b, "_IF_TYPE_", iftype);
65         bundle_add(b, "_RESTRICTION_LIMIT_", limit);
66
67         ret = syspopup_launch("net-popup", b);
68
69         bundle_free(b);
70
71         return ret;
72 }
73 //LCOV_EXCL_STOP