* limitations under the License.
*/
+#if !defined(SECURE_LOGD)
+#define SECURE_LOGD LOGD
+#endif
+
+#if !defined(SECURE_LOGE)
+#define SECURE_LOGE LOGE
+#endif
+
+#if !defined(SECURE_LOGW)
+#define SECURE_LOGW LOGW
+#endif
+
#if !defined(FLOG)
-#define DbgPrint(format, arg...) LOGD("[\e[32m%s/%s\e[0m:%d] " format, util_basename(__FILE__), __func__, __LINE__, ##arg)
-#define ErrPrint(format, arg...) LOGE("[\e[32m%s/%s\e[0m:%d] " format, util_basename(__FILE__), __func__, __LINE__, ##arg)
+#define DbgPrint(format, arg...) SECURE_LOGD("[\e[32m%s/%s\e[0m:%d] " format, util_basename(__FILE__), __func__, __LINE__, ##arg)
+#define ErrPrint(format, arg...) SECURE_LOGE("[\e[32m%s/%s\e[0m:%d] " format, util_basename(__FILE__), __func__, __LINE__, ##arg)
#else
extern FILE *__file_log_fp;
#define DbgPrint(format, arg...) do { fprintf(__file_log_fp, "[LOG] [\e[32m%s/%s\e[0m:%d] " format, util_basename(__FILE__), __func__, __LINE__, ##arg); fflush(__file_log_fp); } while (0)
LB_STATUS_ERROR_TIMEOUT = LB_STATUS_ERROR | 0x0400,
LB_STATUS_ERROR_NOT_IMPLEMENTED = LB_STATUS_ERROR | 0x0800,
LB_STATUS_ERROR_NO_SPACE = LB_STATUS_ERROR | 0x1000,
+ LB_STATUS_ERROR_DISABLED = LB_STATUS_ERROR | 0x2000,
};
#define LB_STATUS_IS_ERROR(s) (!!((s) & LB_STATUS_ERROR))
Name: liblivebox-service
Summary: Service API for gathering installed livebox information.
-Version: 0.4.5
+Version: 0.4.6
Release: 1
Group: HomeTF/Livebox
License: Flora License
} else {
ErrPrint("Failed to get mainappid\n");
ret = NULL; /* I cannot believe the pkgmgrinfo_pkginfo_get_mainappid. it maybe able to touch my "ret" even though it fails */
+
}
pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
{
sqlite3_stmt *stmt;
const char *tmp;
- char *pkgid;
+ const char *pkgid;
sqlite3 *handle;
char *ret = NULL;
if (!handle)
return NULL;
- if (sqlite3_prepare_v2(handle, "SELECT appid FROM pkgmap WHERE (pkgid = ?) or (appid = ?)", -1, &stmt, NULL) != SQLITE_OK) {
+ if (sqlite3_prepare_v2(handle, "SELECT appid, uiapp FROM pkgmap WHERE (pkgid = ?) or (appid = ? and prime = 1)", -1, &stmt, NULL) != SQLITE_OK) {
ErrPrint("Error: %s\n", sqlite3_errmsg(handle));
goto out;
}
goto out;
}
- pkgid = strdup(tmp);
- if (!pkgid) {
- ErrPrint("Error: %s\n", strerror(errno));
- sqlite3_reset(stmt);
- sqlite3_finalize(stmt);
- goto out;
+ pkgid = (const char *)sqlite3_column_text(stmt, 1);
+ if (!pkgid || !strlen(pkgid)) {
+ /*
+ * This record has no uiapp.
+ * Try to find the main ui-app id.
+ */
+ ret = pkgmgr_get_mainapp(tmp);
+ } else {
+ ret = strdup(pkgid);
+ if (!ret)
+ ErrPrint("Error: %s\n", strerror(errno));
}
sqlite3_reset(stmt);
sqlite3_finalize(stmt);
- ret = pkgmgr_get_mainapp(pkgid);
- free(pkgid);
-
out:
close_db(handle);
return ret;