INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src)
SET(HEADERS_LIB_AMD
amd.h
+ amd_mod_common.h
amd_api_noti.h
amd_api_wayland.h
amd_api_app_status.h
--- /dev/null
+/*
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+#pragma once
+
+#include <dlog.h>
+
+#ifndef _E
+#define _E LOGE
+#endif
+
+#ifndef _W
+#define _W LOGW
+#endif
+
+#ifndef _I
+#define _I LOGI
+#endif
+
+#ifndef _D
+#define _D LOGD
+#endif
+
+#ifndef EXPORT
+#define EXPORT __attribute__ ((visibility("default")))
+#endif
+
+#ifndef ARRAY_SIZE
+#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
+#endif
+
+#ifndef REGULAR_UID_MIN
+#define REGULAR_UID_MIN 5000
+#endif
+++ /dev/null
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
- *
- * 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.
- */
-
-#pragma once
-
-#include <dlog.h>
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-#define LOG_TAG "AMD_BOOST"
-
-#ifndef _E
-#define _E LOGE
-#endif
-
-#ifndef _W
-#define _W LOGW
-#endif
-
-#ifndef _I
-#define _I LOGI
-#endif
-
-#ifndef _D
-#define _D LOGD
-#endif
-
-#define EXPORT __attribute__ ((visibility("default")))
#include <aul_cmd.h>
#include <aul_svc_priv_key.h>
#include <bundle_internal.h>
+#include <amd_mod_common.h>
-#include "amd_boost_private.h"
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+#define LOG_TAG "AMD_BOOST"
#define PASS_BUS_NAME "org.tizen.system.pass"
#define PASS_PATH_PMQOS "/Org/Tizen/System/Pass/Pmqos"
+++ /dev/null
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
- *
- * 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.
- */
-
-#pragma once
-
-#include <dlog.h>
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-#define LOG_TAG "AMD_COMPLICATION"
-
-#ifndef _E
-#define _E LOGE
-#endif
-
-#ifndef _W
-#define _W LOGW
-#endif
-
-#ifndef _I
-#define _I LOGI
-#endif
-
-#ifndef _D
-#define _D LOGD
-#endif
-
-#define EXPORT __attribute__ ((visibility("default")))
#include <aul_sock.h>
#include <bundle_internal.h>
#include <amd.h>
+#include <amd_mod_common.h>
-#include "amd_complication_private.h"
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+#define LOG_TAG "AMD_COMPLICATION"
-#define ARRAY_SIZE(x) ((sizeof(x)) / sizeof(x[0]))
#define MAX_NR_OF_DESCRIPTORS 2
#define PRIVILEGE_DATASHARING "http://tizen.org/privilege/datasharing"
#include <aul.h>
#include "component_info.h"
-#include "private.h"
+#include "component_manager_private.h"
namespace component_manager {
#include "component_manager.h"
#include "request_handler/component_info_get.h"
#include "request_handler/component_info_foreach.h"
-#include "private.h"
+#include "component_manager_private.h"
namespace component_manager {
using namespace component_manager::request_handler;
--- /dev/null
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+#pragma once
+
+#include <amd_mod_common.h>
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+
+#define LOG_TAG "AMD_COMPONENT_MANAGER"
+
#include "dispatcher.h"
#include "pending_job.h"
-#include "private.h"
+#include "component_manager_private.h"
namespace component_manager {
*/
#include "job.h"
-#include "private.h"
+#include "component_manager_private.h"
namespace component_manager {
*/
#include "component_manager.h"
-#include "private.h"
+#include "component_manager_private.h"
using namespace component_manager;
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
- *
- * 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 PRIVATE_H_
-#define PRIVATE_H_
-
-#include <dlog.h>
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-
-#define LOG_TAG "AMD_COMPONENT_MANAGER"
-
-#ifndef _E
-#define _E LOGE
-#endif
-
-#ifndef _W
-#define _W LOGW
-#endif
-
-#ifndef _I
-#define _I LOGI
-#endif
-
-#ifndef _D
-#define _D LOGD
-#endif
-
-#ifdef EXPORT
-#undef EXPORT
-#endif
-
-#define EXPORT __attribute__((visibility("default")))
-
-#ifdef ARRAY_SIZE
-#undef ARRAY_SIZE
-#endif
-
-#define ARRAY_SIZE(x) (sizeof(x) / (sizeof(x[0])))
-
-#endif // PRIVATE_H_
#include <memory>
#include "request_handler.h"
-#include "private.h"
+#include "component_manager_private.h"
namespace component_manager {
#include "component_info.h"
#include "request_handler/component_info_foreach.h"
-#include "private.h"
+#include "component_manager_private.h"
namespace component_manager {
namespace request_handler {
#include "component_info.h"
#include "request_handler/component_info_get.h"
-#include "private.h"
+#include "component_manager_private.h"
namespace component_manager {
namespace request_handler {
#include <fcntl.h>
#include "worker.h"
-#include "private.h"
+#include "component_manager_private.h"
namespace component_manager {
+++ /dev/null
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
- *
- * 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.
- */
-
-#pragma once
-
-#include <dlog.h>
-
-#undef LOG_TAG
-#define LOG_TAG "AMD_COOLDOWN"
-
-#define _E(fmt, arg...) LOGE(fmt, ##arg)
-#define _D(fmt, arg...) LOGD(fmt, ##arg)
-#define _W(fmt, arg...) LOGW(fmt, ##arg)
-#define _I(fmt, arg...) LOGI(fmt, ##arg)
-
-#define EXPORT __attribute__ ((visibility("default")))
-
#include <gio/gio.h>
#include <aul.h>
#include <amd.h>
+#include <amd_mod_common.h>
-#include "amd_cooldown.h"
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+#define LOG_TAG "AMD_COOLDOWN"
#define DBUS_SERVICE_DBUS "org.freedesktop.DBus"
#define DBUS_PATH_DBUS "/org/freedesktop/DBus"
#define AMD_DBUS_INTERFACE "org.tizen.application.manager"
#define AMD_DBUS_OBJECT_PATH "/Org/Tizen/Application/Manager"
-#define REGULAR_UID_MIN 5000
-
#define COOLDOWN_STATUS_RELEASE "release"
#define COOLDOWN_STATUS_LIMIT "limit"
+++ /dev/null
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
- *
- * 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.
- */
-
-#pragma once
-
-#include <dlog.h>
-
-#undef LOG_TAG
-#define LOG_TAG "AMD_CYNARA_CORE"
-
-#define _E(fmt, arg...) LOGE(fmt, ##arg)
-#define _D(fmt, arg...) LOGD(fmt, ##arg)
-#define _W(fmt, arg...) LOGW(fmt, ##arg)
-#define _I(fmt, arg...) LOGI(fmt, ##arg)
-
-#undef EXPORT
-#define EXPORT __attribute__ ((visibility("default")))
-
#include <security-manager.h>
#include <cert-svc/ccert.h>
#include <cert-svc/cinstance.h>
+#include <amd_mod_common.h>
-#include "amd_cynara_core.h"
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+#define LOG_TAG "AMD_CYNARA_CORE"
#define MAX_LOCAL_BUFSZ 128
-#define REGULAR_UID_MIN 5000
static cynara_async *r_cynara;
static int cynara_fd = -1;
+++ /dev/null
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
- *
- * 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.
- */
-
-#pragma once
-
-#include <dlog.h>
-
-#undef LOG_TAG
-#define LOG_TAG "AMD_EXTRACTOR"
-
-#define _E(fmt, arg...) LOGE(fmt, ##arg)
-#define _D(fmt, arg...) LOGD(fmt, ##arg)
-#define _W(fmt, arg...) LOGW(fmt, ##arg)
-#define _I(fmt, arg...) LOGI(fmt, ##arg)
-
-#define EXPORT __attribute__ ((visibility("default")))
-
#include <aul.h>
#include <bundle_internal.h>
#include <tzplatform_config.h>
+#include <amd.h>
+#include <amd_mod_common.h>
-#include "amd.h"
-#include "amd_extractor.h"
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+#define LOG_TAG "AMD_EXTRACTOR"
#define PATH_APP_ROOT tzplatform_getenv(TZ_USER_APP)
#define PATH_GLOBAL_APP_RO_ROOT tzplatform_getenv(TZ_SYS_RO_APP)
* limitations under the License.
*/
-#ifndef __AMD_INPUT_PRIVATE_H__
-#define __AMD_INPUT_PRIVATE_H__
+#pragma once
-#include <dlog.h>
+#include <amd_mod_common.h>
#ifdef LOG_TAG
#undef LOG_TAG
#endif
-#define LOG_TAG "AMD_INPUT"
-
-#ifndef _E
-#define _E LOGE
-#endif
-
-#ifndef _W
-#define _W LOGW
-#endif
-
-#ifndef _I
-#define _I LOGI
-#endif
-
-#ifndef _D
-#define _D LOGD
-#endif
-
-#ifdef EXPORT
-#undef EXPORT
-#endif
-
-#define EXPORT __attribute__ ((visibility("default")))
-
-#endif /* __AMD_INPUT_PRIVATE_H__ */
+#define LOG_TAG "AMD_INPUT"
\ No newline at end of file
#include <aul.h>
#include <amd.h>
-#include "amd_input_private.h"
#include "amd_input_config.h"
+#include "amd_input_private.h"
static bool locked;
static bool init_done;
#include <string.h>
#include <iniparser.h>
-#include "amd_input_private.h"
#include "amd_input_config.h"
+#include "amd_input_private.h"
#define CONFIG_PATH "/usr/share/amd/conf/amd_input.conf"
#define CONFIG_SECTION_NAME "Setting"
+++ /dev/null
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
- *
- * 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.
- */
-
-#pragma once
-
-#include <dlog.h>
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-#define LOG_TAG "AMD_JOB_SCHEDULER"
-
-#ifndef _E
-#define _E LOGE
-#endif
-
-#ifndef _W
-#define _W LOGW
-#endif
-
-#ifndef _I
-#define _I LOGI
-#endif
-
-#ifndef _D
-#define _D LOGD
-#endif
-
-#define EXPORT __attribute__ ((visibility("default")))
#include <aul_job_scheduler.h>
#include <bundle_internal.h>
#include <amd.h>
+#include <amd_mod_common.h>
-#include "amd_job_scheduler_private.h"
-
-#define ARRAY_SIZE(x) ((sizeof(x)) / sizeof(x[0]))
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+#define LOG_TAG "AMD_JOB_SCHEDULER"
struct job_s {
char *id;
+++ /dev/null
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
- *
- * 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.
- */
-
-#pragma once
-
-#include <dlog.h>
-
-#undef LOG_TAG
-#define LOG_TAG "AMD_LAUNCHPAD"
-
-#define EXPORT __attribute__ ((visibility("default")))
--- /dev/null
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+#pragma once
+
+#include <amd_mod_common.h>
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+#define LOG_TAG "AMD_LAUNCHPAD"
#include <dirent.h>
#include <string.h>
#include <unistd.h>
+#include <amd_mod_common.h>
-#include "launchpad-private.h"
#include "launcher_info.h"
+#include "launchpad_private.h"
#define FREE_AND_NULL(x) do { \
if (x) { \
info = calloc(1, sizeof(struct launcher_info_s));
if (info == NULL) {
- LOGE("Out of memory");
+ _E("Out of memory");
return NULL;
}
sscanf(buf, "%ms %ms", &tok1, &tok2);
if (tok1 && strcasecmp(TAG_LAUNCHER, tok1) == 0) {
if (info) {
- LOGD("name: %s, exe: %s", info->name, info->exe);
+ _D("name: %s, exe: %s", info->name, info->exe);
list = g_list_append(list, info);
}
if (strcasecmp(TAG_NAME, tok1) == 0) {
info->name = strdup(tok2);
if (info->name == NULL) {
- LOGE("Out of memory");
+ _E("Out of memory");
__destroy_launcher_info(info);
info = NULL;
break;
} else if (strcasecmp(TAG_EXE, tok1) == 0) {
info->exe = strdup(tok2);
if (info->exe == NULL) {
- LOGE("Out of memory");
+ _E("Out of memory");
__destroy_launcher_info(info);
info = NULL;
break;
}
if (access(info->exe, F_OK | X_OK) != 0) {
- LOGE("Failed to access %s", info->exe);
+ _E("Failed to access %s", info->exe);
__destroy_launcher_info(info);
info = NULL;
}
} else if (strcasecmp(TAG_APP_TYPE, tok1) == 0) {
__parse_app_types(info, &buf[strlen(tok1)]);
if (info->app_types == NULL) {
- LOGE("app_types is NULL");
+ _E("app_types is NULL");
__destroy_launcher_info(info);
info = NULL;
break;
fclose(fp);
if (info) {
- LOGD("name: %s, exe: %s", info->name, info->exe);
+ _D("name: %s, exe: %s", info->name, info->exe);
list = g_list_append(list, info);
}
#include <security-manager.h>
#include <tzplatform_config.h>
#include <trust-anchor.h>
+#include <amd_mod_common.h>
-#include "launchpad-private.h"
#include "launcher_info.h"
+#include "launchpad_private.h"
#define AUL_K_EXEC "__AUL_EXEC__"
#define AUL_K_APPID "__AUL_APPID__"
+++ /dev/null
-/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
- *
- * 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.
- */
-
-#pragma once
-
-#include <dlog.h>
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-#define LOG_TAG "AMD_LOADER_MANAGER"
-
-#ifndef _E
-#define _E LOGE
-#endif
-
-#ifndef _W
-#define _W LOGW
-#endif
-
-#ifndef _I
-#define _I LOGI
-#endif
-
-#ifndef _D
-#define _D LOGD
-#endif
-
-#define EXPORT __attribute__ ((visibility("default")))
-
-#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
#include <aul_cmd.h>
#include <bundle_internal.h>
#include <glib.h>
+#include <amd_mod_common.h>
-#include "amd_loader_manager_private.h"
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+#define LOG_TAG "AMD_LOADER_MANAGER"
#define METADATA_KEY_APP_DEFINED_LOADER \
"http://tizen.org/metadata/app-defined-loader"
+++ /dev/null
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
- *
- * 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.
- */
-
-#pragma once
-
-#include <dlog.h>
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-#define LOG_TAG "AMD_RPC_PORT"
-
-#ifndef _E
-#define _E LOGE
-#endif
-
-#ifndef _W
-#define _W LOGW
-#endif
-
-#ifndef _I
-#define _I LOGI
-#endif
-
-#ifndef _D
-#define _D LOGD
-#endif
-
-#define EXPORT __attribute__ ((visibility("default")))
#include <cert-svc/ccert.h>
#include <cert-svc/cinstance.h>
#include <amd.h>
+#include <amd_mod_common.h>
-#include "amd_rpc_port_private.h"
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+#define LOG_TAG "AMD_RPC_PORT"
-#define ARRAY_SIZE(x) ((sizeof(x)) / sizeof(x[0]))
#define MAX_NR_OF_DESCRIPTORS 2
#define PRIVILEGE_DATASHARING "http://tizen.org/privilege/datasharing"
#define KEY_PRIVILEGE_CHECK_BYPASS \
--- /dev/null
+/*
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+#pragma once
+
+#include <amd_mod_common.h>
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+#define LOG_TAG "AMD_RUA"
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
- *
- * 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.
- */
-
-#pragma once
-
-#include <dlog.h>
-
-#undef LOG_TAG
-#define LOG_TAG "AMD_RUA"
-
-#ifndef _E
-#define _E LOGE
-#endif
-
-#ifndef _W
-#define _W LOGW
-#endif
-
-#ifndef _I
-#define _I LOGI
-#endif
-
-#ifndef _D
-#define _D LOGD
-#endif
-
-#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
-
-#define EXPORT __attribute__ ((visibility("default")))
#include "amd_rua_info.h"
#include "amd_rua_launch_context.h"
#include "amd_rua_image_monitor.h"
-#include "private.h"
+#include "amd_rua_private.h"
#define AUL_SVC_K_LAUNCH_MODE "__APP_SVC_LAUNCH_MODE__"
_rua_info_fini();
_rua_request_fini();
_rua_launch_context_fini();
-}
+}
\ No newline at end of file
#include <amd.h>
#include "amd_rua_image_monitor.h"
-#include "private.h"
+#include "amd_rua_private.h"
#define PATH_RUN "/run"
#define FILE_E_IMG ".e-img"
#include "amd_rua_info.h"
#include "amd_rua_image_monitor.h"
-#include "private.h"
+#include "amd_rua_private.h"
struct rua_info_s {
char *key;
#include <amd.h>
#include "amd_rua_launch_context.h"
-#include "private.h"
+#include "amd_rua_private.h"
#define MULTI_INSTANCE_SHORTCUT "multi-instance-shortcut"
#define QUERY_KEY_ID "id="
#include "amd_rua_request.h"
#include "amd_rua_info.h"
-#include "private.h"
+#include "amd_rua_private.h"
static int __dispatch_update_rua_stat(amd_request_h req)
{
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
- *
- * 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 __SCREEN_RESOLUTION_PRIVATE_H__
-#define __SCREEN_RESOLUTION_PRIVATE_H__
-
-#include <dlog.h>
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-
-#define LOG_TAG "AMD_SCREEN_RESOLUTION"
-
-#ifdef EXPORT
-#undef EXPORT
-#endif
-
-#define EXPORT __attribute__((visibility("default")))
-
-#ifdef ARRAY_SIZE
-#undef ARRAY_SIZE
-#endif
-
-#define ARRAY_SIZE(x) (sizeof(x) / (sizeof(x[0])))
-
-#endif /* __SCREEN_RESOLUTION_PRIVATE_H__ */
#include <stdbool.h>
#include <amd.h>
+#include <amd_mod_common.h>
#include <aul.h>
#include <aul_cmd.h>
#include <bundle_internal.h>
#include <tzplatform_config.h>
#include <tizen-launch-client-protocol.h>
-#include "screen-resolution-private.h"
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+#define LOG_TAG "AMD_SCREEN_RESOLUTION"
struct wayland_context_s {
struct wl_display *display;
+++ /dev/null
-/*
- * Copyright (c) 2016 - 2017 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
- *
- * 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.
- */
-
-#pragma once
-
-#include <dlog.h>
-
-#undef LOG_TAG
-#define LOG_TAG "AMD_SHARE"
-
-#undef EXPORT
-#define EXPORT __attribute__ ((visibility("default")))
-
#include <bundle_internal.h>
#include <tzplatform_config.h>
#include <security-manager.h>
+#include <amd.h>
+#include <amd_mod_common.h>
-#include "amd.h"
-#include "amd_share.h"
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+#define LOG_TAG "AMD_SHARE"
-#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
#define LEGACY_APP_PATH "/opt/usr/apps/"
#define AUL_SVC_K_URI "__APP_SVC_URI__"
#define PRIVILEGE_DATASHARING "http://tizen.org/privilege/datasharing"
char buf[PATH_MAX];
if (stat(path, &path_stat) != 0) {
- LOGE("failed to stat file to share (%s, %d)", path, errno);
+ _E("failed to stat file to share (%s, %d)", path, errno);
return -1;
}
if (!S_ISREG(path_stat.st_mode)) {
- LOGE("file is not a regular file (%s)", path);
+ _E("file is not a regular file (%s)", path);
return -1;
}
h = malloc(sizeof(struct shared_info_main_s));
if (h == NULL) {
- LOGE("Out of memory");
+ _E("Out of memory");
return NULL;
}
h->shared_info = malloc(sizeof(shared_info_t));
if (h->shared_info == NULL) {
- LOGE("Out of memory");
+ _E("Out of memory");
free(h);
return NULL;
}
ret = security_manager_private_sharing_req_new(&h->shared_info->handle);
if (ret != SECURITY_MANAGER_SUCCESS) {
- LOGE("Failed to create private sharing request handle");
+ _E("Failed to create private sharing request handle");
free(h->shared_info);
free(h);
return NULL;
h->shared_info->owner_appid = strdup(owner_appid);
if (h->shared_info->owner_appid == NULL) {
- LOGE("Out of memory");
+ _E("Out of memory");
security_manager_private_sharing_req_free(
h->shared_info->handle);
free(h->shared_info);
h->appid = strdup(appid);
if (h->appid == NULL) {
- LOGE("Out of memory");
+ _E("Out of memory");
free(h->shared_info->owner_appid);
security_manager_private_sharing_req_free(
h->shared_info->handle);
return paths;
if (!path) {
- LOGD("path was null");
+ _D("path was null");
return paths;
}
if (strncmp(path, "file://", 7) == 0) {
path = &path[7];
} else {
- LOGE("file wasn't started with file://");
+ _E("file wasn't started with file://");
return paths;
}
path = __convert_legacy_path(path, uid);
if (__can_share(path, pkgid, uid) != 0) {
- LOGE("__can_share() returned an error");
+ _E("__can_share() returned an error");
free(path);
return paths;
}
path_array = bundle_get_str_array(kb, AUL_SVC_DATA_SELECTED, &len);
if (!path_array || len <= 0) {
- LOGE("path_array was null");
+ _E("path_array was null");
return paths;
}
ai = amd_appinfo_find(uid, owner_appid);
if (ai == NULL) {
- LOGE("appinfo is NULL");
+ _E("appinfo is NULL");
return paths;
}
pkgid = amd_appinfo_get_value(ai, AMD_AIT_PKGID);
if (pkgid == NULL) {
- LOGE("pkgid was null");
+ _E("pkgid was null");
return paths;
}
case BUNDLE_TYPE_STR:
bundle_get_str(kb, AUL_SVC_DATA_PATH, &path);
if (!path) {
- LOGE("path was null");
+ _E("path was null");
break;
}
ai = amd_appinfo_find(uid, owner_appid);
pkgid = amd_appinfo_get_value(ai, AMD_AIT_PKGID);
if (pkgid == NULL) {
- LOGE("pkgid was null");
+ _E("pkgid was null");
break;
}
path = __convert_legacy_path(path, uid);
if (__can_share(path, pkgid, uid) != 0) {
- LOGE("__can_share() returned an error");
+ _E("__can_share() returned an error");
free(path);
break;
}
case BUNDLE_TYPE_STR_ARRAY:
path_array = bundle_get_str_array(kb, AUL_SVC_DATA_PATH, &len);
if (!path_array || len <= 0) {
- LOGE("path_array was null");
+ _E("path_array was null");
break;
}
ai = amd_appinfo_find(uid, owner_appid);
pkgid = amd_appinfo_get_value(ai, AMD_AIT_PKGID);
if (pkgid == NULL) {
- LOGE("pkgid was null");
+ _E("pkgid was null");
break;
}
array = (char **)g_malloc0(sizeof(char *) * (len + 1));
if (array == NULL) {
- LOGE("out of memory");
+ _E("out of memory");
return NULL;
}
while (list) {
array[i] = g_strdup(list->data);
if (array[i] == NULL) {
- LOGE("Out of memory");
+ _E("Out of memory");
g_strfreev(array);
return NULL;
}
if (!paths || !owner_appid)
goto clear;
- LOGD("grant permission %s : %s", owner_appid, appid);
+ _D("grant permission %s : %s", owner_appid, appid);
h = __new_shared_info_handle(appid, uid, owner_appid);
if (h == NULL)
r = security_manager_private_sharing_req_set_owner_appid(
h->shared_info->handle, owner_appid);
if (r != SECURITY_MANAGER_SUCCESS)
- LOGE("Failed to set owner appid(%s) %d", owner_appid, r);
+ _E("Failed to set owner appid(%s) %d", owner_appid, r);
r = security_manager_private_sharing_req_set_target_appid(
h->shared_info->handle, appid);
if (r != SECURITY_MANAGER_SUCCESS)
- LOGE("Failed to set target appid(%s) %d", appid, r);
+ _E("Failed to set target appid(%s) %d", appid, r);
r = security_manager_private_sharing_req_add_paths(
h->shared_info->handle, (const char **)path_array, len);
if (r != SECURITY_MANAGER_SUCCESS)
- LOGE("Failed to add paths %d", r);
+ _E("Failed to add paths %d", r);
- LOGD("security_manager_private_sharing_apply ++");
+ _D("security_manager_private_sharing_apply ++");
r = security_manager_private_sharing_apply(h->shared_info->handle);
- LOGD("security_manager_private_sharing_apply --");
+ _D("security_manager_private_sharing_apply --");
if (r != SECURITY_MANAGER_SUCCESS) {
- LOGE("Failed to apply private sharing %d", r);
+ _E("Failed to apply private sharing %d", r);
__temporary_permission_destroy(h);
h = NULL;
}
return -1;
if (handle->shared_info) { /* back out */
- LOGD("revoke permission %s : %s",
+ _D("revoke permission %s : %s",
handle->shared_info->owner_appid,
handle->appid);
r = security_manager_private_sharing_drop(
handle->shared_info->handle);
if (r != SECURITY_MANAGER_SUCCESS)
- LOGE("revoke error %d", r);
+ _E("revoke error %d", r);
security_manager_private_sharing_req_free(
handle->shared_info->handle);
list = amd_app_status_get_extra(app_status, "share");
if (!list) {
- LOGD("list was null");
+ _D("list was null");
return -1;
}
while (list) {
sit = (shared_info_t *)list->data;
- LOGD("revoke permission %s : %d", sit->owner_appid, pid);
+ _D("revoke permission %s : %d", sit->owner_appid, pid);
r = security_manager_private_sharing_drop(sit->handle);
if (r != SECURITY_MANAGER_SUCCESS)
- LOGE("revoke error %d", r);
+ _E("revoke error %d", r);
security_manager_private_sharing_req_free(sit->handle);
list = g_list_next(list);
}
list = amd_app_status_get_extra(app_status, "share");
if (!list) {
- LOGD("list was null");
+ _D("list was null");
return -1;
}
iter = g_list_next(iter);
if (!strcmp(shared_info->owner_appid, owner_appid)) {
list = g_list_remove(list, shared_info);
- LOGD("Revoke permission %s : %d",
+ _D("Revoke permission %s : %d",
shared_info->owner_appid, pid);
ret = security_manager_private_sharing_drop(shared_info->handle);
if (ret != SECURITY_MANAGER_SUCCESS)
- LOGE("Revoke error %d", ret);
+ _E("Revoke error %d", ret);
security_manager_private_sharing_req_free(shared_info->handle);
free(shared_info->owner_appid);
if (appid) {
__cur_shared_info = __temporary_permission_create(pid, appid, data, uid);
if (__cur_shared_info == NULL)
- LOGD("No sharable path : %d %s", pid, appid);
+ _D("No sharable path : %d %s", pid, appid);
}
return 0;
if (res >= 0) {
ret = __temporary_permission_apply(pid, uid, __cur_shared_info);
if (ret != 0) {
- LOGD("Couldn't apply temporary permission: %d",
+ _D("Couldn't apply temporary permission: %d",
ret);
}
}
__cur_shared_info = __temporary_permission_create(caller_pid,
appid, data, target_uid);
if (__cur_shared_info == NULL)
- LOGW("No sharable path: %d %s", caller_pid, appid);
+ _W("No sharable path: %d %s", caller_pid, appid);
}
return 0;
ret = __temporary_permission_apply(pid, target_uid,
__cur_shared_info);
if (ret < 0)
- LOGD("Couldn't apply temporary permission: %d", ret);
+ _D("Couldn't apply temporary permission: %d", ret);
__temporary_permission_destroy(__cur_shared_info);
__cur_shared_info = NULL;
shared_info_h info = __temporary_permission_create(caller_pid,
callee_appid, data, target_uid);
if (info == NULL) {
- LOGW("No sharable path: %d %s", caller_pid, caller_appid);
+ _W("No sharable path: %d %s", caller_pid, caller_appid);
return -1;
}
callee_pid = amd_app_status_get_pid(callee_app_status);
ret = __temporary_permission_apply(callee_pid, target_uid, info);
if (ret != 0) {
- LOGE("Couldn't apply temporary permission: %d",
+ _E("Couldn't apply temporary permission: %d",
ret);
}
__temporary_permission_destroy(info);
- LOGI("caller(%s), callee(%s), result(%d)",
+ _I("caller(%s), callee(%s), result(%d)",
caller_appid, callee_appid, ret);
return ret;
{
int r;
- LOGD("share init");
+ _D("share init");
r = amd_request_register_cmds(__dispatch_table,
ARRAY_SIZE(__dispatch_table));
if (r < 0) {
- LOGE("Failed to register cmds");
+ _E("Failed to register cmds");
return -1;
}
r = amd_cynara_register_checkers(__cynara_checkers,
ARRAY_SIZE(__cynara_checkers));
if (r < 0) {
- LOGE("Failed to register cynara checkers");
+ _E("Failed to register cynara checkers");
return -1;
}
EXPORT void AMD_MOD_FINI(void)
{
- LOGD("share finish");
+ _D("share finish");
}
+++ /dev/null
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
- *
- * 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.
- */
-
-#pragma once
-
-#include <dlog.h>
-
-#undef LOG_TAG
-#define LOG_TAG "AMD_SPLASH_SCREEN"
-
-#undef EXPORT
-#define EXPORT __attribute__ ((visibility("default")))
-
-#define FREE_AND_NULL(x) \
- do { \
- if (x) { \
- free(x); \
- x = NULL; \
- } \
- } while (0)
-
#include <vconf.h>
#include <sensor_internal.h>
#include <amd.h>
+#include <amd_mod_common.h>
-#include "splash-screen-private.h"
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+#define LOG_TAG "AMD_SPLASH_SCREEN"
#define APP_CONTROL_OPERATION_MAIN "http://tizen.org/appcontrol/operation/main"
#define K_FAKE_EFFECT "__FAKE_EFFECT__"
#define TIZEN_FEATURE_AUTO_ROTATION \
(!(amd_config_get_tizen_profile() & (AMD_TIZEN_PROFILE_TV)))
+#define FREE_AND_NULL(x) \
+ do { \
+ if (x) { \
+ free(x); \
+ x = NULL; \
+ } \
+ } while (0)
+
struct splash_image_s {
struct tizen_launch_splash *image;
char *appid;
app_status = amd_app_status_find_by_pid(si->pid);
if (app_status) {
if (amd_app_status_is_starting(app_status) == false) {
- LOGW("% is not starting", si->pid);
+ _W("% is not starting", si->pid);
return TRUE;
}
}
comp_type = amd_appinfo_get_value(ai, AMD_AIT_COMPTYPE);
if (comp_type == NULL || strcmp(comp_type, APP_TYPE_UI) != 0) {
- LOGD("component_type: %s", comp_type);
+ _D("component_type: %s", comp_type);
return -1;
}
if (TIZEN_FEATURE_CHARGER_STATUS) {
if (rotation.charger_status) {
if (!rotation.initialized && __init_rotation() < 0)
- LOGW("Failed to initialize rotation");
+ _W("Failed to initialize rotation");
}
} else {
if (!rotation.initialized && __init_rotation() < 0)
- LOGW("Failed to initialize rotation");
+ _W("Failed to initialize rotation");
}
- LOGD("angle: %d", rotation.angle);
+ _D("angle: %d", rotation.angle);
image_info = __get_splash_image_info(ai, kb, cmd);
if (image_info) {
si = (struct splash_image_s *)calloc(1, sizeof(struct splash_image_s));
if (si == NULL) {
- LOGE("out of memory");
+ _E("out of memory");
return NULL;
}
si->image = tizen_launch_effect_create_splash_img(
tz_launch_effect);
if (si->image == NULL) {
- LOGE("Failed to get launch image");
+ _E("Failed to get launch image");
free(si);
return NULL;
}
si->src = strdup(src);
if (si->src == NULL) {
- LOGE("out of memory");
+ _E("out of memory");
__splash_screen_destroy_image(si);
return NULL;
}
else
si->effect_type = strdup("launch");
if (si->effect_type == NULL) {
- LOGE("Out of memory");
+ _E("Out of memory");
__splash_screen_destroy_image(si);
return NULL;
}
si->theme_type = strdup("default");
if (si->theme_type == NULL) {
- LOGE("Out of memory");
+ _E("Out of memory");
__splash_screen_destroy_image(si);
return NULL;
}
appid = amd_appinfo_get_value(ai, AMD_AIT_NAME);
si->appid = strdup(appid);
if (si->appid == NULL) {
- LOGE("out of memory");
+ _E("out of memory");
__splash_screen_destroy_image(si);
return NULL;
}
b = bundle_create();
if (!b) {
- LOGE("Out of memory");
+ _E("Out of memory");
return;
}
ret = bundle_encode(b, &raw, &len);
bundle_free(b);
if (ret != BUNDLE_ERROR_NONE) {
- LOGE("Failed to encode bundle. error(%d)", ret);
+ _E("Failed to encode bundle. error(%d)", ret);
return;
}
wl_array_init(&extra_config);
__set_extra_config(&extra_config, si->appid);
- LOGD("src(%s), type(%d), color-depth(%d), rotation(%d), " \
+ _D("src(%s), type(%d), color-depth(%d), rotation(%d), " \
"indicator(%d), effect_type(%s)",
si->src, si->type, si->color_depth, si->rotation,
si->indicator, si->effect_type);
if (si == NULL)
return;
- LOGD("pid(%d)", pid);
+ _D("pid(%d)", pid);
si->pid = pid;
tizen_launch_splash_owner(si->image, pid);
wl_display_flush(display);
b = bundle_create();
if (b == NULL) {
- LOGE("out of memory");
+ _E("out of memory");
return;
}
bundle_add(b, AUL_K_APPID, appid);
ret = bundle_encode(b, &raw_data, &len);
if (ret != BUNDLE_ERROR_NONE) {
- LOGE("Failed to encode bundle");
+ _E("Failed to encode bundle");
bundle_free(b);
return;
}
memcpy(data, raw_data, size + 1);
free(raw_data);
- LOGD("effect_type(%s), pid(%d)", effect_type, pid);
+ _D("effect_type(%s), pid(%d)", effect_type, pid);
tizen_launch_effect_type_set(tz_launch_effect, effect_type,
pid, &options);
wl_display_flush(display);
if (!display) {
display = amd_wayland_get_display();
if (!display) {
- LOGE("Failed to get display");
+ _E("Failed to get display");
return -1;
}
}
if (!tz_launch_effect) {
- LOGE("Failed to bind tizen launch screen");
+ _E("Failed to bind tizen launch screen");
return -1;
}
break;
}
- LOGD("angle: %d", rotation.angle);
+ _D("angle: %d", rotation.angle);
}
static void __auto_rotate_screen_cb(keynode_t *key, void *data)
{
rotation.auto_rotate = vconf_keynode_get_bool(key);
if (!rotation.auto_rotate) {
- LOGD("auto_rotate: %d, angle: %d",
+ _D("auto_rotate: %d, angle: %d",
rotation.auto_rotate, rotation.angle);
}
}
if (!rotation.sensor) {
rotation.sensor = sensord_get_sensor(AUTO_ROTATION_SENSOR);
if (!rotation.sensor) {
- LOGE("Failed to get sensor. errno(%d)", errno);
+ _E("Failed to get sensor. errno(%d)", errno);
return -1;
}
}
rotation.angle = 0;
rotation.handle = sensord_connect(rotation.sensor);
if (rotation.handle < 0) {
- LOGW("Failed to connect sensord");
+ _W("Failed to connect sensord");
return -1;
}
__rotation_changed_cb,
NULL);
if (!r) {
- LOGW("Failed to register event");
+ _W("Failed to register event");
sensord_disconnect(rotation.handle);
return -1;
}
r = sensord_start(rotation.handle, 0);
if (!r) {
- LOGW("Failed to start sensord");
+ _W("Failed to start sensord");
sensord_unregister_event(rotation.handle,
AUTO_ROTATION_CHANGE_STATE_EVENT);
sensord_disconnect(rotation.handle);
ret = vconf_notify_key_changed(VCONFKEY_SETAPPL_AUTO_ROTATE_SCREEN_BOOL,
__auto_rotate_screen_cb, NULL);
if (ret != 0) {
- LOGW("Failed to register callback for %s",
+ _W("Failed to register callback for %s",
VCONFKEY_SETAPPL_AUTO_ROTATE_SCREEN_BOOL);
}
rotation.initialized = true;
info = (struct image_info_s *)calloc(1, sizeof(struct image_info_s));
if (info == NULL) {
- LOGE("out of memory");
+ _E("out of memory");
return NULL;
}
else
info->type = strdup("img");
if (info->type == NULL) {
- LOGE("Out of memory");
+ _E("Out of memory");
return -1;
}
}
if (!info->indicator_display) {
info->indicator_display = strdup("true");
if (info->indicator_display == NULL) {
- LOGE("Out of memory");
+ _E("Out of memory");
return -1;
}
}
if (!info->color_depth) {
info->color_depth = strdup("24");
if (info->color_depth == NULL) {
- LOGE("Out of memory");
+ _E("Out of memory");
return -1;
}
}
cur_splash_image = NULL;
if (bundle_get_val(kb, AUL_K_MULTI_INSTANCE_SHORTCUT)) {
- LOGW("Multiple instance shortcut");
+ _W("Multiple instance shortcut");
return 0;
}
if (amd_launch_context_is_bg_launch(h)) {
- LOGW("Background launch");
+ _W("Background launch");
return 0;
}
tz_launch_effect_id = id;
tz_launch_effect = wl_registry_bind(registry, id,
&tizen_launch_effect_interface, 1);
- LOGD("tz_launch_effect(%p)", tz_launch_effect);
+ _D("tz_launch_effect(%p)", tz_launch_effect);
}
return 0;
tz_launch_effect = NULL;
tz_launch_effect_id = 0;
splash_screen_initialized = 0;
- LOGW("tizen launch effect is destroyed");
+ _W("tizen launch effect is destroyed");
}
return 0;
rotation.charger_status = vconf_keynode_get_int(keynode);
if (rotation.charger_status) {
if (__init_rotation() < 0)
- LOGW("Failed to initialize rotation");
+ _W("Failed to initialize rotation");
} else {
__fini_rotation();
}
- LOGD("charger status(%d)", rotation.charger_status);
+ _D("charger status(%d)", rotation.charger_status);
}
}
r = vconf_get_int(VCONFKEY_SYSMAN_CHARGER_STATUS,
&rotation.charger_status);
if (r < 0) {
- LOGW("Failed to get charger status");
+ _W("Failed to get charger status");
return G_SOURCE_CONTINUE;
}
r = vconf_notify_key_changed(VCONFKEY_SYSMAN_CHARGER_STATUS,
__charger_status_changed_cb, NULL);
if (r < 0) {
- LOGW("Failed to register vconf cb");
+ _W("Failed to register vconf cb");
return G_SOURCE_CONTINUE;
}
if (rotation.charger_status) {
if (__init_rotation() < 0)
- LOGW("Failed to initialize rotation");
+ _W("Failed to initialize rotation");
}
} else {
if (__init_rotation() < 0)
- LOGW("Failed to initialize rotation");
+ _W("Failed to initialize rotation");
}
rotation.timer = 0;
EXPORT int AMD_MOD_INIT(void)
{
- LOGD("splash screen init");
+ _D("splash screen init");
__load_splash_screen_info(SPLASH_SCREEN_INFO_PATH);
EXPORT void AMD_MOD_FINI(void)
{
- LOGD("splash screen finish");
+ _D("splash screen finish");
if (rotation.timer)
g_source_remove(rotation.timer);
--- /dev/null
+/*
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+#pragma once
+
+#include <amd_mod_common.h>
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+
+#define LOG_TAG "AMD_APP_GROUP"
#include <aul.h>
#include <aul_sock.h>
#include <aul_screen_connector.h>
+#include <amd.h>
+#include <amd_mod_common.h>
-#include "amd.h"
#include "amd_screen_connector.h"
#include "app_group.h"
#include "status.h"
#define SUSPEND_INTERVAL 5 /* sec */
+
+#ifdef LOG_TAG
#undef LOG_TAG
+#endif
#define LOG_TAG "AMD_SCREEN_CONNECTOR"
-#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
struct app_screen_s {
char *appid;
app_screen = calloc(1, sizeof(struct app_screen_s));
if (app_screen == NULL) {
- LOGE("out of memory");
+ _E("out of memory");
return NULL;
}
app_screen->appid = strdup(appid);
if (app_screen->appid == NULL) {
- LOGE("out of memory");
+ _E("out of memory");
free(app_screen);
return NULL;
}
app_screen->instance_id = strdup(instance_id);
if (app_screen->instance_id == NULL) {
- LOGE("out of memory");
+ _E("out of memory");
free(app_screen->appid);
free(app_screen);
return NULL;
viewer_info = calloc(1, sizeof(struct viewer_info_s));
if (viewer_info == NULL) {
- LOGE("out of memory");
+ _E("out of memory");
return NULL;
}
user_info = malloc(sizeof(struct user_info_s));
if (user_info == NULL) {
- LOGE("out of memory");
+ _E("out of memory");
return NULL;
}
b = bundle_create();
if (b == NULL) {
- LOGE("out of memory");
+ _E("out of memory");
return NULL;
}
b = __create_bundle(app_screen, event);
if (b == NULL) {
- LOGE("out of memory");
+ _E("out of memory");
return;
}
node = __find_app_group_node_by_pid(pids[i]);
wid = (unsigned int)_app_group_node_get_window(node);
if (wid == surf) {
- LOGD("pid(%d), surf(%u)", pids[i], surf);
+ _D("pid(%d), surf(%u)", pids[i], surf);
pid = pids[i];
}
}
return FALSE;
ret = amd_suspend_update_status(pid, AMD_SUSPEND_STATUS_INCLUDE);
- LOGD("pid(%d), result(%d)", pid, ret);
+ _D("pid(%d), result(%d)", pid, ret);
return FALSE;
}
b = bundle_create();
if (b == NULL) {
- LOGE("out of memory");
+ _E("out of memory");
return -1;
}
&status, sizeof(aul_screen_status_e));
amd_app_com_send(provider_appid, viewer_pid, b, viewer_uid);
bundle_free(b);
- LOGD("send viewer status to %s(%d)", provider_appid, status);
+ _D("send viewer status to %s(%d)", provider_appid, status);
return 0;
}
if (status != AUL_SCREEN_STATUS_PRE_RESUME)
viewer_info->status = status;
else
- LOGW("pre resume status will not be stored as a viewer status");
+ _W("pre resume status will not be stored as a viewer status");
found = g_list_find_custom(user_info->app_screen_list,
GUINT_TO_POINTER(surf), __compare_app_screen_surf);
* viewer pause event to provider
*/
send_pause = false;
- LOGW("Skip pause : viewer pid(%d), status(%d)",
+ _W("Skip pause : viewer pid(%d), status(%d)",
viewer_info->pid, viewer_info->status);
break;
}
__send_viewer_visibility_to_provider(app_screen->appid, status,
pid, uid);
} else {
- LOGW("Unknown status(%d)", status);
+ _W("Unknown status(%d)", status);
}
return 0;
ret = aul_sock_send_raw(pid, uid, APP_UPDATE_REQUESTED,
(unsigned char *)&dummy, 0, AUL_SOCK_NOREPLY);
if (ret < 0) {
- LOGE("Failed to send the update request");
+ _E("Failed to send the update request");
amd_suspend_update_status(pid, AMD_SUSPEND_STATUS_INCLUDE);
return -1;
}
g_timeout_add_seconds(SUSPEND_INTERVAL, __suspend_timer,
GINT_TO_POINTER(pid));
- LOGD("pid(%d), uid(%d)", pid, uid);
+ _D("pid(%d), uid(%d)", pid, uid);
return 0;
}
app_status = amd_app_status_find_by_pid(pid);
if (app_status == NULL) {
- LOGW("Failed to find app status info - pid(%d), uid(%d)",
+ _W("Failed to find app status info - pid(%d), uid(%d)",
pid, uid);
return -1;
}
if (found) {
app_screen = (struct app_screen_s *)found->data;
if (app_screen->surf == surf) {
- LOGD("Already exists");
+ _D("Already exists");
return 0;
}
app_screen->surf = surf;
g_list_foreach(user_info->screen_viewer_list,
__send_app_screen_updated, app_screen);
- LOGW("surf is changed to %u", surf);
+ _W("surf is changed to %u", surf);
return 0;
}
app_screen);
g_list_foreach(user_info->screen_viewer_list,
__send_app_screen_added, app_screen);
- LOGD("pid(%d), appid(%s), surf(%d), uid(%d)", pid, appid, surf, uid);
+ _D("pid(%d), appid(%s), surf(%d), uid(%d)", pid, appid, surf, uid);
return 0;
}
app_status = amd_app_status_find_by_pid(pid);
if (app_status == NULL) {
- LOGW("Failed to find app status info - pid(%d), uid(%d)",
+ _W("Failed to find app status info - pid(%d), uid(%d)",
pid, uid);
return -1;
}
if (user_info->last_focused_app_screen == app_screen)
user_info->last_focused_app_screen = NULL;
- LOGD("pid(%d), instance_id(%s)", pid, instance_id);
+ _D("pid(%d), instance_id(%s)", pid, instance_id);
return 0;
}
app_status = amd_app_status_find_by_pid(pid);
if (app_status == NULL) {
- LOGW("Failed to find app status info - pid(%d), uid(%d)",
+ _W("Failed to find app status info - pid(%d), uid(%d)",
pid, uid);
return -1;
}
app_screen->surf = surf;
g_list_foreach(user_info->screen_viewer_list,
__send_app_screen_updated, app_screen);
- LOGD("pid(%d), appid(%s), surf(%d), uid(%d)", pid, appid, surf, uid);
+ _D("pid(%d), appid(%s), surf(%d), uid(%d)", pid, appid, surf, uid);
return 0;
}
app_status = amd_app_status_find_by_pid(pid);
if (app_status == NULL) {
- LOGW("Failed to find app status info - pid(%d), uid(%d)",
+ _W("Failed to find app status info - pid(%d), uid(%d)",
pid, uid);
return -1;
}
g_list_foreach(user_info->screen_viewer_list,
__send_app_screen_focused, app_screen);
- LOGD("focus pid(%d), appid(%s), surf(%d), uid(%d)", pid, appid, surf, uid);
+ _D("focus pid(%d), appid(%s), surf(%d), uid(%d)", pid, appid, surf, uid);
return 0;
}
app_screen = (struct app_screen_s *)iter->data;
iter = g_list_next(iter);
if (app_screen && app_screen->pid == pid) {
- LOGD("pid(%d), surf(%d)", pid, app_screen->surf);
+ _D("pid(%d), surf(%d)", pid, app_screen->surf);
g_list_foreach(user_info->screen_viewer_list,
__send_app_screen_removed, app_screen);
user_info->app_screen_list = g_list_remove(
user_info = g_hash_table_lookup(user_table, GUINT_TO_POINTER(uid));
if (user_info == NULL) {
- LOGW("user info is empty");
+ _W("user info is empty");
return -1;
}
list = g_list_find_custom(user_info->screen_viewer_list, viewer_info,
__compare_viewers);
if (list) {
- LOGD("Already exists");
+ _D("Already exists");
__destroy_viewer_info(viewer_info);
return 0;
}
g_list_foreach(user_info->app_screen_list,
__foreach_app_screen_list, viewer_info);
- LOGD("pid(%d), screen_type(%d), private(%d), ref(%u), uid(%d)",
+ _D("pid(%d), screen_type(%d), private(%d), ref(%u), uid(%d)",
pid, screen_type, priv, ref, uid);
return 0;
user_info = g_hash_table_lookup(user_table, GUINT_TO_POINTER(uid));
if (user_info == NULL) {
- LOGW("user info is empty");
+ _W("user info is empty");
return -1;
}
}
}
- LOGD("pid(%d), screen_type(%d), private(%d), ref(%u) uid(%d)",
+ _D("pid(%d), screen_type(%d), private(%d), ref(%u) uid(%d)",
pid, screen_type, priv, ref, uid);
return 0;
user_info = g_hash_table_lookup(user_table, GUINT_TO_POINTER(uid));
if (user_info == NULL) {
- LOGW("user info is empty");
+ _W("user info is empty");
return -1;
}
user_info = g_hash_table_lookup(user_table, GUINT_TO_POINTER(uid));
if (user_info) {
- LOGE("Already exists");
+ _E("Already exists");
return 0;
}
surf = atol(value);
ret = _screen_connector_add_app_screen(pid, surf,
instance_id, uid);
- LOGD("pid(%d), surf(%d), instance_id(%s), result(%d)",
+ _D("pid(%d), surf(%d), instance_id(%s), result(%d)",
pid, surf, instance_id, ret);
return 0;
instance_id = bundle_get_val(b, AUL_K_INSTANCE_ID);
ret = __screen_connector_remove_app_screen(pid,
instance_id, uid);
- LOGD("pid(%d), instance_id(%s), result(%d)",
+ _D("pid(%d), instance_id(%s), result(%d)",
pid, instance_id, ret);
return 0;
instance_id = bundle_get_val(b, AUL_K_INSTANCE_ID);
ret = __screen_connector_send_update_request(appid, instance_id, uid);
- LOGD("appid(%s), instance_id(%s), caller_pid(%d), result(%d)",
+ _D("appid(%s), instance_id(%s), caller_pid(%d), result(%d)",
appid, instance_id, caller_pid, ret);
return 0;
ret = __screen_connector_add_screen_viewer(pid, screen_type,
priv, ref, uid);
- LOGD("pid(%d), screen_type(%d), private(%d), result(%d)",
+ _D("pid(%d), screen_type(%d), private(%d), result(%d)",
pid, screen_type, priv, ret);
return 0;
ret = __screen_connector_remove_screen_viewer(pid, screen_type,
priv, ref, uid);
- LOGD("pid(%d), screen_type(%d), private(%d), result(%d)",
+ _D("pid(%d), screen_type(%d), private(%d), result(%d)",
pid, screen_type, priv, ret);
return 0;
int type;
if (b == NULL) {
- LOGE("Empty bundle data !!");
+ _E("Empty bundle data !!");
return -1;
}
type_str = bundle_get_val(b, AUL_K_SCREEN_TYPE);
if (type_str == NULL) {
- LOGE("Cannot get screen type !!");
+ _E("Cannot get screen type !!");
return -1;
}
bundle_get_byte(b, "__AUL_SC_SURFACE__", (void **)&surf, &size);
if (surf == NULL) {
- LOGE("Failed to get surface");
+ _E("Failed to get surface");
amd_request_send_result(req, -1);
return -1;
}
appid = __screen_connector_get_appid_by_surface_id(*surf, uid);
if (appid == NULL) {
- LOGE("Failed to get appid");
+ _E("Failed to get appid");
amd_request_send_result(req, -1);
return -1;
}
ret_b = bundle_create();
if (ret_b == NULL) {
- LOGE("Out of memory");
+ _E("Out of memory");
amd_request_send_result(req, -1);
return -1;
}
bundle_get_byte(b, "__AUL_SC_SURFACE__", (void **)&surf, &size);
if (surf == NULL) {
- LOGE("Failed to get surface");
+ _E("Failed to get surface");
amd_request_send_result(req, -1);
return -1;
}
instance_id = __screen_connector_get_instance_id_by_surface_id(*surf,
uid);
if (instance_id == NULL) {
- LOGE("Failed to get instance_id");
+ _E("Failed to get instance_id");
amd_request_send_result(req, -1);
return -1;
}
ret_b = bundle_create();
if (ret_b == NULL) {
- LOGE("Out of memory");
+ _E("Out of memory");
amd_request_send_result(req, -1);
return -1;
}
return -1;
if (user_info->last_focused_app_screen == NULL) {
- LOGE("requested bad focused screen");
+ _E("requested bad focused screen");
return -1;
}
val = bundle_get_val(b, "__AUL_SC_VIEWER_STATUS__");
if (val == NULL || !isdigit(*val)) {
- LOGE("Failed to get viewer status");
+ _E("Failed to get viewer status");
amd_request_send_result(req, -1);
return -1;
}
val = bundle_get_val(b, AUL_K_WID);
if (val == NULL || !isdigit(*val)) {
- LOGE("Failed to get surface id");
+ _E("Failed to get surface id");
amd_request_send_result(req, -1);
return -1;
}
{
int r;
- LOGD("screen connector init");
+ _D("screen connector init");
user_table = g_hash_table_new_full(g_direct_hash, g_direct_equal,
NULL, __destroy_user_info);
if (user_table == NULL) {
- LOGE("Failed to create user table");
+ _E("Failed to create user table");
return -1;
}
r = amd_request_register_cmds(__dispatch_table,
ARRAY_SIZE(__dispatch_table));
if (r < 0) {
- LOGE("Failed to register cmds");
+ _E("Failed to register cmds");
return -1;
}
r = amd_cynara_register_checkers(__cynara_checkers,
ARRAY_SIZE(__cynara_checkers));
if (r < 0) {
- LOGE("Failed to register checkers");
+ _E("Failed to register checkers");
return -1;
}
void _screen_connector_fini(void)
{
- LOGD("screen connector fini");
+ _D("screen connector fini");
if (user_table)
g_hash_table_destroy(user_table);
#include <aul_sock.h>
#include <system_info.h>
#include <aul_comp_types.h>
-
#include <amd.h>
#include "amd_screen_connector.h"
#include "app_group.h"
#include "app_group_wayland.h"
#include "app_group_request.h"
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-
-#define LOG_TAG "AMD_APP_GROUP"
+#include "app_group_private.h"
#define APP_SVC_K_LAUNCH_MODE "__APP_SVC_LAUNCH_MODE__"
#define STATUS_FOREGROUND "fg"
ctx = calloc(1, sizeof(struct app_group_context_s));
if (!ctx) {
- LOGE("Out of memory");
+ _E("Out of memory");
return NULL;
}
ctx->id = strdup(id);
if (!ctx->id) {
- LOGE("Failed to duplicate ID(%s)", id);
+ _E("Failed to duplicate ID(%s)", id);
free(ctx);
return NULL;
}
ctx->caller_id = strdup(caller_id ? caller_id : "NULL");
if (!ctx->caller_id) {
- LOGE("Failed to duplicate caller ID(%s)", caller_id);
+ _E("Failed to duplicate caller ID(%s)", caller_id);
__destroy_app_group_context(ctx);
return NULL;
}
group = calloc(1, sizeof(struct app_group_s));
if (!group) {
- LOGE("Out of memory");
+ _E("Out of memory");
return NULL;
}
group->leader_id = strdup(leader_id);
if (!group->leader_id) {
- LOGE("Failed to duplicate leader ID");
+ _E("Failed to duplicate leader ID");
free(group);
return NULL;
}
app_status = amd_app_status_find_by_effective_pid(pid);
if (!app_status) {
- LOGE("Failed to find app status. pid(%d)", pid);
+ _E("Failed to find app status. pid(%d)", pid);
return NULL;
}
app_type = amd_app_status_get_app_type(app_status);
if (app_type == AMD_AT_COMPONENT_BASED_APP) {
- LOGE("The type of the application(%d) is component-based", pid);
+ _E("The type of the application(%d) is component-based", pid);
return NULL;
}
GList *iter;
if (!id) {
- LOGE("Invalid parameter");
+ _E("Invalid parameter");
return NULL;
}
GList *iter;
if (!id) {
- LOGE("Invalid parameter");
+ _E("Invalid parameter");
return NULL;
}
amd_comp_status_h comp = NULL;
if (!node) {
- LOGE("Invalid parameter");
+ _E("Invalid parameter");
return -1;
}
new_ctx = __create_app_group_context(ctx->pid, ctx->id, ctx->caller_pid,
ctx->caller_id, ctx->launch_mode, ctx->can_shift, true);
if (!new_ctx) {
- LOGE("Failed to create app group context. %s:%d",
+ _E("Failed to create app group context. %s:%d",
ctx->id, ctx->pid);
return NULL;
}
ctx = (struct app_group_context_s *)node->data;
if (!ctx) {
- LOGE("App group context is nullptr");
+ _E("App group context is nullptr");
return false;
}
if (node) {
ctx = (struct app_group_context_s *)node->data;
if (ctx && ctx->can_be_leader) {
- LOGW("Sencond leader. leader_id(%s), id(%s)",
+ _W("Sencond leader. leader_id(%s), id(%s)",
id, ctx->id);
return node;
}
ctx = (struct app_group_context_s *)node->data;
if (!ctx) {
- LOGE("App group context is nullptr");
+ _E("App group context is nullptr");
return;
}
group = _app_group_find(ctx->id);
if (!group) {
- LOGE("Failed to find app group. %s", ctx->id);
+ _E("Failed to find app group. %s", ctx->id);
return;
}
if (!next_wid)
return;
- LOGD("Reroute");
+ _D("Reroute");
_app_group_wayland_attach_window(prev_wid, next_wid);
}
ctx = (struct app_group_context_s *)node->data;
if (!ctx) {
- LOGE("App group context is nullptr");
+ _E("App group context is nullptr");
return;
}
if (__app_group_node_is_leader(node)) {
- LOGW("App group leader. %s:%d", ctx->id, ctx->pid);
+ _W("App group leader. %s:%d", ctx->id, ctx->pid);
if (!__app_group_node_find_second_leader(ctx->id)) {
_app_group_node_clear_top(node, uid);
__app_group_node_remove(node);
__app_group_node_remove_leader(ctx->id);
}
} else if (__app_group_node_is_sub(node)) {
- LOGW("App group Sub. %s:%d", ctx->id, ctx->pid);
+ _W("App group Sub. %s:%d", ctx->id, ctx->pid);
caller_id = __app_group_node_get_next_caller_id(node);
if (__app_group_node_can_reroute(node) ||
(caller_id && strcmp(caller_id, ctx->id) != 0)) {
- LOGW("App group reroute");
+ _W("App group reroute");
__app_group_node_reroute(node);
} else {
- LOGW("App group clear top");
+ _W("App group clear top");
_app_group_node_clear_top(node, uid);
}
__app_group_node_remove(node);
int pos = -1;
if (!id || !leader_id) {
- LOGE("Invalid parameter");
+ _E("Invalid parameter");
return NULL;
}
ctx = __create_app_group_context(pid, id, caller_pid, caller_id,
launch_mode, can_shift, recycle);
if (!ctx) {
- LOGE("Failed to create app group context. %s:%d",
+ _E("Failed to create app group context. %s:%d",
id, pid);
return NULL;
}
if (!found) {
group = __create_app_group(leader_id, leader_pid);
if (!group) {
- LOGE("Failed to create app group. %s:%d",
+ _E("Failed to create app group. %s:%d",
leader_id, leader_pid);
__destroy_app_group_context(ctx);
return NULL;
node = g_list_find_custom(group->list, id, __compare_context_id);
if (node) {
- LOGE("Already exists. %s:%d", id, pid);
+ _E("Already exists. %s:%d", id, pid);
__destroy_app_group_context(ctx);
return NULL;
}
struct app_group_context_s *ctx;
int before_wid = 0;
- LOGD("app_group_start");
+ _D("app_group_start");
caller_pid = __get_caller_pid(b);
caller_id = __get_caller_id(b);
pkgid = amd_appinfo_get_value(ai, AMD_AIT_PKGID);
comp_type = amd_appinfo_get_value(ai, AMD_AIT_COMPTYPE);
- LOGD("Send BG signal %s:%s", appid, comp_type);
+ _D("Send BG signal %s:%s", appid, comp_type);
aul_send_app_status_change_signal(ctx->pid, appid, pkgid,
STATUS_BACKGROUND, comp_type);
amd_app_status_find_service_apps(app_status, STATUS_BG,
app_group_node_h caller_node;
if (!id || !b) {
- LOGE("Invalid parameter");
+ _E("Invalid parameter");
return;
}
_app_group_wayland_attach_window(caller_wid,
ctx->wid);
} else {
- LOGE("Invalid caller window id");
+ _E("Invalid caller window id");
}
}
}
if (!found) {
group = __create_app_group(ctx->id, ctx->pid);
if (!group) {
- LOGE("Failed to create app group. %s:%d",
+ _E("Failed to create app group. %s:%d",
ctx->id, ctx->pid);
__app_group_context_do_recycle(ctx);
return;
ret = aul_sock_send_raw(pid, uid, APP_SUSPEND, (unsigned char *)&dummy,
sizeof(int), AUL_SOCK_NOREPLY);
if (ret < 0) {
- LOGE("Failed to send suspend signal. pid(%d), result(%d)",
+ _E("Failed to send suspend signal. pid(%d), result(%d)",
pid, ret);
}
- LOGD("[__APP_SUSPEND__] pid: %d, uid: %d", pid, uid);
+ _D("[__APP_SUSPEND__] pid: %d, uid: %d", pid, uid);
}
static void __prepare_to_suspend(int pid, uid_t uid)
ret = aul_sock_send_raw(pid, uid, APP_WAKE, (unsigned char *)&dummy,
sizeof(int), AUL_SOCK_NOREPLY);
if (ret < 0) {
- LOGE("Failed to send wake signal. pid(%d), result(%d)",
+ _E("Failed to send wake signal. pid(%d), result(%d)",
pid, ret);
}
- LOGD("[__APP_WAKE__] pid: %d, uid: %d", pid, uid);
+ _D("[__APP_WAKE__] pid: %d, uid: %d", pid, uid);
}
static void __app_group_send_status(pid_t pid, bool flag, bool force, bool self)
app_status = amd_app_status_find_by_effective_pid(pid);
if (!app_status) {
- LOGE("Failed to find app status. pid(%d)", pid);
+ _E("Failed to find app status. pid(%d)", pid);
return;
}
ai = amd_appinfo_find(uid, appid);
if (!ai) {
- LOGE("Failed to find appinfo. %s:%d", appid, uid);
+ _E("Failed to find appinfo. %s:%d", appid, uid);
return;
}
bg_allowed = amd_suspend_is_allowed_background(ai);
excluded = amd_suspend_is_excluded(pid);
- LOGD("Send %s signal %s", flag ? "FG" : "BG", appid);
+ _D("Send %s signal %s", flag ? "FG" : "BG", appid);
aul_send_app_status_change_signal(pid, appid, pkgid,
flag ? STATUS_FOREGROUND : STATUS_BACKGROUND,
APP_TYPE_UI);
switch (*launch_mode) {
case APP_GROUP_LAUNCH_MODE_CALLER:
- LOGD("Launch mode is caller");
+ _D("Launch mode is caller");
str = bundle_get_val(b, APP_SVC_K_LAUNCH_MODE);
if (str && !strcmp(str, "group"))
return true;
if (size > 0) {
leader_pids = (pid_t *)calloc(size, sizeof(pid_t));
if (!leader_pids) {
- LOGE("Out of memory");
+ _E("Out of memory");
return;
}
leader_ids = (char **)calloc(size + 1, sizeof(char *));
if (!leader_ids) {
- LOGE("Out of memory");
+ _E("Out of memory");
return NULL;
}
group_pids = calloc(size, sizeof(pid_t));
if (!group_pids) {
- LOGE("Out of memory");
+ _E("Out of memory");
return;
}
if (!ctx->group_sig && leader_pid != pid) {
app_status = amd_app_status_find_by_pid(pid);
pkgid = amd_app_status_get_pkgid(app_status);
- LOGD("Send group signal %d", pid);
+ _D("Send group signal %d", pid);
aul_send_app_group_signal(leader_pid, pid,
pkgid);
ctx->group_sig = true;
if (!caller_id) {
caller_id = _app_group_get_id(caller_pid);
if (!caller_id) {
- LOGE("Failed to get caller id. %d", caller_pid);
+ _E("Failed to get caller id. %d", caller_pid);
ret = -1;
goto end;
}
node = _app_group_node_find(caller_id);
caller_wid = _app_group_node_get_window(node);
if (caller_wid == 0) {
- LOGW("Caller(%d) window isn't ready",
+ _W("Caller(%d) window isn't ready",
caller_pid);
if (__app_group_can_be_leader(b))
*can_attach = false;
*can_attach = true;
}
} else {
- LOGE("Cannot find leader pid");
+ _E("Cannot find leader pid");
if (__app_group_can_be_leader(b)) {
*can_attach = false;
} else {
__launch_context.leader_pid = *leader_pid;
__launch_context.leader_id = leader_id;
- LOGW("[__APP_GROUP__] can_attach(%d), mode(%d), leader(%s:%d)",
+ _W("[__APP_GROUP__] can_attach(%d), mode(%d), leader(%s:%d)",
__launch_context.can_attach,
__launch_context.mode,
__launch_context.leader_id ? __launch_context.leader_id : "null",
idle_pids = calloc(size, sizeof(pid_t));
if (!idle_pids) {
- LOGE("Out of memory");
+ _E("Out of memory");
return;
}
ret = __app_group_can_start(appid, kb, &can_attach,
&leader_pid, &launch_mode, uid);
if (ret != 0) {
- LOGE("Can't make group info");
+ _E("Can't make group info");
return -1;
}
if (can_attach && leader_pid == -1) {
- LOGE("Can't launch singleton app in the same group");
+ _E("Can't launch singleton app in the same group");
return -1;
}
}
}
if (!id) {
- LOGE("Failed to get id. pid(%d)", pid);
+ _E("Failed to get id. pid(%d)", pid);
return AMD_NOTI_CONTINUE;
}
ret = amd_comp_status_set_leader_id(comp_status,
__launch_context.leader_id);
if (ret < 0) {
- LOGE("Fail to set leader id (%s)",
+ _E("Fail to set leader id (%s)",
__launch_context.leader_id);
}
}
bundle_add(kb, AUL_K_NEW_INSTANCE, "true");
}
} else {
- LOGW("Wrong request");
+ _W("Wrong request");
bundle_del(kb, AUL_K_INSTANCE_ID);
}
{
int r;
- LOGD("app group init");
+ _D("app group init");
r = _app_group_wayland_init();
if (r < 0) {
- LOGE("Failed to initialize app group wayland");
+ _E("Failed to initialize app group wayland");
return -1;
}
r = _app_group_request_init();
if (r < 0) {
- LOGE("Failed to initialize app group request");
+ _E("Failed to initialize app group request");
return -1;
}
if (__recycle_bin)
g_list_free_full(__recycle_bin, __destroy_app_group_context);
- LOGD("app group fini");
+ _D("app group fini");
}
#include <bundle_internal.h>
#include <aul_sock.h>
#include <system_info.h>
+#include <amd.h>
-#include "amd.h"
#include "amd_screen_connector.h"
#include "app_group.h"
#include "app_group_request.h"
#include "app_group_wayland.h"
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-
-#define LOG_TAG "AMD_APP_GROUP"
-
-#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
+#include "app_group_private.h"
static app_group_h __find_app_group_by_pid(pid_t pid)
{
app_status = amd_app_status_find_by_appid(appid, uid);
if (!app_status) {
- LOGE("Failed to find app status. appid(%s)", appid);
+ _E("Failed to find app status. appid(%s)", appid);
return 0;
}
b = amd_request_get_bundle(req);
if (!b) {
- LOGE("Failed to get bundle");
+ _E("Failed to get bundle");
amd_request_send_result(req, -1);
return -1;
}
pid = atoi(pid_str);
if (pid <= 1) {
- LOGE("Invalid process ID(%d)", pid);
+ _E("Invalid process ID(%d)", pid);
amd_request_send_result(req, -1);
return -1;
}
node = __find_app_group_node_by_pid(pid);
if (!node) {
- LOGE("Failed to find app group node. pid(%d)", pid);
+ _E("Failed to find app group node. pid(%d)", pid);
amd_request_send_result(req, -1);
return -1;
}
wid = _app_group_node_get_window(node);
if (wid <= 0)
- LOGE("Failed to get window");
+ _E("Failed to get window");
amd_request_send_result(req, wid);
- LOGI("pid(%d), wid(%u)", pid, wid);
+ _I("pid(%d), wid(%u)", pid, wid);
return 0;
}
b = amd_request_get_bundle(req);
if (!b) {
- LOGE("Failed to get bundle");
+ _E("Failed to get bundle");
return -1;
}
wid = atoi(wid_str);
if (wid <= 0) {
- LOGE("Failed to get window ID");
+ _E("Failed to get window ID");
return -1;
}
node = __find_app_group_node_by_pid(pid);
if (!node) {
- LOGE("Failed to find app group node. pid(%d)", pid);
+ _E("Failed to find app group node. pid(%d)", pid);
return -1;
}
ret = _app_group_node_set_window(node, wid);
if (ret < 0) {
- LOGE("Failed to set window. pid(%d), wid(%d)",
+ _E("Failed to set window. pid(%d), wid(%d)",
pid, wid);
return -1;
}
_screen_connector_add_app_screen(pid, wid, NULL, uid);
amd_noti_send(AMD_NOTI_MSG_APP_GROUP_WINDOW_SET, pid, wid, NULL, NULL);
- LOGI("pid(%d), wid(%d), result(%d)", pid, wid, ret);
+ _I("pid(%d), wid(%d), result(%d)", pid, wid, ret);
return ret;
}
b = amd_request_get_bundle(req);
if (!b) {
- LOGE("Failed to get bundle");
+ _E("Failed to get bundle");
amd_request_send_result(req, 0);
return -1;
}
node = __find_app_group_node_by_pid(pid);
if (!node) {
- LOGE("Failed to find app group node. pid(%d)", pid);
+ _E("Failed to find app group node. pid(%d)", pid);
amd_request_send_result(req, 0);
return -1;
}
fg = _app_group_node_get_fg_flag(node);
amd_request_send_result(req, (int)fg);
- LOGI("pid(%d), fg(%s)", pid, fg ? "true" : "false");
+ _I("pid(%d), fg(%s)", pid, fg ? "true" : "false");
return 0;
}
node = __find_app_group_node_by_pid(pid);
if (!node) {
- LOGE("Failed to find app group node. pid(%d)", pid);
+ _E("Failed to find app group node. pid(%d)", pid);
amd_request_send_result(req, 0);
return -1;
}
_app_group_node_clear_top(node, uid);
amd_request_send_result(req, 0);
- LOGI("pid(%d)", pid);
+ _I("pid(%d)", pid);
return 0;
}
b = amd_request_get_bundle(req);
if (!b) {
- LOGE("Failed to get bundle");
+ _E("Failed to get bundle");
amd_request_send_result(req, -1);
return -1;
}
app_group = __find_app_group_by_pid(pid);
if (!app_group) {
- LOGE("Failed to find app group. pid(%d)", pid);
+ _E("Failed to find app group. pid(%d)", pid);
amd_request_send_result(req, -1);
return -1;
}
leader_pid = _app_group_get_leader_pid(app_group);
amd_request_send_result(req, leader_pid);
- LOGI("pid(%d), leader_pid(%d)", pid, leader_pid);
+ _I("pid(%d), leader_pid(%d)", pid, leader_pid);
return 0;
}
if (pids != NULL)
free(pids);
- LOGI("count(%d)", cnt);
+ _I("count(%d)", cnt);
return 0;
}
if (pids != NULL)
free(pids);
- LOGI("count(%d)", cnt);
+ _I("count(%d)", cnt);
return 0;
}
b = amd_request_get_bundle(req);
if (!b) {
- LOGE("Failed to get bundle");
+ _E("Failed to get bundle");
amd_request_send_raw(req, APP_GROUP_GET_GROUP_PIDS, empty, 0);
return -1;
}
leader_pid = atoi(buf);
if (leader_pid <= 1) {
- LOGE("Failed to get leader process ID");
+ _E("Failed to get leader process ID");
amd_request_send_raw(req, APP_GROUP_GET_GROUP_PIDS, empty, 0);
return -1;
}
if (pids != NULL)
free(pids);
- LOGI("leader_pid(%d), count(%d)", leader_pid, cnt);
+ _I("leader_pid(%d), count(%d)", leader_pid, cnt);
return 0;
}
node = __find_app_group_node_by_pid(pid);
if (!node) {
- LOGE("Failed to find app group node. pid(%d)", pid);
+ _E("Failed to find app group node. pid(%d)", pid);
amd_request_send_result(req, 0);
return -1;
}
_app_group_node_lower(node, &exit);
amd_request_send_result(req, (int)exit);
- LOGI("pid(%d), exit(%s)", pid, exit ? "true" : "false");
+ _I("pid(%d), exit(%s)", pid, exit ? "true" : "false");
return 0;
}
int wid;
if (!below_appid) {
- LOGE("Invalid parameter");
+ _E("Invalid parameter");
return -1;
}
wid = __get_window_by_pid(pid);
if (wid == 0) {
- LOGE("Caller(%d) window is not ready", pid);
+ _E("Caller(%d) window is not ready", pid);
return -1;
}
below_wid = __get_window_by_appid(below_appid, uid);
if (below_wid == 0) {
- LOGE("Below app(%s) window is not ready", below_appid);
+ _E("Below app(%s) window is not ready", below_appid);
return -1;
}
b = amd_request_get_bundle(req);
if (!b) {
- LOGE("Failed to get bundle");
+ _E("Failed to get bundle");
amd_request_send_result(req, -1);
return -1;
}
appid = bundle_get_val(b, AUL_K_APPID);
if (!appid) {
- LOGE("Failed to get appid");
+ _E("Failed to get appid");
amd_request_send_result(req, -1);
return -1;
}
ret = __app_group_activate_below(pid, uid, appid);
amd_request_send_result(req, ret);
- LOGI("pid(%d), appid(%s), result(%d)", pid, appid, ret);
+ _I("pid(%d), appid(%s), result(%d)", pid, appid, ret);
amd_noti_send(AMD_NOTI_MSG_APP_GROUP_ACTIVATE_BELOW, pid, (int)uid,
(void *)appid, b);
int wid;
if (!above_appid) {
- LOGE("Invalid parameter");
+ _E("Invalid parameter");
return -1;
}
wid = __get_window_by_pid(pid);
if (wid == 0) {
- LOGE("Caller(%d) window is not ready", pid);
+ _E("Caller(%d) window is not ready", pid);
return -1;
}
above_wid = __get_window_by_appid(above_appid, uid);
if (above_wid == 0) {
- LOGE("Above app(%s) window is not ready", above_appid);
+ _E("Above app(%s) window is not ready", above_appid);
return -1;
}
b = amd_request_get_bundle(req);
if (!b) {
- LOGE("Failed to get bundle");
+ _E("Failed to get bundle");
amd_request_send_result(req, -1);
return -1;
}
appid = bundle_get_val(b, AUL_K_APPID);
if (!appid) {
- LOGE("Failed to get appid");
+ _E("Failed to get appid");
amd_request_send_result(req, -1);
return -1;
}
ret = __app_group_activate_above(pid, uid, appid);
amd_request_send_result(req, ret);
- LOGI("pid(%d), appid(%s), result(%d)", pid, appid, ret);
+ _I("pid(%d), appid(%s), result(%d)", pid, appid, ret);
return 0;
}
parent_wid = __get_window_by_appid(parent_appid, uid);
if (parent_wid == 0) {
- LOGE("Parent(%s) window is not ready", parent_appid);
+ _E("Parent(%s) window is not ready", parent_appid);
return -ENOENT;
}
child_wid = __get_window_by_appid(child_appid, uid);
if (child_wid == 0) {
- LOGE("Child(%s) window is not ready", child_appid);
+ _E("Child(%s) window is not ready", child_appid);
return -ENOENT;
}
int ret;
if (!b) {
- LOGE("Invalid bundle");
+ _E("Invalid bundle");
amd_request_send_result(req, -EINVAL);
return -EINVAL;
}
parent_appid = bundle_get_val(b, AUL_K_PARENT_APPID);
if (!parent_appid) {
- LOGE("Invalid parameters");
+ _E("Invalid parameters");
amd_request_send_result(req, -EINVAL);
return -EINVAL;
}
child_appid = bundle_get_val(b, AUL_K_CHILD_APPID);
if (!child_appid) {
- LOGE("Invalid parameters");
+ _E("Invalid parameters");
amd_request_send_result(req, -EINVAL);
return -EINVAL;
}
ret = __app_window_attach(parent_appid, child_appid, uid);
amd_request_send_result(req, ret);
- LOGI("parent appid(%s), child appid(%s), result(%d)",
+ _I("parent appid(%s), child appid(%s), result(%d)",
parent_appid, child_appid, ret);
return ret;
wid = __get_window_by_appid(appid, uid);
if (wid == 0) {
- LOGE("%s window(%u) is invalid", appid, wid);
+ _E("%s window(%u) is invalid", appid, wid);
return -ENOENT;
}
int ret;
if (!b) {
- LOGE("Invalid bundle");
+ _E("Invalid bundle");
amd_request_send_result(req, -EINVAL);
return -EINVAL;
}
child_appid = bundle_get_val(b, AUL_K_CHILD_APPID);
if (!child_appid) {
- LOGE("Invalid parameters");
+ _E("Invalid parameters");
amd_request_send_result(req, -EINVAL);
return -EINVAL;
}
ret = __app_window_detach(child_appid, uid);
amd_request_send_result(req, ret);
- LOGI("child appid(%s), result(%d)", child_appid, ret);
+ _I("child appid(%s), result(%d)", child_appid, ret);
return ret;
}
b = amd_request_get_bundle(req);
if (!b) {
- LOGE("Failed to get bundle");
+ _E("Failed to get bundle");
return -1;
}
id = bundle_get_val(b, AUL_K_INSTANCE_ID);
if (!id) {
- LOGE("Failed to get instance ID");
+ _E("Failed to get instance ID");
return -1;
}
wid = (uint32_t)atoi(wid_str);
if (wid <= 0) {
- LOGE("Failed to get window ID");
+ _E("Failed to get window ID");
return -1;
}
node = _app_group_node_find(id);
if (!node) {
- LOGE("Failed to find app group node. id(%s)", id);
+ _E("Failed to find app group node. id(%s)", id);
return -1;
}
ret = _app_group_node_set_window(node, wid);
if (ret < 0) {
- LOGE("Failed to set window. id(%s), wid(%u)",
+ _E("Failed to set window. id(%s), wid(%u)",
id, wid);
return -1;
}
_screen_connector_add_app_screen(pid, wid, id, uid);
amd_noti_send(AMD_NOTI_MSG_APP_GROUP_WINDOW_SET,
pid, wid, (void *)id, NULL);
- LOGI("id(%s), wid(%u), result(%d)", id, wid, ret);
+ _I("id(%s), wid(%u), result(%d)", id, wid, ret);
return ret;
}
b = amd_request_get_bundle(req);
if (!b) {
- LOGE("Failed to get bundle");
+ _E("Failed to get bundle");
amd_request_send_result(req, 0);
return -1;
}
id = bundle_get_val(b, AUL_K_INSTANCE_ID);
if (!id) {
- LOGE("Failed to get instance ID");
+ _E("Failed to get instance ID");
amd_request_send_result(req, 0);
return -1;
}
node = _app_group_node_find(id);
if (!node) {
- LOGE("Failed to find app group node. id(%s)", id);
+ _E("Failed to find app group node. id(%s)", id);
amd_request_send_result(req, 0);
return -1;
}
_app_group_node_lower(node, &exit);
amd_request_send_result(req, (int)exit);
- LOGI("id(%s), exit(%s)", id, exit ? "true" : "false");
+ _I("id(%s), exit(%s)", id, exit ? "true" : "false");
return 0;
}
APP_GET_INFO_OK, b, AUL_SOCK_NOREPLY);
bundle_free(b);
- LOGI("count(%d), result(%d)", cnt, ret);
+ _I("count(%d), result(%d)", cnt, ret);
return 0;
}
app_status = amd_app_status_find_by_effective_pid(pid);
if (!app_status) {
- LOGE("Failed to get app status");
+ _E("Failed to get app status");
return;
}
b = bundle_create();
if (!b) {
- LOGE("Out of memory");
+ _E("Out of memory");
return;
}
ret = aul_sock_send_bundle_with_fd(fd, APP_GET_INFO_OK, b,
AUL_SOCK_ASYNC);
if (ret < 0)
- LOGE("Failed to send bundle. result(%d)", ret);
+ _E("Failed to send bundle. result(%d)", ret);
bundle_free(b);
}
b = amd_request_get_bundle(req);
if (!b) {
- LOGE("Failed to get bundle");
+ _E("Failed to get bundle");
amd_request_send_result(req, -1);
return -1;
}
id = bundle_get_val(b, AUL_K_LEADER_ID);
if (!id) {
- LOGE("Failed to get leader id");
+ _E("Failed to get leader id");
amd_request_send_result(req, -1);
return -1;
}
_app_group_foreach_context(group, __foreach_group_info, req);
- LOGI("leader(%s), count(%d)", id, group_count);
+ _I("leader(%s), count(%d)", id, group_count);
return 0;
}
_app_group_foreach_idle_context(__foreach_group_info, req);
- LOGI("count(%d)", idle_count);
+ _I("count(%d)", idle_count);
return 0;
}
b = amd_request_get_bundle(req);
if (!b) {
- LOGE("Failed to get bundle");
+ _E("Failed to get bundle");
return -EINVAL;
}
wid = atoi(wid_str);
if (wid <= 0) {
- LOGE("Failed to get window ID");
+ _E("Failed to get window ID");
return -EINVAL;
}
node = _app_group_node_find_by_wid(wid);
if (node) {
- LOGE("Already exists. wid(%d)", wid);
+ _E("Already exists. wid(%d)", wid);
return -EALREADY;
}
node = __find_app_group_node_by_pid(pid);
if (!node) {
- LOGE("Failed to find app group node. pid(%d)", pid);
+ _E("Failed to find app group node. pid(%d)", pid);
return -EINVAL;
}
new_node = _app_group_node_add_node(node);
if (!new_node) {
- LOGE("Failed to add new node. pid(%d), wid(%d)", pid, wid);
+ _E("Failed to add new node. pid(%d), wid(%d)", pid, wid);
return -ENOMEM;
}
ret = _app_group_node_set_window(new_node, wid);
if (ret < 0)
- LOGE("Failed to set window. pid(%d), wid(%d)", pid, wid);
+ _E("Failed to set window. pid(%d), wid(%d)", pid, wid);
_screen_connector_add_app_screen(pid, wid, NULL, uid);
amd_noti_send(AMD_NOTI_MSG_APP_GROUP_WINDOW_SET, pid, wid, NULL, NULL);
- LOGI("pid(%d), wid(%d), result(%d)", pid, wid, ret);
+ _I("pid(%d), wid(%d), result(%d)", pid, wid, ret);
return ret;
}
b = amd_request_get_bundle(req);
if (!b) {
- LOGE("Failed to get bundle");
+ _E("Failed to get bundle");
return -EINVAL;
}
wid = atoi(wid_str);
if (wid <= 0) {
- LOGE("Failed to get window ID");
+ _E("Failed to get window ID");
return -EINVAL;
}
node = _app_group_node_find_by_wid(wid);
if (!node) {
- LOGE("Failed to find node. pid(%d), wid(%d)", pid, wid);
+ _E("Failed to find node. pid(%d), wid(%d)", pid, wid);
return -EINVAL;
}
ret = _app_group_node_remove_node(node);
if (ret < 0)
- LOGE("Failed to remove node. pid(%d), wid(%d)", pid, wid);
+ _E("Failed to remove node. pid(%d), wid(%d)", pid, wid);
- LOGI("pid(%d), wid(%d), result(%d)", pid, wid, ret);
+ _I("pid(%d), wid(%d), result(%d)", pid, wid, ret);
return ret;
}
int app_type;
if (!b) {
- LOGE("Failed to get bundle");
+ _E("Failed to get bundle");
return AMD_CYNARA_RET_DENIED;
}
id = bundle_get_val(b, AUL_K_INSTANCE_ID);
if (!id) {
- LOGE("Failed to get instance ID");
+ _E("Failed to get instance ID");
return AMD_CYNARA_RET_DENIED;
}
app_status = amd_app_status_find_by_effective_pid(pid);
if (!app_status) {
- LOGE("Failed to find app status. pid(%d)", pid);
+ _E("Failed to find app status. pid(%d)", pid);
return AMD_CYNARA_RET_DENIED;
}
if (app_type == AMD_AT_COMPONENT_BASED_APP) {
comp_status = amd_comp_status_find_by_instance_id(id);
if (!comp_status) {
- LOGE("Failed to find comp status. instance(%s)", id);
+ _E("Failed to find comp status. instance(%s)", id);
return AMD_CYNARA_RET_DENIED;
}
if (amd_comp_status_get_pid(comp_status) != pid) {
- LOGE("Reject request! instance(%s:%d) doesn't exist",
+ _E("Reject request! instance(%s:%d) doesn't exist",
id, pid);
return AMD_CYNARA_RET_DENIED;
}
} else {
inst_id = amd_app_status_get_instance_id(app_status);
if (!inst_id || strcmp(inst_id, id) != 0) {
- LOGE("Reject request! instance(%s:%d) doesn't exist",
+ _E("Reject request! instance(%s:%d) doesn't exist",
id, pid);
return AMD_CYNARA_RET_DENIED;
}
{
int r;
- LOGD("app group request init");
+ _D("app group request init");
r = amd_request_register_cmds(__dispatch_table,
ARRAY_SIZE(__dispatch_table));
if (r < 0) {
- LOGE("Failed to register cmds");
+ _E("Failed to register cmds");
return -1;
}
r = amd_cynara_register_checkers(__cynara_checkers,
ARRAY_SIZE(__cynara_checkers));
if (r < 0) {
- LOGE("Failed to register checkers");
+ _E("Failed to register checkers");
return -1;
}
void _app_group_request_fini(void)
{
- LOGD("app group request fini");
+ _D("app group request fini");
}
#include <wayland-client.h>
#include <wayland-tbm-client.h>
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-
-#define LOG_TAG "AMD_APP_GROUP"
+#include "app_group_private.h"
struct wayland_context_s {
struct wl_display *display;
int _app_group_wayland_lower_window(int wid)
{
if (!__context.tizen_policy_initialized) {
- LOGE("tizen_policy is not initialized");
+ _E("tizen_policy is not initialized");
return -1;
}
int _app_group_wayland_attach_window(int parent_wid, int child_wid)
{
if (!__context.tizen_policy_initialized) {
- LOGE("tizen_policy is not initialized");
+ _E("tizen_policy is not initialized");
return -1;
}
tizen_policy_set_transient_for(__context.tizen_policy,
child_wid, parent_wid);
wl_display_roundtrip(__context.display);
- LOGW("[__ATTACH__] parent_wid(%d), child_wid(%d)",
+ _W("[__ATTACH__] parent_wid(%d), child_wid(%d)",
parent_wid, child_wid);
return 0;
int _app_group_wayland_detach_window(int child_wid)
{
if (!__context.tizen_policy_initialized) {
- LOGE("tizen_policy is not initialized");
+ _E("tizen_policy is not initialized");
return -1;
}
tizen_policy_unset_transient_for(__context.tizen_policy, child_wid);
wl_display_roundtrip(__context.display);
- LOGW("[__DETACH__] child_wid(%d)", child_wid);
+ _W("[__DETACH__] child_wid(%d)", child_wid);
return 0;
}
int _app_group_wayland_activate_below(int wid, int below_wid)
{
if (!__context.tizen_policy_initialized) {
- LOGE("tizen_policy is not initialized");
+ _E("tizen_policy is not initialized");
return -1;
}
int _app_group_wayland_activate_above(int wid, int above_wid)
{
if (!__context.tizen_policy_initialized) {
- LOGE("tizen_policy is not initialized");
+ _E("tizen_policy is not initialized");
return -1;
}
amd_wayland_set_tizen_policy(__context.tizen_policy);
__context.tizen_policy_initialized = true;
}
- LOGD("tizen_policy(%p)", __context.tizen_policy);
+ _D("tizen_policy(%p)", __context.tizen_policy);
}
return 0;
__context.tizen_policy_id = 0;
__context.tizen_policy_initialized = false;
amd_wayland_set_tizen_policy(__context.tizen_policy);
- LOGW("tizen policy is destroyed");
+ _W("tizen policy is destroyed");
}
return 0;
int _app_group_wayland_init(void)
{
- LOGD("app group wayland init");
+ _D("app group wayland init");
amd_noti_listen(AMD_NOTI_MSG_WAYLAND_LISTENER_TIZEN_POLICY,
__on_wayland_listener_tizen_policy);
amd_noti_listen(AMD_NOTI_MSG_WAYLAND_LISTENER_REMOVE,
void _app_group_wayland_fini(void)
{
- LOGD("app group wayland fini");
+ _D("app group wayland fini");
}
#include <unistd.h>
#include <dlog.h>
#include <amd.h>
+#include <amd_mod_common.h>
#include "status.h"
+#ifdef LOG_TAG
#undef LOG_TAG
+#endif
#define LOG_TAG "AMD_UI_CORE"
pid_t _status_get_effective_pid(pid_t pid)
app_status = amd_app_status_find_by_effective_pid(pid);
if (!app_status) {
- LOGW("Failed to find app status info. pid(%d)", pid);
+ _W("Failed to find app status info. pid(%d)", pid);
return -1;
}
#include <dlog.h>
-#include "amd.h"
+#include <amd.h>
+#include <amd_mod_common.h>
+
#include "amd_screen_connector.h"
#include "app_group.h"
+#ifdef LOG_TAG
#undef LOG_TAG
+#endif
#define LOG_TAG "AMD_UI_CORE"
-#undef EXPORT
-#define EXPORT __attribute__ ((visibility("default")))
-
EXPORT int AMD_MOD_INIT(void)
{
- LOGD("ui-core init");
+ _D("ui-core init");
if (_app_group_init() < 0)
return -1;
EXPORT void AMD_MOD_FINI(void)
{
- LOGD("ui-core fini");
+ _D("ui-core fini");
_screen_connector_fini();
_app_group_fini();
}
+++ /dev/null
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
- *
- * 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.
- */
-
-#pragma once
-
-#include <dlog.h>
-
-#undef LOG_TAG
-#define LOG_TAG "AMD_WATCH"
-
-#ifndef _E
-#define _E LOGE
-#endif
-
-#ifndef _W
-#define _W LOGW
-#endif
-
-#ifndef _I
-#define _I LOGI
-#endif
-
-#ifndef _D
-#define _D LOGD
-#endif
-
-#ifndef REGULAR_UID_MIN
-#define REGULAR_UID_MIN 5000
-#endif
-
-#undef EXPORT
-#define EXPORT __attribute__ ((visibility("default")))
--- /dev/null
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+#pragma once
+
+#include <amd_mod_common.h>
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+#define LOG_TAG "AMD_WATCH"
#include <bundle_internal.h>
#include <amd.h>
-#include "amd_watch.h"
#include "amd_watch_logger.h"
+#include "amd_watch_private.h"
struct watch_info {
char *appid;
#include <stdarg.h>
#include <amd.h>
-#include "amd_watch.h"
#include "amd_logger.h"
+#include "amd_watch_private.h"
#define LOG_FILE "amd_watch.log"
#define LOG_PATH LOGGER_PATH "/" LOG_FILE
* limitations under the License.
*/
-#ifndef __AMD_WATCHDOG_PRIVATE_H__
-#define __AMD_WATCHDOG_PRIVATE_H__
+#pragma once
-#include <dlog.h>
+#include <amd_mod_common.h>
#ifdef LOG_TAG
#undef LOG_TAG
#endif
#define LOG_TAG "AMD_WATCHDOG"
-
-#ifndef _E
-#define _E LOGE
-#endif
-
-#ifndef _W
-#define _W LOGW
-#endif
-
-#ifndef _I
-#define _I LOGI
-#endif
-
-#ifndef _D
-#define _D LOGD
-#endif
-
-#define EXPORT __attribute__ ((visibility("default")))
-
-#define RESOURCED_FREEZER_PATH "/Org/Tizen/ResourceD/Freezer"
-#define RESOURCED_FREEZER_INTERFACE "org.tizen.resourced.freezer"
-#define RESOURCED_FREEZER_SIGNAL "FreezerState"
-
-#endif /* __AMD_WATCHDOG_PRIVATE_H__ */
#include <bundle_internal.h>
#include <amd.h>
-#include "amd_watchdog_private.h"
#include "amd_watchdog_config.h"
#include "amd_watchdog_logger.h"
+#include "amd_watchdog_private.h"
-#define ARRAY_SIZE(x) ((sizeof(x)) / sizeof(x[0]))
+#define RESOURCED_FREEZER_PATH "/Org/Tizen/ResourceD/Freezer"
+#define RESOURCED_FREEZER_INTERFACE "org.tizen.resourced.freezer"
+#define RESOURCED_FREEZER_SIGNAL "FreezerState"
typedef struct watchdog_s {
GDBusConnection *conn;
#include <string.h>
#include <iniparser.h>
-#include "amd_watchdog_private.h"
#include "amd_watchdog_config.h"
+#include "amd_watchdog_private.h"
#define CONFIG_PATH "/usr/share/amd/conf/amd_watchdog.conf"
#define CONFIG_SECTION_NAME "Setting"
#include <stdarg.h>
#include <amd.h>
-#include "amd_watchdog_private.h"
#include "amd_watchdog_logger.h"
+#include "amd_watchdog_private.h"
#define LOG_FILE "amd_watchdog.log"
#define LOG_PATH LOGGER_PATH "/" LOG_FILE
+++ /dev/null
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
- *
- * 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.
- */
-
-#pragma once
-
-#include <dlog.h>
-
-#undef LOG_TAG
-#define LOG_TAG "AMD_WAYLAND_CORE"
-
-#undef EXPORT
-#define EXPORT __attribute__ ((visibility("default")))
#include <wayland-tbm-client.h>
#include <tizen-extension-client-protocol.h>
#include <amd.h>
+#include <amd_mod_common.h>
-#include "wayland-core-private.h"
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+#define LOG_TAG "AMD_WAYLAND_CORE"
#define PATH_RUN_WAYLAND "/run/wayland-0"
#define PATH_RUN_WMREADY "/run/.wm_ready"
if (!interface)
return;
- LOGW("interface(%s), id(%u), version(%u)", interface, id, version);
+ _W("interface(%s), id(%u), version(%u)", interface, id, version);
snprintf(buf, sizeof(buf), "wayland.listener.%s", interface);
amd_noti_send(buf, (int)id, (int)version, reg, NULL);
}
static void __wl_listener_remove_cb(void *data, struct wl_registry *reg,
unsigned int id)
{
- LOGW("id(%u)", id);
+ _W("id(%u)", id);
amd_noti_send(AMD_NOTI_MSG_WAYLAND_LISTENER_REMOVE,
(int)id, 0, reg, NULL);
}
while (wl_display_prepare_read(__wl_source.display) != 0) {
if (wl_display_dispatch_pending(__wl_source.display) < 0)
- LOGW("Failed to dispatch queue pending");
+ _W("Failed to dispatch queue pending");
}
__wl_source.prepared = true;
if (g_source_is_destroyed(source)) {
if (__wl_source.display && __wl_source.prepared)
wl_display_cancel_read(__wl_source.display);
- LOGE("Display source(%p) already destroyed", source);
+ _E("Display source(%p) already destroyed", source);
return FALSE;
}
if (__wl_source.gfd->revents & (G_IO_HUP | G_IO_ERR)) {
wl_display_cancel_read(__wl_source.display);
- LOGE("Error: revents(%x)", __wl_source.gfd->revents);
+ _E("Error: revents(%x)", __wl_source.gfd->revents);
__wl_source.prepared = false;
g_source_destroy(source);
abort();
if (__wl_source.gfd->revents & G_IO_IN) {
if (wl_display_read_events(__wl_source.display) < 0)
- LOGW("Failed to read events");
+ _W("Failed to read events");
__wl_source.prepared = false;
return TRUE;
}
gpointer data)
{
if (g_source_is_destroyed(source)) {
- LOGE("Source(%p) is already destroyed", source);
+ _E("Source(%p) is already destroyed", source);
return G_SOURCE_REMOVE;
}
if (__wl_source.gfd->revents & (G_IO_HUP | G_IO_ERR)) {
- LOGE("Error: revents(%x)", __wl_source.gfd->revents);
+ _E("Error: revents(%x)", __wl_source.gfd->revents);
g_source_destroy(source);
abort();
return G_SOURCE_REMOVE;
if (__wl_source.gfd->revents & G_IO_IN) {
if (wl_display_dispatch_pending(__wl_source.display) < 0)
- LOGW("Failed to dispatch queue pending");
+ _W("Failed to dispatch queue pending");
}
wl_display_flush(__wl_source.display);
__wl_source.display = wl_display_connect(NULL);
if (!__wl_source.display) {
- LOGE("Failed to connect wayland display");
+ _E("Failed to connect wayland display");
return -1;
}
amd_wayland_set_display(__wl_source.display);
__wl_source.registry = wl_display_get_registry(__wl_source.display);
if (!__wl_source.registry) {
- LOGE("Failed to get wayland registry");
+ _E("Failed to get wayland registry");
return -1;
}
r = wl_display_roundtrip(__wl_source.display);
if (r < 0)
- LOGW("wl_display_roundtrip() is failed. result(%d)", r);
+ _W("wl_display_roundtrip() is failed. result(%d)", r);
__wl_source.gsource = g_source_new(&__wl_source_funcs, sizeof(GSource));
if (!__wl_source.gsource) {
- LOGE("Failed to create GSource");
+ _E("Failed to create GSource");
return -1;
}
__wl_source.gfd = (GPollFD *)g_malloc(sizeof(GPollFD));
if (!__wl_source.gfd) {
- LOGE("Failed to create GPollFD");
+ _E("Failed to create GPollFD");
return -1;
}
static gboolean __init_wl(gpointer data)
{
- LOGI("Initialize Wayland");
+ _I("Initialize Wayland");
if (__wl_source_init() < 0) {
__retry_cnt++;
if (__retry_cnt > 10) {
- LOGE("Failed to initialize wayland: Retry(%d)", __retry_cnt);
+ _E("Failed to initialize wayland: Retry(%d)", __retry_cnt);
__wl_source_fini();
g_timeout_add_seconds(1, __init_wl, NULL);
return G_SOURCE_REMOVE;
return true;
if (strcmp(event_name, "wayland-0") == 0) {
- LOGD("%s is created", event_name);
+ _D("%s is created", event_name);
__file_monitor.wl_ready = true;
} else if (strcmp(event_name, ".wm_ready") == 0) {
- LOGD("%s is created", event_name);
+ _D("%s is created", event_name);
__file_monitor.wm_ready = true;
}
{
if (!__file_monitor.wl_ready) {
if (access(PATH_RUN_WAYLAND, F_OK) == 0) {
- LOGD("%s exists", PATH_RUN_WAYLAND);
+ _D("%s exists", PATH_RUN_WAYLAND);
__file_monitor.wl_ready = true;
}
}
if (!__file_monitor.wm_ready) {
if (access(PATH_RUN_WMREADY, F_OK) == 0) {
- LOGD("%s exists", PATH_RUN_WMREADY);
+ _D("%s exists", PATH_RUN_WMREADY);
__file_monitor.wm_ready = true;
}
}
__file_monitor.handle = amd_inotify_add_watch(PATH_RUN, IN_CREATE,
__wayland_monitor_cb, NULL);
if (__file_monitor.handle == NULL) {
- LOGE("Failed to add inotify watch");
+ _E("Failed to add inotify watch");
return -1;
}
static gboolean __idle_cb(gpointer data)
{
- LOGD("wayland core init");
+ _D("wayland core init");
if (__file_monitor_init() < 0)
return G_SOURCE_CONTINUE;
EXPORT int AMD_MOD_INIT(void)
{
- LOGD("wayland core init");
+ _D("wayland core init");
g_idle_add(__idle_cb, NULL);
EXPORT void AMD_MOD_FINI(void)
{
- LOGD("wayland core finish");
+ _D("wayland core finish");
__file_monitor_fini();
__wl_source_fini();
--- /dev/null
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+#pragma once
+
+#include <amd_mod_common.h>
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+#define LOG_TAG "AMD_WIDGET"
#include <bundle_internal.h>
#include <pkgmgr-info.h>
#include <aul_widget.h>
+#include <amd.h>
-#include "amd.h"
-#include "amd_widget_private.h"
#include "amd_widget_logger.h"
+#include "amd_widget_private.h"
#ifndef AUL_K_WIDGET_OPERATION
#define AUL_K_WIDGET_OPERATION "__WIDGET_OP__"
#endif
#define MAX_NR_OF_DESCRIPTORS 2
#define MAX_PID_STR_BUFSZ 20
-#define REGULAR_UID_MIN 5000
-#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
#define DISABLE_ENDPOINT "widget.disable"
typedef struct _widget_t {
#include <stdarg.h>
#include <amd.h>
-#include "amd_widget_private.h"
-#include "amd_widget_logger.h"
#include "amd_logger.h"
+#include "amd_widget_logger.h"
+#include "amd_widget_private.h"
#define LOG_FILE "amd_widget.log"
#define LOG_PATH LOGGER_PATH "/" LOG_FILE
+++ /dev/null
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
- *
- * 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 __AMD_WIDGET_PRIVATE_H__
-#define __AMD_WIDGET_PRIVATE_H__
-
-#include <dlog.h>
-
-#undef LOG_TAG
-#define LOG_TAG "AMD_WIDGET"
-
-#ifndef _E
-#define _E LOGE
-#endif
-
-#ifndef _W
-#define _W LOGW
-#endif
-
-#ifndef _I
-#define _I LOGI
-#endif
-
-#ifndef _D
-#define _D LOGD
-#endif
-
-#undef EXPORT
-#define EXPORT __attribute__ ((visibility("default")))
-
-#endif /* __AMD_WIDGET_PRIVATE_H__ */