TizenRefApp-7940 Implement task manager service (Model) 59/112059/5
authorOleksander Kostenko <o.kostenko@samsung.com>
Wed, 25 Jan 2017 15:18:44 +0000 (17:18 +0200)
committerOleksander Kostenko <o.kostenko@samsung.com>
Wed, 25 Jan 2017 16:43:08 +0000 (18:43 +0200)
Change-Id: I015cdd414fc522b37335577da7af2e4a3c784e54
Signed-off-by: Oleksander Kostenko <o.kostenko@samsung.com>
26 files changed:
inc/Config.h
project_def.prop
res/edje/main_layout.edc
src/App/inc/App.h
src/App/inc/MainController.h
src/App/inc/MainLayout.h
src/App/inc/Resource.h
src/App/inc/TaskMngrService.h [new file with mode: 0644]
src/App/src/App.cpp
src/App/src/MainController.cpp
src/App/src/MainLayout.cpp
src/App/src/TaskMngrService.cpp [new file with mode: 0644]
src/Common/inc/AtspiAccessibleInterface.h
src/Common/inc/BaseView.h
src/Common/inc/Callback.h
src/Common/inc/LangUtils.h
src/Common/inc/Logger.h
src/Common/inc/PathUtils.h
src/Common/inc/View.h
src/Common/inc/Window.h
src/Common/src/Logger.cpp
src/Common/src/PathUtils.cpp
src/Common/src/View.cpp
src/Common/src/Window.cpp
src/main.cpp
tizen-manifest.xml

index 050af59..943182d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016  Samsung Electronics Co., Ltd
+ * Copyright 2017  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.1 (the "License");
  * you may not use this file except in compliance with the License.
index b3b6fbd..d9386c8 100644 (file)
@@ -9,7 +9,7 @@ type = app
 profile = wearable-3.0
 
 # C/CPP Sources
-USER_SRCS = src/App/src/App.cpp src/main.cpp src/Common/src/PathUtils.cpp src/Common/src/Window.cpp src/Common/src/Logger.cpp src/Common/src/View.cpp 
+USER_SRCS = src/App/src/App.cpp src/App/src/TaskMngrService.cpp src/main.cpp src/Common/src/PathUtils.cpp src/Common/src/Window.cpp src/Common/src/Logger.cpp src/App/src/MainController.cpp src/App/src/MainLayout.cpp src/Common/src/View.cpp 
 
 # EDC Sources
 USER_EDCS =  
@@ -42,7 +42,7 @@ USER_CPP_INC_FILES =
 USER_INC_DIRS = $(USER_C_INC_DIRS) $(USER_CPP_INC_DIRS)
 
 # User Library Path
-USER_LIB_DIRS = lib 
+USER_LIB_DIRS = 
 
 # EDC Resource Path
 USER_EDCS_IMAGE_DIRS = ${OUTPUT_DIR} edje/images 
@@ -52,7 +52,7 @@ USER_EDCS_FONT_DIRS = ${OUTPUT_DIR} edje/fonts
 # EDC Flags
 USER_EXT_EDC_KEYS = EDC0 
 
-USER_EXT_EDC0_EDCS = res/edje/taskmanager.edc 
+USER_EXT_EDC0_EDCS = res/edje/main_layout.edc 
 USER_EXT_EDC0_EDCS_IMAGE_DIRS = ${OUTPUT_DIR} edje/images 
 USER_EXT_EDC0_EDCS_SOUND_DIRS = ${OUTPUT_DIR} edje/sounds 
 USER_EXT_EDC0_EDCS_FONT_DIRS = ${OUTPUT_DIR} edje/fonts 
index d65ef3f..3a48254 100644 (file)
@@ -1,15 +1,14 @@
 /*
- * Task Manager
- * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ * Copyright 2017  Samsung Electronics Co., Ltd
  *
- * Licensed under the Flora License, Version 1.1 (the License);
+ * Licensed under the Flora License, Version 1.1 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
  * http://floralicense.org/license/
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
+ * 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.
index a2ef6df..8cdd57e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016  Samsung Electronics Co., Ltd
+ * Copyright 2017  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.1 (the "License");
  * you may not use this file except in compliance with the License.
 #include <app.h>
 #include <app_control.h>
 
-namespace TaskMngr
-{
+namespace TaskMngr {
     class Window;
     class TaskMngrService;
     class MainController;
 
-    class App
-    {
+    class App {
         public:
             static App &getInst();
             int start(int argc, char *argv[]);
index d75b916..f64f91f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016  Samsung Electronics Co., Ltd
+ * Copyright 2017  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.1 (the "License");
  * you may not use this file except in compliance with the License.
 
 #include "MainLayout.h"
 
-namespace TaskMngr
-{
+namespace TaskMngr {
     class MainController
-        : public MainLayout
-    {
+            : public MainLayout {
         public:
             MainController(Evas_Object *parent);
             virtual ~MainController();
index f7a5a28..91809a0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016  Samsung Electronics Co., Ltd
+ * Copyright 2017  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.1 (the "License");
  * you may not use this file except in compliance with the License.
 
 #include "View.h"
 
-namespace TaskMngr
-{
+namespace TaskMngr {
     class MainLayout
-        : public View
-    {
+        : public View {
         public:
             MainLayout(Evas_Object *parent);
             virtual ~MainLayout();
index a617cc8..894848a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016  Samsung Electronics Co., Ltd
+ * Copyright 2017  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.1 (the "License");
  * you may not use this file except in compliance with the License.
diff --git a/src/App/inc/TaskMngrService.h b/src/App/inc/TaskMngrService.h
new file mode 100644 (file)
index 0000000..971890a
--- /dev/null
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2017  Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * 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 TaskMngrService_h_
+#define TaskMngrService_h_
+
+#include <string>
+#include <vector>
+#include <app_info.h>
+#include <rua.h>
+
+namespace TaskMngr {
+    struct AppInfo {
+        std::string pkgid;
+        std::string appid;
+        std::string instanceId;
+        std::string name;
+        std::string icon;
+        std::string uri;
+        time_t launchTime;
+    };
+
+    class TaskMngrService {
+        public:
+            TaskMngrService();
+            ~TaskMngrService();
+
+            /**
+            * @brief Shutdowns given currently running application.
+            *
+            * @param[in] appid The ID of the application
+            * @param[in] instance_id The instance ID of the application
+            *
+            * @return true or false on failure
+            */
+            bool killApp(const std::string &appid, const std::string &instanceId = std::string());
+            /**
+            * @brief Resumes the given application.
+            *
+            * @param[in] appid The ID of the application
+            * @param[in] uri The URI of the data
+            *
+            * @return true or false on failure
+            */
+            bool launchApp(const std::string &appid, const std::string &uri = std::string());
+            /**
+            * @brief Get or create list of launched applications
+            *
+            * @return list with information about launched applications
+            */
+            std::vector<AppInfo> getAppInfo();
+
+        private:
+            TaskMngrService(const TaskMngrService&) = delete;
+            TaskMngrService& operator=(TaskMngrService) = delete;
+
+            void init();
+            void finit();
+            void filterCreate();
+            void findAndAppendApp();
+            bool appInfoCb(app_info_h app_info);
+            void fillAppInfoList(char **table, int &rows, int &cols);
+
+        private:
+            rua_rec m_RuaRecord;
+            app_info_filter_h m_Filter;
+            std::vector<AppInfo> m_AppInfo;
+    };
+}
+
+#endif /* TaskMngrService_h_ */
index 1e3bc9d..b92b630 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016  Samsung Electronics Co., Ltd
+ * Copyright 2017  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.1 (the "License");
  * you may not use this file except in compliance with the License.
index 2a2ba4d..4d9d465 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016  Samsung Electronics Co., Ltd
+ * Copyright 2017  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.1 (the "License");
  * you may not use this file except in compliance with the License.
index 1320bfb..ed63c31 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016  Samsung Electronics Co., Ltd
+ * Copyright 2017  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.1 (the "License");
  * you may not use this file except in compliance with the License.
@@ -51,8 +51,7 @@ void MainLayout::setIndex(Evas_Object *obj)
 
 void MainLayout::showNoContents(bool show)
 {
-    if (show && !m_pNoContent)
-    {
+    if (show && !m_pNoContent) {
         m_pNoContent = elm_layout_add(getEo());
         elm_layout_theme_set(getEo(), "layout", "nocontents", "text");
         setContent(m_pNoContent, "swl.bg");
diff --git a/src/App/src/TaskMngrService.cpp b/src/App/src/TaskMngrService.cpp
new file mode 100644 (file)
index 0000000..78801a8
--- /dev/null
@@ -0,0 +1,208 @@
+/*
+ * Copyright 2017  Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * 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.
+ */
+
+#include "TaskMngrService.h"
+#include "Logger.h"
+#include "Callback.h"
+
+#include <app_manager_extension.h>
+#include <utility>
+#include <app_control.h>
+#include <app_manager.h>
+
+using namespace TaskMngr;
+
+TaskMngrService::TaskMngrService()
+    : m_RuaRecord()
+    , m_Filter()
+{
+    init();
+}
+
+TaskMngrService::~TaskMngrService()
+{
+    finit();
+}
+
+bool TaskMngrService::killApp(const std::string &appid, const std::string &instanceId)
+{
+    TRACE;
+    int ret = 0;
+    bool running = false;
+    app_context_h context = nullptr;
+
+    if (instanceId.empty()) {
+        app_manager_is_running(appid.c_str(), &running);
+        if (running) {
+            app_manager_get_app_context(appid.c_str(), &context);
+        } else {
+            rua_delete_history_with_instance_id(appid.c_str(), nullptr);
+            return false;
+        }
+    } else {
+        app_manager_get_app_context_by_instance_id(appid.c_str(), instanceId.c_str(), &context);
+    }
+
+    if (context) {
+        app_manager_terminate_app(context);
+        app_context_destroy(context);
+    }
+
+    LOG("terminate app = ", appid);
+    ret = rua_delete_history_with_instance_id(appid.c_str(), instanceId.c_str());
+
+    return !ret;
+}
+
+bool TaskMngrService::launchApp(const std::string &appid, const std::string &uri)
+{
+    TRACE;
+    int ret = 0;
+    app_control_h service = nullptr;
+
+    app_control_create(&service);
+    if (!service)
+        return false;
+
+    app_control_set_operation(service, APP_CONTROL_OPERATION_MAIN);
+    app_control_set_app_id(service, appid.c_str());
+
+    if (!uri.empty())
+        app_control_set_uri(service, uri.c_str());
+
+    ret = app_control_send_launch_request(service, nullptr, nullptr);
+    app_control_destroy(service);
+    if (ret != APP_CONTROL_ERROR_NONE) {
+        LOG_ERROR("Failed to send launch request");
+        return false;
+    }
+
+    return true;
+}
+
+std::vector<AppInfo> TaskMngrService::getAppInfo()
+{
+    m_AppInfo.clear();
+
+    char **table = nullptr;
+    int rows = 0;
+    int cols = 0;
+
+    if (rua_history_load_db(&table, &rows, &cols)) {
+        LOG_ERROR("rua_history_load_db failed!");
+    }
+
+    if (table) {
+        fillAppInfoList(table, rows, cols);
+        rua_history_unload_db(&table);
+    }
+
+    return m_AppInfo;
+}
+
+void TaskMngrService::init()
+{
+    if (rua_init()) {
+        LOG_ERROR("rua_init failed!");
+    }
+
+    filterCreate();
+}
+
+void TaskMngrService::finit()
+{
+    app_info_filter_destroy(m_Filter);
+    rua_fini();
+}
+
+void TaskMngrService::filterCreate()
+{
+    app_info_filter_create(&m_Filter);
+    app_info_filter_add_bool(m_Filter, PACKAGE_INFO_PROP_APP_TASKMANAGE, true);
+}
+
+void TaskMngrService::findAndAppendApp()
+{
+    app_info_filter_add_string(m_Filter, PACKAGE_INFO_PROP_APP_ID, m_RuaRecord.pkg_name);
+    app_info_filter_foreach_appinfo(m_Filter, makeCbLast(&TaskMngrService::appInfoCb), this);
+}
+
+bool TaskMngrService::appInfoCb(app_info_h appInfo)
+{
+    AppInfo item;
+    char *variable = nullptr;
+    int ret = 0;
+
+    app_info_get_app_id(appInfo, &variable);
+    if (variable) {
+        item.appid = variable;
+        free(variable);
+        variable = nullptr;
+    }
+
+    app_info_get_package(appInfo, &variable);
+    if (variable) {
+        item.pkgid = variable;
+        free(variable);
+        variable = nullptr;
+    }
+
+    if (m_RuaRecord.uri)
+        item.uri = m_RuaRecord.uri;
+
+    if (m_RuaRecord.instance_id)
+        item.instanceId = m_RuaRecord.instance_id;
+
+    if (m_RuaRecord.instance_name) {
+        item.name = m_RuaRecord.instance_name;
+    } else {
+        app_info_get_label(appInfo, &variable);
+        if (variable) {
+            item.name = variable;
+            free(variable);
+            variable = nullptr;
+        }
+    }
+
+    if (m_RuaRecord.icon) {
+        item.icon = m_RuaRecord.icon;
+    } else {
+        ret = app_info_get_icon(appInfo, &variable);
+        if (variable) {
+            item.icon = variable;
+            free(variable);
+            variable = nullptr;
+        }
+    }
+    item.launchTime = m_RuaRecord.launch_time;
+
+    if (item.pkgid == "org.tizen.task-mgr" || item.pkgid == "org.tizen.taskmanager") {
+        LOG_ERROR("ignoring Recents app");
+        return false;
+    }
+
+    m_AppInfo.push_back(std::move(item));
+
+    return true;
+}
+
+void TaskMngrService::fillAppInfoList(char **table, int &rows, int &cols)
+{
+    for (int row = 0; row < rows; ++row) {
+        rua_history_get_rec(&m_RuaRecord, table, rows, cols, row);
+        findAndAppendApp();
+    }
+}
index 1be20ca..85aef1e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016  Samsung Electronics Co., Ltd
+ * Copyright 2017  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.1 (the "License");
  * you may not use this file except in compliance with the License.
 #include "Config.h"
 #include <Elementary.h>
 
-namespace TaskMngr
-{
+namespace TaskMngr {
     /**
      * @brief Wrapper for Elm_Interface_Atspi_Accessible interface (Screen reader)
      */
-    class AtspiAccessibleInterface
-    {
+    class AtspiAccessibleInterface {
         public:
             AtspiAccessibleInterface(Elm_Interface_Atspi_Accessible *obj);
             void wrap(Elm_Interface_Atspi_Accessible *obj);
index 9d4b20c..694015c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016  Samsung Electronics Co., Ltd
+ * Copyright 2017  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.1 (the "License");
  * you may not use this file except in compliance with the License.
 #include "PathUtils.h"
 #include "AtspiAccessibleInterface.h"
 
-namespace TaskMngr
-{
+namespace TaskMngr {
     /**
      * @brief Basic interface for all visual objects used across the whole application.
      */
-    class BaseView
-    {
+    class BaseView {
         public:
             BaseView();
             virtual ~BaseView() {};
index faf09b0..9e3669b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016  Samsung Electronics Co., Ltd
+ * Copyright 2017  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.1 (the "License");
  * you may not use this file except in compliance with the License.
@@ -21,8 +21,7 @@ template <class F>
 struct Callback;
 
 template <class R, class C, class... A>
-struct Callback<R(C::*)(A...)>
-{
+struct Callback<R(C::*)(A...)> {
     using M = R(C::*)(A...);
 
     template <M m>
index 950d04a..8523c4c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016  Samsung Electronics Co., Ltd
+ * Copyright 2017  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.1 (the "License");
  * you may not use this file except in compliance with the License.
 #include <stdio.h>
 #include <stdarg.h>
 
-namespace TaskMngr
-{
+namespace TaskMngr {
     // Translatable Text
-    struct TText
-    {
+    struct TText {
         explicit TText(const char *stringId, const char *domainName)
             : m_pDomain(domainName)
             , m_pMsg(stringId)
@@ -55,8 +53,7 @@ namespace TaskMngr
     };
 
     // dgettext
-    struct DText
-    {
+    struct DText {
         explicit DText(const char *stringId, const char *domainName)
         {
             m_pMsg = dgettext(domainName, stringId);
index a833443..ab13ec2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016  Samsung Electronics Co., Ltd
+ * Copyright 2017  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.1 (the "License");
  * you may not use this file except in compliance with the License.
index 7ac905e..52f32fb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016  Samsung Electronics Co., Ltd
+ * Copyright 2017  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.1 (the "License");
  * you may not use this file except in compliance with the License.
 #include <string>
 #include "Resource.h"
 
-namespace TaskMngr
-{
-    namespace PathUtils
-    {
+namespace TaskMngr {
+    namespace PathUtils {
             /**
              * @brief Gets the absolute path to file in the application resource directory.
              * @param[in] path to file in res. dir (without slash at begin/end)
index 809038a..fa10784 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016  Samsung Electronics Co., Ltd
+ * Copyright 2017  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.1 (the "License");
  * you may not use this file except in compliance with the License.
 
 #include <Elementary.h>
 
-namespace TaskMngr
-{
+namespace TaskMngr {
     /**
      * @brief Wraps all basic Evas_Object operations and manages automatic self-removal by EVAS_CALLBACK_FREE and EVAS_CALLBACK_DEL events.
      */
     class View
-        : public BaseView
-    {
+        : public BaseView {
         public:
             View();
 
index 8667ad8..dbe1c37 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016  Samsung Electronics Co., Ltd
+ * Copyright 2017  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.1 (the "License");
  * you may not use this file except in compliance with the License.
 
 #include "View.h"
 
-namespace TaskMngr
-{
+namespace TaskMngr {
     class Window
-        : public View
-    {
+        : public View {
         public:
             Window();
             virtual ~Window();
index 4d0d316..5ee4c0a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016  Samsung Electronics Co., Ltd
+ * Copyright 2017  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.1 (the "License");
  * you may not use this file except in compliance with the License.
@@ -16,8 +16,7 @@
 
 #include "Logger.h"
 
-namespace
-{
+namespace {
     const std::string enterFraseFormat = "%s: %s(%d) -> [ENTER]";
     const std::string leaveFraseFormat = "%s: %s -> [LEAVE]";
     const log_priority defaultPriority = DLOG_DEBUG;
index 03508ed..d819af4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016  Samsung Electronics Co., Ltd
+ * Copyright 2017  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.1 (the "License");
  * you may not use this file except in compliance with the License.
@@ -28,11 +28,9 @@ std::string getResourcePath(const std::string &filePath)
 {
     std::string res;
     static std::string basePath;
-    if (basePath.empty())
-    {
+    if (basePath.empty()) {
         char *path = app_get_resource_path();
-        if (path)
-        {
+        if (path) {
             basePath = path;
             free(path);
         }
@@ -48,11 +46,9 @@ std::string getDataPath(const std::string &filePath)
 {
     std::string res;
     static std::string basePath;
-    if (basePath.empty())
-    {
+    if (basePath.empty()) {
         char *path = app_get_data_path();
-        if (path)
-        {
+        if (path) {
             basePath = path;
             free(path);
         }
@@ -68,8 +64,7 @@ std::string getResourcePath()
 {
     std::string res;
     char* resPath = app_get_resource_path();
-    if (resPath)
-    {
+    if (resPath) {
         res = resPath;
         free(resPath);
     }
@@ -80,8 +75,7 @@ std::string getResourcePath()
 std::string getLocalePath()
 {
     std::string resPath(getResourcePath());
-    if (!resPath.empty())
-    {
+    if (!resPath.empty()) {
         resPath.append("locale");
     }
 
@@ -90,8 +84,7 @@ std::string getLocalePath()
 
 static bool storageCb(int storageId, storage_type_e type, storage_state_e state, const char *path, void *userData)
 {
-    if (type == STORAGE_TYPE_INTERNAL)
-    {
+    if (type == STORAGE_TYPE_INTERNAL) {
         int *internalStorage = (int *)userData;
         *internalStorage = storageId;
         return false;
@@ -113,8 +106,7 @@ const std::string &getDownloadPath()
     if (error == STORAGE_ERROR_NONE)
         storage_get_directory(storageId, STORAGE_DIRECTORY_DOWNLOADS, &dirPath);
 
-    if (dirPath)
-    {
+    if (dirPath) {
         downloadPath = dirPath;
         free(dirPath);
     }
index f6b5c18..c94b711 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016  Samsung Electronics Co., Ltd
+ * Copyright 2017  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.1 (the "License");
  * you may not use this file except in compliance with the License.
@@ -24,8 +24,7 @@
 
 using namespace TaskMngr;
 
-namespace
-{
+namespace {
     const char *thisKey = "this";
 }
 
@@ -52,8 +51,7 @@ Evas_Object_Event_Cb View::getCb(Evas_Callback_Type type)
 void View::setEventCb(Evas_Callback_Type type)
 {
     Evas_Object_Event_Cb cb = getCb(type);
-    if (cb)
-    {
+    if (cb) {
         evas_object_event_callback_add(m_pEo, type, cb, this);
     } else {
         LOG_ERROR("Not implemented");
@@ -63,16 +61,14 @@ void View::setEventCb(Evas_Callback_Type type)
 
 void View::setEo(Evas_Object *eo)
 {
-    if (m_pEo)
-    {
+    if (m_pEo) {
         LOG_ERROR("m_pEo not null");
         assert(false);
     }
 
     BaseView::setEo(eo);
 
-    if (eo)
-    {
+    if (eo) {
         setData(this);
         setEventCb(EVAS_CALLBACK_FREE);
         setEventCb(EVAS_CALLBACK_DEL);
@@ -82,8 +78,7 @@ void View::setEo(Evas_Object *eo)
 void View::unsetEventCb(Evas_Callback_Type type)
 {
     Evas_Object_Event_Cb cb = getCb(type);
-    if (cb)
-    {
+    if (cb) {
         evas_object_event_callback_del(m_pEo, type, cb);
     } else {
         LOG_ERROR("Not implemented");
@@ -161,8 +156,7 @@ std::string TaskMngr::markupToUtf8(const char *str)
 
     std::string res;
     char *markup = elm_entry_markup_to_utf8(str);
-    if (markup)
-    {
+    if (markup) {
         res = markup;
         free(markup);
     }
@@ -177,8 +171,7 @@ std::string TaskMngr::utf8ToMarkup(const char *str)
 
     std::string res;
     char *markup = elm_entry_utf8_to_markup(str);
-    if (markup)
-    {
+    if (markup) {
         res = markup;
         free(markup);
     }
index b13c92a..42be144 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016  Samsung Electronics Co., Ltd
+ * Copyright 2017  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.1 (the "License");
  * you may not use this file except in compliance with the License.
index da2c9b2..ab5e33f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016  Samsung Electronics Co., Ltd
+ * Copyright 2017  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.1 (the "License");
  * you may not use this file except in compliance with the License.
index 7524f00..5a66445 100644 (file)
@@ -1,8 +1,14 @@
 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns="http://tizen.org/ns/packages" api-version="3.0" package="org.tizen.taskmanager" version="1.0.0">
-       <profile name="wearable" />
-       <ui-application appid="org.tizen.taskmanager" exec="taskmanager" type="capp" multiple="false" taskmanage="true" nodisplay="false" hw-acceleration="on">
-               <icon>taskmanager.png</icon>
-               <label>taskmanager</label>
-       </ui-application>
+    <profile name="wearable" />
+    <ui-application appid="org.tizen.taskmanager" exec="taskmanager" type="capp" multiple="false" taskmanage="true" nodisplay="false" hw-acceleration="on">
+        <icon>taskmanager.png</icon>
+        <label>taskmanager</label>
+    </ui-application>
+    <privileges>
+        <privilege>http://tizen.org/privilege/packagemanager.clearcache</privilege>
+        <privilege>http://tizen.org/privilege/appmanager.kill.bgapp</privilege>
+        <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
+        <privilege>http://tizen.org/privilege/packagemanager.info</privilege>
+    </privileges>
 </manifest>