return r;
}
+String
+_PackageAppInfoImpl::GetAppFeature(const String& key) const
+{
+ SysTryReturn(NID_APP, __appId.IsEmpty() == false, L"", E_SYSTEM, "__appId is empty.");
+
+ String value;
+ Database db;
+ String query;
+
+ query.Format(1024, L"SELECT AppFeature.VALUE FROM AppInfo, AppFeature WHERE AppFeature.ID = AppInfo.UNIQUE_ID and AppFeature.NAME = '%ls' and AppInfo.PACKAGE_NAME = '%ls'",
+ key.GetPointer(), __appId.GetPointer());
+
+ SysLog(NID_APP, "query = [%ls]", query.GetPointer());
+
+ result r = db.Construct(PACKAGE_DATABASE_FILE_NAME, "r");
+ SysTryReturn(NID_APP, r == E_SUCCESS, L"", E_SYSTEM, "db.Construct() failed. [%s]", GetErrorMessage(r));
+
+ std::unique_ptr< DbStatement > pStmt(_PackageManagerImpl::CreateStatementN(db, query));
+ SysTryReturn(NID_APP, pStmt, L"", E_SYSTEM, "CreateStatementN(%ls) failed. [%s]", query.GetPointer(), GetErrorMessage(GetLastResult()));
+
+ std::unique_ptr< DbEnumerator > pEnum(_PackageManagerImpl::ExecuteStatementN(db, pStmt.get()));
+ SysTryReturn(NID_APP, pEnum, L"", E_SYSTEM, "ExecuteStatementN() failed. [%s]", GetErrorMessage(GetLastResult()));
+
+ while (pEnum->MoveNext() == E_SUCCESS)
+ {
+ pEnum->GetStringAt(0, value);
+ }
+
+ SysLog(NID_APP, "value = [%ls]", value.GetPointer());
+
+ return value;
+}
+
_PackageAppInfoImpl*
_PackageAppInfoImpl::GetInstance(PackageAppInfo* pPackageAppInfo)
{
char* pUrl = null;
char* pMainAppId = null;
char* pStoreClientId = null;
+ char* pRootPath = null;
int installedTime = 0;
pkgmgrinfo_installed_storage storage = PMINFO_INTERNAL_STORAGE;
bool removable = true;
- // temp
- Database db;
- DbStatement* pStmt = null;
- DbEnumerator* pEnum = null;
- String query;
-
std::unique_ptr<char[]> pPackageId(_StringConverter::CopyToCharArrayN(packageId));
SysTryReturnResult(NID_APP, pPackageId, E_OUT_OF_MEMORY, "pPackageId is null");
SysLog(NID_APP, "pkgmgrinfo_pkginfo_get_storeclientid() is failed. result = [%d]", result);
}
- // temp
- query.Format(1024, L"SELECT PkgInfo.*, AppInfo.APP_MAINMENU_ICON FROM AppInfo, PkgInfo WHERE AppInfo.ID = PkgInfo.UNIQUE_ID and AppInfo.APP_DEFAULT = 'True' and PkgInfo.PKG_ID = '%ls'", packageId.GetPointer());
-
- r = db.Construct(PACKAGE_DATABASE_FILE_NAME, "r");
- SysTryCatch(NID_APP, r == E_SUCCESS, , r, "[%s] An error occurs while opening a database.", GetErrorMessage(r));
-
- pStmt = _PackageManagerImpl::CreateStatementN(db, query);
- SysTryCatch(NID_APP, pStmt != null, GetLastResult(), GetLastResult(), "[%s] An error occurs while creating a database statement.", GetErrorMessage(GetLastResult()));
-
- pEnum = _PackageManagerImpl::ExecuteStatementN(db, pStmt);
- if (pEnum != null)
+ result = pkgmgrinfo_pkginfo_get_root_path(__packageInfoHandle, &pRootPath);
+ if (result == PMINFO_R_OK)
{
- if (pEnum->MoveNext() == E_SUCCESS)
- {
- String rootPath;
- int storageType = 0;
-
- if (pEnum->GetColumnType(16) != DB_COLUMNTYPE_NULL)
- {
- pEnum->GetStringAt(16, rootPath);
- }
- if (pEnum->GetColumnType(17) != DB_COLUMNTYPE_NULL)
- {
- pEnum->GetIntAt(17, storageType);
- }
-
- SetAppRootPath(rootPath);
- SetAppStorageType(storageType);
- }
-
- delete pEnum;
+ SysLog(NID_APP, "pkgmgrinfo_pkginfo_get_root_path(): rootPath = [%s]", pRootPath);
+ String rootPath(pRootPath);
+ __appRootPath = rootPath;
+ }
+ else
+ {
+ SysLog(NID_APP, "pkgmgrinfo_pkginfo_get_root_path() is failed. result = [%d]", result);
}
-CATCH:
- delete pStmt;
return r;
}