mirror of
https://github.com/openharmony/ability_ability_runtime.git
synced 2026-08-25 12:23:20 -04:00
!7688 nativeLibraryPath代码回退
Merge pull request !7688 from XKK/nativeLibraryPath2
This commit is contained in:
@@ -201,10 +201,6 @@ class ApplicationContext {
|
||||
return this.__context_impl__.resourceDir;
|
||||
}
|
||||
|
||||
get nativeLibraryPath() {
|
||||
return this.__context_impl__.nativeLibraryPath;
|
||||
}
|
||||
|
||||
get filesDir() {
|
||||
return this.__context_impl__.filesDir;
|
||||
}
|
||||
|
||||
@@ -122,10 +122,6 @@ class Context {
|
||||
return this.__context_impl__.resourceDir;
|
||||
}
|
||||
|
||||
get nativeLibraryPath() {
|
||||
return this.__context_impl__.nativeLibraryPath;
|
||||
}
|
||||
|
||||
get filesDir() {
|
||||
return this.__context_impl__.filesDir;
|
||||
}
|
||||
|
||||
@@ -103,11 +103,6 @@ std::string AbilityContextImpl::GetResourceDir()
|
||||
return stageContext_ ? stageContext_->GetResourceDir() : "";
|
||||
}
|
||||
|
||||
std::string AbilityContextImpl::GetNativeLibraryPath()
|
||||
{
|
||||
return stageContext_ ? stageContext_->GetNativeLibraryPath() : "";
|
||||
}
|
||||
|
||||
std::string AbilityContextImpl::GetFilesDir()
|
||||
{
|
||||
return stageContext_ ? stageContext_->GetFilesDir() : "";
|
||||
|
||||
@@ -363,11 +363,6 @@ std::string ApplicationContext::GetResourceDir()
|
||||
return (contextImpl_ != nullptr) ? contextImpl_->GetResourceDir() : "";
|
||||
}
|
||||
|
||||
std::string ApplicationContext::GetNativeLibraryPath()
|
||||
{
|
||||
return (contextImpl_ != nullptr) ? contextImpl_->GetNativeLibraryPath() : "";
|
||||
}
|
||||
|
||||
std::string ApplicationContext::GetFilesDir()
|
||||
{
|
||||
return (contextImpl_ != nullptr) ? contextImpl_->GetFilesDir() : "";
|
||||
|
||||
@@ -69,7 +69,6 @@ const std::string ContextImpl::CONTEXT_FILES("/files");
|
||||
const std::string ContextImpl::CONTEXT_HAPS("/haps");
|
||||
const std::string ContextImpl::CONTEXT_ELS[] = {"el1", "el2", "el3", "el4"};
|
||||
const std::string ContextImpl::CONTEXT_RESOURCE_END = "/resources/resfile";
|
||||
const std::string ContextImpl::CONTEXT_NATIVE_LIBRARY_PATH_PREV = "/proc/3697/root/data/storage/el1/bundle/";
|
||||
Global::Resource::DeviceType ContextImpl::deviceType_ = Global::Resource::DeviceType::DEVICE_NOT_SET;
|
||||
const std::string OVERLAY_STATE_CHANGED = "usual.event.OVERLAY_STATE_CHANGED";
|
||||
const int32_t TYPE_RESERVE = 1;
|
||||
@@ -308,28 +307,6 @@ std::string ContextImpl::GetResourceDir()
|
||||
return "";
|
||||
}
|
||||
|
||||
std::string ContextImpl::GetNativeLibraryPath()
|
||||
{
|
||||
auto appInfo = GetApplicationInfo();
|
||||
if (appInfo == nullptr || appInfo->nativeLibraryPath.empty()) {
|
||||
return "";
|
||||
}
|
||||
std::shared_ptr<AppExecFwk::HapModuleInfo> hapModuleInfoPtr = GetHapModuleInfo();
|
||||
if (hapModuleInfoPtr == nullptr) {
|
||||
return "";
|
||||
}
|
||||
if (!hapModuleInfoPtr->isLibIsolated) {
|
||||
return CONTEXT_DATA_STORAGE + CONTEXT_ELS[0] + CONTEXT_BUNDLE + appInfo->nativeLibraryPath;
|
||||
}
|
||||
if (hapModuleInfoPtr->moduleName.empty()) {
|
||||
return "";
|
||||
}
|
||||
|
||||
std::string ret = CONTEXT_DATA_STORAGE + CONTEXT_ELS[0] + CONTEXT_BUNDLE + hapModuleInfoPtr->moduleName +
|
||||
CONTEXT_FILE_SEPARATOR + appInfo->nativeLibraryPath;
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::string ContextImpl::GetFilesDir()
|
||||
{
|
||||
std::string dir = GetBaseDir() + CONTEXT_FILES;
|
||||
|
||||
@@ -149,7 +149,6 @@ napi_value JsApplicationContextUtils::OnSwitchArea(napi_env env, NapiCallbackInf
|
||||
BindNativeProperty(env, object, "cacheDir", GetCacheDir);
|
||||
BindNativeProperty(env, object, "tempDir", GetTempDir);
|
||||
BindNativeProperty(env, object, "resourceDir", GetResourceDir);
|
||||
BindNativeProperty(env, object, "nativeLibraryPath", GetNativeLibraryPath);
|
||||
BindNativeProperty(env, object, "filesDir", GetFilesDir);
|
||||
BindNativeProperty(env, object, "distributedFilesDir", GetDistributedFilesDir);
|
||||
BindNativeProperty(env, object, "databaseDir", GetDatabaseDir);
|
||||
@@ -340,24 +339,6 @@ napi_value JsApplicationContextUtils::OnGetResourceDir(napi_env env, NapiCallbac
|
||||
return CreateJsValue(env, path);
|
||||
}
|
||||
|
||||
napi_value JsApplicationContextUtils::GetNativeLibraryPath(napi_env env, napi_callback_info info)
|
||||
{
|
||||
HILOG_DEBUG("called");
|
||||
GET_NAPI_INFO_WITH_NAME_AND_CALL(
|
||||
env, info, JsApplicationContextUtils, OnGetNativeLibraryPath, APPLICATION_CONTEXT_NAME);
|
||||
}
|
||||
|
||||
napi_value JsApplicationContextUtils::OnGetNativeLibraryPath(napi_env env, NapiCallbackInfo& info)
|
||||
{
|
||||
auto applicationContext = applicationContext_.lock();
|
||||
if (!applicationContext) {
|
||||
HILOG_WARN("applicationContext is already released");
|
||||
return CreateJsUndefined(env);
|
||||
}
|
||||
std::string path = applicationContext->GetNativeLibraryPath();
|
||||
return CreateJsValue(env, path);
|
||||
}
|
||||
|
||||
napi_value JsApplicationContextUtils::GetFilesDir(napi_env env, napi_callback_info info)
|
||||
{
|
||||
HILOG_DEBUG("called");
|
||||
@@ -1268,7 +1249,6 @@ void JsApplicationContextUtils::BindNativeApplicationContext(napi_env env, napi_
|
||||
BindNativeProperty(env, object, "cacheDir", JsApplicationContextUtils::GetCacheDir);
|
||||
BindNativeProperty(env, object, "tempDir", JsApplicationContextUtils::GetTempDir);
|
||||
BindNativeProperty(env, object, "resourceDir", JsApplicationContextUtils::GetResourceDir);
|
||||
BindNativeProperty(env, object, "nativeLibraryPath", JsApplicationContextUtils::GetNativeLibraryPath);
|
||||
BindNativeProperty(env, object, "filesDir", JsApplicationContextUtils::GetFilesDir);
|
||||
BindNativeProperty(env, object, "distributedFilesDir", JsApplicationContextUtils::GetDistributedFilesDir);
|
||||
BindNativeProperty(env, object, "databaseDir", JsApplicationContextUtils::GetDatabaseDir);
|
||||
|
||||
@@ -51,7 +51,6 @@ public:
|
||||
napi_value OnGetCacheDir(napi_env env, NapiCallbackInfo& info);
|
||||
napi_value OnGetTempDir(napi_env env, NapiCallbackInfo& info);
|
||||
napi_value OnGetResourceDir(napi_env env, NapiCallbackInfo& info);
|
||||
napi_value OnGetNativeLibraryPath(napi_env env, NapiCallbackInfo& info);
|
||||
napi_value OnGetFilesDir(napi_env env, NapiCallbackInfo& info);
|
||||
napi_value OnGetDistributedFilesDir(napi_env env, NapiCallbackInfo& info);
|
||||
napi_value OnGetDatabaseDir(napi_env env, NapiCallbackInfo& info);
|
||||
@@ -62,7 +61,6 @@ public:
|
||||
static napi_value GetCacheDir(napi_env env, napi_callback_info info);
|
||||
static napi_value GetTempDir(napi_env env, napi_callback_info info);
|
||||
static napi_value GetResourceDir(napi_env env, napi_callback_info info);
|
||||
static napi_value GetNativeLibraryPath(napi_env env, napi_callback_info info);
|
||||
static napi_value GetFilesDir(napi_env env, napi_callback_info info);
|
||||
static napi_value GetDistributedFilesDir(napi_env env, napi_callback_info info);
|
||||
static napi_value GetDatabaseDir(napi_env env, napi_callback_info info);
|
||||
@@ -134,7 +132,6 @@ napi_value JsBaseContext::OnSwitchArea(napi_env env, NapiCallbackInfo& info)
|
||||
BindNativeProperty(env, object, "cacheDir", GetCacheDir);
|
||||
BindNativeProperty(env, object, "tempDir", GetTempDir);
|
||||
BindNativeProperty(env, object, "resourceDir", GetResourceDir);
|
||||
BindNativeProperty(env, object, "nativeLibraryPath", GetNativeLibraryPath);
|
||||
BindNativeProperty(env, object, "filesDir", GetFilesDir);
|
||||
BindNativeProperty(env, object, "distributedFilesDir", GetDistributedFilesDir);
|
||||
BindNativeProperty(env, object, "databaseDir", GetDatabaseDir);
|
||||
@@ -325,23 +322,6 @@ napi_value JsBaseContext::OnGetResourceDir(napi_env env, NapiCallbackInfo& info)
|
||||
return CreateJsValue(env, path);
|
||||
}
|
||||
|
||||
napi_value JsBaseContext::GetNativeLibraryPath(napi_env env, napi_callback_info info)
|
||||
{
|
||||
HILOG_DEBUG("called");
|
||||
GET_NAPI_INFO_WITH_NAME_AND_CALL(env, info, JsBaseContext, OnGetNativeLibraryPath, BASE_CONTEXT_NAME);
|
||||
}
|
||||
|
||||
napi_value JsBaseContext::OnGetNativeLibraryPath(napi_env env, NapiCallbackInfo& info)
|
||||
{
|
||||
auto context = context_.lock();
|
||||
if (!context) {
|
||||
HILOG_WARN("context is already released");
|
||||
return CreateJsUndefined(env);
|
||||
}
|
||||
std::string path = context->GetNativeLibraryPath();
|
||||
return CreateJsValue(env, path);
|
||||
}
|
||||
|
||||
napi_value JsBaseContext::GetFilesDir(napi_env env, napi_callback_info info)
|
||||
{
|
||||
HILOG_DEBUG("called");
|
||||
@@ -695,7 +675,6 @@ napi_value CreateJsBaseContext(napi_env env, std::shared_ptr<Context> context, b
|
||||
BindNativeProperty(env, object, "cacheDir", JsBaseContext::GetCacheDir);
|
||||
BindNativeProperty(env, object, "tempDir", JsBaseContext::GetTempDir);
|
||||
BindNativeProperty(env, object, "resourceDir", JsBaseContext::GetResourceDir);
|
||||
BindNativeProperty(env, object, "nativeLibraryPath", JsBaseContext::GetNativeLibraryPath);
|
||||
BindNativeProperty(env, object, "filesDir", JsBaseContext::GetFilesDir);
|
||||
BindNativeProperty(env, object, "distributedFilesDir", JsBaseContext::GetDistributedFilesDir);
|
||||
BindNativeProperty(env, object, "databaseDir", JsBaseContext::GetDatabaseDir);
|
||||
|
||||
@@ -43,7 +43,6 @@ public:
|
||||
std::string GetCacheDir() override;
|
||||
std::string GetTempDir() override;
|
||||
std::string GetResourceDir() override;
|
||||
std::string GetNativeLibraryPath() override;
|
||||
std::string GetFilesDir() override;
|
||||
std::string GetDatabaseDir() override;
|
||||
std::string GetPreferencesDir() override;
|
||||
|
||||
@@ -42,7 +42,6 @@ public:
|
||||
std::string GetCacheDir() override;
|
||||
std::string GetTempDir() override;
|
||||
std::string GetResourceDir() override;
|
||||
std::string GetNativeLibraryPath() override;
|
||||
std::string GetFilesDir() override;
|
||||
std::string GetDatabaseDir() override;
|
||||
std::string GetPreferencesDir() override;
|
||||
|
||||
@@ -43,7 +43,6 @@ public:
|
||||
static napi_value GetCacheDir(napi_env env, napi_callback_info info);
|
||||
static napi_value GetTempDir(napi_env env, napi_callback_info info);
|
||||
static napi_value GetResourceDir(napi_env env, napi_callback_info info);
|
||||
static napi_value GetNativeLibraryPath(napi_env env, napi_callback_info info);
|
||||
static napi_value GetFilesDir(napi_env env, napi_callback_info info);
|
||||
static napi_value GetDistributedFilesDir(napi_env env, napi_callback_info info);
|
||||
static napi_value GetDatabaseDir(napi_env env, napi_callback_info info);
|
||||
@@ -57,7 +56,6 @@ public:
|
||||
napi_value OnGetCacheDir(napi_env env, NapiCallbackInfo& info);
|
||||
napi_value OnGetTempDir(napi_env env, NapiCallbackInfo& info);
|
||||
napi_value OnGetResourceDir(napi_env env, NapiCallbackInfo& info);
|
||||
napi_value OnGetNativeLibraryPath(napi_env env, NapiCallbackInfo& info);
|
||||
napi_value OnGetFilesDir(napi_env env, NapiCallbackInfo& info);
|
||||
napi_value OnGetDistributedFilesDir(napi_env env, NapiCallbackInfo& info);
|
||||
napi_value OnGetDatabaseDir(napi_env env, NapiCallbackInfo& info);
|
||||
|
||||
@@ -111,11 +111,6 @@ std::string AbilityContext::GetResourceDir()
|
||||
return stageContext_ ? stageContext_->GetResourceDir() : "";
|
||||
}
|
||||
|
||||
std::string AbilityContext::GetNativeLibraryPath()
|
||||
{
|
||||
return stageContext_ ? stageContext_->GetNativeLibraryPath() : "";
|
||||
}
|
||||
|
||||
std::string AbilityContext::GetFilesDir()
|
||||
{
|
||||
return stageContext_ ? stageContext_->GetFilesDir() : "";
|
||||
|
||||
@@ -34,7 +34,6 @@ constexpr const char *CONTEXT_HAPS("haps");
|
||||
constexpr const char *CONTEXT_ASSET("asset");
|
||||
constexpr const char *CONTEXT_ELS[] = {"el1", "el2", "el3", "el4"};
|
||||
constexpr const char *CONTEXT_RESOURCE_BASE("/data/storage/el1/bundle");
|
||||
constexpr const char *CONTEXT_NATIVE_LIBRARY_PATH_PREV("/proc/3697/root/data/storage/el1/bundle/");
|
||||
constexpr const char *CONTEXT_RESOURCE_END("/resources/resfile");
|
||||
constexpr int DIR_DEFAULT_PERM = 0770;
|
||||
}
|
||||
@@ -139,29 +138,6 @@ std::string AbilityStageContext::GetResourceDir()
|
||||
return "";
|
||||
}
|
||||
|
||||
std::string AbilityStageContext::GetNativeLibraryPath()
|
||||
{
|
||||
auto appInfo = GetApplicationInfo();
|
||||
if (appInfo == nullptr || appInfo->nativeLibraryPath.empty()) {
|
||||
return "";
|
||||
}
|
||||
std::shared_ptr<AppExecFwk::HapModuleInfo> hapModuleInfoPtr = GetHapModuleInfo();
|
||||
if (hapModuleInfoPtr == nullptr) {
|
||||
return "";
|
||||
}
|
||||
if (!hapModuleInfoPtr->isLibIsolated) {
|
||||
return std::string(CONTEXT_RESOURCE_BASE) + CONTEXT_FILE_SEPARATOR + appInfo->nativeLibraryPath;
|
||||
}
|
||||
if (hapModuleInfoPtr->moduleName.empty()) {
|
||||
return "";
|
||||
}
|
||||
|
||||
std::string ret = std::string(CONTEXT_RESOURCE_BASE) + CONTEXT_FILE_SEPARATOR + hapModuleInfoPtr->moduleName +
|
||||
CONTEXT_FILE_SEPARATOR + appInfo->nativeLibraryPath;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::string AbilityStageContext::GetFilesDir()
|
||||
{
|
||||
if (GetPreviewPath().empty()) {
|
||||
|
||||
@@ -49,7 +49,6 @@ napi_value JsApplicationContextUtils::OnSwitchArea(napi_env env, NapiCallbackInf
|
||||
BindNativeProperty(env, object, "cacheDir", GetCacheDir);
|
||||
BindNativeProperty(env, object, "tempDir", GetTempDir);
|
||||
BindNativeProperty(env, object, "resourceDir", GetResourceDir);
|
||||
BindNativeProperty(env, object, "nativeLibraryPath", GetNativeLibraryPath);
|
||||
BindNativeProperty(env, object, "filesDir", GetFilesDir);
|
||||
BindNativeProperty(env, object, "distributedFilesDir", GetDistributedFilesDir);
|
||||
BindNativeProperty(env, object, "databaseDir", GetDatabaseDir);
|
||||
@@ -101,23 +100,6 @@ napi_value JsApplicationContextUtils::OnGetResourceDir(napi_env env, NapiCallbac
|
||||
return CreateJsValue(env, path);
|
||||
}
|
||||
|
||||
napi_value JsApplicationContextUtils::GetNativeLibraryPath(napi_env env, napi_callback_info info)
|
||||
{
|
||||
GET_NAPI_INFO_WITH_NAME_AND_CALL(
|
||||
env, info, JsApplicationContextUtils, OnGetNativeLibraryPath, APPLICATION_CONTEXT_NAME);
|
||||
}
|
||||
|
||||
napi_value JsApplicationContextUtils::OnGetNativeLibraryPath(napi_env env, NapiCallbackInfo &info)
|
||||
{
|
||||
auto context = context_.lock();
|
||||
if (!context) {
|
||||
HILOG_WARN("context is already released");
|
||||
return CreateJsUndefined(env);
|
||||
}
|
||||
std::string path = context->GetNativeLibraryPath();
|
||||
return CreateJsValue(env, path);
|
||||
}
|
||||
|
||||
napi_value JsApplicationContextUtils::GetArea(napi_env env, napi_callback_info info)
|
||||
{
|
||||
GET_NAPI_INFO_WITH_NAME_AND_CALL(env, info, JsApplicationContextUtils, OnGetArea, APPLICATION_CONTEXT_NAME);
|
||||
@@ -326,7 +308,6 @@ void JsApplicationContextUtils::BindNativeApplicationContext(napi_env env, napi_
|
||||
BindNativeProperty(env, object, "cacheDir", JsApplicationContextUtils::GetCacheDir);
|
||||
BindNativeProperty(env, object, "tempDir", JsApplicationContextUtils::GetTempDir);
|
||||
BindNativeProperty(env, object, "resourceDir", JsApplicationContextUtils::GetResourceDir);
|
||||
BindNativeProperty(env, object, "nativeLibraryPath", JsApplicationContextUtils::GetNativeLibraryPath);
|
||||
BindNativeProperty(env, object, "filesDir", JsApplicationContextUtils::GetFilesDir);
|
||||
BindNativeProperty(env, object, "distributedFilesDir", JsApplicationContextUtils::GetDistributedFilesDir);
|
||||
BindNativeProperty(env, object, "databaseDir", JsApplicationContextUtils::GetDatabaseDir);
|
||||
|
||||
@@ -42,7 +42,6 @@ public:
|
||||
static napi_value GetCacheDir(napi_env env, napi_callback_info info);
|
||||
static napi_value GetTempDir(napi_env env, napi_callback_info info);
|
||||
static napi_value GetResourceDir(napi_env env, napi_callback_info info);
|
||||
static napi_value GetNativeLibraryPath(napi_env env, napi_callback_info info);
|
||||
static napi_value GetFilesDir(napi_env env, napi_callback_info info);
|
||||
static napi_value GetDistributedFilesDir(napi_env env, napi_callback_info info);
|
||||
static napi_value GetDatabaseDir(napi_env env, napi_callback_info info);
|
||||
@@ -52,7 +51,6 @@ public:
|
||||
napi_value OnGetCacheDir(napi_env env, NapiCallbackInfo &info);
|
||||
napi_value OnGetTempDir(napi_env env, NapiCallbackInfo &info);
|
||||
napi_value OnGetResourceDir(napi_env env, NapiCallbackInfo &info);
|
||||
napi_value OnGetNativeLibraryPath(napi_env env, NapiCallbackInfo &info);
|
||||
napi_value OnGetFilesDir(napi_env env, NapiCallbackInfo &info);
|
||||
napi_value OnGetDistributedFilesDir(napi_env env, NapiCallbackInfo &info);
|
||||
napi_value OnGetDatabaseDir(napi_env env, NapiCallbackInfo &info);
|
||||
@@ -116,7 +114,6 @@ napi_value JsBaseContext::OnSwitchArea(napi_env env, NapiCallbackInfo &info)
|
||||
BindNativeProperty(env, object, "cacheDir", GetCacheDir);
|
||||
BindNativeProperty(env, object, "tempDir", GetTempDir);
|
||||
BindNativeProperty(env, object, "resourceDir", GetResourceDir);
|
||||
BindNativeProperty(env, object, "nativeLibraryPath", GetNativeLibraryPath);
|
||||
BindNativeProperty(env, object, "filesDir", GetFilesDir);
|
||||
BindNativeProperty(env, object, "distributedFilesDir", GetDistributedFilesDir);
|
||||
BindNativeProperty(env, object, "databaseDir", GetDatabaseDir);
|
||||
@@ -199,22 +196,6 @@ napi_value JsBaseContext::OnGetResourceDir(napi_env env, NapiCallbackInfo &info)
|
||||
return CreateJsValue(env, path);
|
||||
}
|
||||
|
||||
napi_value JsBaseContext::GetNativeLibraryPath(napi_env env, napi_callback_info info)
|
||||
{
|
||||
GET_NAPI_INFO_WITH_NAME_AND_CALL(env, info, JsBaseContext, OnGetNativeLibraryPath, BASE_CONTEXT_NAME);
|
||||
}
|
||||
|
||||
napi_value JsBaseContext::OnGetNativeLibraryPath(napi_env env, NapiCallbackInfo &info)
|
||||
{
|
||||
auto context = context_.lock();
|
||||
if (!context) {
|
||||
HILOG_WARN("context is already released");
|
||||
return CreateJsUndefined(env);
|
||||
}
|
||||
std::string path = context->GetNativeLibraryPath();
|
||||
return CreateJsValue(env, path);
|
||||
}
|
||||
|
||||
napi_value JsBaseContext::GetFilesDir(napi_env env, napi_callback_info info)
|
||||
{
|
||||
GET_NAPI_INFO_WITH_NAME_AND_CALL(env, info, JsBaseContext, OnGetFilesDir, BASE_CONTEXT_NAME);
|
||||
@@ -332,7 +313,6 @@ napi_value CreateJsBaseContext(napi_env env, std::shared_ptr<Context> context, b
|
||||
BindNativeProperty(env, object, "cacheDir", JsBaseContext::GetCacheDir);
|
||||
BindNativeProperty(env, object, "tempDir", JsBaseContext::GetTempDir);
|
||||
BindNativeProperty(env, object, "resourceDir", JsBaseContext::GetResourceDir);
|
||||
BindNativeProperty(env, object, "nativeLibraryPath", JsBaseContext::GetNativeLibraryPath);
|
||||
BindNativeProperty(env, object, "filesDir", JsBaseContext::GetFilesDir);
|
||||
BindNativeProperty(env, object, "distributedFilesDir", JsBaseContext::GetDistributedFilesDir);
|
||||
BindNativeProperty(env, object, "databaseDir", JsBaseContext::GetDatabaseDir);
|
||||
|
||||
@@ -43,8 +43,6 @@ public:
|
||||
|
||||
virtual std::string GetResourceDir() = 0;
|
||||
|
||||
virtual std::string GetNativeLibraryPath() = 0;
|
||||
|
||||
virtual std::string GetFilesDir() = 0;
|
||||
|
||||
virtual std::string GetDatabaseDir() = 0;
|
||||
|
||||
@@ -37,7 +37,6 @@ public:
|
||||
std::string GetCacheDir() override;
|
||||
std::string GetTempDir() override;
|
||||
std::string GetResourceDir() override;
|
||||
std::string GetNativeLibraryPath() override;
|
||||
std::string GetFilesDir() override;
|
||||
bool IsUpdatingConfigurations() override;
|
||||
bool PrintDrawnCompleted() override;
|
||||
|
||||
@@ -70,7 +70,6 @@ public:
|
||||
std::string GetCacheDir() override;
|
||||
std::string GetTempDir() override;
|
||||
std::string GetResourceDir() override;
|
||||
std::string GetNativeLibraryPath() override;
|
||||
void GetAllTempDir(std::vector<std::string> &tempPaths);
|
||||
std::string GetFilesDir() override;
|
||||
bool IsUpdatingConfigurations() override;
|
||||
|
||||
@@ -123,8 +123,6 @@ public:
|
||||
|
||||
virtual std::string GetResourceDir() = 0;
|
||||
|
||||
virtual std::string GetNativeLibraryPath() = 0;
|
||||
|
||||
/**
|
||||
* @brief Checks whether the configuration of this ability is changing.
|
||||
*
|
||||
|
||||
@@ -79,8 +79,6 @@ public:
|
||||
|
||||
std::string GetResourceDir() override;
|
||||
|
||||
std::string GetNativeLibraryPath() override;
|
||||
|
||||
/**
|
||||
* @brief Get all temporary directories.
|
||||
*
|
||||
@@ -368,7 +366,6 @@ private:
|
||||
static const std::string CONTEXT_HAPS;
|
||||
static const std::string CONTEXT_ELS[];
|
||||
static const std::string CONTEXT_RESOURCE_END;
|
||||
static const std::string CONTEXT_NATIVE_LIBRARY_PATH_PREV;
|
||||
int flags_ = 0x00000000;
|
||||
|
||||
void InitResourceManager(const AppExecFwk::BundleInfo &bundleInfo, const std::shared_ptr<ContextImpl> &appContext,
|
||||
|
||||
@@ -82,7 +82,6 @@ public:
|
||||
napi_value OnGetCacheDir(napi_env env, NapiCallbackInfo& info);
|
||||
napi_value OnGetTempDir(napi_env env, NapiCallbackInfo& info);
|
||||
napi_value OnGetResourceDir(napi_env env, NapiCallbackInfo& info);
|
||||
napi_value OnGetNativeLibraryPath(napi_env env, NapiCallbackInfo& info);
|
||||
napi_value OnGetFilesDir(napi_env env, NapiCallbackInfo& info);
|
||||
napi_value OnGetDistributedFilesDir(napi_env env, NapiCallbackInfo& info);
|
||||
napi_value OnGetDatabaseDir(napi_env env, NapiCallbackInfo& info);
|
||||
@@ -98,7 +97,6 @@ public:
|
||||
static napi_value GetCacheDir(napi_env env, napi_callback_info info);
|
||||
static napi_value GetTempDir(napi_env env, napi_callback_info info);
|
||||
static napi_value GetResourceDir(napi_env env, napi_callback_info info);
|
||||
static napi_value GetNativeLibraryPath(napi_env env, napi_callback_info info);
|
||||
static napi_value GetFilesDir(napi_env env, napi_callback_info info);
|
||||
static napi_value GetDistributedFilesDir(napi_env env, napi_callback_info info);
|
||||
static napi_value GetDatabaseDir(napi_env env, napi_callback_info info);
|
||||
|
||||
@@ -392,35 +392,6 @@ HWTEST_F(ApplicationContextTest, GetResourceDir_0200, TestSize.Level1)
|
||||
GTEST_LOG_(INFO) << "GetResourceDir_0200 end";
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.number: GetNativeLibraryPath_0100
|
||||
* @tc.name: GetNativeLibraryPath
|
||||
* @tc.desc: Get Resource Dir failed
|
||||
*/
|
||||
HWTEST_F(ApplicationContextTest, GetNativeLibraryPath_0100, TestSize.Level1)
|
||||
{
|
||||
GTEST_LOG_(INFO) << "GetNativeLibraryPath_0100 start";
|
||||
std::shared_ptr<ContextImpl> contextImpl = nullptr;
|
||||
context_->AttachContextImpl(contextImpl);
|
||||
auto ret = context_->GetNativeLibraryPath();
|
||||
EXPECT_EQ(ret, "");
|
||||
GTEST_LOG_(INFO) << "GetNativeLibraryPath_0100 end";
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.number: GetNativeLibraryPath_0200
|
||||
* @tc.name: GetNativeLibraryPath
|
||||
* @tc.desc: Get Resource Dir failed
|
||||
*/
|
||||
HWTEST_F(ApplicationContextTest, GetNativeLibraryPath_0200, TestSize.Level1)
|
||||
{
|
||||
GTEST_LOG_(INFO) << "GetNativeLibraryPath_0200 start";
|
||||
context_->AttachContextImpl(mock_);
|
||||
auto ret = context_->GetNativeLibraryPath();
|
||||
EXPECT_EQ(ret, "/nativeLibraryPath");
|
||||
GTEST_LOG_(INFO) << "GetNativeLibraryPath_0200 end";
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.number: GetGroupDir_0100
|
||||
* @tc.name: GetGroupDir
|
||||
|
||||
@@ -64,11 +64,6 @@ std::string MockContextImpl::GetResourceDir()
|
||||
return "/resfile";
|
||||
}
|
||||
|
||||
std::string MockContextImpl::GetNativeLibraryPath()
|
||||
{
|
||||
return "/nativeLibraryPath";
|
||||
}
|
||||
|
||||
std::string MockContextImpl::GetFilesDir()
|
||||
{
|
||||
return "/files";
|
||||
|
||||
@@ -40,8 +40,6 @@ public:
|
||||
|
||||
std::string GetResourceDir() override;
|
||||
|
||||
std::string GetNativeLibraryPath() override;
|
||||
|
||||
std::string GetFilesDir() override;
|
||||
|
||||
std::string GetDatabaseDir() override;
|
||||
|
||||
-12
@@ -784,18 +784,6 @@ HWTEST_F(AbilityContextImplTest, Ability_Context_Impl_GetResourceDir_0200, Funct
|
||||
EXPECT_EQ(ret, "");
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.number: Ability_Context_Impl_GetNativeLibraryPath_0100
|
||||
* @tc.name: GetNativeLibraryPath
|
||||
* @tc.desc: Get resource Dir failed
|
||||
*/
|
||||
HWTEST_F(AbilityContextImplTest, Ability_Context_Impl_GetNativeLibraryPath_0100, Function | MediumTest | Level1)
|
||||
{
|
||||
context_->SetStageContext(mock_);
|
||||
auto ret = context_->GetNativeLibraryPath();
|
||||
EXPECT_EQ(ret, "/nativeLibraryPath");
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.number: Ability_Context_Impl_GetGroupDir_0100
|
||||
* @tc.name: GetGroupDir
|
||||
|
||||
@@ -66,11 +66,6 @@ std::string MockContext::GetResourceDir()
|
||||
return "/resfile";
|
||||
}
|
||||
|
||||
std::string MockContext::GetNativeLibraryPath()
|
||||
{
|
||||
return "/nativeLibraryPath";
|
||||
}
|
||||
|
||||
std::string MockContext::GetFilesDir()
|
||||
{
|
||||
return "/files";
|
||||
|
||||
@@ -43,8 +43,6 @@ public:
|
||||
|
||||
std::string GetResourceDir() override;
|
||||
|
||||
std::string GetNativeLibraryPath() override;
|
||||
|
||||
std::string GetFilesDir() override;
|
||||
|
||||
std::string GetDatabaseDir() override;
|
||||
|
||||
@@ -77,11 +77,6 @@ std::string MockAbilityRuntimeContext::GetResourceDir()
|
||||
return {};
|
||||
};
|
||||
|
||||
std::string MockAbilityRuntimeContext::GetNativeLibraryPath()
|
||||
{
|
||||
return {};
|
||||
};
|
||||
|
||||
std::string MockAbilityRuntimeContext::GetFilesDir()
|
||||
{
|
||||
return {};
|
||||
|
||||
@@ -43,7 +43,6 @@ public:
|
||||
std::string GetCacheDir() override;
|
||||
std::string GetTempDir() override;
|
||||
std::string GetResourceDir() override;
|
||||
std::string GetNativeLibraryPath() override;
|
||||
std::string GetFilesDir() override;
|
||||
bool IsUpdatingConfigurations() override;
|
||||
bool PrintDrawnCompleted() override;
|
||||
|
||||
@@ -333,24 +333,6 @@ HWTEST_F(ContextImplTest, GetResourceDir_0100, TestSize.Level1)
|
||||
HILOG_INFO("%{public}s end.", __func__);
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: GetNativeLibraryPath_0100
|
||||
* @tc.desc: Get resource directory basic test.
|
||||
* @tc.type: FUNC
|
||||
* @tc.require: issueI61P7Y
|
||||
*/
|
||||
HWTEST_F(ContextImplTest, GetNativeLibraryPath_0100, TestSize.Level1)
|
||||
{
|
||||
HILOG_INFO("%{public}s start.", __func__);
|
||||
auto contextImpl = std::make_shared<AbilityRuntime::ContextImpl>();
|
||||
EXPECT_NE(contextImpl, nullptr);
|
||||
|
||||
auto nativeLibraryPath = contextImpl->GetNativeLibraryPath();
|
||||
EXPECT_EQ(nativeLibraryPath, "");
|
||||
|
||||
HILOG_INFO("%{public}s end.", __func__);
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: GetFilesDir_0100
|
||||
* @tc.desc: Get files directory basic test.
|
||||
|
||||
Reference in New Issue
Block a user