issueNo: I4A27N

Description:fix the warning of previewer
Feature or Bugfix:Bugfix
Binary Source:No

Signed-off-by: youzhi92 <chenyouzhi@huawei.com>
Change-Id: I7de2ad86cfceda86cef66cc187fbe4bc7ece8e62
This commit is contained in:
youzhi92
2021-09-14 21:45:44 +08:00
parent 6c81d1993d
commit 6b82e71665
5 changed files with 18 additions and 4 deletions
+10 -2
View File
@@ -19,7 +19,9 @@
#if (defined(__LINUX__) || defined(__LITEOS__))
#include "ace_ability.h"
#endif
#ifdef FEATURE_API_VERSION
#include "bundle_manager.h"
#endif // FEATURE_API_VERSION
#include "component_factory.h"
#include "component_utils.h"
#include "fatal_handler.h"
@@ -344,6 +346,7 @@ char *JsAppContext::GetResourcePath(const char *uri) const
void JsAppContext::LoadApiVersion()
{
#ifdef FEATURE_API_VERSION
BundleInfo bundle = {0};
uint8_t retCode = GetBundleInfo(currentBundleName_, false, &bundle);
if (retCode != 0) {
@@ -352,14 +355,19 @@ void JsAppContext::LoadApiVersion()
}
compatibleApi_ = bundle.compatibleApi;
targetApi_ = bundle.targetApi;
#else
const int32_t currentApiVersion = 6;
compatibleApi_ = currentApiVersion;
targetApi_ = currentApiVersion;
#endif
}
const int32_t JsAppContext::GetCompatibleApi() const
int32_t JsAppContext::GetCompatibleApi() const
{
return compatibleApi_;
}
const int32_t JsAppContext::GetTargetApi() const
int32_t JsAppContext::GetTargetApi() const
{
return targetApi_;
}
+2 -2
View File
@@ -97,8 +97,8 @@ public:
topJSAbilityImpl_ = object;
}
void LoadApiVersion();
const int32_t GetCompatibleApi() const;
const int32_t GetTargetApi() const;
int32_t GetCompatibleApi() const;
int32_t GetTargetApi() const;
const AppStyleManager *GetStyleManager()
{
@@ -100,6 +100,8 @@
#define FEATURE_ACELITE_LITE_DFX_MODULE
#define FEATURE_API_VERSION
/**
* enable Canvas component Feature API on ipcamera real devices
*/
@@ -102,6 +102,8 @@
*/
#define FEATURE_DATE_FORMAT
#define FEATURE_API_VERSION
/**
* support lite ace dfx module
*/
@@ -142,6 +142,8 @@
*/
#define FEATURE_DATE_FORMAT
#define FEATURE_API_VERSION
#define JS_ENGINE_STATIC_MULTI_CONTEXTS_ENABLED
/**