fix issues 69/74969/4 accepted/tizen/common/20160620.163200 accepted/tizen/ivi/20160617.083714 accepted/tizen/mobile/20160617.083835 accepted/tizen/tv/20160617.083602 accepted/tizen/wearable/20160617.083917 submit/tizen/20160616.235341
authorJunghyun Yeon <jungh.yeon@samsung.com>
Thu, 16 Jun 2016 07:32:01 +0000 (16:32 +0900)
committerJunghyun Yeon <jungh.yeon@samsung.com>
Fri, 17 Jun 2016 00:14:21 +0000 (09:14 +0900)
- adjust enum value of appinfo filter property
- fix compare routine for splash screen to compare properly
- add error check routine for OOM
- add missed parameter for log

Change-Id: I884990e3cea253ed21d6940b98b2d3087cc43fce
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
include/pkgmgrinfo_private.h
parser/pkgmgr_parser_db.c
src/pkgmgrinfo_appinfo.c
src/pkgmgrinfo_certinfo.c

index 38d71b4..33b59e9 100644 (file)
@@ -149,7 +149,7 @@ typedef enum _pkgmgrinfo_appinfo_filter_prop_bool {
 typedef enum _pkgmgrinfo_appinfo_filter_prop_int {
        /*Currently No Fields*/
        E_PMINFO_APPINFO_PROP_APP_MIN_INT = 601,
-       E_PMINFO_APPINFO_PROP_APP_DISABLE_FOR_USER,
+       E_PMINFO_APPINFO_PROP_APP_DISABLE_FOR_USER = E_PMINFO_APPINFO_PROP_APP_MIN_INT,
        E_PMINFO_APPINFO_PROP_APP_MAX_INT = E_PMINFO_APPINFO_PROP_APP_DISABLE_FOR_USER
 } pkgmgrinfo_appinfo_filter_prop_int;
 
index 385d09b..87bc1d9 100644 (file)
@@ -1776,7 +1776,7 @@ static int __insert_application_metadata_splashscreen_info(manifest_x *mfx)
 
                        if (strcasestr(md->key, "operation_effect=")) {
                                operation = index(md->key, '=');
-                               if ((operation + 1) != NULL)
+                               if (operation[1] != '\0')
                                        operation++;
                                else
                                        operation = NULL;
@@ -1793,19 +1793,19 @@ static int __insert_application_metadata_splashscreen_info(manifest_x *mfx)
                        while (token != NULL) {
                                if (strcasestr(token, "portrait-effectimage=")) {
                                        portraitimg = index(token, '=');
-                                       if ((portraitimg + 1) != NULL)
+                                       if (portraitimg[1] != '\0')
                                                portraitimg++;
                                        else
                                                portraitimg = NULL;
                                } else if (strcasestr(token, "landscape-effectimage=")) {
                                        landscapeimg = index(token, '=');
-                                       if ((landscapeimg + 1) != NULL)
+                                       if (landscapeimg[1] != '\0')
                                                landscapeimg++;
                                        else
                                                landscapeimg = NULL;
                                } else if (strcasestr(token, "indicatordisplay=")) {
                                        indicatordisplay = index(token, '=');
-                                       if ((indicatordisplay + 1) != NULL)
+                                       if (indicatordisplay[1] != '\0')
                                                indicatordisplay++;
                                        else
                                                indicatordisplay = "true";
index 46a1674..0da8632 100644 (file)
@@ -2201,6 +2201,7 @@ API int pkgmgrinfo_appinfo_usr_get_datacontrol_info(const char *providerid, cons
 
        /*Start constructing query*/
        query = sqlite3_mprintf("select * from package_app_data_control where providerid=%Q and type=%Q", providerid, type);
+       tryvm_if(query == NULL, ret = PMINFO_R_ERROR, "Out of memory");
 
        /*prepare query*/
        ret = sqlite3_prepare_v2(GET_DB(manifest_db), query, strlen(query), &stmt, NULL);
@@ -2242,6 +2243,7 @@ API int pkgmgrinfo_appinfo_usr_get_datacontrol_appid(const char *providerid, uid
 
        /*Start constructing query*/
        query = sqlite3_mprintf("select * from package_app_data_control where providerid=%Q", providerid);
+       tryvm_if(query == NULL, ret = PMINFO_R_ERROR, "Out of memory");
 
        /*prepare query*/
        ret = sqlite3_prepare_v2(GET_DB(manifest_db), query, strlen(query), &stmt, NULL);
index 5a25a22..3688488 100644 (file)
@@ -192,7 +192,7 @@ static int _pkginfo_get_pkgid_from_appid(uid_t uid, const char *appid,
                _save_column_str(stmt, 0, pkgid);
                ret = PMINFO_R_OK;
        } else if (ret == SQLITE_DONE) {
-               _LOGI("cannot find pkgid of app %s for uid %d", appid);
+               _LOGI("cannot find pkgid of app %s for uid %d", appid, (int)uid);
                ret = PMINFO_R_ENOENT;
        } else {
                _LOGE("step error: %s", sqlite3_errmsg(db));