rewrite pkg-mgr to app_info. 91/58391/5
authorLukasz Stanislawski <l.stanislaws@samsung.com>
Sat, 30 Jan 2016 10:03:34 +0000 (11:03 +0100)
committerMichal Pawluk <m.pawluk@samsung.com>
Sun, 31 Jan 2016 17:39:30 +0000 (18:39 +0100)
Change-Id: Ic59884fe50520ee635803d75cb298021ba7bd4db
Signed-off-by: Lukasz Stanislawski <l.stanislaws@samsung.com>
src/modules/information/noti.c
src/ticker.c
tizen-manifest.xml

index 2c61ce5..68e6a4f 100644 (file)
@@ -25,7 +25,7 @@
 #include <notification.h>
 #include <notification_list.h>
 //#include <notification_internal.h>
-#include <pkgmgr-info.h>
+#include <app_manager.h>
 #include <app_preference.h>
 
 #include "common.h"
@@ -143,32 +143,29 @@ static void insert_icon_list(struct noti_status *data)
 
 char* __indicator_ui_get_pkginfo_icon(const char *pkgid)
 {
-       int ret = 0;
+       int ret;
        char *icon_path = NULL;
-       char *icon_ret = NULL;
-       retif(pkgid == NULL, NULL, "invalid parameter");
+       app_info_h app_info;
 
-       pkgmgrinfo_appinfo_h appinfo_h = NULL;
+       retif(pkgid == NULL, NULL, "invalid parameter");
 
-       ret = pkgmgrinfo_appinfo_get_appinfo(pkgid, &appinfo_h);
-       if (ret < 0) {
-               ERR("pkgmgrinfo_appinfo_get_appinfo is failed %d %s", ret,pkgid);
+       ret = app_info_create(pkgid, &app_info);
+       if (ret != APP_MANAGER_ERROR_NONE) {
+               ERR("app_info_create for %s failed %d", pkgid, ret);
+               return NULL;
        }
 
        /* Icon path */
-       ret = pkgmgrinfo_appinfo_get_icon(appinfo_h, &icon_path);
-
-       if (ret < 0) {
-               ERR("pkgmgrinfo_appinfo_get_icon is failed %d", ret);
-       }
-       if(icon_path) {
-               icon_ret = (char*)strdup(icon_path);
-       }
-       if (appinfo_h) {
-               pkgmgrinfo_appinfo_destroy_appinfo(appinfo_h);
+       ret = app_info_get_icon(app_info, &icon_path);
+       if (ret != APP_MANAGER_ERROR_NONE) {
+               app_info_destroy(app_info);
+               ERR("app_info_get_icon failed %d", ret);
+               return NULL;
        }
 
-       return icon_ret;
+       app_info_destroy(app_info);
+
+       return icon_path;
 }
 
 
index 35ae89a..0fc89c0 100644 (file)
@@ -27,7 +27,7 @@
 #include <metadata_extractor.h>
 #include <notification.h>
 //#include <notification_text_domain.h>
-#include <pkgmgr-info.h>
+#include <app_manager.h>
 
 #include "common.h"
 #include "main.h"
@@ -294,31 +294,28 @@ static Evas_Object *_animated_icon_get(Evas_Object *parent, const char *path)
 
 static char *_get_pkginfo_icon(const char *pkgid)
 {
-       int ret = 0;
+       int ret;
        char *icon_path = NULL;
-       char *icon_ret = NULL;
-       retif(pkgid == NULL, NULL, "invalid parameter");
+       app_info_h app_info;
 
-       pkgmgrinfo_appinfo_h appinfo_h = NULL;
+       retif(pkgid == NULL, NULL, "invalid parameter");
 
-       ret = pkgmgrinfo_appinfo_get_appinfo(pkgid, &appinfo_h);
-       if (ret < 0) {
-               _E("pkgmgrinfo_appinfo_get_appinfo is failed %d", ret);
+       ret = app_info_create(pkgid, &app_info);
+       if (ret != APP_MANAGER_ERROR_NONE) {
+               _E("app_info_create for %s failed %d", pkgid, ret);
                return NULL;
        }
 
-       ret = pkgmgrinfo_appinfo_get_icon(appinfo_h, &icon_path);
-       if (ret < 0) {
-               _E("pkgmgrinfo_appinfo_get_icon is failed %d", ret);
-       }
-       if (icon_path) {
-               icon_ret = (char*)strdup(icon_path);
-       }
-       if (appinfo_h) {
-               pkgmgrinfo_appinfo_destroy_appinfo(appinfo_h);
+       ret = app_info_get_icon(app_info, &icon_path);
+       if (ret != APP_MANAGER_ERROR_NONE) {
+               app_info_destroy(app_info);
+               _E("app_info_get_icon failed %d", ret);
+               return NULL;
        }
 
-       return icon_ret;
+       app_info_destroy(app_info);
+
+       return icon_path;
 }
 
 static Evas_Object *_ticker_create_icon(Evas_Object *parent, notification_h noti)
index d599e23..f3091d1 100644 (file)
@@ -1,8 +1,11 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
 <manifest xmlns="http://tizen.org/ns/packages" api-version="3.0" package="org.tizen.indicator-win" version="1.0.0">
-       <profile name="mobile" />
-       <ui-application appid="org.tizen.indicator-win" exec="indicator-win" type="capp" multiple="false" taskmanage="true" nodisplay="false" launch_mode="single">
-               <icon>indicator-win.png</icon>
-               <label>indicator-win</label>
-       </ui-application>
+    <profile name="mobile"/>
+    <ui-application appid="org.tizen.indicator-win" exec="indicator-win" launch_mode="single" multiple="false" nodisplay="true" taskmanage="false" type="capp">
+        <label>indicator-win</label>
+        <icon>indicator-win.png</icon>
+    </ui-application>
+    <privileges>
+        <privilege>http://tizen.org/privilege/packagemanager.info</privilege>
+    </privileges>
 </manifest>