BuildRequires: pkgconfig(security-privilege-manager)
BuildRequires: pkgconfig(security-manager)
BuildRequires: pkgconfig(pkgmgr-info)
+BuildRequires: pkgconfig(capi-appfw-app-manager)
%description
Application providing ui for managing other installed applications privacy status.
INCLUDE(FindPkgConfig)
SET(pkg_name "org.tizen.privacy-setting")
-pkg_check_modules(${pkg_name} REQUIRED glib-2.0 ui-gadget-1 evas elementary edje eina efl-extension security-privilege-manager dlog security-manager pkgmgr-info)
+pkg_check_modules(${pkg_name} REQUIRED glib-2.0 ui-gadget-1 evas elementary edje eina efl-extension security-privilege-manager dlog security-manager pkgmgr-info capi-appfw-app-manager)
SET(SRCS
${CMAKE_SOURCE_DIR}/common/src/common_utils.c
#include <glib.h>
#include <pkgmgr-info.h>
#include <tzplatform_config.h>
+#include <app_manager_extension.h>
#include "common_utils.h"
#include "privacy_view.h"
elm_object_item_signal_emit(first, "elm,action,title,slide,start", "elm");
}
+
+static void __terminate_app()
+{
+ /* Get app context for each appid */
+ GList *l;
+ for (l = pp_app_list; l != NULL; l = l->next) {
+ char* appid = (char*)l->data;
+ bool is_running = false;
+ /* If app is running then terminate app. */
+ int ret = app_manager_is_running(appid, &is_running);
+ if (is_running) {
+ app_context_h context = NULL;
+ ret = app_manager_get_app_context(appid, &context);
+ if (ret != APP_MANAGER_ERROR_NONE)
+ LOGE("app_manager_get_app_context failed. ret = %d", ret);
+ ret = app_manager_terminate_app(context);
+ if (ret != APP_MANAGER_ERROR_NONE)
+ LOGE("app_manager_terminate_app failed. ret = %d", ret);
+ app_context_destroy(context);
+ }
+ }
+
+}
+
static void package_privacy_check_changed_cb(void *data, Evas_Object *obj, void *event_info)
{
Elm_Object_Item *ei = event_info;
if (pd->status) {
level = "Ask user";
pd->status = false;
+ __terminate_app();
} else {
level = "Allow";
pd->status = true;