mirror of
https://gitee.com/openharmony/bundlemanager_bundle_framework
synced 2024-11-27 01:11:15 +00:00
!166 NAPI correction (bundleFlag)
Merge pull request !166 from blackleon/update_master_1201
This commit is contained in:
commit
539b3fe45f
@ -32,6 +32,8 @@ enum class BundleFlag {
|
||||
GET_BUNDLE_DEFAULT = 0x00000000,
|
||||
// get bundle info include abilityInfos
|
||||
GET_BUNDLE_WITH_ABILITIES = 0x00000001,
|
||||
// get application info include permission
|
||||
GET_APPLICATION_INFO_WITH_PERMISSION = 0x00000008,
|
||||
};
|
||||
|
||||
// configuration information about a bundle
|
||||
|
@ -4087,6 +4087,24 @@ void CreateQueryShortCutFlagObject(napi_env env, napi_value value)
|
||||
NAPI_CALL_RETURN_VOID(env, napi_set_named_property(env, value, "QUERY_SHORTCUT_HOME", nQueryShortCutHome));
|
||||
}
|
||||
|
||||
void CreateBundleFlagObject(napi_env env, napi_value value)
|
||||
{
|
||||
napi_value nDefault;
|
||||
NAPI_CALL_RETURN_VOID(
|
||||
env, napi_create_int32(env, static_cast<int32_t>(BundleFlag::GET_BUNDLE_DEFAULT), &nDefault));
|
||||
NAPI_CALL_RETURN_VOID(env, napi_set_named_property(env, value, "GET_BUNDLE_DEFAULT", nDefault));
|
||||
napi_value nWithAbilities;
|
||||
NAPI_CALL_RETURN_VOID(
|
||||
env, napi_create_int32(env, static_cast<int32_t>(BundleFlag::GET_BUNDLE_WITH_ABILITIES), &nWithAbilities));
|
||||
NAPI_CALL_RETURN_VOID(env, napi_set_named_property(env, value, "GET_BUNDLE_WITH_ABILITIES", nWithAbilities));
|
||||
napi_value nWithPermission;
|
||||
NAPI_CALL_RETURN_VOID(
|
||||
env, napi_create_int32(
|
||||
env, static_cast<int32_t>(BundleFlag::GET_APPLICATION_INFO_WITH_PERMISSION), &nWithPermission));
|
||||
NAPI_CALL_RETURN_VOID(
|
||||
env, napi_set_named_property(env, value, "GET_APPLICATION_INFO_WITH_PERMISSION", nWithPermission));
|
||||
}
|
||||
|
||||
void CreateInstallErrorCodeObject(napi_env env, napi_value value)
|
||||
{
|
||||
napi_value nSuccess;
|
||||
|
@ -233,6 +233,7 @@ void CreateModuleRemoveFlagObject(napi_env env, napi_value value);
|
||||
void CreateSignatureCompareResultObject(napi_env env, napi_value value);
|
||||
void CreateShortcutExistenceObject(napi_env env, napi_value value);
|
||||
void CreateQueryShortCutFlagObject(napi_env env, napi_value value);
|
||||
void CreateBundleFlagObject(napi_env env, napi_value value);
|
||||
void CreateInstallErrorCodeObject(napi_env env, napi_value value);
|
||||
} // namespace AppExecFwk
|
||||
} // namespace OHOS
|
||||
|
@ -77,6 +77,10 @@ static napi_value Init(napi_env env, napi_value exports)
|
||||
NAPI_CALL(env, napi_create_object(env, &nQueryShortCutFlag));
|
||||
CreateQueryShortCutFlagObject(env, nShortcutExistence);
|
||||
|
||||
napi_value nBundleFlag = nullptr;
|
||||
NAPI_CALL(env, napi_create_object(env, &nBundleFlag));
|
||||
CreateBundleFlagObject(env, nBundleFlag);
|
||||
|
||||
napi_value nInstallErrorCode = nullptr;
|
||||
NAPI_CALL(env, napi_create_object(env, &nInstallErrorCode));
|
||||
CreateInstallErrorCodeObject(env, nInstallErrorCode);
|
||||
@ -114,6 +118,7 @@ static napi_value Init(napi_env env, napi_value exports)
|
||||
DECLARE_NAPI_PROPERTY("SignatureCompareResult", nSignatureCompareResult),
|
||||
DECLARE_NAPI_PROPERTY("ShortcutExistence", nShortcutExistence),
|
||||
DECLARE_NAPI_PROPERTY("QueryShortCutFlag", nQueryShortCutFlag),
|
||||
DECLARE_NAPI_PROPERTY("BundleFlag", nBundleFlag),
|
||||
DECLARE_NAPI_PROPERTY("InstallErrorCode", nInstallErrorCode)
|
||||
};
|
||||
NAPI_CALL(env, napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc));
|
||||
|
Loading…
Reference in New Issue
Block a user