tizen 2.3.1 release
[framework/appfw/aul-1.git] / src / status.c
1 /*
2  *  aul
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>, Jaeho Lee <jaeho81.lee@samsung.com>
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  */
21
22 #include <aul.h>
23 #include <bundle.h>
24
25 #include "aul_util.h"
26 #include "app_sock.h"
27 #include "aul_api.h"
28 #include "launch.h"
29
30 SLPAPI int aul_status_update(int status)
31 {
32         int ret;
33
34         ret = __app_send_raw_with_noreply(AUL_UTIL_PID, APP_STATUS_UPDATE, (unsigned char *)&status, sizeof(status));
35
36         return ret;
37 }
38
39 SLPAPI int aul_running_list_update(char *appid, char *app_path, char *pid)
40 {
41         int ret;
42         bundle *kb;
43
44         kb = bundle_create();
45
46         bundle_add(kb, AUL_K_APPID, appid);
47         bundle_add(kb, AUL_K_EXEC, app_path);
48         bundle_add(kb, AUL_K_PID, pid);
49
50         ret = app_send_cmd(AUL_UTIL_PID, APP_RUNNING_LIST_UPDATE, kb);
51
52         if (kb != NULL)
53                         bundle_free(kb);
54
55         return ret;
56 }
57