4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>, Jaeho Lee <jaeho81.lee@samsung.com>
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
12 * http://www.apache.org/licenses/LICENSE-2.0
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.
32 #include "menu_db_util.h"
33 #include "simple_util.h"
39 static int (*_aul_key_handler) (bundle *kb, void *data) = NULL;
40 static void *_aul_key_data = NULL;
42 extern GSourceFuncs funcs;
44 int app_key_event(bundle *kb)
47 _aul_key_handler(kb, _aul_key_data);
51 int aul_register_key_init_callback(
52 int (*aul_handler) (bundle *, void *), void *data)
54 /* Save start handler function in static var */
55 _aul_key_handler = aul_handler;
60 SLPAPI int aul_key_init(int (*aul_handler) (bundle *, void *), void *data)
62 #ifdef _APPFW_FEATURE_AMD_KEY
68 if (aul_handler != NULL)
69 aul_register_key_init_callback(aul_handler, data);
71 fd = aul_initialize();
75 src = g_source_new(&funcs, sizeof(GSource));
77 gpollfd = (GPollFD *) g_malloc(sizeof(GPollFD));
78 if (gpollfd == NULL) {
83 gpollfd->events = POLLIN;
86 g_source_add_poll(src, gpollfd);
87 g_source_set_callback(src, (GSourceFunc) __aul_glib_handler,
88 (gpointer) gpollfd, NULL);
89 g_source_set_priority(src, G_PRIORITY_LOW);
91 ret = g_source_attach(src, NULL);
100 SLPAPI int aul_key_reserve()
102 #ifdef _APPFW_FEATURE_AMD_KE
106 kb = bundle_create();
107 ret = app_send_cmd(AUL_UTIL_PID, APP_KEY_RESERVE, kb);
116 SLPAPI int aul_key_release()
118 #ifdef _APPFW_FEATURE_AMD_KE
122 kb = bundle_create();
123 ret = app_send_cmd(AUL_UTIL_PID, APP_KEY_RELEASE, kb);