From 470178466ceb17afc2af68ec82b56510c19e3096 Mon Sep 17 00:00:00 2001 From: lanhaoyu Date: Wed, 3 Sep 2025 23:04:59 +0800 Subject: [PATCH] getAbilityResourceInfo Signed-off-by: lanhaoyu --- .../launcher_ability_resource_info.h | 3 +- .../launcher_ability_resource_info.cpp | 4 +- ...bundle_framework_core_ipc_interface_code.h | 1 + .../include/bundlemgr/bundle_mgr_host.h | 8 + .../include/bundlemgr/bundle_mgr_interface.h | 6 + .../src/bundlemgr/bundle_mgr_host.cpp | 22 + .../js/bundle_resource/bundle_resource.cpp | 5 + interfaces/kits/native/bundle/BUILD.gn | 3 +- .../bundle/include/ability_resource_info.h | 170 + .../bundle/include/bundle_manager_common.h | 72 + .../bundle/include/bundle_mgr_proxy_native.h | 12 +- .../bundle/include/native_interface_bundle.h | 18 +- .../kits/native/bundle/libbundle.ndk.json | 36 + .../bundle/src/ability_resource_info.cpp | 326 ++ .../bundle/src/bundle_mgr_proxy_native.cpp | 49 +- .../bundle/src/native_interface_bundle.cpp | 58 + services/bundlemgr/include/bundle_data_mgr.h | 2 + .../bundlemgr/include/bundle_mgr_host_impl.h | 10 + services/bundlemgr/src/bundle_data_mgr.cpp | 27 + .../bundlemgr/src/bundle_mgr_host_impl.cpp | 139 + .../bms_bundle_permission_false_test.cpp | 29 + .../bms_bundle_mgr_host_test.cpp | 4513 +++++++++-------- 22 files changed, 3257 insertions(+), 2256 deletions(-) create mode 100644 interfaces/kits/native/bundle/include/ability_resource_info.h create mode 100644 interfaces/kits/native/bundle/include/bundle_manager_common.h create mode 100644 interfaces/kits/native/bundle/src/ability_resource_info.cpp diff --git a/interfaces/inner_api/appexecfwk_base/include/bundle_resource/launcher_ability_resource_info.h b/interfaces/inner_api/appexecfwk_base/include/bundle_resource/launcher_ability_resource_info.h index 075c5ffa37..a51ca3575c 100644 --- a/interfaces/inner_api/appexecfwk_base/include/bundle_resource/launcher_ability_resource_info.h +++ b/interfaces/inner_api/appexecfwk_base/include/bundle_resource/launcher_ability_resource_info.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023-2024 Huawei Device Co., Ltd. + * Copyright (c) 2023-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -25,6 +25,7 @@ namespace AppExecFwk { struct LauncherAbilityResourceInfo : Parcelable { int32_t appIndex = 0; int32_t extensionAbilityType = -1; + bool isDefaultApp = false; std::string bundleName; std::string moduleName; std::string abilityName; diff --git a/interfaces/inner_api/appexecfwk_base/src/bundle_resource/launcher_ability_resource_info.cpp b/interfaces/inner_api/appexecfwk_base/src/bundle_resource/launcher_ability_resource_info.cpp index f95ffe8f6a..d34ca151c4 100644 --- a/interfaces/inner_api/appexecfwk_base/src/bundle_resource/launcher_ability_resource_info.cpp +++ b/interfaces/inner_api/appexecfwk_base/src/bundle_resource/launcher_ability_resource_info.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2023-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -58,6 +58,7 @@ bool LauncherAbilityResourceInfo::ReadFromParcel(Parcel &parcel) } READ_PARCEL_AND_RETURN_FALSE_IF_FAIL(Int32, parcel, appIndex); + READ_PARCEL_AND_RETURN_FALSE_IF_FAIL(Bool, parcel, isDefaultApp); return true; } @@ -77,6 +78,7 @@ bool LauncherAbilityResourceInfo::Marshalling(Parcel &parcel) const WRITE_PARCEL_AND_RETURN_FALSE_IF_FAIL(Uint8Unaligned, parcel, data); } WRITE_PARCEL_AND_RETURN_FALSE_IF_FAIL(Int32, parcel, appIndex); + WRITE_PARCEL_AND_RETURN_FALSE_IF_FAIL(Bool, parcel, isDefaultApp); return true; } diff --git a/interfaces/inner_api/appexecfwk_core/include/bundle_framework_core_ipc_interface_code.h b/interfaces/inner_api/appexecfwk_core/include/bundle_framework_core_ipc_interface_code.h index c75fc0c7ee..24288a3345 100644 --- a/interfaces/inner_api/appexecfwk_core/include/bundle_framework_core_ipc_interface_code.h +++ b/interfaces/inner_api/appexecfwk_core/include/bundle_framework_core_ipc_interface_code.h @@ -227,6 +227,7 @@ enum class BundleMgrInterfaceCode : uint32_t { CLEAN_BUNDLE_CACHE_FILES_FOR_SELF = 201, IS_DEBUGGABLE_APPLICATION = 202, GET_ALL_BUNDLE_NAMES = 203, + GET_ABILITY_RESOURCE_INFO = 204, }; /* SAID: 401-85 Interface No.85 subservice also provides the following interfaces */ diff --git a/interfaces/inner_api/appexecfwk_core/include/bundlemgr/bundle_mgr_host.h b/interfaces/inner_api/appexecfwk_core/include/bundlemgr/bundle_mgr_host.h index 34f2d5a3a0..6f0878e3be 100644 --- a/interfaces/inner_api/appexecfwk_core/include/bundlemgr/bundle_mgr_host.h +++ b/interfaces/inner_api/appexecfwk_core/include/bundlemgr/bundle_mgr_host.h @@ -940,6 +940,14 @@ private: ErrCode HandleGetAllShortcutInfoForSelf(MessageParcel &data, MessageParcel &reply); ErrCode HandleGetPluginInfo(MessageParcel &data, MessageParcel &reply); ErrCode HandleGetTestRunner(MessageParcel &data, MessageParcel &reply); +/** + * @brief Obtain a list of applications that support opening files in a certain format. + * @param fileType Indicates the file type. + * @param abilityResourceInfo Indicates the ability resource array. + * @param size Indicates the ability resource array size. + * @return Returns ERR_OK if called successfully; returns error code otherwise. + */ + ErrCode HandleGetAbilityResourceInfo(MessageParcel &data, MessageParcel &reply); private: /** * @brief Write a parcelabe vector objects to the proxy node. diff --git a/interfaces/inner_api/appexecfwk_core/include/bundlemgr/bundle_mgr_interface.h b/interfaces/inner_api/appexecfwk_core/include/bundlemgr/bundle_mgr_interface.h index fe27220db9..b2968a5969 100644 --- a/interfaces/inner_api/appexecfwk_core/include/bundlemgr/bundle_mgr_interface.h +++ b/interfaces/inner_api/appexecfwk_core/include/bundlemgr/bundle_mgr_interface.h @@ -1884,6 +1884,12 @@ public: { return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR; } + + virtual ErrCode GetAbilityResourceInfo(const std::string &fileType, + std::vector &launcherAbilityResourceInfos) + { + return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR; + } }; #define WRITE_PARCEL(func) \ diff --git a/interfaces/inner_api/appexecfwk_core/src/bundlemgr/bundle_mgr_host.cpp b/interfaces/inner_api/appexecfwk_core/src/bundlemgr/bundle_mgr_host.cpp index e263f4e6e0..dbd7d955f8 100644 --- a/interfaces/inner_api/appexecfwk_core/src/bundlemgr/bundle_mgr_host.cpp +++ b/interfaces/inner_api/appexecfwk_core/src/bundlemgr/bundle_mgr_host.cpp @@ -719,6 +719,9 @@ int BundleMgrHost::OnRemoteRequest(uint32_t code, MessageParcel &data, MessagePa case static_cast(BundleMgrInterfaceCode::GET_ALL_BUNDLE_NAMES): errCode = HandleGetAllBundleNames(data, reply); break; + case static_cast(BundleMgrInterfaceCode::GET_ABILITY_RESOURCE_INFO): + errCode = HandleGetAbilityResourceInfo(data, reply); + break; default : APP_LOGW("bundleMgr host receives unknown code %{public}u", code); return IPCObjectStub::OnRemoteRequest(code, data, reply, option); @@ -5009,5 +5012,24 @@ ErrCode BundleMgrHost::HandleGetAllBundleNames(MessageParcel &data, MessageParce } return ERR_OK; } + +ErrCode BundleMgrHost::HandleGetAbilityResourceInfo(MessageParcel &data, MessageParcel &reply) +{ + HITRACE_METER_NAME_EX(HITRACE_LEVEL_INFO, HITRACE_TAG_APP, __PRETTY_FUNCTION__, nullptr); + std::string fileType = data.ReadString(); + std::vector launcherAbilityResourceInfos; + ErrCode ret = GetAbilityResourceInfo(fileType, launcherAbilityResourceInfos); + if (!reply.WriteInt32(ret)) { + APP_LOGE("write failed"); + return ERR_APPEXECFWK_PARCEL_ERROR; + } + if (ret == ERR_OK) { + if (!WriteParcelableVector(launcherAbilityResourceInfos, reply)) { + APP_LOGE("write failed"); + return ERR_APPEXECFWK_PARCEL_ERROR; + } + } + return ERR_OK; +} } // namespace AppExecFwk } // namespace OHOS diff --git a/interfaces/kits/js/bundle_resource/bundle_resource.cpp b/interfaces/kits/js/bundle_resource/bundle_resource.cpp index 8082edce7d..7377a397c7 100644 --- a/interfaces/kits/js/bundle_resource/bundle_resource.cpp +++ b/interfaces/kits/js/bundle_resource/bundle_resource.cpp @@ -143,6 +143,11 @@ static void ConvertLauncherAbilityResourceInfo( NAPI_CALL_RETURN_VOID(env, napi_set_named_property(env, objLauncherAbilityResourceInfo, DRAWABLE_DESCRIPTOR, nDrawableDescriptor)); + napi_value nIsDefaultApp; + NAPI_CALL_RETURN_VOID(env, napi_get_boolean(env, launcherAbilityResourceInfo.isDefaultApp, &nIsDefaultApp)); + NAPI_CALL_RETURN_VOID(env, napi_set_named_property(env, objLauncherAbilityResourceInfo, + IS_DEFAULT_APPLICATION, nIsDefaultApp)); + napi_value nAppIndex; NAPI_CALL_RETURN_VOID(env, napi_create_int32(env, launcherAbilityResourceInfo.appIndex, &nAppIndex)); NAPI_CALL_RETURN_VOID(env, napi_set_named_property(env, objLauncherAbilityResourceInfo, APP_INDEX, nAppIndex)); diff --git a/interfaces/kits/native/bundle/BUILD.gn b/interfaces/kits/native/bundle/BUILD.gn index a0e85f64e9..2009a1c66d 100644 --- a/interfaces/kits/native/bundle/BUILD.gn +++ b/interfaces/kits/native/bundle/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. +# Copyright (c) 2022-2025 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -36,6 +36,7 @@ ohos_shared_library("bundle_ndk") { "LOG_DOMAIN = 0xD001120", ] sources = [ + "src/ability_resource_info.cpp", "src/bundle_mgr_proxy_native.cpp", "src/native_interface_bundle.cpp", ] diff --git a/interfaces/kits/native/bundle/include/ability_resource_info.h b/interfaces/kits/native/bundle/include/ability_resource_info.h new file mode 100644 index 0000000000..7b2da8d7bf --- /dev/null +++ b/interfaces/kits/native/bundle/include/ability_resource_info.h @@ -0,0 +1,170 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup Native_Bundle + * @{ + * + * @brief Describe the functions of AbilityResourceInfo. + * + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 21 + */ + +/** + * @file ability_resource_info.h + * + * @brief Defines the OH_NativeBundle_AbilityResourceInfo APIs. + * + * @library libbundle_ndk.z.so + * @kit AbilityKit + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 21 + */ + +#ifndef ABILITY_RESOURCE_INFO_H +#define ABILITY_RESOURCE_INFO_H + +#include +#include +#include "bundle_manager_common.h" + +#ifdef __cplusplus +extern "C" { +#endif + +struct OH_NativeBundle_AbilityResourceInfo; +typedef struct OH_NativeBundle_AbilityResourceInfo OH_NativeBundle_AbilityResourceInfo; + +/** +* @brief Get the bundle name of the abilityResourceInfo. + * + * @param abilityResourceInfo The ability resource info that has been obtained. + * @param bundleName The bundle name obtained from abilityResourceInfo. + * @return The error code. + * {@link BUNDLE_MANAGER_ERROR_CODE_NO_ERROR} if the operation is successful. + * {@link BUNDLE_MANAGER_ERROR_CODE_PARAM_INVALID} if the abilityResourceInfo is invalid. + * @since 21 + */ +BundleManager_ErrorCode OH_NativeBundle_GetBundleName( + OH_NativeBundle_AbilityResourceInfo *abilityResourceInfo, char **bundleName); + +/** +* @brief Get the module name of the abilityResourceInfo. + * + * @param abilityResourceInfo The ability resource info that has been obtained. + * @param moduleName The module name obtained from abilityResourceInfo. + * @return The error code. + * {@link BUNDLE_MANAGER_ERROR_CODE_NO_ERROR} if the operation is successful. + * {@link BUNDLE_MANAGER_ERROR_CODE_PARAM_INVALID} if the abilityResourceInfo is invalid. + * @since 21 + */ +BundleManager_ErrorCode OH_NativeBundle_GetModuleName( + OH_NativeBundle_AbilityResourceInfo *abilityResourceInfo, char **moduleName); + +/** +* @brief Get the ability name of the abilityResourceInfo. + * + * @param abilityResourceInfo The ability resource info that has been obtained. + * @param abilityName The ability name obtained from abilityResourceInfo. + * @return The error code. + * {@link BUNDLE_MANAGER_ERROR_CODE_NO_ERROR} if the operation is successful. + * {@link BUNDLE_MANAGER_ERROR_CODE_PARAM_INVALID} if the abilityResourceInfo is invalid. + * @since 21 + */ +BundleManager_ErrorCode OH_NativeBundle_GetAbilityName( + OH_NativeBundle_AbilityResourceInfo *abilityResourceInfo, char **abilityName); + +/** +* @brief Get the icon of the abilityResourceInfo. + * + * @param abilityResourceInfo The ability resource info that has been obtained. + * @param icon The icon obtained from abilityResourceInfo. + * @return The error code. + * {@link BUNDLE_MANAGER_ERROR_CODE_NO_ERROR} if the operation is successful. + * {@link BUNDLE_MANAGER_ERROR_CODE_PARAM_INVALID} if the abilityResourceInfo is invalid. + * @since 21 + */ +BundleManager_ErrorCode OH_NativeBundle_GetIcon(OH_NativeBundle_AbilityResourceInfo *abilityResourceInfo, char **icon); + +/** +* @brief Get the label of the abilityResourceInfo. + * + * @param abilityResourceInfo The ability resource info that has been obtained. + * @param label The label obtained from abilityResourceInfo. + * @return The error code. + * {@link BUNDLE_MANAGER_ERROR_CODE_NO_ERROR} if the operation is successful. + * {@link BUNDLE_MANAGER_ERROR_CODE_PARAM_INVALID} if the abilityResourceInfo is invalid. + * @since 21 + */ +BundleManager_ErrorCode OH_NativeBundle_GetLabel( + OH_NativeBundle_AbilityResourceInfo *abilityResourceInfo, char **label); + +/** +* @brief Get the appIndex of the abilityResourceInfo. + * + * @param abilityResourceInfo The ability resource info that has been obtained. + * @param appIndex The appIndex obtained from abilityResourceInfo. + * @return The error code. + * {@link BUNDLE_MANAGER_ERROR_CODE_NO_ERROR} if the operation is successful. + * {@link BUNDLE_MANAGER_ERROR_CODE_PARAM_INVALID} if the abilityResourceInfo is invalid. + * @since 21 + */ +BundleManager_ErrorCode OH_NativeBundle_GetAppIndex( + OH_NativeBundle_AbilityResourceInfo *abilityResourceInfo, int *appIndex); + +/** +* @brief Check whether abilityResourceInfo is the default application. + * + * @param abilityResourceInfo The ability resource info that has been obtained. + * @param isDefault Check whether abilityResourceInfo is the default application. + * @return The error code. + * {@link BUNDLE_MANAGER_ERROR_CODE_NO_ERROR} if the operation is successful. + * {@link BUNDLE_MANAGER_ERROR_CODE_PARAM_INVALID} if the abilityResourceInfo is invalid. + * @since 21 + */ +BundleManager_ErrorCode OH_NativeBundle_CheckDefaultApp( + OH_NativeBundle_AbilityResourceInfo *abilityResourceInfo, bool *isDefault); + +OH_NativeBundle_AbilityResourceInfo *OH_AbilityResourceInfo_Create(size_t elementSize); + +BundleManager_ErrorCode OH_AbilityResourceInfo_Destroy(OH_NativeBundle_AbilityResourceInfo *resourceInfo, size_t count); + +BundleManager_ErrorCode OH_NativeBundle_SetAbilityResourceInfo_AppIndex( + OH_NativeBundle_AbilityResourceInfo *abilityResourceInfo, int appIndex); + +BundleManager_ErrorCode OH_NativeBundle_SetAbilityResourceInfo_IsDefaultApp( + OH_NativeBundle_AbilityResourceInfo *abilityResourceInfo, int isDefaultApp); + +BundleManager_ErrorCode OH_NativeBundle_SetAbilityResourceInfo_BundleName( + OH_NativeBundle_AbilityResourceInfo *abilityResourceInfo, const char *bundleName); + +BundleManager_ErrorCode OH_NativeBundle_SetAbilityResourceInfo_ModuleName( + OH_NativeBundle_AbilityResourceInfo *abilityResourceInfo, const char *moduleName); + +BundleManager_ErrorCode OH_NativeBundle_SetAbilityResourceInfo_AbilityName( + OH_NativeBundle_AbilityResourceInfo *abilityResourceInfo, const char *abilityName); + +BundleManager_ErrorCode OH_NativeBundle_SetAbilityResourceInfo_Label( + OH_NativeBundle_AbilityResourceInfo *abilityResourceInfo, const char *label); + +BundleManager_ErrorCode OH_NativeBundle_SetAbilityResourceInfo_Icon( + OH_NativeBundle_AbilityResourceInfo *abilityResourceInfo, const char *icon); +#ifdef __cplusplus +} // extern "C" +#endif + +/** @} */ +#endif // ABILITY_RESOURCE_INFO_H \ No newline at end of file diff --git a/interfaces/kits/native/bundle/include/bundle_manager_common.h b/interfaces/kits/native/bundle/include/bundle_manager_common.h new file mode 100644 index 0000000000..91f3124f4a --- /dev/null +++ b/interfaces/kits/native/bundle/include/bundle_manager_common.h @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup Native_Bundle + * @{ + * + * @brief Describes the Native Bundle. + * + * @since 21 + * @version 1.0 + */ + +/** + * @file bundle_manager_common.h + * + * @brief Declare the common types for the native BundleManager. + * + * @library libbundle_ndk.z.so + * @kit AbilityKit + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 21 + */ + +#ifndef BUNDLE_MANAGER_COMMON_H +#define BUNDLE_MANAGER_COMMON_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Enumerates the error codes. + * + * @since 21 + */ +typedef enum { + /** + * @error No error. + * @since 21 + */ + BUNDLE_MANAGER_ERROR_CODE_NO_ERROR = 0, + /** + * @error permission denied. + * @since 21 + */ + BUNDLE_MANAGER_ERROR_CODE_PERMISSION_DENIED = 201, + /** + * @error param invalid. + * @since 21 + */ + BUNDLE_MANAGER_ERROR_CODE_PARAM_INVALID = 401, +} BundleManager_ErrorCode; + +#ifdef __cplusplus +} +#endif + +/** @} */ +#endif // BUNDLE_MANAGER_COMMON_H \ No newline at end of file diff --git a/interfaces/kits/native/bundle/include/bundle_mgr_proxy_native.h b/interfaces/kits/native/bundle/include/bundle_mgr_proxy_native.h index bd970468ef..19be4ecfc6 100644 --- a/interfaces/kits/native/bundle/include/bundle_mgr_proxy_native.h +++ b/interfaces/kits/native/bundle/include/bundle_mgr_proxy_native.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -20,6 +20,7 @@ #include "application_info.h" #include "bundle_info.h" +#include "launcher_ability_resource_info.h" #include "iremote_broker.h" #include "iremote_object.h" @@ -42,15 +43,22 @@ public: bool GetCompatibleDeviceTypeNative(std::string &deviceType); + ErrCode GetLauncherAbilityResourceInfoNative(std::string &fileType, + std::vector &launcherAbilityResourceInfoArr); + enum { GET_BUNDLE_INFO_FOR_SELF_NATIVE = 98, - GET_COMPATIBLED_DEVICE_TYPE_NATIVE = 166 + GET_COMPATIBLED_DEVICE_TYPE_NATIVE = 166, + GET_LAUNCHER_ABILITY_RESOURE_INFO_NATIVE = 204 }; private: sptr GetBmsProxy(); template bool GetParcelableInfo(uint32_t code, MessageParcel &data, T &parcelableInfo); bool SendTransactCmd(uint32_t code, MessageParcel &data, MessageParcel &reply); + template + ErrCode GetParcelableInfosWithErrCode(uint32_t code, MessageParcel &data, + std::vector &parcelableInfos); }; } // namespace AppExecFwk } // namespace OHOS diff --git a/interfaces/kits/native/bundle/include/native_interface_bundle.h b/interfaces/kits/native/bundle/include/native_interface_bundle.h index 65f9ccafc1..a6ce4171a4 100644 --- a/interfaces/kits/native/bundle/include/native_interface_bundle.h +++ b/interfaces/kits/native/bundle/include/native_interface_bundle.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -39,6 +39,8 @@ #include #include +#include "ability_resource_info.h" + #ifdef __cplusplus extern "C" { #endif @@ -225,6 +227,20 @@ bool OH_NativeBundle_IsDebugMode(bool* isDebugMode); * @since 20 */ OH_NativeBundle_ModuleMetadata* OH_NativeBundle_GetModuleMetadata(size_t* size); + +/** + * @brief Obtain a list of applications that support opening files in a certain format. + * + * @permisssion {@code ohos.permission.GET_ABILITY_INFO}. + * @param fileType Indicates the file type. + * @param abilityResourceInfo Indicates the ability resource array. + * @param size Indicates the ability resource array size. + * @return Returns {@link BUNDLE_MANAGER_ERROR_CODE_NO_ERROR} if the call is successful. + * Returns {@link BUNDLE_MANAGER_ERROR_CODE_PERMISSION_DENIED} if the caller has no correct permission. + * @since 21 + */ +BundleManager_ErrorCode OH_NativeBundle_GetAbilityResourceInfo( + char *fileType, OH_NativeBundle_AbilityResourceInfo **abilityResourceInfo, size_t *size); #ifdef __cplusplus }; #endif diff --git a/interfaces/kits/native/bundle/libbundle.ndk.json b/interfaces/kits/native/bundle/libbundle.ndk.json index 7c05eef7bb..82330c58de 100644 --- a/interfaces/kits/native/bundle/libbundle.ndk.json +++ b/interfaces/kits/native/bundle/libbundle.ndk.json @@ -26,5 +26,41 @@ { "first_introduced": "20", "name": "OH_NativeBundle_GetModuleMetadata" + }, + { + "first_introduced": "21", + "name": "OH_NativeBundle_GetAbilityResourceInfo" + }, + { + "first_introduced": "21", + "name": "OH_NativeBundle_GetBundleName" + }, + { + "first_introduced": "21", + "name": "OH_NativeBundle_GetModuleName" + }, + { + "first_introduced": "21", + "name": "OH_NativeBundle_GetAbilityName" + }, + { + "first_introduced": "21", + "name": "OH_NativeBundle_GetIcon" + }, + { + "first_introduced": "21", + "name": "OH_NativeBundle_GetLabel" + }, + { + "first_introduced": "21", + "name": "OH_NativeBundle_GetAppIndex" + }, + { + "first_introduced": "21", + "name": "OH_NativeBundle_CheckDefaultApp" + }, + { + "first_introduced": "21", + "name": "OH_AbilityResourceInfo_Destroy" } ] diff --git a/interfaces/kits/native/bundle/src/ability_resource_info.cpp b/interfaces/kits/native/bundle/src/ability_resource_info.cpp new file mode 100644 index 0000000000..4d07b60658 --- /dev/null +++ b/interfaces/kits/native/bundle/src/ability_resource_info.cpp @@ -0,0 +1,326 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include +#include + +#include "ability_resource_info.h" +#include "app_log_wrapper.h" +#include "securec.h" + +struct OH_NativeBundle_AbilityResourceInfo { + int appIndex; + bool isDefaultApp; + char *bundleName; + char *moduleName; + char *abilityName; + char *label; + char *icon; +}; + +// Helper function to release char* memory +static void ReleaseChar(char* &str) +{ + if (str != nullptr) { + free(str); + str = nullptr; + } +} + +bool CopyChar(char* &name, char *value) +{ + if (value == nullptr){ + APP_LOGE("value is null"); + } + size_t length = strlen(value); + if (length == 0) { + APP_LOGE("failed due to the length of value is empty or too long"); + return false; + } + name = static_cast(malloc(length + 1)); + if (name == nullptr) { + APP_LOGE("failed due to malloc error"); + return false; + } + if (strcpy_s(name, length + 1, value) != EOK) { + APP_LOGE("failed due to strcpy_s error"); + ReleaseChar(name); + return false; + } + return true; +} + +bool CopyConstChar(char* &name, const char *value) +{ + if (value == nullptr){ + APP_LOGE("value is null"); + } + size_t length = strlen(value); + if (length == 0) { + APP_LOGE("failed due to the length of value is empty or too long"); + return false; + } + name = static_cast(malloc(length + 1)); + if (name == nullptr) { + APP_LOGE("failed due to malloc error"); + return false; + } + if (strcpy_s(name, length + 1, value) != EOK) { + APP_LOGE("failed due to strcpy_s error"); + ReleaseChar(name); + return false; + } + return true; +} + +void ResetResourceInfo(OH_NativeBundle_AbilityResourceInfo *resourceInfo, size_t count) +{ + if (resourceInfo == nullptr || count == 0) { + return; + } + for (size_t i = 0; i < count; ++i) { + resourceInfo[i].appIndex = 0; + resourceInfo[i].isDefaultApp = false; + resourceInfo[i].bundleName = nullptr; + resourceInfo[i].moduleName = nullptr; + resourceInfo[i].abilityName = nullptr; + resourceInfo[i].label = nullptr; + resourceInfo[i].icon = nullptr; + } +} + +void ReleaseResourceInfo(OH_NativeBundle_AbilityResourceInfo *resourceInfo, size_t count) +{ + if (resourceInfo == nullptr) { + return; + } + for (size_t i = 0; i < count; ++i) { + ReleaseChar(resourceInfo[i].bundleName); + ReleaseChar(resourceInfo[i].moduleName); + ReleaseChar(resourceInfo[i].abilityName); + ReleaseChar(resourceInfo[i].label); + ReleaseChar(resourceInfo[i].icon); + } + free(resourceInfo); +} + +OH_NativeBundle_AbilityResourceInfo *OH_AbilityResourceInfo_Create(size_t elementSize) +{ + if (elementSize == 0) { + APP_LOGE("failed due to the length of value is 0"); + return nullptr; + } + + OH_NativeBundle_AbilityResourceInfo *abilityResourceInfo = static_cast( + malloc(elementSize * sizeof(OH_NativeBundle_AbilityResourceInfo))); + if (abilityResourceInfo == nullptr) { + APP_LOGE("failed to allocate memory for OH_AbilityResourceInfo_Create"); + return nullptr; + } + ResetResourceInfo(abilityResourceInfo, elementSize); + + return abilityResourceInfo; +} + +BundleManager_ErrorCode OH_AbilityResourceInfo_Destroy(OH_NativeBundle_AbilityResourceInfo *resourceInfo, size_t count) +{ + ReleaseResourceInfo(resourceInfo, count); + return BUNDLE_MANAGER_ERROR_CODE_NO_ERROR; +} + +BundleManager_ErrorCode OH_NativeBundle_SetAbilityResourceInfo_AppIndex( + OH_NativeBundle_AbilityResourceInfo *abilityResourceInfo, int appIndex) +{ + if (abilityResourceInfo == nullptr) { + APP_LOGE("null abilityResourceInfo"); + return BUNDLE_MANAGER_ERROR_CODE_PARAM_INVALID; + } + abilityResourceInfo->appIndex = appIndex; + return BUNDLE_MANAGER_ERROR_CODE_NO_ERROR; +} + +BundleManager_ErrorCode OH_NativeBundle_GetAppIndex( + OH_NativeBundle_AbilityResourceInfo *abilityResourceInfo, int *appIndex) +{ + if (abilityResourceInfo == nullptr || appIndex == nullptr) { + APP_LOGE("abilityResourceInfo or appIndex is nullptr"); + return BUNDLE_MANAGER_ERROR_CODE_PARAM_INVALID; + } + *appIndex = abilityResourceInfo->appIndex; + return BUNDLE_MANAGER_ERROR_CODE_NO_ERROR; +} + +BundleManager_ErrorCode OH_NativeBundle_SetAbilityResourceInfo_IsDefaultApp( + OH_NativeBundle_AbilityResourceInfo *abilityResourceInfo, int isDefaultApp) +{ + if (abilityResourceInfo == nullptr) { + APP_LOGE("abilityResourceInfo is nullptr"); + return BUNDLE_MANAGER_ERROR_CODE_PARAM_INVALID; + } + abilityResourceInfo->isDefaultApp = isDefaultApp; + return BUNDLE_MANAGER_ERROR_CODE_NO_ERROR; +} + +BundleManager_ErrorCode OH_NativeBundle_CheckDefaultApp( + OH_NativeBundle_AbilityResourceInfo *abilityResourceInfo, bool *isDefault) +{ + if (abilityResourceInfo == nullptr || isDefault == nullptr) { + APP_LOGE("abilityResourceInfo or appIndex is nullptr"); + return BUNDLE_MANAGER_ERROR_CODE_PARAM_INVALID; + } + *isDefault = abilityResourceInfo->isDefaultApp; + return BUNDLE_MANAGER_ERROR_CODE_NO_ERROR; +} + +BundleManager_ErrorCode OH_NativeBundle_SetAbilityResourceInfo_BundleName( + OH_NativeBundle_AbilityResourceInfo *abilityResourceInfo, const char *bundleName) +{ + if (abilityResourceInfo == nullptr || bundleName == nullptr) { + APP_LOGE("abilityResourceInfo or bundleName is nullptr"); + return BUNDLE_MANAGER_ERROR_CODE_PARAM_INVALID; + } + if (!CopyConstChar(abilityResourceInfo->bundleName, bundleName)) { + APP_LOGE("copy bundleName failed"); + return BUNDLE_MANAGER_ERROR_CODE_PARAM_INVALID; + } + return BUNDLE_MANAGER_ERROR_CODE_NO_ERROR; +} + +BundleManager_ErrorCode OH_NativeBundle_GetBundleName( + OH_NativeBundle_AbilityResourceInfo *abilityResourceInfo, char **bundleName) +{ + if (abilityResourceInfo == nullptr || bundleName == nullptr) { + APP_LOGE("abilityResourceInfo or bundleName is nullptr"); + return BUNDLE_MANAGER_ERROR_CODE_PARAM_INVALID; + } + if (!CopyChar(*bundleName, abilityResourceInfo->bundleName)) { + APP_LOGE("copy bundleName failed"); + return BUNDLE_MANAGER_ERROR_CODE_PARAM_INVALID; + } + return BUNDLE_MANAGER_ERROR_CODE_NO_ERROR; +} + +BundleManager_ErrorCode OH_NativeBundle_SetAbilityResourceInfo_ModuleName( + OH_NativeBundle_AbilityResourceInfo *abilityResourceInfo, const char *moduleName) +{ + if (abilityResourceInfo == nullptr || moduleName == nullptr) { + APP_LOGE("abilityResourceInfo or moduleName is nullptr"); + return BUNDLE_MANAGER_ERROR_CODE_PARAM_INVALID; + } + if (!CopyConstChar(abilityResourceInfo->moduleName, moduleName)) { + APP_LOGE("copy moduleName failed"); + return BUNDLE_MANAGER_ERROR_CODE_PARAM_INVALID; + } + return BUNDLE_MANAGER_ERROR_CODE_NO_ERROR; +} + +BundleManager_ErrorCode OH_NativeBundle_GetModuleName( + OH_NativeBundle_AbilityResourceInfo *abilityResourceInfo, char **moduleName) +{ + if (abilityResourceInfo == nullptr || moduleName == nullptr) { + APP_LOGE("abilityResourceInfo or moduleName is nullptr"); + return BUNDLE_MANAGER_ERROR_CODE_PARAM_INVALID; + } + if (!CopyChar(*moduleName, abilityResourceInfo->moduleName)) { + APP_LOGE("copy moduleName failed"); + return BUNDLE_MANAGER_ERROR_CODE_PARAM_INVALID; + } + return BUNDLE_MANAGER_ERROR_CODE_NO_ERROR; +} + +BundleManager_ErrorCode OH_NativeBundle_SetAbilityResourceInfo_AbilityName( + OH_NativeBundle_AbilityResourceInfo *abilityResourceInfo, const char *abilityName) +{ + if (abilityResourceInfo == nullptr || abilityName == nullptr) { + APP_LOGE("abilityResourceInfo or abilityName is nullptr"); + return BUNDLE_MANAGER_ERROR_CODE_PARAM_INVALID; + } + if (!CopyConstChar(abilityResourceInfo->abilityName, abilityName)) { + APP_LOGE("copy abilityName failed"); + return BUNDLE_MANAGER_ERROR_CODE_PARAM_INVALID; + } + return BUNDLE_MANAGER_ERROR_CODE_NO_ERROR; +} + +BundleManager_ErrorCode OH_NativeBundle_GetAbilityName( + OH_NativeBundle_AbilityResourceInfo *abilityResourceInfo, char **abilityName) +{ + if (abilityResourceInfo == nullptr || abilityName == nullptr) { + APP_LOGE("abilityResourceInfo or abilityName is nullptr"); + return BUNDLE_MANAGER_ERROR_CODE_PARAM_INVALID; + } + if (!CopyChar(*abilityName, abilityResourceInfo->abilityName)) { + APP_LOGE("copy abilityName failed"); + return BUNDLE_MANAGER_ERROR_CODE_PARAM_INVALID; + } + return BUNDLE_MANAGER_ERROR_CODE_NO_ERROR; +} + +BundleManager_ErrorCode OH_NativeBundle_SetAbilityResourceInfo_Label( + OH_NativeBundle_AbilityResourceInfo *abilityResourceInfo, const char *label) +{ + if (abilityResourceInfo == nullptr || label == nullptr) { + APP_LOGE("abilityResourceInfo or label is nullptr"); + return BUNDLE_MANAGER_ERROR_CODE_PARAM_INVALID; + } + if (!CopyConstChar(abilityResourceInfo->label, label)) { + APP_LOGE("copy label failed"); + return BUNDLE_MANAGER_ERROR_CODE_PARAM_INVALID; + } + return BUNDLE_MANAGER_ERROR_CODE_NO_ERROR; +} + +BundleManager_ErrorCode OH_NativeBundle_GetLabel(OH_NativeBundle_AbilityResourceInfo *abilityResourceInfo, char **label) +{ + if (abilityResourceInfo == nullptr || label == nullptr) { + APP_LOGE("abilityResourceInfo or label is nullptr"); + return BUNDLE_MANAGER_ERROR_CODE_PARAM_INVALID; + } + if (!CopyChar(*label, abilityResourceInfo->label)) { + APP_LOGE("copy label failed"); + return BUNDLE_MANAGER_ERROR_CODE_PARAM_INVALID; + } + return BUNDLE_MANAGER_ERROR_CODE_NO_ERROR; +} + +BundleManager_ErrorCode OH_NativeBundle_SetAbilityResourceInfo_Icon( + OH_NativeBundle_AbilityResourceInfo *abilityResourceInfo, const char *icon) +{ + if (abilityResourceInfo == nullptr || icon == nullptr) { + APP_LOGE("abilityResourceInfo or icon is nullptr"); + return BUNDLE_MANAGER_ERROR_CODE_PARAM_INVALID; + } + if (!CopyConstChar(abilityResourceInfo->icon, icon)) { + APP_LOGE("copy icon failed"); + return BUNDLE_MANAGER_ERROR_CODE_PARAM_INVALID; + } + return BUNDLE_MANAGER_ERROR_CODE_NO_ERROR; +} + +BundleManager_ErrorCode OH_NativeBundle_GetIcon(OH_NativeBundle_AbilityResourceInfo *abilityResourceInfo, char **icon) +{ + if (abilityResourceInfo == nullptr || icon == nullptr) { + APP_LOGE("abilityResourceInfo or icon is nullptr"); + return BUNDLE_MANAGER_ERROR_CODE_PARAM_INVALID; + } + if (!CopyChar(*icon, abilityResourceInfo->icon)) { + APP_LOGE("copy icon failed"); + return BUNDLE_MANAGER_ERROR_CODE_PARAM_INVALID; + } + return BUNDLE_MANAGER_ERROR_CODE_NO_ERROR; +} \ No newline at end of file diff --git a/interfaces/kits/native/bundle/src/bundle_mgr_proxy_native.cpp b/interfaces/kits/native/bundle/src/bundle_mgr_proxy_native.cpp index b508402efb..b07a242d13 100644 --- a/interfaces/kits/native/bundle/src/bundle_mgr_proxy_native.cpp +++ b/interfaces/kits/native/bundle/src/bundle_mgr_proxy_native.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -20,6 +20,7 @@ #include "if_system_ability_manager.h" #include "ipc_skeleton.h" #include "iservice_registry.h" +#include "parcel_macro.h" #include "string_ex.h" #include "system_ability_definition.h" @@ -81,6 +82,24 @@ bool BundleMgrProxyNative::GetCompatibleDeviceTypeNative(std::string &deviceType return true; } +ErrCode BundleMgrProxyNative::GetLauncherAbilityResourceInfoNative( + std::string &fileType, std::vector &launcherAbilityResourceInfoArr) +{ + LOG_I(BMS_TAG_QUERY, "begin to get Launcher Ability Resource Info"); + MessageParcel data; + if (!data.WriteInterfaceToken(BMS_PROXY_INTERFACE_TOKEN)) { + LOG_E(BMS_TAG_QUERY, "fail to GetLauncherAbilityResourceInfoNative due to write InterfaceToken fail"); + return ERR_APPEXECFWK_PARCEL_ERROR; + } + if (!data.WriteString(fileType)) { + LOG_E(BMS_TAG_QUERY, "fail to GetLauncherAbilityResourceInfoNative due to write flag fail"); + return ERR_APPEXECFWK_PARCEL_ERROR; + } + ErrCode ret = GetParcelableInfosWithErrCode( + GET_LAUNCHER_ABILITY_RESOURE_INFO_NATIVE, data, launcherAbilityResourceInfoArr); + return ret; +} + bool BundleMgrProxyNative::SendTransactCmd(uint32_t code, MessageParcel &data, MessageParcel &reply) { MessageOption option(MessageOption::TF_SYNC); @@ -120,5 +139,33 @@ bool BundleMgrProxyNative::GetParcelableInfo(uint32_t code, MessageParcel &data, APP_LOGD("get parcelable info success"); return true; } + +template +ErrCode BundleMgrProxyNative::GetParcelableInfosWithErrCode( + uint32_t code, MessageParcel &data, std::vector &parcelableInfos) +{ + MessageParcel reply; + if (!SendTransactCmd(code, data, reply)) { + APP_LOGE("SendTransactCmd failed"); + return ERR_APPEXECFWK_PARCEL_ERROR; + } + + ErrCode res = reply.ReadInt32(); + if (res == ERR_OK) { + int32_t infoSize = reply.ReadInt32(); + CONTAINER_SECURITY_VERIFY(reply, infoSize, &parcelableInfos); + for (int32_t i = 0; i < infoSize; i++) { + std::unique_ptr info(reply.ReadParcelable()); + if (info == nullptr) { + APP_LOGE("Read Parcelable infos failed"); + return ERR_APPEXECFWK_PARCEL_ERROR; + } + parcelableInfos.emplace_back(*info); + } + APP_LOGD("get parcelable infos success"); + } + APP_LOGD("GetParcelableInfosWithErrCode ErrCode : %{public}d", res); + return res; +} } // namespace AppExecFwk } // namespace OHOS \ No newline at end of file diff --git a/interfaces/kits/native/bundle/src/native_interface_bundle.cpp b/interfaces/kits/native/bundle/src/native_interface_bundle.cpp index b25d6e20a6..880f79573b 100644 --- a/interfaces/kits/native/bundle/src/native_interface_bundle.cpp +++ b/interfaces/kits/native/bundle/src/native_interface_bundle.cpp @@ -31,6 +31,7 @@ namespace { const size_t CHAR_MIN_LENGTH = 1; const size_t CHAR_MAX_LENGTH = 10240; const size_t MAX_ALLOWED_SIZE = 1024 * 1024; +const size_t ARRAY_MAX_LENGTH = 1024; } // Helper function to release char* memory @@ -540,4 +541,61 @@ OH_NativeBundle_ModuleMetadata* OH_NativeBundle_GetModuleMetadata(size_t* size) *size = bundleInfo.applicationInfo.metadata.size(); APP_LOGD("OH_NativeBundle_GetModuleMetadata success"); return moduleMetadata; +} + +BundleManager_ErrorCode OH_NativeBundle_GetAbilityResourceInfo( + char *fileType, OH_NativeBundle_AbilityResourceInfo **abilityResourceInfo, size_t *size) +{ + if (fileType == nullptr || size == nullptr || abilityResourceInfo == nullptr) { + APP_LOGE("invalid param"); + return BUNDLE_MANAGER_ERROR_CODE_NO_ERROR; + } + *size = 0; + std::string fileTypeStr(fileType); + OHOS::AppExecFwk::BundleMgrProxyNative bundleMgrProxyNative; + std::vector launcherAbilityResourceInfoArr; + OHOS::ErrCode ret = + bundleMgrProxyNative.GetLauncherAbilityResourceInfoNative(fileTypeStr, launcherAbilityResourceInfoArr); + if (ret == BUNDLE_MANAGER_ERROR_CODE_PERMISSION_DENIED) { + APP_LOGE("failed to get launcher Ability Resource Info Arr because of permission denied"); + return BUNDLE_MANAGER_ERROR_CODE_PERMISSION_DENIED; + } + + size_t abilityResourceInfoSize = launcherAbilityResourceInfoArr.size(); + if (abilityResourceInfoSize == 0 || abilityResourceInfoSize > ARRAY_MAX_LENGTH) { + APP_LOGW("failed due to the length of value is empty or too long"); + return BUNDLE_MANAGER_ERROR_CODE_NO_ERROR; + } + + *abilityResourceInfo = OH_AbilityResourceInfo_Create(abilityResourceInfoSize); + if (*abilityResourceInfo == nullptr) { + APP_LOGE("failed to allocate memory for OH_NativeBundle_ModuleMetadata"); + return BUNDLE_MANAGER_ERROR_CODE_NO_ERROR; + } + + size_t i = 0; + for (auto &launcherAbilityResourceInfoSrc : launcherAbilityResourceInfoArr) { + if (OH_NativeBundle_SetAbilityResourceInfo_AppIndex(abilityResourceInfo[i], + launcherAbilityResourceInfoSrc.appIndex) != BUNDLE_MANAGER_ERROR_CODE_NO_ERROR || + OH_NativeBundle_SetAbilityResourceInfo_IsDefaultApp(abilityResourceInfo[i], + launcherAbilityResourceInfoSrc.isDefaultApp) != BUNDLE_MANAGER_ERROR_CODE_NO_ERROR || + OH_NativeBundle_SetAbilityResourceInfo_BundleName(abilityResourceInfo[i], + launcherAbilityResourceInfoSrc.bundleName.c_str()) != BUNDLE_MANAGER_ERROR_CODE_NO_ERROR || + OH_NativeBundle_SetAbilityResourceInfo_ModuleName(abilityResourceInfo[i], + launcherAbilityResourceInfoSrc.moduleName.c_str()) != BUNDLE_MANAGER_ERROR_CODE_NO_ERROR || + OH_NativeBundle_SetAbilityResourceInfo_AbilityName(abilityResourceInfo[i], + launcherAbilityResourceInfoSrc.abilityName.c_str()) != BUNDLE_MANAGER_ERROR_CODE_NO_ERROR || + OH_NativeBundle_SetAbilityResourceInfo_Label(abilityResourceInfo[i], + launcherAbilityResourceInfoSrc.label.c_str()) != BUNDLE_MANAGER_ERROR_CODE_NO_ERROR || + OH_NativeBundle_SetAbilityResourceInfo_Icon(abilityResourceInfo[i], + launcherAbilityResourceInfoSrc.icon.c_str()) != BUNDLE_MANAGER_ERROR_CODE_NO_ERROR) { + APP_LOGE("failed to set ability resource info"); + OH_AbilityResourceInfo_Destroy(*abilityResourceInfo, i + 1); + return BUNDLE_MANAGER_ERROR_CODE_NO_ERROR; + } + ++i; + } + + *size = abilityResourceInfoSize; + return BUNDLE_MANAGER_ERROR_CODE_NO_ERROR; } \ No newline at end of file diff --git a/services/bundlemgr/include/bundle_data_mgr.h b/services/bundlemgr/include/bundle_data_mgr.h index 488462aa33..21f3e4297d 100644 --- a/services/bundlemgr/include/bundle_data_mgr.h +++ b/services/bundlemgr/include/bundle_data_mgr.h @@ -1187,6 +1187,8 @@ public: const int32_t userId, PluginBundleInfo &pluginBundleInfo); bool SetBundleUserInfoRemovable(const std::string bundleName, int32_t userId, bool removable); ErrCode GetTestRunner(const std::string &bundleName, const std::string &moduleName, ModuleTestRunner &testRunner); + bool ImplicitQueryAbilityInfosWithDefault(const Want &want, int32_t flags, int32_t userId, + std::vector &abilityInfos, std::vector &defaultAbilityInfos); private: /** diff --git a/services/bundlemgr/include/bundle_mgr_host_impl.h b/services/bundlemgr/include/bundle_mgr_host_impl.h index f3ad23960e..0ad604bcd9 100644 --- a/services/bundlemgr/include/bundle_mgr_host_impl.h +++ b/services/bundlemgr/include/bundle_mgr_host_impl.h @@ -1195,6 +1195,8 @@ public: const int32_t userId, PluginBundleInfo &pluginBundleInfo) override; virtual ErrCode GetTestRunner(const std::string &bundleName, const std::string &moduleName, ModuleTestRunner &testRunner) override; + virtual ErrCode GetAbilityResourceInfo(const std::string &fileType, + std::vector &launcherAbilityResourceInfos) override; private: bool GetLabelByBundleName(const std::string &bundleName, int32_t userId, std::string &label); @@ -1256,6 +1258,14 @@ private: std::string &label); bool SendQueryBundleInfoEvent(QueryEventInfo &query, int64_t intervalTime, bool reportNow); bool GetCallingInfo(int32_t callingUid, std::string &callingBundleName, std::string &callingAppId); + std::vector FileTypeNormalize(const std::string &fileType); + void FilterAbilityResourceInfoWithAbilityInfo(const AbilityInfo &abilityInfo, + std::vector &launcherAbilityResourceInfo); + bool UpdateDefaultAppForLauncherAbility(const AbilityInfo &abilityInfo, + const std::vector &defaultAppAbilityInfos, + std::vector &launcherAbilityResourceInfo); + ErrCode ImplicitQueryAbilityInfosWithDefault(const std::string &normalizedType, + std::vector &launcherAbilityResourceInfos); std::atomic isBrokerServiceExisted_ = false; }; diff --git a/services/bundlemgr/src/bundle_data_mgr.cpp b/services/bundlemgr/src/bundle_data_mgr.cpp index d4c4232c84..441f6d3380 100644 --- a/services/bundlemgr/src/bundle_data_mgr.cpp +++ b/services/bundlemgr/src/bundle_data_mgr.cpp @@ -11407,5 +11407,32 @@ ErrCode BundleDataMgr::GetTestRunner(const std::string &bundleName, const std::s BundleParser bundleParser; return bundleParser.ParseTestRunner(moduleInfo->hapPath, testRunner); } + +bool BundleDataMgr::ImplicitQueryAbilityInfosWithDefault(const Want &want, int32_t flags, int32_t userId, + std::vector &abilityInfos, std::vector &defaultAbilityInfos) +{ + (void)ImplicitQueryAbilityInfos(want, flags, userId, abilityInfos); + (void)ImplicitQueryCloneAbilityInfos(want, flags, userId, abilityInfos); +#ifdef BUNDLE_FRAMEWORK_DEFAULT_APP + std::vector extensionInfos; + if (DefaultAppMgr::GetInstance().GetDefaultApplication(want, userId, defaultAbilityInfos, extensionInfos)) { + if (!defaultAbilityInfos.empty()) { + APP_LOGI("find target default application"); + abilityInfos.insert(abilityInfos.end(), defaultAbilityInfos.begin(), defaultAbilityInfos.end()); + } + } + std::vector backupAbilityInfos; + if (DefaultAppMgr::GetInstance().GetDefaultApplication(want, userId, backupAbilityInfos, extensionInfos, true)) { + if (!backupAbilityInfos.empty()) { + APP_LOGI("find target backup default application"); + abilityInfos.insert(abilityInfos.end(), backupAbilityInfos.begin(), backupAbilityInfos.end()); + if (defaultAbilityInfos.empty()) { + defaultAbilityInfos = backupAbilityInfos; + } + } + } +#endif + return !abilityInfos.empty(); +} } // namespace AppExecFwk } // namespace OHOS diff --git a/services/bundlemgr/src/bundle_mgr_host_impl.cpp b/services/bundlemgr/src/bundle_mgr_host_impl.cpp index 2a42a0e1d4..415cdc2ecd 100644 --- a/services/bundlemgr/src/bundle_mgr_host_impl.cpp +++ b/services/bundlemgr/src/bundle_mgr_host_impl.cpp @@ -47,12 +47,16 @@ #ifdef BMS_USER_AUTH_FRAMEWORK_ENABLED #include "migrate_data_user_auth_callback.h" #endif +#include "mime_type_mgr.h" #include "parameters.h" #include "system_ability_definition.h" #include "scope_guard.h" #ifdef BMS_USER_AUTH_FRAMEWORK_ENABLED #include "user_auth_client_impl.h" #endif +#ifdef BUNDLE_FRAMEWORK_UDMF_ENABLED +#include "utd_client.h" +#endif #include "xcollie_helper.h" namespace OHOS { @@ -83,6 +87,7 @@ const std::string AUTH_TITLE = " "; const std::string BUNDLE_NAME = "bundleName"; const std::string LABEL = "label"; const std::string NEW_LINE = "\n"; +const std::string ACTION_VIEW_DATA = "ohos.want.action.viewData"; const std::string RESOURCE_NOT_SUPPORT = "warning: dump label failed due to the device not supporting bundle resource!"; const uint8_t JSON_INDENTATION = 4; @@ -6153,5 +6158,139 @@ ErrCode BundleMgrHostImpl::GetTestRunner(const std::string &bundleName, const st } return dataMgr->GetTestRunner(bundleName, moduleName, testRunner); } + +void BundleMgrHostImpl::FilterAbilityResourceInfoWithAbilityInfo(const AbilityInfo &abilityInfo, + std::vector &launcherAbilityResourceInfo) +{ + launcherAbilityResourceInfo.erase( + std::remove_if( + launcherAbilityResourceInfo.begin(), + launcherAbilityResourceInfo.end(), + [&abilityInfo](const LauncherAbilityResourceInfo &info) { + return (info.moduleName != abilityInfo.moduleName) + || (info.abilityName != abilityInfo.name) + || (info.appIndex != abilityInfo.appIndex); + }), + launcherAbilityResourceInfo.end()); +} + +bool BundleMgrHostImpl::UpdateDefaultAppForLauncherAbility(const AbilityInfo &abilityInfo, + const std::vector &defaultAppAbilityInfos, + std::vector &launcherAbilityResourceInfo) +{ + auto it = std::find_if(defaultAppAbilityInfos.begin(), defaultAppAbilityInfos.end(), + [&abilityInfo](const AbilityInfo &defaultAppAbilityInfo) { + return (defaultAppAbilityInfo.bundleName == abilityInfo.bundleName) && + (defaultAppAbilityInfo.appIndex == abilityInfo.appIndex); + }); + if (it != defaultAppAbilityInfos.end()) { + for (auto &info : launcherAbilityResourceInfo) { + info.isDefaultApp = true; + } + return true; + } + return false; +} + +ErrCode BundleMgrHostImpl::ImplicitQueryAbilityInfosWithDefault(const std::string &normalizedType, + std::vector &launcherAbilityResourceInfos) +{ +#ifdef BUNDLE_FRAMEWORK_BUNDLE_RESOURCE + auto dataMgr = GetDataMgrFromService(); + if (dataMgr == nullptr) { + APP_LOGE("dataMgr is nullptr"); + return ERR_APPEXECFWK_NULL_PTR; + } + Want want; + want.SetType(normalizedType); + want.SetAction(ACTION_VIEW_DATA); + int32_t abilityInfoflags = static_cast(GetAbilityInfoFlag::GET_ABILITY_INFO_DEFAULT); + auto uid = IPCSkeleton::GetCallingUid(); + int32_t userId = BundleUtil::GetUserIdByUid(uid); + std::vector abilityInfos; + std::vector defaultAbilityInfos; + if (dataMgr->ImplicitQueryAbilityInfosWithDefault(want, abilityInfoflags, userId, abilityInfos, defaultAbilityInfos) != true) { + APP_LOGW("ImplicitQueryAbilityInfosWithDefault failed"); + return ERR_OK; + } + auto manager = DelayedSingleton::GetInstance(); + if (manager == nullptr) { + APP_LOGE("manager is nullptr"); + return ERR_APPEXECFWK_NULL_PTR; + } + bool findDefaultApp = false; + if (!defaultAbilityInfos.empty()) { + findDefaultApp = true; + } + uint32_t resourceInfoflags = static_cast(ResourceFlag::GET_RESOURCE_INFO_ALL); + for (auto &abilityInfo : abilityInfos) { + std::vector launcherAbilityResourceInfo; + if (!manager->GetLauncherAbilityResourceInfo(abilityInfo.bundleName, resourceInfoflags, + launcherAbilityResourceInfo, abilityInfo.appIndex)) { + APP_LOGW("get resource failed -n %{public}s -f %{public}u", abilityInfo.bundleName.c_str(), + resourceInfoflags); + continue; + } + FilterAbilityResourceInfoWithAbilityInfo(abilityInfo, launcherAbilityResourceInfo); + if (findDefaultApp && UpdateDefaultAppForLauncherAbility(abilityInfo, defaultAbilityInfos, + launcherAbilityResourceInfo)) { + findDefaultApp = false; + } + launcherAbilityResourceInfos.insert(launcherAbilityResourceInfos.end(), + launcherAbilityResourceInfo.begin(), launcherAbilityResourceInfo.end()); + } +#else + APP_LOGI("bundle resource not support"); +#endif + return ERR_OK; +} + +std::vector BundleMgrHostImpl::FileTypeNormalize(const std::string &fileType) +{ +#ifdef BUNDLE_FRAMEWORK_UDMF_ENABLED + if(BundleUtil::IsUtd(fileType)) { + return {fileType}; + } + if (fileType[0] == '.') { + std::vector utdVector; + if (!MimeTypeMgr::GetUtdVectorByUri(fileType, utdVector)) { + APP_LOGW("GetUtdVectorByUri failed"); + return {}; + } else { + return utdVector; + } + } else { + return BundleUtil::GetUtdVectorByMimeType(fileType); + } +#else + APP_LOGI("UDMF not support"); + return {}; +#endif +} + +ErrCode BundleMgrHostImpl::GetAbilityResourceInfo(const std::string &fileType, + std::vector &launcherAbilityResourceInfos) +{ + APP_LOGD("start GetLauncherAbilityResourceInfo, fileType: %{public}s", fileType.c_str()); + if (!BundlePermissionMgr::VerifyCallingPermissionForAll(Constants::PERMISSION_GET_ABILITY_INFO)) { + APP_LOGE("verify permission failed"); + return ERR_BUNDLE_MANAGER_PERMISSION_DENIED; + } + if (fileType.empty()) { + APP_LOGW("fileType is empty"); + return ERR_OK; + } + std::vector normalizedTypeVector = FileTypeNormalize(fileType); + APP_LOGI("normalized:%{public}s", BundleUtil::ToString(normalizedTypeVector).c_str()); + if (normalizedTypeVector.empty()) { + APP_LOGW("normalizedTypeVector empty"); + return ERR_OK; + } + for (const std::string& normalizedType : normalizedTypeVector) { + (void)ImplicitQueryAbilityInfosWithDefault(normalizedType, launcherAbilityResourceInfos); + } + APP_LOGI("GetAbilityResourceInfo end, size: %{public}zu", launcherAbilityResourceInfos.size()); + return ERR_OK; +} } // namespace AppExecFwk } // namespace OHOS diff --git a/services/bundlemgr/test/unittest/bms_bundle_permission_grant_test/bms_bundle_permission_false_test.cpp b/services/bundlemgr/test/unittest/bms_bundle_permission_grant_test/bms_bundle_permission_false_test.cpp index 2489ec3188..cf897539ca 100644 --- a/services/bundlemgr/test/unittest/bms_bundle_permission_grant_test/bms_bundle_permission_false_test.cpp +++ b/services/bundlemgr/test/unittest/bms_bundle_permission_grant_test/bms_bundle_permission_false_test.cpp @@ -1968,4 +1968,33 @@ HWTEST_F(BmsBundlePermissionFalseTest, GetShortcutInfoByAppIndex_0001, Function EXPECT_EQ(testRet, ERR_BUNDLE_MANAGER_PERMISSION_DENIED); EXPECT_TRUE(shortcutInfos.empty()); } + +/** + * @tc.number: GetAbilityResourceInfo_0001 + * @tc.name: test GetAbilityResourceInfo + * @tc.desc: test GetAbilityResourceInfo + */ +HWTEST_F(BmsBundlePermissionFalseTest, GetAbilityResourceInfo_0001, Function | SmallTest | Level1) +{ + std::string fileType = ""; + std::vector launcherAbilityResourceInfos; + auto testRet = bundleMgrHostImpl_->GetAbilityResourceInfo(fileType, launcherAbilityResourceInfos); + EXPECT_EQ(testRet, ERR_BUNDLE_MANAGER_PERMISSION_DENIED); + EXPECT_TRUE(launcherAbilityResourceInfos.empty()); +} + +/** + * @tc.number: GetAbilityResourceInfo_0002 + * @tc.name: test GetAbilityResourceInfo + * @tc.desc: test GetAbilityResourceInfo + */ +HWTEST_F(BmsBundlePermissionFalseTest, GetAbilityResourceInfo_0002, Function | SmallTest | Level1) +{ + MessageParcel data; + MessageParcel reply; + std::string fileType = ""; + data.WriteString(fileType); + ErrCode res = bundleMgrHostImpl_->HandleGetAbilityResourceInfo(data, reply); + EXPECT_EQ(res, ERR_OK); +} } // OHOS \ No newline at end of file diff --git a/test/systemtest/common/bms/bms_bundle_mgr_host_test/bms_bundle_mgr_host_test.cpp b/test/systemtest/common/bms/bms_bundle_mgr_host_test/bms_bundle_mgr_host_test.cpp index b4936dd0e8..96dd72b6ee 100644 --- a/test/systemtest/common/bms/bms_bundle_mgr_host_test/bms_bundle_mgr_host_test.cpp +++ b/test/systemtest/common/bms/bms_bundle_mgr_host_test/bms_bundle_mgr_host_test.cpp @@ -1,2250 +1,2265 @@ -/* - * Copyright (c) 2024-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#define private public - -#include -#include -#include -#include "bundle_mgr_host.h" - -using namespace testing::ext; - -namespace OHOS { -namespace AppExecFwk { - -class BmsBundleMgrHostTest : public testing::Test { -public: - static void SetUpTestCase(); - static void TearDownTestCase(); - void SetUp(); - void TearDown(); -}; - -void BmsBundleMgrHostTest::SetUpTestCase() -{} - -void BmsBundleMgrHostTest::TearDownTestCase() -{} - -void BmsBundleMgrHostTest::SetUp() -{} - -void BmsBundleMgrHostTest::TearDown() -{} - -/** - * @tc.number: HandleGetApplicationInfo_0100 - * @tc.name: test the HandleGetApplicationInfo - * @tc.desc: 1. system running normally - * 2. test HandleGetApplicationInfo - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetApplicationInfo_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetApplicationInfo(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetApplicationInfoWithIntFlags_0100 - * @tc.name: test the HandleGetApplicationInfoWithIntFlags - * @tc.desc: 1. system running normally - * 2. test HandleGetApplicationInfoWithIntFlags - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetApplicationInfoWithIntFlags_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetApplicationInfoWithIntFlags(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetApplicationInfoWithIntFlagsV9_0100 - * @tc.name: test the HandleGetApplicationInfoWithIntFlagsV9 - * @tc.desc: 1. system running normally - * 2. test HandleGetApplicationInfoWithIntFlagsV9 - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetApplicationInfoWithIntFlagsV9_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetApplicationInfoWithIntFlagsV9(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetApplicationInfosWithIntFlags_0100 - * @tc.name: test the HandleGetApplicationInfosWithIntFlags - * @tc.desc: 1. system running normally - * 2. test HandleGetApplicationInfosWithIntFlags - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetApplicationInfosWithIntFlags_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetApplicationInfosWithIntFlags(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetApplicationInfosWithIntFlagsV9_0100 - * @tc.name: test the HandleGetApplicationInfosWithIntFlagsV9 - * @tc.desc: 1. system running normally - * 2. test HandleGetApplicationInfosWithIntFlagsV9 - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetApplicationInfosWithIntFlagsV9_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetApplicationInfosWithIntFlagsV9(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetBundleInfoForSelf_0100 - * @tc.name: test the HandleGetBundleInfoForSelf - * @tc.desc: 1. system running normally - * 2. test HandleGetBundleInfoForSelf - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetBundleInfoForSelf_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetBundleInfoForSelf(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetDependentBundleInfo_0100 - * @tc.name: test the HandleGetDependentBundleInfo - * @tc.desc: 1. system running normally - * 2. test HandleGetDependentBundleInfo - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetDependentBundleInfo_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetDependentBundleInfo(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetBundleInfoWithIntFlagsV9_0100 - * @tc.name: test the HandleGetBundleInfoWithIntFlagsV9 - * @tc.desc: 1. system running normally - * 2. test HandleGetBundleInfoWithIntFlagsV9 - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetBundleInfoWithIntFlagsV9_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetBundleInfoWithIntFlagsV9(data, reply); - EXPECT_EQ(res, ERR_BUNDLE_MANAGER_INTERNAL_ERROR); -} - -/** - * @tc.number: HandleGetBundlePackInfo_0100 - * @tc.name: test the HandleGetBundlePackInfo - * @tc.desc: 1. system running normally - * 2. test HandleGetBundlePackInfo - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetBundlePackInfo_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetBundlePackInfo(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetBundlePackInfoWithIntFlags_0100 - * @tc.name: test the HandleGetBundlePackInfoWithIntFlags - * @tc.desc: 1. system running normally - * 2. test HandleGetBundlePackInfoWithIntFlags - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetBundlePackInfoWithIntFlags_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetBundlePackInfoWithIntFlags(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetBundleInfos_0100 - * @tc.name: test the HandleGetBundleInfos - * @tc.desc: 1. system running normally - * 2. test HandleGetBundleInfos - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetBundleInfos_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetBundleInfos(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetBundleInfosWithIntFlags_0100 - * @tc.name: test the HandleGetBundleInfosWithIntFlags - * @tc.desc: 1. system running normally - * 2. test HandleGetBundleInfosWithIntFlags - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetBundleInfosWithIntFlags_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetBundleInfosWithIntFlags(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetBundleInfosWithIntFlagsV9_0100 - * @tc.name: test the HandleGetBundleInfosWithIntFlagsV9 - * @tc.desc: 1. system running normally - * 2. test HandleGetBundleInfosWithIntFlagsV9 - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetBundleInfosWithIntFlagsV9_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetBundleInfosWithIntFlagsV9(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetBundleNameForUid_0100 - * @tc.name: test the HandleGetBundleNameForUid - * @tc.desc: 1. system running normally - * 2. test HandleGetBundleNameForUid - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetBundleNameForUid_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetBundleNameForUid(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetBundlesForUid_0100 - * @tc.name: test the HandleGetBundlesForUid - * @tc.desc: 1. system running normally - * 2. test HandleGetBundlesForUid - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetBundlesForUid_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetBundlesForUid(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetBundleGids_0100 - * @tc.name: test the HandleGetBundleGids - * @tc.desc: 1. system running normally - * 2. test HandleGetBundleGids - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetBundleGids_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetBundleGids(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetBundleGidsByUid_0100 - * @tc.name: test the HandleGetBundleGidsByUid - * @tc.desc: 1. system running normally - * 2. test HandleGetBundleGidsByUid - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetBundleGidsByUid_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetBundleGidsByUid(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetBundleInfosByMetaData_0100 - * @tc.name: test the HandleGetBundleInfosByMetaData - * @tc.desc: 1. system running normally - * 2. test HandleGetBundleInfosByMetaData - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetBundleInfosByMetaData_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetBundleInfosByMetaData(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleQueryAbilityInfo_0100 - * @tc.name: test the HandleQueryAbilityInfo - * @tc.desc: 1. system running normally - * 2. test HandleQueryAbilityInfo - */ -HWTEST_F(BmsBundleMgrHostTest, HandleQueryAbilityInfo_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleQueryAbilityInfo(data, reply); - EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); -} - -/** - * @tc.number: HandleQueryAbilityInfoMutiparam_0100 - * @tc.name: test the HandleQueryAbilityInfoMutiparam - * @tc.desc: 1. system running normally - * 2. test HandleQueryAbilityInfoMutiparam - */ -HWTEST_F(BmsBundleMgrHostTest, HandleQueryAbilityInfoMutiparam_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleQueryAbilityInfoMutiparam(data, reply); - EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); -} - -/** - * @tc.number: HandleQueryAbilityInfos_0100 - * @tc.name: test the HandleQueryAbilityInfos - * @tc.desc: 1. system running normally - * 2. test HandleQueryAbilityInfos - */ -HWTEST_F(BmsBundleMgrHostTest, HandleQueryAbilityInfos_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleQueryAbilityInfos(data, reply); - EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); -} - -/** - * @tc.number: HandleQueryAbilityInfosMutiparam_0100 - * @tc.name: test the HandleQueryAbilityInfosMutiparam - * @tc.desc: 1. system running normally - * 2. test HandleQueryAbilityInfosMutiparam - */ -HWTEST_F(BmsBundleMgrHostTest, HandleQueryAbilityInfosMutiparam_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleQueryAbilityInfosMutiparam(data, reply); - EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); -} - -/** - * @tc.number: HandleQueryAbilityInfosV9_0100 - * @tc.name: test the HandleQueryAbilityInfosV9 - * @tc.desc: 1. system running normally - * 2. test HandleQueryAbilityInfosV9 - */ -HWTEST_F(BmsBundleMgrHostTest, HandleQueryAbilityInfosV9_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleQueryAbilityInfosV9(data, reply); - EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); -} - -/** - * @tc.number: HandleQueryLauncherAbilityInfos_0100 - * @tc.name: test the HandleQueryLauncherAbilityInfos - * @tc.desc: 1. system running normally - * 2. test HandleQueryLauncherAbilityInfos - */ -HWTEST_F(BmsBundleMgrHostTest, HandleQueryLauncherAbilityInfos_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleQueryLauncherAbilityInfos(data, reply); - EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); -} - -/** - * @tc.number: HandleQueryAllAbilityInfos_0100 - * @tc.name: test the HandleQueryAllAbilityInfos - * @tc.desc: 1. system running normally - * 2. test HandleQueryAllAbilityInfos - */ -HWTEST_F(BmsBundleMgrHostTest, HandleQueryAllAbilityInfos_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleQueryAllAbilityInfos(data, reply); - EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); -} - -/** - * @tc.number: HandleQueryAbilityInfoByUriForUserId_0100 - * @tc.name: test the HandleQueryAbilityInfoByUriForUserId - * @tc.desc: 1. system running normally - * 2. test HandleQueryAbilityInfoByUriForUserId - */ -HWTEST_F(BmsBundleMgrHostTest, HandleQueryAbilityInfoByUriForUserId_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleQueryAbilityInfoByUriForUserId(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleQueryKeepAliveBundleInfos_0100 - * @tc.name: test the HandleQueryKeepAliveBundleInfos - * @tc.desc: 1. system running normally - * 2. test HandleQueryKeepAliveBundleInfos - */ -HWTEST_F(BmsBundleMgrHostTest, HandleQueryKeepAliveBundleInfos_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleQueryKeepAliveBundleInfos(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetAbilityLabel_0100 - * @tc.name: test the HandleGetAbilityLabel - * @tc.desc: 1. system running normally - * 2. test HandleGetAbilityLabel - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetAbilityLabel_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetAbilityLabel(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetAbilityLabelWithModuleName_0100 - * @tc.name: test the HandleGetAbilityLabelWithModuleName - * @tc.desc: 1. system running normally - * 2. test HandleGetAbilityLabelWithModuleName - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetAbilityLabelWithModuleName_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetAbilityLabelWithModuleName(data, reply); - EXPECT_EQ(res, ERR_BUNDLE_MANAGER_INVALID_PARAMETER); -} - -/** - * @tc.number: HandleCheckIsSystemAppByUid_0100 - * @tc.name: test the HandleCheckIsSystemAppByUid - * @tc.desc: 1. system running normally - * 2. test HandleCheckIsSystemAppByUid - */ -HWTEST_F(BmsBundleMgrHostTest, HandleCheckIsSystemAppByUid_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleCheckIsSystemAppByUid(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetBundleArchiveInfo_0100 - * @tc.name: test the HandleGetBundleArchiveInfo - * @tc.desc: 1. system running normally - * 2. test HandleGetBundleArchiveInfo - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetBundleArchiveInfo_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetBundleArchiveInfo(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetBundleArchiveInfoWithIntFlags_0100 - * @tc.name: test the HandleGetBundleArchiveInfoWithIntFlags - * @tc.desc: 1. system running normally - * 2. test HandleGetBundleArchiveInfoWithIntFlags - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetBundleArchiveInfoWithIntFlags_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetBundleArchiveInfoWithIntFlags(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetBundleArchiveInfoWithIntFlagsV9_0100 - * @tc.name: test the HandleGetBundleArchiveInfoWithIntFlagsV9 - * @tc.desc: 1. system running normally - * 2. test HandleGetBundleArchiveInfoWithIntFlagsV9 - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetBundleArchiveInfoWithIntFlagsV9_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetBundleArchiveInfoWithIntFlagsV9(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetHapModuleInfo_0100 - * @tc.name: test the HandleGetHapModuleInfo - * @tc.desc: 1. system running normally - * 2. test HandleGetHapModuleInfo - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetHapModuleInfo_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetHapModuleInfo(data, reply); - EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); -} - -/** - * @tc.number: HandleGetHapModuleInfoWithUserId_0100 - * @tc.name: test the HandleGetHapModuleInfoWithUserId - * @tc.desc: 1. system running normally - * 2. test HandleGetHapModuleInfoWithUserId - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetHapModuleInfoWithUserId_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetHapModuleInfoWithUserId(data, reply); - EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); -} - -/** - * @tc.number: HandleGetLaunchWantForBundle_0100 - * @tc.name: test the HandleGetLaunchWantForBundle - * @tc.desc: 1. system running normally - * 2. test HandleGetLaunchWantForBundle - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetLaunchWantForBundle_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetLaunchWantForBundle(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetPermissionDef_0100 - * @tc.name: test the HandleGetPermissionDef - * @tc.desc: 1. system running normally - * 2. test HandleGetPermissionDef - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetPermissionDef_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetPermissionDef(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleCleanBundleCacheFiles_0100 - * @tc.name: test the HandleCleanBundleCacheFiles - * @tc.desc: 1. system running normally - * 2. test HandleCleanBundleCacheFiles - */ -HWTEST_F(BmsBundleMgrHostTest, HandleCleanBundleCacheFiles_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleCleanBundleCacheFiles(data, reply); - EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); -} - -/** - * @tc.number: HandleCleanBundleDataFiles_0100 - * @tc.name: test the HandleCleanBundleDataFiles - * @tc.desc: 1. system running normally - * 2. test HandleCleanBundleDataFiles - */ -HWTEST_F(BmsBundleMgrHostTest, HandleCleanBundleDataFiles_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleCleanBundleDataFiles(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleRegisterBundleStatusCallback_0100 - * @tc.name: test the HandleRegisterBundleStatusCallback - * @tc.desc: 1. system running normally - * 2. test HandleRegisterBundleStatusCallback - */ -HWTEST_F(BmsBundleMgrHostTest, HandleRegisterBundleStatusCallback_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleRegisterBundleStatusCallback(data, reply); - EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); -} - -/** - * @tc.number: HandleRegisterBundleEventCallback_0100 - * @tc.name: test the HandleRegisterBundleEventCallback - * @tc.desc: 1. system running normally - * 2. test HandleRegisterBundleEventCallback - */ -HWTEST_F(BmsBundleMgrHostTest, HandleRegisterBundleEventCallback_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleRegisterBundleEventCallback(data, reply); - EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); -} - -/** - * @tc.number: HandleUnregisterBundleEventCallback_0100 - * @tc.name: test the HandleUnregisterBundleEventCallback - * @tc.desc: 1. system running normally - * 2. test HandleUnregisterBundleEventCallback - */ -HWTEST_F(BmsBundleMgrHostTest, HandleUnregisterBundleEventCallback_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleUnregisterBundleEventCallback(data, reply); - EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); -} - -/** - * @tc.number: HandleClearBundleStatusCallback_0100 - * @tc.name: test the HandleClearBundleStatusCallback - * @tc.desc: 1. system running normally - * 2. test HandleClearBundleStatusCallback - */ -HWTEST_F(BmsBundleMgrHostTest, HandleClearBundleStatusCallback_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleClearBundleStatusCallback(data, reply); - EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); -} - -/** - * @tc.number: HandleUnregisterBundleStatusCallback_0100 - * @tc.name: test the HandleUnregisterBundleStatusCallback - * @tc.desc: 1. system running normally - * 2. test HandleUnregisterBundleStatusCallback - */ -HWTEST_F(BmsBundleMgrHostTest, HandleUnregisterBundleStatusCallback_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleUnregisterBundleStatusCallback(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleDumpInfos_0100 - * @tc.name: test the HandleDumpInfos - * @tc.desc: 1. system running normally - * 2. test HandleDumpInfos - */ -HWTEST_F(BmsBundleMgrHostTest, HandleDumpInfos_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleDumpInfos(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleCompileProcessAOT_0100 - * @tc.name: test the HandleCompileProcessAOT - * @tc.desc: 1. system running normally - * 2. test HandleCompileProcessAOT - */ -HWTEST_F(BmsBundleMgrHostTest, HandleCompileProcessAOT_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleCompileProcessAOT(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleCompileReset_0100 - * @tc.name: test the HandleCompileReset - * @tc.desc: 1. system running normally - * 2. test HandleCompileReset - */ -HWTEST_F(BmsBundleMgrHostTest, HandleCompileReset_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleCompileReset(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetBundleInstaller_0100 - * @tc.name: test the HandleGetBundleInstaller - * @tc.desc: 1. system running normally - * 2. test HandleGetBundleInstaller - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetBundleInstaller_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetBundleInstaller(data, reply); - EXPECT_EQ(res, ERR_APPEXECFWK_INSTALL_HOST_INSTALLER_FAILED); -} - -/** - * @tc.number: HandleGetBundleUserMgr_0100 - * @tc.name: test the HandleGetBundleUserMgr - * @tc.desc: 1. system running normally - * 2. test HandleGetBundleUserMgr - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetBundleUserMgr_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetBundleUserMgr(data, reply); - EXPECT_EQ(res, ERR_APPEXECFWK_INSTALL_HOST_INSTALLER_FAILED); -} - -/** - * @tc.number: HandleGetVerifyManager_0100 - * @tc.name: test the HandleGetVerifyManager - * @tc.desc: 1. system running normally - * 2. test HandleGetVerifyManager - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetVerifyManager_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetVerifyManager(data, reply); - EXPECT_EQ(res, ERR_BUNDLE_MANAGER_VERIFY_GET_VERIFY_MGR_FAILED); -} - -/** - * @tc.number: HandleIsDebuggableApplication_0100 - * @tc.name: test the HandleIsDebuggableApplication - * @tc.desc: 1. system running normally - * 2. test HandleIsDebuggableApplication - */ -HWTEST_F(BmsBundleMgrHostTest, HandleIsDebuggableApplication, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleIsDebuggableApplication(data, reply); - EXPECT_EQ(res, ERR_BUNDLE_MANAGER_PARAM_ERROR); -} - -/** - * @tc.number: HandleIsApplicationEnabled_0100 - * @tc.name: test the HandleIsApplicationEnabled - * @tc.desc: 1. system running normally - * 2. test HandleIsApplicationEnabled - */ -HWTEST_F(BmsBundleMgrHostTest, HandleIsApplicationEnabled_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleIsApplicationEnabled(data, reply); - EXPECT_EQ(res, ERR_BUNDLE_MANAGER_PARAM_ERROR); -} - -/** - * @tc.number: HandleSetApplicationEnabled_0100 - * @tc.name: test the HandleSetApplicationEnabled - * @tc.desc: 1. system running normally - * 2. test HandleSetApplicationEnabled - */ -HWTEST_F(BmsBundleMgrHostTest, HandleSetApplicationEnabled_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleSetApplicationEnabled(data, reply); - EXPECT_EQ(res, ERR_BUNDLE_MANAGER_PARAM_ERROR); -} - -/** - * @tc.number: HandleIsAbilityEnabled_0100 - * @tc.name: test the HandleIsAbilityEnabled - * @tc.desc: 1. system running normally - * 2. test HandleIsAbilityEnabled - */ -HWTEST_F(BmsBundleMgrHostTest, HandleIsAbilityEnabled_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleIsAbilityEnabled(data, reply); - EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); -} - -/** - * @tc.number: HandleSetAbilityEnabled_0100 - * @tc.name: test the HandleSetAbilityEnabled - * @tc.desc: 1. system running normally - * 2. test HandleSetAbilityEnabled - */ -HWTEST_F(BmsBundleMgrHostTest, HandleSetAbilityEnabled_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleSetAbilityEnabled(data, reply); - EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); -} - -/** - * @tc.number: HandleGetAllFormsInfo_0100 - * @tc.name: test the HandleGetAllFormsInfo - * @tc.desc: 1. system running normally - * 2. test HandleGetAllFormsInfo - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetAllFormsInfo_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetAllFormsInfo(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetFormsInfoByApp_0100 - * @tc.name: test the HandleGetFormsInfoByApp - * @tc.desc: 1. system running normally - * 2. test HandleGetFormsInfoByApp - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetFormsInfoByApp_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetFormsInfoByApp(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetFormsInfoByModule_0100 - * @tc.name: test the HandleGetFormsInfoByModule - * @tc.desc: 1. system running normally - * 2. test HandleGetFormsInfoByModule - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetFormsInfoByModule_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetFormsInfoByModule(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetShortcutInfos_0100 - * @tc.name: test the HandleGetShortcutInfos - * @tc.desc: 1. system running normally - * 2. test HandleGetShortcutInfos - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetShortcutInfos_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetShortcutInfos(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetShortcutInfoV9_0100 - * @tc.name: test the HandleGetShortcutInfoV9 - * @tc.desc: 1. system running normally - * 2. test HandleGetShortcutInfoV9 - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetShortcutInfoV9_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetShortcutInfoV9(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetShortcutInfoByAppIndex_0100 - * @tc.name: test the HandleGetShortcutInfoByAppIndex - * @tc.desc: 1. system running normally - * 2. test HandleGetShortcutInfoByAppIndex - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetShortcutInfoByAppIndex_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetShortcutInfoByAppIndex(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetAllCommonEventInfo_0100 - * @tc.name: test the HandleGetAllCommonEventInfo - * @tc.desc: 1. system running normally - * 2. test HandleGetAllCommonEventInfo - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetAllCommonEventInfo_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetAllCommonEventInfo(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetDistributedBundleInfo_0100 - * @tc.name: test the HandleGetDistributedBundleInfo - * @tc.desc: 1. system running normally - * 2. test HandleGetDistributedBundleInfo - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetDistributedBundleInfo_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetDistributedBundleInfo(data, reply); - EXPECT_EQ(res, ERR_INVALID_VALUE); -} - -/** - * @tc.number: HandleGetAppPrivilegeLevel_0100 - * @tc.name: test the HandleGetAppPrivilegeLevel - * @tc.desc: 1. system running normally - * 2. test HandleGetAppPrivilegeLevel - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetAppPrivilegeLevel_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetAppPrivilegeLevel(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleQueryExtAbilityInfosWithoutType_0100 - * @tc.name: test the HandleQueryExtAbilityInfosWithoutType - * @tc.desc: 1. system running normally - * 2. test HandleQueryExtAbilityInfosWithoutType - */ -HWTEST_F(BmsBundleMgrHostTest, HandleQueryExtAbilityInfosWithoutType_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleQueryExtAbilityInfosWithoutType(data, reply); - EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); -} - -/** - * @tc.number: HandleQueryExtAbilityInfosWithoutTypeV9_0100 - * @tc.name: test the HandleQueryExtAbilityInfosWithoutTypeV9 - * @tc.desc: 1. system running normally - * 2. test HandleQueryExtAbilityInfosWithoutTypeV9 - */ -HWTEST_F(BmsBundleMgrHostTest, HandleQueryExtAbilityInfosWithoutTypeV9_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleQueryExtAbilityInfosWithoutTypeV9(data, reply); - EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); -} - -/** - * @tc.number: HandleQueryExtAbilityInfos - * @tc.name: test the HandleQueryExtAbilityInfos - * @tc.desc: 1. system running normally - * 2. test HandleQueryExtAbilityInfos - */ -HWTEST_F(BmsBundleMgrHostTest, HandleQueryExtAbilityInfos_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleQueryExtAbilityInfos(data, reply); - EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); -} - -/** - * @tc.number: HandleQueryExtAbilityInfosV9 - * @tc.name: test the HandleQueryExtAbilityInfosV9 - * @tc.desc: 1. system running normally - * 2. test HandleQueryExtAbilityInfosV9 - */ -HWTEST_F(BmsBundleMgrHostTest, HandleQueryExtAbilityInfosV9_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleQueryExtAbilityInfosV9(data, reply); - EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); -} - -/** - * @tc.number: HandleQueryExtAbilityInfosByType - * @tc.name: test the HandleQueryExtAbilityInfosByType - * @tc.desc: 1. system running normally - * 2. test HandleQueryExtAbilityInfosByType - */ -HWTEST_F(BmsBundleMgrHostTest, HandleQueryExtAbilityInfosByType_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleQueryExtAbilityInfosByType(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleVerifyCallingPermission - * @tc.name: test the HandleVerifyCallingPermission - * @tc.desc: 1. system running normally - * 2. test HandleVerifyCallingPermission - */ -HWTEST_F(BmsBundleMgrHostTest, HandleVerifyCallingPermission_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleVerifyCallingPermission(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleQueryExtensionAbilityInfoByUri - * @tc.name: test the HandleQueryExtensionAbilityInfoByUri - * @tc.desc: 1. system running normally - * 2. test HandleQueryExtensionAbilityInfoByUri - */ -HWTEST_F(BmsBundleMgrHostTest, HandleQueryExtensionAbilityInfoByUri_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleQueryExtensionAbilityInfoByUri(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetAppIdByBundleName - * @tc.name: test the HandleGetAppIdByBundleName - * @tc.desc: 1. system running normally - * 2. test HandleGetAppIdByBundleName - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetAppIdByBundleName_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetAppIdByBundleName(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetAppType - * @tc.name: test the HandleGetAppType - * @tc.desc: 1. system running normally - * 2. test HandleGetAppType - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetAppType_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetAppType(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetUidByBundleName - * @tc.name: test the HandleGetUidByBundleName - * @tc.desc: 1. system running normally - * 2. test HandleGetUidByBundleName - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetUidByBundleName_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetUidByBundleName(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetUidByDebugBundleName - * @tc.name: test the HandleGetUidByDebugBundleName - * @tc.desc: 1. system running normally - * 2. test HandleGetUidByDebugBundleName - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetUidByDebugBundleName_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetUidByDebugBundleName(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetAbilityInfo - * @tc.name: test the HandleGetAbilityInfo - * @tc.desc: 1. system running normally - * 2. test HandleGetAbilityInfo - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetAbilityInfo_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetAbilityInfo(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetAbilityInfoWithModuleName - * @tc.name: test the HandleGetAbilityInfoWithModuleName - * @tc.desc: 1. system running normally - * 2. test HandleGetAbilityInfoWithModuleName - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetAbilityInfoWithModuleName_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetAbilityInfoWithModuleName(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetModuleUpgradeFlag - * @tc.name: test the HandleGetModuleUpgradeFlag - * @tc.desc: 1. system running normally - * 2. test HandleGetModuleUpgradeFlag - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetModuleUpgradeFlag_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetModuleUpgradeFlag(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleSetModuleUpgradeFlag - * @tc.name: test the HandleSetModuleUpgradeFlag - * @tc.desc: 1. system running normally - * 2. test HandleSetModuleUpgradeFlag - */ -HWTEST_F(BmsBundleMgrHostTest, HandleSetModuleUpgradeFlag_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleSetModuleUpgradeFlag(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleIsModuleRemovable - * @tc.name: test the HandleIsModuleRemovable - * @tc.desc: 1. system running normally - * 2. test HandleIsModuleRemovable - */ -HWTEST_F(BmsBundleMgrHostTest, HandleIsModuleRemovable_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleIsModuleRemovable(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleSetModuleRemovable - * @tc.name: test the HandleSetModuleRemovable - * @tc.desc: 1. system running normally - * 2. test HandleSetModuleRemovable - */ -HWTEST_F(BmsBundleMgrHostTest, HandleSetModuleRemovable_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleSetModuleRemovable(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleImplicitQueryInfoByPriority - * @tc.name: test the HandleImplicitQueryInfoByPriority - * @tc.desc: 1. system running normally - * 2. test HandleImplicitQueryInfoByPriority - */ -HWTEST_F(BmsBundleMgrHostTest, HandleImplicitQueryInfoByPriority_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleImplicitQueryInfoByPriority(data, reply); - EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); -} - -/** - * @tc.number: HandleImplicitQueryInfos - * @tc.name: test the HandleImplicitQueryInfos - * @tc.desc: 1. system running normally - * 2. test HandleImplicitQueryInfos - */ -HWTEST_F(BmsBundleMgrHostTest, HandleImplicitQueryInfos_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleImplicitQueryInfos(data, reply); - EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); -} - -/** - * @tc.number: HandleGetAllDependentModuleNames - * @tc.name: test the HandleGetAllDependentModuleNames - * @tc.desc: 1. system running normally - * 2. test HandleGetAllDependentModuleNames - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetAllDependentModuleNames_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetAllDependentModuleNames(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetSandboxBundleInfo - * @tc.name: test the HandleGetSandboxBundleInfo - * @tc.desc: 1. system running normally - * 2. test HandleGetSandboxBundleInfo - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetSandboxBundleInfo_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetSandboxBundleInfo(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleObtainCallingBundleName - * @tc.name: test the HandleObtainCallingBundleName - * @tc.desc: 1. system running normally - * 2. test HandleObtainCallingBundleName - */ -HWTEST_F(BmsBundleMgrHostTest, HandleObtainCallingBundleName_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleObtainCallingBundleName(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetBundleStats - * @tc.name: test the HandleGetBundleStats - * @tc.desc: 1. system running normally - * 2. test HandleGetBundleStats - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetBundleStats_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetBundleStats(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetAllBundleStats - * @tc.name: test the HandleGetAllBundleStats - * @tc.desc: 1. system running normally - * 2. test HandleGetAllBundleStats - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetAllBundleStats_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetAllBundleStats(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleCheckAbilityEnableInstall - * @tc.name: test the HandleCheckAbilityEnableInstall - * @tc.desc: 1. system running normally - * 2. test HandleCheckAbilityEnableInstall - */ -HWTEST_F(BmsBundleMgrHostTest, HandleCheckAbilityEnableInstall_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleCheckAbilityEnableInstall(data, reply); - EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); -} - -/** - * @tc.number: HandleGetSandboxAbilityInfo - * @tc.name: test the HandleGetSandboxAbilityInfo - * @tc.desc: 1. system running normally - * 2. test HandleGetSandboxAbilityInfo - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetSandboxAbilityInfo_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetSandboxAbilityInfo(data, reply); - EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); -} - -/** - * @tc.number: HandleGetSandboxExtAbilityInfos - * @tc.name: test the HandleGetSandboxExtAbilityInfos - * @tc.desc: 1. system running normally - * 2. test HandleGetSandboxExtAbilityInfos - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetSandboxExtAbilityInfos_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetSandboxExtAbilityInfos(data, reply); - EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); -} - -/** - * @tc.number: HandleGetSandboxHapModuleInfo - * @tc.name: test the HandleGetSandboxHapModuleInfo - * @tc.desc: 1. system running normally - * 2. test HandleGetSandboxHapModuleInfo - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetSandboxHapModuleInfo_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetSandboxHapModuleInfo(data, reply); - EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); -} - -/** - * @tc.number: HandleGetMediaData - * @tc.name: test the HandleGetMediaData - * @tc.desc: 1. system running normally - * 2. test HandleGetMediaData - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetMediaData_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetMediaData(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetStringById - * @tc.name: test the HandleGetStringById - * @tc.desc: 1. system running normally - * 2. test HandleGetStringById - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetStringById_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetStringById(data, reply); - EXPECT_EQ(res, ERR_INVALID_VALUE); -} - -/** - * @tc.number: HandleGetIconById - * @tc.name: test the HandleGetIconById - * @tc.desc: 1. system running normally - * 2. test HandleGetIconById - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetIconById_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetIconById(data, reply); - EXPECT_EQ(res, ERR_INVALID_VALUE); -} - -/** - * @tc.number: HandleGetQuickFixManagerProxy - * @tc.name: test the HandleGetQuickFixManagerProxy - * @tc.desc: 1. system running normally - * 2. test HandleGetQuickFixManagerProxy - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetQuickFixManagerProxy_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetQuickFixManagerProxy(data, reply); - EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); -} - -/** - * @tc.number: HandleSetDebugMode - * @tc.name: test the HandleSetDebugMode - * @tc.desc: 1. system running normally - * 2. test HandleSetDebugMode - */ -HWTEST_F(BmsBundleMgrHostTest, HandleSetDebugMode_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleSetDebugMode(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleVerifySystemApi - * @tc.name: test the HandleVerifySystemApi - * @tc.desc: 1. system running normally - * 2. test HandleVerifySystemApi - */ -HWTEST_F(BmsBundleMgrHostTest, HandleVerifySystemApi_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleVerifySystemApi(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetOverlayManagerProxy - * @tc.name: test the HandleGetOverlayManagerProxy - * @tc.desc: 1. system running normally - * 2. test HandleGetOverlayManagerProxy - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetOverlayManagerProxy_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetOverlayManagerProxy(data, reply); - EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); -} - -/** - * @tc.number: HandleProcessPreload - * @tc.name: test the HandleProcessPreload - * @tc.desc: 1. system running normally - * 2. test HandleProcessPreload - */ -HWTEST_F(BmsBundleMgrHostTest, HandleProcessPreload_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleProcessPreload(data, reply); - EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); -} - -/** - * @tc.number: HandleGetAppProvisionInfo - * @tc.name: test the HandleGetAppProvisionInfo - * @tc.desc: 1. system running normally - * 2. test HandleGetAppProvisionInfo - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetAppProvisionInfo_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetAppProvisionInfo(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetProvisionMetadata - * @tc.name: test the HandleGetProvisionMetadata - * @tc.desc: 1. system running normally - * 2. test HandleGetProvisionMetadata - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetProvisionMetadata_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetProvisionMetadata(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetBaseSharedBundleInfos - * @tc.name: test the HandleGetBaseSharedBundleInfos - * @tc.desc: 1. system running normally - * 2. test HandleGetBaseSharedBundleInfos - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetBaseSharedBundleInfos_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetBaseSharedBundleInfos(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetAllSharedBundleInfo - * @tc.name: test the HandleGetAllSharedBundleInfo - * @tc.desc: 1. system running normally - * 2. test HandleGetAllSharedBundleInfo - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetAllSharedBundleInfo_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetAllSharedBundleInfo(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetSharedBundleInfo - * @tc.name: test the HandleGetSharedBundleInfo - * @tc.desc: 1. system running normally - * 2. test HandleGetSharedBundleInfo - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetSharedBundleInfo_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetSharedBundleInfo(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetSharedBundleInfoBySelf - * @tc.name: test the HandleGetSharedBundleInfoBySelf - * @tc.desc: 1. system running normally - * 2. test HandleGetSharedBundleInfoBySelf - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetSharedBundleInfoBySelf_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetSharedBundleInfoBySelf(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetSharedDependencies - * @tc.name: test the HandleGetSharedDependencies - * @tc.desc: 1. system running normally - * 2. test HandleGetSharedDependencies - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetSharedDependencies_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetSharedDependencies(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetProxyDataInfos - * @tc.name: test the HandleGetProxyDataInfos - * @tc.desc: 1. system running normally - * 2. test HandleGetProxyDataInfos - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetProxyDataInfos_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetProxyDataInfos(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetAllProxyDataInfos - * @tc.name: test the HandleGetAllProxyDataInfos - * @tc.desc: 1. system running normally - * 2. test HandleGetAllProxyDataInfos - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetAllProxyDataInfos_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetAllProxyDataInfos(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetSpecifiedDistributionType - * @tc.name: test the HandleGetSpecifiedDistributionType - * @tc.desc: 1. system running normally - * 2. test HandleGetSpecifiedDistributionType - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetSpecifiedDistributionType_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetSpecifiedDistributionType(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleBatchGetSpecifiedDistributionType - * @tc.name: test the HandleBatchGetSpecifiedDistributionType - * @tc.desc: 1. system running normally - * 2. test HandleBatchGetSpecifiedDistributionType - */ -HWTEST_F(BmsBundleMgrHostTest, HandleBatchGetSpecifiedDistributionType_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleBatchGetSpecifiedDistributionType(data, reply); - EXPECT_EQ(res, ERR_BUNDLE_MANAGER_INVALID_PARAMETER); -} - -/** - * @tc.number: HandleGetAdditionalInfo - * @tc.name: test the HandleGetAdditionalInfo - * @tc.desc: 1. system running normally - * 2. test HandleGetAdditionalInfo - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetAdditionalInfo_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetAdditionalInfo(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleBatchGetAdditionalInfo - * @tc.name: test the HandleBatchGetAdditionalInfo - * @tc.desc: 1. system running normally - * 2. test HandleBatchGetAdditionalInfo - */ -HWTEST_F(BmsBundleMgrHostTest, HandleBatchGetAdditionalInfo_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleBatchGetAdditionalInfo(data, reply); - EXPECT_EQ(res, ERR_BUNDLE_MANAGER_INVALID_PARAMETER); -} - -/** - * @tc.number: HandleSetExtNameOrMIMEToApp - * @tc.name: test the HandleSetExtNameOrMIMEToApp - * @tc.desc: 1. system running normally - * 2. test HandleSetExtNameOrMIMEToApp - */ -HWTEST_F(BmsBundleMgrHostTest, HandleSetExtNameOrMIMEToApp_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleSetExtNameOrMIMEToApp(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleDelExtNameOrMIMEToApp - * @tc.name: test the HandleDelExtNameOrMIMEToApp - * @tc.desc: 1. system running normally - * 2. test HandleDelExtNameOrMIMEToApp - */ -HWTEST_F(BmsBundleMgrHostTest, HandleDelExtNameOrMIMEToApp_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleDelExtNameOrMIMEToApp(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleQueryDataGroupInfos - * @tc.name: test the HandleQueryDataGroupInfos - * @tc.desc: 1. system running normally - * 2. test HandleQueryDataGroupInfos - */ -HWTEST_F(BmsBundleMgrHostTest, HandleQueryDataGroupInfos_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleQueryDataGroupInfos(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetPreferenceDirByGroupId - * @tc.name: test the HandleGetPreferenceDirByGroupId - * @tc.desc: 1. system running normally - * 2. test HandleGetPreferenceDirByGroupId - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetPreferenceDirByGroupId_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetPreferenceDirByGroupId(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleQueryAppGalleryBundleName - * @tc.name: test the HandleQueryAppGalleryBundleName - * @tc.desc: 1. system running normally - * 2. test HandleQueryAppGalleryBundleName - */ -HWTEST_F(BmsBundleMgrHostTest, HandleQueryAppGalleryBundleName_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleQueryAppGalleryBundleName(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleQueryExtensionAbilityInfosWithTypeName - * @tc.name: test the HandleQueryExtensionAbilityInfosWithTypeName - * @tc.desc: 1. system running normally - * 2. test HandleQueryExtensionAbilityInfosWithTypeName - */ -HWTEST_F(BmsBundleMgrHostTest, HandleQueryExtensionAbilityInfosWithTypeName_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleQueryExtensionAbilityInfosWithTypeName(data, reply); - EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); -} - -/** - * @tc.number: HandleQueryExtensionAbilityInfosOnlyWithTypeName - * @tc.name: test the HandleQueryExtensionAbilityInfosOnlyWithTypeName - * @tc.desc: 1. system running normally - * 2. test HandleQueryExtensionAbilityInfosOnlyWithTypeName - */ -HWTEST_F(BmsBundleMgrHostTest, HandleQueryExtensionAbilityInfosOnlyWithTypeName_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleQueryExtensionAbilityInfosOnlyWithTypeName(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleResetAOTCompileStatus - * @tc.name: test the HandleResetAOTCompileStatus - * @tc.desc: 1. system running normally - * 2. test HandleResetAOTCompileStatus - */ -HWTEST_F(BmsBundleMgrHostTest, HandleResetAOTCompileStatus_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleResetAOTCompileStatus(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetJsonProfile - * @tc.name: test the HandleGetJsonProfile - * @tc.desc: 1. system running normally - * 2. test HandleGetJsonProfile - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetJsonProfile_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetJsonProfile(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetBundleResourceProxy - * @tc.name: test the HandleGetBundleResourceProxy - * @tc.desc: 1. system running normally - * 2. test HandleGetBundleResourceProxy - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetBundleResourceProxy_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetBundleResourceProxy(data, reply); - EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); -} - -/** - * @tc.number: HandleSetAdditionalInfo - * @tc.name: test the HandleSetAdditionalInfo - * @tc.desc: 1. system running normally - * 2. test HandleSetAdditionalInfo - */ -HWTEST_F(BmsBundleMgrHostTest, HandleSetAdditionalInfo_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleSetAdditionalInfo(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetRecoverableApplicationInfo - * @tc.name: test the HandleGetRecoverableApplicationInfo - * @tc.desc: 1. system running normally - * 2. test HandleGetRecoverableApplicationInfo - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetRecoverableApplicationInfo_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetRecoverableApplicationInfo(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetUninstalledBundleInfo - * @tc.name: test the HandleGetUninstalledBundleInfo - * @tc.desc: 1. system running normally - * 2. test HandleGetUninstalledBundleInfo - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetUninstalledBundleInfo_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetUninstalledBundleInfo(data, reply); - EXPECT_EQ(res, ERR_BUNDLE_MANAGER_INTERNAL_ERROR); -} - -/** - * @tc.number: HandleCreateBundleDataDir - * @tc.name: test the HandleCreateBundleDataDir - * @tc.desc: 1. system running normally - * 2. test HandleCreateBundleDataDir - */ -HWTEST_F(BmsBundleMgrHostTest, HandleCreateBundleDataDir_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleCreateBundleDataDir(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetAllPreinstalledApplicationInfos - * @tc.name: test the HandleGetAllPreinstalledApplicationInfos - * @tc.desc: 1. system running normally - * 2. test HandleGetAllPreinstalledApplicationInfos - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetAllPreinstalledApplicationInfos_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleCreateBundleDataDir(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleCreateBundleDataDirWithEl_0100 - * @tc.name: test the HandleCreateBundleDataDirWithEl - * @tc.desc: 1. system running normally - * 2. test HandleCreateBundleDataDirWithEl - */ -HWTEST_F(BmsBundleMgrHostTest, HandleCreateBundleDataDirWithEl_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleCreateBundleDataDirWithEl(data, reply); - EXPECT_EQ(res, ERR_BUNDLE_MANAGER_PARAM_ERROR); -} - -/** - * @tc.number: HandleCanOpenLink - * @tc.name: test the HandleCanOpenLink - * @tc.desc: 1. system running normally - * 2. test HandleCanOpenLink - */ -HWTEST_F(BmsBundleMgrHostTest, HandleCanOpenLink_0100, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleCanOpenLink(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleIsBundleInstalled_0001 - * @tc.name: test the HandleIsBundleInstalled - * @tc.desc: 1. system running normally - * 2. test HandleIsBundleInstalled - */ -HWTEST_F(BmsBundleMgrHostTest, HandleIsBundleInstalled_0001, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleIsBundleInstalled(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetAllPluginInfo_0001 - * @tc.name: test the HandleGetAllPluginInfo - * @tc.desc: 1. system running normally - * 2. test HandleGetAllPluginInfo - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetAllPluginInfo_0001, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetAllPluginInfo(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetPluginInfosForSelf_0001 - * @tc.name: test the HandleGetPluginInfosForSelf - * @tc.desc: 1. system running normally - * 2. test HandleGetPluginInfosForSelf - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetPluginInfosForSelf_0001, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetPluginInfosForSelf(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetCompatibleDeviceTypeNative_0001 - * @tc.name: test the HandleGetCompatibleDeviceTypeNative - * @tc.desc: 1. system running normally - * 2. test HandleGetCompatibleDeviceTypeNative - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetCompatibleDeviceTypeNative_0001, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetCompatibleDeviceTypeNative(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetCompatibleDeviceType_0001 - * @tc.name: test the HandleGetCompatibleDeviceType - * @tc.desc: 1. system running normally - * 2. test HandleGetCompatibleDeviceType - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetCompatibleDeviceType_0001, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetCompatibleDeviceType(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleGetBundleNameByAppId_0001 - * @tc.name: test the HandleGetBundleNameByAppId - * @tc.desc: 1. system running normally - * 2. test HandleGetBundleNameByAppId - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetBundleNameByAppId_0001, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetBundleNameByAppId(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: AllocatAshmemNum_0001 - * @tc.name: test the AllocatAshmemNum - * @tc.desc: 1. system running normally - * 2. test AllocatAshmemNum - */ -HWTEST_F(BmsBundleMgrHostTest, AllocatAshmemNum_0001, Function | MediumTest | Level0) -{ - BundleMgrHost bundleMgrHost; - bundleMgrHost.ashmemNum_ = 0; - bundleMgrHost.AllocatAshmemNum(); - EXPECT_EQ(bundleMgrHost.ashmemNum_, 1); -} - -/** - * @tc.number: WriteBigString_0001 - * @tc.name: test the WriteBigString - * @tc.desc: 1. system running normally - * 2. test WriteBigString - */ -HWTEST_F(BmsBundleMgrHostTest, WriteBigString_0001, Function | MediumTest | Level0) -{ - BundleMgrHost bundleMgrHost; - std::string str; - MessageParcel reply; - auto ret = bundleMgrHost.WriteBigString(str, reply); - EXPECT_EQ(ERR_OK, ret); -} - -/** - * @tc.number: HandleGetOdidByBundleName_0001 - * @tc.name: test the HandleGetOdidByBundleName - * @tc.desc: 1. system running normally - * 2. test HandleGetOdidByBundleName - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetOdidByBundleName_0001, Function | MediumTest | Level0) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - auto ret = bundleMgrHost.HandleGetOdidByBundleName(data, reply); - EXPECT_EQ(ERR_OK, ret); -} - -/** - * @tc.number: HandleGetSignatureInfoByBundleName_0001 - * @tc.name: test the HandleGetSignatureInfoByBundleName - * @tc.desc: 1. system running normally - * 2. test HandleGetSignatureInfoByBundleName - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetSignatureInfoByBundleName_0001, Function | MediumTest | Level0) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - auto ret = bundleMgrHost.HandleGetSignatureInfoByBundleName(data, reply); - EXPECT_EQ(ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR, ret); -} - -/** - * @tc.number: HandleUpdateAppEncryptedStatus_0001 - * @tc.name: test the HandleUpdateAppEncryptedStatus - * @tc.desc: 1. system running normally - * 2. test HandleUpdateAppEncryptedStatus - */ -HWTEST_F(BmsBundleMgrHostTest, HandleUpdateAppEncryptedStatus_0001, Function | MediumTest | Level0) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - auto ret = bundleMgrHost.HandleUpdateAppEncryptedStatus(data, reply); - EXPECT_EQ(ERR_OK, ret); -} - -/** - * @tc.number: HandleGetBundleInfosForContinuation_0001 - * @tc.name: test the HandleGetBundleInfosForContinuation - * @tc.desc: 1. system running normally - * 2. test HandleGetBundleInfosForContinuation - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetBundleInfosForContinuation_0001, Function | MediumTest | Level0) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - auto ret = bundleMgrHost.HandleGetBundleInfosForContinuation(data, reply); - EXPECT_EQ(ERR_OK, ret); -} - -/** - * @tc.number: HandleGetContinueBundleNames_0001 - * @tc.name: test the HandleGetContinueBundleNames - * @tc.desc: 1. system running normally - * 2. test HandleGetContinueBundleNames - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetContinueBundleNames_0001, Function | MediumTest | Level0) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - auto ret = bundleMgrHost.HandleGetContinueBundleNames(data, reply); - EXPECT_EQ(ERR_OK, ret); -} - -/** - * @tc.number: HandleGetBundleMgrExtProxy_0001 - * @tc.name: test the HandleGetBundleMgrExtProxy - * @tc.desc: 1. system running normally - * 2. test HandleGetBundleMgrExtProxy - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetBundleMgrExtProxy_0001, Function | MediumTest | Level0) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - auto ret = bundleMgrHost.HandleGetBundleMgrExtProxy(data, reply); - EXPECT_EQ(ret, ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR); -} - -/** - * @tc.number: HandleGetSandboxDataDir_0001 - * @tc.name: test the HandleGetSandboxDataDir - * @tc.desc: 1. system running normally - * 2. test HandleGetSandboxDataDir - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetSandboxDataDir_0001, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetSandboxDataDir(data, reply); - EXPECT_EQ(res, ERR_OK); -} - -/** - * @tc.number: HandleCompileReset_0001 - * @tc.name: test the HandleCompileReset - * @tc.desc: 1. system running normally - * 2. test HandleCompileReset - */ - HWTEST_F(BmsBundleMgrHostTest, HandleResetAllAOT_0001, Function | MediumTest | Level1) - { - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleResetAllAOT(data, reply); - EXPECT_EQ(res, ERR_OK); - } - /** - * @tc.number: HandleGetPluginInfo_0001 - * @tc.name: test the HandleGetPluginInfo - * @tc.desc: 1. system running normally - * 2. test HandleGetPluginInfo - */ -HWTEST_F(BmsBundleMgrHostTest, HandleGetPluginInfo_0001, Function | MediumTest | Level1) -{ - BundleMgrHost bundleMgrHost; - MessageParcel data; - MessageParcel reply; - ErrCode res = bundleMgrHost.HandleGetPluginInfo(data, reply); - EXPECT_EQ(res, ERR_OK); -} -} // AppExecFwk +/* + * Copyright (c) 2024-2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#define private public + +#include +#include +#include +#include "bundle_mgr_host.h" + +using namespace testing::ext; + +namespace OHOS { +namespace AppExecFwk { + +class BmsBundleMgrHostTest : public testing::Test { +public: + static void SetUpTestCase(); + static void TearDownTestCase(); + void SetUp(); + void TearDown(); +}; + +void BmsBundleMgrHostTest::SetUpTestCase() +{} + +void BmsBundleMgrHostTest::TearDownTestCase() +{} + +void BmsBundleMgrHostTest::SetUp() +{} + +void BmsBundleMgrHostTest::TearDown() +{} + +/** + * @tc.number: HandleGetApplicationInfo_0100 + * @tc.name: test the HandleGetApplicationInfo + * @tc.desc: 1. system running normally + * 2. test HandleGetApplicationInfo + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetApplicationInfo_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetApplicationInfo(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetApplicationInfoWithIntFlags_0100 + * @tc.name: test the HandleGetApplicationInfoWithIntFlags + * @tc.desc: 1. system running normally + * 2. test HandleGetApplicationInfoWithIntFlags + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetApplicationInfoWithIntFlags_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetApplicationInfoWithIntFlags(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetApplicationInfoWithIntFlagsV9_0100 + * @tc.name: test the HandleGetApplicationInfoWithIntFlagsV9 + * @tc.desc: 1. system running normally + * 2. test HandleGetApplicationInfoWithIntFlagsV9 + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetApplicationInfoWithIntFlagsV9_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetApplicationInfoWithIntFlagsV9(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetApplicationInfosWithIntFlags_0100 + * @tc.name: test the HandleGetApplicationInfosWithIntFlags + * @tc.desc: 1. system running normally + * 2. test HandleGetApplicationInfosWithIntFlags + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetApplicationInfosWithIntFlags_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetApplicationInfosWithIntFlags(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetApplicationInfosWithIntFlagsV9_0100 + * @tc.name: test the HandleGetApplicationInfosWithIntFlagsV9 + * @tc.desc: 1. system running normally + * 2. test HandleGetApplicationInfosWithIntFlagsV9 + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetApplicationInfosWithIntFlagsV9_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetApplicationInfosWithIntFlagsV9(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetBundleInfoForSelf_0100 + * @tc.name: test the HandleGetBundleInfoForSelf + * @tc.desc: 1. system running normally + * 2. test HandleGetBundleInfoForSelf + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetBundleInfoForSelf_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetBundleInfoForSelf(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetDependentBundleInfo_0100 + * @tc.name: test the HandleGetDependentBundleInfo + * @tc.desc: 1. system running normally + * 2. test HandleGetDependentBundleInfo + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetDependentBundleInfo_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetDependentBundleInfo(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetBundleInfoWithIntFlagsV9_0100 + * @tc.name: test the HandleGetBundleInfoWithIntFlagsV9 + * @tc.desc: 1. system running normally + * 2. test HandleGetBundleInfoWithIntFlagsV9 + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetBundleInfoWithIntFlagsV9_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetBundleInfoWithIntFlagsV9(data, reply); + EXPECT_EQ(res, ERR_BUNDLE_MANAGER_INTERNAL_ERROR); +} + +/** + * @tc.number: HandleGetBundlePackInfo_0100 + * @tc.name: test the HandleGetBundlePackInfo + * @tc.desc: 1. system running normally + * 2. test HandleGetBundlePackInfo + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetBundlePackInfo_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetBundlePackInfo(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetBundlePackInfoWithIntFlags_0100 + * @tc.name: test the HandleGetBundlePackInfoWithIntFlags + * @tc.desc: 1. system running normally + * 2. test HandleGetBundlePackInfoWithIntFlags + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetBundlePackInfoWithIntFlags_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetBundlePackInfoWithIntFlags(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetBundleInfos_0100 + * @tc.name: test the HandleGetBundleInfos + * @tc.desc: 1. system running normally + * 2. test HandleGetBundleInfos + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetBundleInfos_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetBundleInfos(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetBundleInfosWithIntFlags_0100 + * @tc.name: test the HandleGetBundleInfosWithIntFlags + * @tc.desc: 1. system running normally + * 2. test HandleGetBundleInfosWithIntFlags + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetBundleInfosWithIntFlags_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetBundleInfosWithIntFlags(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetBundleInfosWithIntFlagsV9_0100 + * @tc.name: test the HandleGetBundleInfosWithIntFlagsV9 + * @tc.desc: 1. system running normally + * 2. test HandleGetBundleInfosWithIntFlagsV9 + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetBundleInfosWithIntFlagsV9_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetBundleInfosWithIntFlagsV9(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetBundleNameForUid_0100 + * @tc.name: test the HandleGetBundleNameForUid + * @tc.desc: 1. system running normally + * 2. test HandleGetBundleNameForUid + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetBundleNameForUid_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetBundleNameForUid(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetBundlesForUid_0100 + * @tc.name: test the HandleGetBundlesForUid + * @tc.desc: 1. system running normally + * 2. test HandleGetBundlesForUid + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetBundlesForUid_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetBundlesForUid(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetBundleGids_0100 + * @tc.name: test the HandleGetBundleGids + * @tc.desc: 1. system running normally + * 2. test HandleGetBundleGids + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetBundleGids_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetBundleGids(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetBundleGidsByUid_0100 + * @tc.name: test the HandleGetBundleGidsByUid + * @tc.desc: 1. system running normally + * 2. test HandleGetBundleGidsByUid + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetBundleGidsByUid_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetBundleGidsByUid(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetBundleInfosByMetaData_0100 + * @tc.name: test the HandleGetBundleInfosByMetaData + * @tc.desc: 1. system running normally + * 2. test HandleGetBundleInfosByMetaData + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetBundleInfosByMetaData_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetBundleInfosByMetaData(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleQueryAbilityInfo_0100 + * @tc.name: test the HandleQueryAbilityInfo + * @tc.desc: 1. system running normally + * 2. test HandleQueryAbilityInfo + */ +HWTEST_F(BmsBundleMgrHostTest, HandleQueryAbilityInfo_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleQueryAbilityInfo(data, reply); + EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); +} + +/** + * @tc.number: HandleQueryAbilityInfoMutiparam_0100 + * @tc.name: test the HandleQueryAbilityInfoMutiparam + * @tc.desc: 1. system running normally + * 2. test HandleQueryAbilityInfoMutiparam + */ +HWTEST_F(BmsBundleMgrHostTest, HandleQueryAbilityInfoMutiparam_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleQueryAbilityInfoMutiparam(data, reply); + EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); +} + +/** + * @tc.number: HandleQueryAbilityInfos_0100 + * @tc.name: test the HandleQueryAbilityInfos + * @tc.desc: 1. system running normally + * 2. test HandleQueryAbilityInfos + */ +HWTEST_F(BmsBundleMgrHostTest, HandleQueryAbilityInfos_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleQueryAbilityInfos(data, reply); + EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); +} + +/** + * @tc.number: HandleQueryAbilityInfosMutiparam_0100 + * @tc.name: test the HandleQueryAbilityInfosMutiparam + * @tc.desc: 1. system running normally + * 2. test HandleQueryAbilityInfosMutiparam + */ +HWTEST_F(BmsBundleMgrHostTest, HandleQueryAbilityInfosMutiparam_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleQueryAbilityInfosMutiparam(data, reply); + EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); +} + +/** + * @tc.number: HandleQueryAbilityInfosV9_0100 + * @tc.name: test the HandleQueryAbilityInfosV9 + * @tc.desc: 1. system running normally + * 2. test HandleQueryAbilityInfosV9 + */ +HWTEST_F(BmsBundleMgrHostTest, HandleQueryAbilityInfosV9_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleQueryAbilityInfosV9(data, reply); + EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); +} + +/** + * @tc.number: HandleQueryLauncherAbilityInfos_0100 + * @tc.name: test the HandleQueryLauncherAbilityInfos + * @tc.desc: 1. system running normally + * 2. test HandleQueryLauncherAbilityInfos + */ +HWTEST_F(BmsBundleMgrHostTest, HandleQueryLauncherAbilityInfos_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleQueryLauncherAbilityInfos(data, reply); + EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); +} + +/** + * @tc.number: HandleQueryAllAbilityInfos_0100 + * @tc.name: test the HandleQueryAllAbilityInfos + * @tc.desc: 1. system running normally + * 2. test HandleQueryAllAbilityInfos + */ +HWTEST_F(BmsBundleMgrHostTest, HandleQueryAllAbilityInfos_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleQueryAllAbilityInfos(data, reply); + EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); +} + +/** + * @tc.number: HandleQueryAbilityInfoByUriForUserId_0100 + * @tc.name: test the HandleQueryAbilityInfoByUriForUserId + * @tc.desc: 1. system running normally + * 2. test HandleQueryAbilityInfoByUriForUserId + */ +HWTEST_F(BmsBundleMgrHostTest, HandleQueryAbilityInfoByUriForUserId_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleQueryAbilityInfoByUriForUserId(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleQueryKeepAliveBundleInfos_0100 + * @tc.name: test the HandleQueryKeepAliveBundleInfos + * @tc.desc: 1. system running normally + * 2. test HandleQueryKeepAliveBundleInfos + */ +HWTEST_F(BmsBundleMgrHostTest, HandleQueryKeepAliveBundleInfos_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleQueryKeepAliveBundleInfos(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetAbilityLabel_0100 + * @tc.name: test the HandleGetAbilityLabel + * @tc.desc: 1. system running normally + * 2. test HandleGetAbilityLabel + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetAbilityLabel_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetAbilityLabel(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetAbilityLabelWithModuleName_0100 + * @tc.name: test the HandleGetAbilityLabelWithModuleName + * @tc.desc: 1. system running normally + * 2. test HandleGetAbilityLabelWithModuleName + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetAbilityLabelWithModuleName_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetAbilityLabelWithModuleName(data, reply); + EXPECT_EQ(res, ERR_BUNDLE_MANAGER_INVALID_PARAMETER); +} + +/** + * @tc.number: HandleCheckIsSystemAppByUid_0100 + * @tc.name: test the HandleCheckIsSystemAppByUid + * @tc.desc: 1. system running normally + * 2. test HandleCheckIsSystemAppByUid + */ +HWTEST_F(BmsBundleMgrHostTest, HandleCheckIsSystemAppByUid_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleCheckIsSystemAppByUid(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetBundleArchiveInfo_0100 + * @tc.name: test the HandleGetBundleArchiveInfo + * @tc.desc: 1. system running normally + * 2. test HandleGetBundleArchiveInfo + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetBundleArchiveInfo_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetBundleArchiveInfo(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetBundleArchiveInfoWithIntFlags_0100 + * @tc.name: test the HandleGetBundleArchiveInfoWithIntFlags + * @tc.desc: 1. system running normally + * 2. test HandleGetBundleArchiveInfoWithIntFlags + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetBundleArchiveInfoWithIntFlags_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetBundleArchiveInfoWithIntFlags(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetBundleArchiveInfoWithIntFlagsV9_0100 + * @tc.name: test the HandleGetBundleArchiveInfoWithIntFlagsV9 + * @tc.desc: 1. system running normally + * 2. test HandleGetBundleArchiveInfoWithIntFlagsV9 + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetBundleArchiveInfoWithIntFlagsV9_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetBundleArchiveInfoWithIntFlagsV9(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetHapModuleInfo_0100 + * @tc.name: test the HandleGetHapModuleInfo + * @tc.desc: 1. system running normally + * 2. test HandleGetHapModuleInfo + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetHapModuleInfo_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetHapModuleInfo(data, reply); + EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); +} + +/** + * @tc.number: HandleGetHapModuleInfoWithUserId_0100 + * @tc.name: test the HandleGetHapModuleInfoWithUserId + * @tc.desc: 1. system running normally + * 2. test HandleGetHapModuleInfoWithUserId + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetHapModuleInfoWithUserId_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetHapModuleInfoWithUserId(data, reply); + EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); +} + +/** + * @tc.number: HandleGetLaunchWantForBundle_0100 + * @tc.name: test the HandleGetLaunchWantForBundle + * @tc.desc: 1. system running normally + * 2. test HandleGetLaunchWantForBundle + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetLaunchWantForBundle_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetLaunchWantForBundle(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetPermissionDef_0100 + * @tc.name: test the HandleGetPermissionDef + * @tc.desc: 1. system running normally + * 2. test HandleGetPermissionDef + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetPermissionDef_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetPermissionDef(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleCleanBundleCacheFiles_0100 + * @tc.name: test the HandleCleanBundleCacheFiles + * @tc.desc: 1. system running normally + * 2. test HandleCleanBundleCacheFiles + */ +HWTEST_F(BmsBundleMgrHostTest, HandleCleanBundleCacheFiles_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleCleanBundleCacheFiles(data, reply); + EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); +} + +/** + * @tc.number: HandleCleanBundleDataFiles_0100 + * @tc.name: test the HandleCleanBundleDataFiles + * @tc.desc: 1. system running normally + * 2. test HandleCleanBundleDataFiles + */ +HWTEST_F(BmsBundleMgrHostTest, HandleCleanBundleDataFiles_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleCleanBundleDataFiles(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleRegisterBundleStatusCallback_0100 + * @tc.name: test the HandleRegisterBundleStatusCallback + * @tc.desc: 1. system running normally + * 2. test HandleRegisterBundleStatusCallback + */ +HWTEST_F(BmsBundleMgrHostTest, HandleRegisterBundleStatusCallback_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleRegisterBundleStatusCallback(data, reply); + EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); +} + +/** + * @tc.number: HandleRegisterBundleEventCallback_0100 + * @tc.name: test the HandleRegisterBundleEventCallback + * @tc.desc: 1. system running normally + * 2. test HandleRegisterBundleEventCallback + */ +HWTEST_F(BmsBundleMgrHostTest, HandleRegisterBundleEventCallback_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleRegisterBundleEventCallback(data, reply); + EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); +} + +/** + * @tc.number: HandleUnregisterBundleEventCallback_0100 + * @tc.name: test the HandleUnregisterBundleEventCallback + * @tc.desc: 1. system running normally + * 2. test HandleUnregisterBundleEventCallback + */ +HWTEST_F(BmsBundleMgrHostTest, HandleUnregisterBundleEventCallback_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleUnregisterBundleEventCallback(data, reply); + EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); +} + +/** + * @tc.number: HandleClearBundleStatusCallback_0100 + * @tc.name: test the HandleClearBundleStatusCallback + * @tc.desc: 1. system running normally + * 2. test HandleClearBundleStatusCallback + */ +HWTEST_F(BmsBundleMgrHostTest, HandleClearBundleStatusCallback_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleClearBundleStatusCallback(data, reply); + EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); +} + +/** + * @tc.number: HandleUnregisterBundleStatusCallback_0100 + * @tc.name: test the HandleUnregisterBundleStatusCallback + * @tc.desc: 1. system running normally + * 2. test HandleUnregisterBundleStatusCallback + */ +HWTEST_F(BmsBundleMgrHostTest, HandleUnregisterBundleStatusCallback_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleUnregisterBundleStatusCallback(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleDumpInfos_0100 + * @tc.name: test the HandleDumpInfos + * @tc.desc: 1. system running normally + * 2. test HandleDumpInfos + */ +HWTEST_F(BmsBundleMgrHostTest, HandleDumpInfos_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleDumpInfos(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleCompileProcessAOT_0100 + * @tc.name: test the HandleCompileProcessAOT + * @tc.desc: 1. system running normally + * 2. test HandleCompileProcessAOT + */ +HWTEST_F(BmsBundleMgrHostTest, HandleCompileProcessAOT_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleCompileProcessAOT(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleCompileReset_0100 + * @tc.name: test the HandleCompileReset + * @tc.desc: 1. system running normally + * 2. test HandleCompileReset + */ +HWTEST_F(BmsBundleMgrHostTest, HandleCompileReset_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleCompileReset(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetBundleInstaller_0100 + * @tc.name: test the HandleGetBundleInstaller + * @tc.desc: 1. system running normally + * 2. test HandleGetBundleInstaller + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetBundleInstaller_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetBundleInstaller(data, reply); + EXPECT_EQ(res, ERR_APPEXECFWK_INSTALL_HOST_INSTALLER_FAILED); +} + +/** + * @tc.number: HandleGetBundleUserMgr_0100 + * @tc.name: test the HandleGetBundleUserMgr + * @tc.desc: 1. system running normally + * 2. test HandleGetBundleUserMgr + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetBundleUserMgr_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetBundleUserMgr(data, reply); + EXPECT_EQ(res, ERR_APPEXECFWK_INSTALL_HOST_INSTALLER_FAILED); +} + +/** + * @tc.number: HandleGetVerifyManager_0100 + * @tc.name: test the HandleGetVerifyManager + * @tc.desc: 1. system running normally + * 2. test HandleGetVerifyManager + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetVerifyManager_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetVerifyManager(data, reply); + EXPECT_EQ(res, ERR_BUNDLE_MANAGER_VERIFY_GET_VERIFY_MGR_FAILED); +} + +/** + * @tc.number: HandleIsDebuggableApplication_0100 + * @tc.name: test the HandleIsDebuggableApplication + * @tc.desc: 1. system running normally + * 2. test HandleIsDebuggableApplication + */ +HWTEST_F(BmsBundleMgrHostTest, HandleIsDebuggableApplication, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleIsDebuggableApplication(data, reply); + EXPECT_EQ(res, ERR_BUNDLE_MANAGER_PARAM_ERROR); +} + +/** + * @tc.number: HandleIsApplicationEnabled_0100 + * @tc.name: test the HandleIsApplicationEnabled + * @tc.desc: 1. system running normally + * 2. test HandleIsApplicationEnabled + */ +HWTEST_F(BmsBundleMgrHostTest, HandleIsApplicationEnabled_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleIsApplicationEnabled(data, reply); + EXPECT_EQ(res, ERR_BUNDLE_MANAGER_PARAM_ERROR); +} + +/** + * @tc.number: HandleSetApplicationEnabled_0100 + * @tc.name: test the HandleSetApplicationEnabled + * @tc.desc: 1. system running normally + * 2. test HandleSetApplicationEnabled + */ +HWTEST_F(BmsBundleMgrHostTest, HandleSetApplicationEnabled_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleSetApplicationEnabled(data, reply); + EXPECT_EQ(res, ERR_BUNDLE_MANAGER_PARAM_ERROR); +} + +/** + * @tc.number: HandleIsAbilityEnabled_0100 + * @tc.name: test the HandleIsAbilityEnabled + * @tc.desc: 1. system running normally + * 2. test HandleIsAbilityEnabled + */ +HWTEST_F(BmsBundleMgrHostTest, HandleIsAbilityEnabled_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleIsAbilityEnabled(data, reply); + EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); +} + +/** + * @tc.number: HandleSetAbilityEnabled_0100 + * @tc.name: test the HandleSetAbilityEnabled + * @tc.desc: 1. system running normally + * 2. test HandleSetAbilityEnabled + */ +HWTEST_F(BmsBundleMgrHostTest, HandleSetAbilityEnabled_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleSetAbilityEnabled(data, reply); + EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); +} + +/** + * @tc.number: HandleGetAllFormsInfo_0100 + * @tc.name: test the HandleGetAllFormsInfo + * @tc.desc: 1. system running normally + * 2. test HandleGetAllFormsInfo + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetAllFormsInfo_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetAllFormsInfo(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetFormsInfoByApp_0100 + * @tc.name: test the HandleGetFormsInfoByApp + * @tc.desc: 1. system running normally + * 2. test HandleGetFormsInfoByApp + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetFormsInfoByApp_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetFormsInfoByApp(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetFormsInfoByModule_0100 + * @tc.name: test the HandleGetFormsInfoByModule + * @tc.desc: 1. system running normally + * 2. test HandleGetFormsInfoByModule + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetFormsInfoByModule_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetFormsInfoByModule(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetShortcutInfos_0100 + * @tc.name: test the HandleGetShortcutInfos + * @tc.desc: 1. system running normally + * 2. test HandleGetShortcutInfos + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetShortcutInfos_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetShortcutInfos(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetShortcutInfoV9_0100 + * @tc.name: test the HandleGetShortcutInfoV9 + * @tc.desc: 1. system running normally + * 2. test HandleGetShortcutInfoV9 + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetShortcutInfoV9_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetShortcutInfoV9(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetShortcutInfoByAppIndex_0100 + * @tc.name: test the HandleGetShortcutInfoByAppIndex + * @tc.desc: 1. system running normally + * 2. test HandleGetShortcutInfoByAppIndex + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetShortcutInfoByAppIndex_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetShortcutInfoByAppIndex(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetAllCommonEventInfo_0100 + * @tc.name: test the HandleGetAllCommonEventInfo + * @tc.desc: 1. system running normally + * 2. test HandleGetAllCommonEventInfo + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetAllCommonEventInfo_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetAllCommonEventInfo(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetDistributedBundleInfo_0100 + * @tc.name: test the HandleGetDistributedBundleInfo + * @tc.desc: 1. system running normally + * 2. test HandleGetDistributedBundleInfo + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetDistributedBundleInfo_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetDistributedBundleInfo(data, reply); + EXPECT_EQ(res, ERR_INVALID_VALUE); +} + +/** + * @tc.number: HandleGetAppPrivilegeLevel_0100 + * @tc.name: test the HandleGetAppPrivilegeLevel + * @tc.desc: 1. system running normally + * 2. test HandleGetAppPrivilegeLevel + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetAppPrivilegeLevel_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetAppPrivilegeLevel(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleQueryExtAbilityInfosWithoutType_0100 + * @tc.name: test the HandleQueryExtAbilityInfosWithoutType + * @tc.desc: 1. system running normally + * 2. test HandleQueryExtAbilityInfosWithoutType + */ +HWTEST_F(BmsBundleMgrHostTest, HandleQueryExtAbilityInfosWithoutType_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleQueryExtAbilityInfosWithoutType(data, reply); + EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); +} + +/** + * @tc.number: HandleQueryExtAbilityInfosWithoutTypeV9_0100 + * @tc.name: test the HandleQueryExtAbilityInfosWithoutTypeV9 + * @tc.desc: 1. system running normally + * 2. test HandleQueryExtAbilityInfosWithoutTypeV9 + */ +HWTEST_F(BmsBundleMgrHostTest, HandleQueryExtAbilityInfosWithoutTypeV9_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleQueryExtAbilityInfosWithoutTypeV9(data, reply); + EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); +} + +/** + * @tc.number: HandleQueryExtAbilityInfos + * @tc.name: test the HandleQueryExtAbilityInfos + * @tc.desc: 1. system running normally + * 2. test HandleQueryExtAbilityInfos + */ +HWTEST_F(BmsBundleMgrHostTest, HandleQueryExtAbilityInfos_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleQueryExtAbilityInfos(data, reply); + EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); +} + +/** + * @tc.number: HandleQueryExtAbilityInfosV9 + * @tc.name: test the HandleQueryExtAbilityInfosV9 + * @tc.desc: 1. system running normally + * 2. test HandleQueryExtAbilityInfosV9 + */ +HWTEST_F(BmsBundleMgrHostTest, HandleQueryExtAbilityInfosV9_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleQueryExtAbilityInfosV9(data, reply); + EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); +} + +/** + * @tc.number: HandleQueryExtAbilityInfosByType + * @tc.name: test the HandleQueryExtAbilityInfosByType + * @tc.desc: 1. system running normally + * 2. test HandleQueryExtAbilityInfosByType + */ +HWTEST_F(BmsBundleMgrHostTest, HandleQueryExtAbilityInfosByType_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleQueryExtAbilityInfosByType(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleVerifyCallingPermission + * @tc.name: test the HandleVerifyCallingPermission + * @tc.desc: 1. system running normally + * 2. test HandleVerifyCallingPermission + */ +HWTEST_F(BmsBundleMgrHostTest, HandleVerifyCallingPermission_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleVerifyCallingPermission(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleQueryExtensionAbilityInfoByUri + * @tc.name: test the HandleQueryExtensionAbilityInfoByUri + * @tc.desc: 1. system running normally + * 2. test HandleQueryExtensionAbilityInfoByUri + */ +HWTEST_F(BmsBundleMgrHostTest, HandleQueryExtensionAbilityInfoByUri_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleQueryExtensionAbilityInfoByUri(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetAppIdByBundleName + * @tc.name: test the HandleGetAppIdByBundleName + * @tc.desc: 1. system running normally + * 2. test HandleGetAppIdByBundleName + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetAppIdByBundleName_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetAppIdByBundleName(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetAppType + * @tc.name: test the HandleGetAppType + * @tc.desc: 1. system running normally + * 2. test HandleGetAppType + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetAppType_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetAppType(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetUidByBundleName + * @tc.name: test the HandleGetUidByBundleName + * @tc.desc: 1. system running normally + * 2. test HandleGetUidByBundleName + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetUidByBundleName_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetUidByBundleName(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetUidByDebugBundleName + * @tc.name: test the HandleGetUidByDebugBundleName + * @tc.desc: 1. system running normally + * 2. test HandleGetUidByDebugBundleName + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetUidByDebugBundleName_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetUidByDebugBundleName(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetAbilityInfo + * @tc.name: test the HandleGetAbilityInfo + * @tc.desc: 1. system running normally + * 2. test HandleGetAbilityInfo + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetAbilityInfo_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetAbilityInfo(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetAbilityInfoWithModuleName + * @tc.name: test the HandleGetAbilityInfoWithModuleName + * @tc.desc: 1. system running normally + * 2. test HandleGetAbilityInfoWithModuleName + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetAbilityInfoWithModuleName_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetAbilityInfoWithModuleName(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetModuleUpgradeFlag + * @tc.name: test the HandleGetModuleUpgradeFlag + * @tc.desc: 1. system running normally + * 2. test HandleGetModuleUpgradeFlag + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetModuleUpgradeFlag_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetModuleUpgradeFlag(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleSetModuleUpgradeFlag + * @tc.name: test the HandleSetModuleUpgradeFlag + * @tc.desc: 1. system running normally + * 2. test HandleSetModuleUpgradeFlag + */ +HWTEST_F(BmsBundleMgrHostTest, HandleSetModuleUpgradeFlag_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleSetModuleUpgradeFlag(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleIsModuleRemovable + * @tc.name: test the HandleIsModuleRemovable + * @tc.desc: 1. system running normally + * 2. test HandleIsModuleRemovable + */ +HWTEST_F(BmsBundleMgrHostTest, HandleIsModuleRemovable_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleIsModuleRemovable(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleSetModuleRemovable + * @tc.name: test the HandleSetModuleRemovable + * @tc.desc: 1. system running normally + * 2. test HandleSetModuleRemovable + */ +HWTEST_F(BmsBundleMgrHostTest, HandleSetModuleRemovable_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleSetModuleRemovable(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleImplicitQueryInfoByPriority + * @tc.name: test the HandleImplicitQueryInfoByPriority + * @tc.desc: 1. system running normally + * 2. test HandleImplicitQueryInfoByPriority + */ +HWTEST_F(BmsBundleMgrHostTest, HandleImplicitQueryInfoByPriority_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleImplicitQueryInfoByPriority(data, reply); + EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); +} + +/** + * @tc.number: HandleImplicitQueryInfos + * @tc.name: test the HandleImplicitQueryInfos + * @tc.desc: 1. system running normally + * 2. test HandleImplicitQueryInfos + */ +HWTEST_F(BmsBundleMgrHostTest, HandleImplicitQueryInfos_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleImplicitQueryInfos(data, reply); + EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); +} + +/** + * @tc.number: HandleGetAllDependentModuleNames + * @tc.name: test the HandleGetAllDependentModuleNames + * @tc.desc: 1. system running normally + * 2. test HandleGetAllDependentModuleNames + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetAllDependentModuleNames_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetAllDependentModuleNames(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetSandboxBundleInfo + * @tc.name: test the HandleGetSandboxBundleInfo + * @tc.desc: 1. system running normally + * 2. test HandleGetSandboxBundleInfo + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetSandboxBundleInfo_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetSandboxBundleInfo(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleObtainCallingBundleName + * @tc.name: test the HandleObtainCallingBundleName + * @tc.desc: 1. system running normally + * 2. test HandleObtainCallingBundleName + */ +HWTEST_F(BmsBundleMgrHostTest, HandleObtainCallingBundleName_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleObtainCallingBundleName(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetBundleStats + * @tc.name: test the HandleGetBundleStats + * @tc.desc: 1. system running normally + * 2. test HandleGetBundleStats + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetBundleStats_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetBundleStats(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetAllBundleStats + * @tc.name: test the HandleGetAllBundleStats + * @tc.desc: 1. system running normally + * 2. test HandleGetAllBundleStats + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetAllBundleStats_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetAllBundleStats(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleCheckAbilityEnableInstall + * @tc.name: test the HandleCheckAbilityEnableInstall + * @tc.desc: 1. system running normally + * 2. test HandleCheckAbilityEnableInstall + */ +HWTEST_F(BmsBundleMgrHostTest, HandleCheckAbilityEnableInstall_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleCheckAbilityEnableInstall(data, reply); + EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); +} + +/** + * @tc.number: HandleGetSandboxAbilityInfo + * @tc.name: test the HandleGetSandboxAbilityInfo + * @tc.desc: 1. system running normally + * 2. test HandleGetSandboxAbilityInfo + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetSandboxAbilityInfo_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetSandboxAbilityInfo(data, reply); + EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); +} + +/** + * @tc.number: HandleGetSandboxExtAbilityInfos + * @tc.name: test the HandleGetSandboxExtAbilityInfos + * @tc.desc: 1. system running normally + * 2. test HandleGetSandboxExtAbilityInfos + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetSandboxExtAbilityInfos_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetSandboxExtAbilityInfos(data, reply); + EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); +} + +/** + * @tc.number: HandleGetSandboxHapModuleInfo + * @tc.name: test the HandleGetSandboxHapModuleInfo + * @tc.desc: 1. system running normally + * 2. test HandleGetSandboxHapModuleInfo + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetSandboxHapModuleInfo_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetSandboxHapModuleInfo(data, reply); + EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); +} + +/** + * @tc.number: HandleGetMediaData + * @tc.name: test the HandleGetMediaData + * @tc.desc: 1. system running normally + * 2. test HandleGetMediaData + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetMediaData_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetMediaData(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetStringById + * @tc.name: test the HandleGetStringById + * @tc.desc: 1. system running normally + * 2. test HandleGetStringById + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetStringById_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetStringById(data, reply); + EXPECT_EQ(res, ERR_INVALID_VALUE); +} + +/** + * @tc.number: HandleGetIconById + * @tc.name: test the HandleGetIconById + * @tc.desc: 1. system running normally + * 2. test HandleGetIconById + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetIconById_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetIconById(data, reply); + EXPECT_EQ(res, ERR_INVALID_VALUE); +} + +/** + * @tc.number: HandleGetQuickFixManagerProxy + * @tc.name: test the HandleGetQuickFixManagerProxy + * @tc.desc: 1. system running normally + * 2. test HandleGetQuickFixManagerProxy + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetQuickFixManagerProxy_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetQuickFixManagerProxy(data, reply); + EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); +} + +/** + * @tc.number: HandleSetDebugMode + * @tc.name: test the HandleSetDebugMode + * @tc.desc: 1. system running normally + * 2. test HandleSetDebugMode + */ +HWTEST_F(BmsBundleMgrHostTest, HandleSetDebugMode_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleSetDebugMode(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleVerifySystemApi + * @tc.name: test the HandleVerifySystemApi + * @tc.desc: 1. system running normally + * 2. test HandleVerifySystemApi + */ +HWTEST_F(BmsBundleMgrHostTest, HandleVerifySystemApi_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleVerifySystemApi(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetOverlayManagerProxy + * @tc.name: test the HandleGetOverlayManagerProxy + * @tc.desc: 1. system running normally + * 2. test HandleGetOverlayManagerProxy + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetOverlayManagerProxy_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetOverlayManagerProxy(data, reply); + EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); +} + +/** + * @tc.number: HandleProcessPreload + * @tc.name: test the HandleProcessPreload + * @tc.desc: 1. system running normally + * 2. test HandleProcessPreload + */ +HWTEST_F(BmsBundleMgrHostTest, HandleProcessPreload_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleProcessPreload(data, reply); + EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); +} + +/** + * @tc.number: HandleGetAppProvisionInfo + * @tc.name: test the HandleGetAppProvisionInfo + * @tc.desc: 1. system running normally + * 2. test HandleGetAppProvisionInfo + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetAppProvisionInfo_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetAppProvisionInfo(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetProvisionMetadata + * @tc.name: test the HandleGetProvisionMetadata + * @tc.desc: 1. system running normally + * 2. test HandleGetProvisionMetadata + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetProvisionMetadata_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetProvisionMetadata(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetBaseSharedBundleInfos + * @tc.name: test the HandleGetBaseSharedBundleInfos + * @tc.desc: 1. system running normally + * 2. test HandleGetBaseSharedBundleInfos + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetBaseSharedBundleInfos_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetBaseSharedBundleInfos(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetAllSharedBundleInfo + * @tc.name: test the HandleGetAllSharedBundleInfo + * @tc.desc: 1. system running normally + * 2. test HandleGetAllSharedBundleInfo + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetAllSharedBundleInfo_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetAllSharedBundleInfo(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetSharedBundleInfo + * @tc.name: test the HandleGetSharedBundleInfo + * @tc.desc: 1. system running normally + * 2. test HandleGetSharedBundleInfo + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetSharedBundleInfo_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetSharedBundleInfo(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetSharedBundleInfoBySelf + * @tc.name: test the HandleGetSharedBundleInfoBySelf + * @tc.desc: 1. system running normally + * 2. test HandleGetSharedBundleInfoBySelf + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetSharedBundleInfoBySelf_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetSharedBundleInfoBySelf(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetSharedDependencies + * @tc.name: test the HandleGetSharedDependencies + * @tc.desc: 1. system running normally + * 2. test HandleGetSharedDependencies + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetSharedDependencies_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetSharedDependencies(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetProxyDataInfos + * @tc.name: test the HandleGetProxyDataInfos + * @tc.desc: 1. system running normally + * 2. test HandleGetProxyDataInfos + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetProxyDataInfos_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetProxyDataInfos(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetAllProxyDataInfos + * @tc.name: test the HandleGetAllProxyDataInfos + * @tc.desc: 1. system running normally + * 2. test HandleGetAllProxyDataInfos + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetAllProxyDataInfos_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetAllProxyDataInfos(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetSpecifiedDistributionType + * @tc.name: test the HandleGetSpecifiedDistributionType + * @tc.desc: 1. system running normally + * 2. test HandleGetSpecifiedDistributionType + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetSpecifiedDistributionType_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetSpecifiedDistributionType(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleBatchGetSpecifiedDistributionType + * @tc.name: test the HandleBatchGetSpecifiedDistributionType + * @tc.desc: 1. system running normally + * 2. test HandleBatchGetSpecifiedDistributionType + */ +HWTEST_F(BmsBundleMgrHostTest, HandleBatchGetSpecifiedDistributionType_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleBatchGetSpecifiedDistributionType(data, reply); + EXPECT_EQ(res, ERR_BUNDLE_MANAGER_INVALID_PARAMETER); +} + +/** + * @tc.number: HandleGetAdditionalInfo + * @tc.name: test the HandleGetAdditionalInfo + * @tc.desc: 1. system running normally + * 2. test HandleGetAdditionalInfo + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetAdditionalInfo_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetAdditionalInfo(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleBatchGetAdditionalInfo + * @tc.name: test the HandleBatchGetAdditionalInfo + * @tc.desc: 1. system running normally + * 2. test HandleBatchGetAdditionalInfo + */ +HWTEST_F(BmsBundleMgrHostTest, HandleBatchGetAdditionalInfo_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleBatchGetAdditionalInfo(data, reply); + EXPECT_EQ(res, ERR_BUNDLE_MANAGER_INVALID_PARAMETER); +} + +/** + * @tc.number: HandleSetExtNameOrMIMEToApp + * @tc.name: test the HandleSetExtNameOrMIMEToApp + * @tc.desc: 1. system running normally + * 2. test HandleSetExtNameOrMIMEToApp + */ +HWTEST_F(BmsBundleMgrHostTest, HandleSetExtNameOrMIMEToApp_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleSetExtNameOrMIMEToApp(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleDelExtNameOrMIMEToApp + * @tc.name: test the HandleDelExtNameOrMIMEToApp + * @tc.desc: 1. system running normally + * 2. test HandleDelExtNameOrMIMEToApp + */ +HWTEST_F(BmsBundleMgrHostTest, HandleDelExtNameOrMIMEToApp_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleDelExtNameOrMIMEToApp(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleQueryDataGroupInfos + * @tc.name: test the HandleQueryDataGroupInfos + * @tc.desc: 1. system running normally + * 2. test HandleQueryDataGroupInfos + */ +HWTEST_F(BmsBundleMgrHostTest, HandleQueryDataGroupInfos_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleQueryDataGroupInfos(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetPreferenceDirByGroupId + * @tc.name: test the HandleGetPreferenceDirByGroupId + * @tc.desc: 1. system running normally + * 2. test HandleGetPreferenceDirByGroupId + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetPreferenceDirByGroupId_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetPreferenceDirByGroupId(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleQueryAppGalleryBundleName + * @tc.name: test the HandleQueryAppGalleryBundleName + * @tc.desc: 1. system running normally + * 2. test HandleQueryAppGalleryBundleName + */ +HWTEST_F(BmsBundleMgrHostTest, HandleQueryAppGalleryBundleName_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleQueryAppGalleryBundleName(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleQueryExtensionAbilityInfosWithTypeName + * @tc.name: test the HandleQueryExtensionAbilityInfosWithTypeName + * @tc.desc: 1. system running normally + * 2. test HandleQueryExtensionAbilityInfosWithTypeName + */ +HWTEST_F(BmsBundleMgrHostTest, HandleQueryExtensionAbilityInfosWithTypeName_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleQueryExtensionAbilityInfosWithTypeName(data, reply); + EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); +} + +/** + * @tc.number: HandleQueryExtensionAbilityInfosOnlyWithTypeName + * @tc.name: test the HandleQueryExtensionAbilityInfosOnlyWithTypeName + * @tc.desc: 1. system running normally + * 2. test HandleQueryExtensionAbilityInfosOnlyWithTypeName + */ +HWTEST_F(BmsBundleMgrHostTest, HandleQueryExtensionAbilityInfosOnlyWithTypeName_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleQueryExtensionAbilityInfosOnlyWithTypeName(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleResetAOTCompileStatus + * @tc.name: test the HandleResetAOTCompileStatus + * @tc.desc: 1. system running normally + * 2. test HandleResetAOTCompileStatus + */ +HWTEST_F(BmsBundleMgrHostTest, HandleResetAOTCompileStatus_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleResetAOTCompileStatus(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetJsonProfile + * @tc.name: test the HandleGetJsonProfile + * @tc.desc: 1. system running normally + * 2. test HandleGetJsonProfile + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetJsonProfile_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetJsonProfile(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetBundleResourceProxy + * @tc.name: test the HandleGetBundleResourceProxy + * @tc.desc: 1. system running normally + * 2. test HandleGetBundleResourceProxy + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetBundleResourceProxy_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetBundleResourceProxy(data, reply); + EXPECT_EQ(res, ERR_APPEXECFWK_PARCEL_ERROR); +} + +/** + * @tc.number: HandleSetAdditionalInfo + * @tc.name: test the HandleSetAdditionalInfo + * @tc.desc: 1. system running normally + * 2. test HandleSetAdditionalInfo + */ +HWTEST_F(BmsBundleMgrHostTest, HandleSetAdditionalInfo_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleSetAdditionalInfo(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetRecoverableApplicationInfo + * @tc.name: test the HandleGetRecoverableApplicationInfo + * @tc.desc: 1. system running normally + * 2. test HandleGetRecoverableApplicationInfo + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetRecoverableApplicationInfo_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetRecoverableApplicationInfo(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetUninstalledBundleInfo + * @tc.name: test the HandleGetUninstalledBundleInfo + * @tc.desc: 1. system running normally + * 2. test HandleGetUninstalledBundleInfo + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetUninstalledBundleInfo_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetUninstalledBundleInfo(data, reply); + EXPECT_EQ(res, ERR_BUNDLE_MANAGER_INTERNAL_ERROR); +} + +/** + * @tc.number: HandleCreateBundleDataDir + * @tc.name: test the HandleCreateBundleDataDir + * @tc.desc: 1. system running normally + * 2. test HandleCreateBundleDataDir + */ +HWTEST_F(BmsBundleMgrHostTest, HandleCreateBundleDataDir_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleCreateBundleDataDir(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetAllPreinstalledApplicationInfos + * @tc.name: test the HandleGetAllPreinstalledApplicationInfos + * @tc.desc: 1. system running normally + * 2. test HandleGetAllPreinstalledApplicationInfos + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetAllPreinstalledApplicationInfos_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleCreateBundleDataDir(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleCreateBundleDataDirWithEl_0100 + * @tc.name: test the HandleCreateBundleDataDirWithEl + * @tc.desc: 1. system running normally + * 2. test HandleCreateBundleDataDirWithEl + */ +HWTEST_F(BmsBundleMgrHostTest, HandleCreateBundleDataDirWithEl_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleCreateBundleDataDirWithEl(data, reply); + EXPECT_EQ(res, ERR_BUNDLE_MANAGER_PARAM_ERROR); +} + +/** + * @tc.number: HandleCanOpenLink + * @tc.name: test the HandleCanOpenLink + * @tc.desc: 1. system running normally + * 2. test HandleCanOpenLink + */ +HWTEST_F(BmsBundleMgrHostTest, HandleCanOpenLink_0100, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleCanOpenLink(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleIsBundleInstalled_0001 + * @tc.name: test the HandleIsBundleInstalled + * @tc.desc: 1. system running normally + * 2. test HandleIsBundleInstalled + */ +HWTEST_F(BmsBundleMgrHostTest, HandleIsBundleInstalled_0001, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleIsBundleInstalled(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetAllPluginInfo_0001 + * @tc.name: test the HandleGetAllPluginInfo + * @tc.desc: 1. system running normally + * 2. test HandleGetAllPluginInfo + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetAllPluginInfo_0001, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetAllPluginInfo(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetPluginInfosForSelf_0001 + * @tc.name: test the HandleGetPluginInfosForSelf + * @tc.desc: 1. system running normally + * 2. test HandleGetPluginInfosForSelf + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetPluginInfosForSelf_0001, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetPluginInfosForSelf(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetCompatibleDeviceTypeNative_0001 + * @tc.name: test the HandleGetCompatibleDeviceTypeNative + * @tc.desc: 1. system running normally + * 2. test HandleGetCompatibleDeviceTypeNative + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetCompatibleDeviceTypeNative_0001, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetCompatibleDeviceTypeNative(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetCompatibleDeviceType_0001 + * @tc.name: test the HandleGetCompatibleDeviceType + * @tc.desc: 1. system running normally + * 2. test HandleGetCompatibleDeviceType + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetCompatibleDeviceType_0001, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetCompatibleDeviceType(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleGetBundleNameByAppId_0001 + * @tc.name: test the HandleGetBundleNameByAppId + * @tc.desc: 1. system running normally + * 2. test HandleGetBundleNameByAppId + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetBundleNameByAppId_0001, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetBundleNameByAppId(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: AllocatAshmemNum_0001 + * @tc.name: test the AllocatAshmemNum + * @tc.desc: 1. system running normally + * 2. test AllocatAshmemNum + */ +HWTEST_F(BmsBundleMgrHostTest, AllocatAshmemNum_0001, Function | MediumTest | Level0) +{ + BundleMgrHost bundleMgrHost; + bundleMgrHost.ashmemNum_ = 0; + bundleMgrHost.AllocatAshmemNum(); + EXPECT_EQ(bundleMgrHost.ashmemNum_, 1); +} + +/** + * @tc.number: WriteBigString_0001 + * @tc.name: test the WriteBigString + * @tc.desc: 1. system running normally + * 2. test WriteBigString + */ +HWTEST_F(BmsBundleMgrHostTest, WriteBigString_0001, Function | MediumTest | Level0) +{ + BundleMgrHost bundleMgrHost; + std::string str; + MessageParcel reply; + auto ret = bundleMgrHost.WriteBigString(str, reply); + EXPECT_EQ(ERR_OK, ret); +} + +/** + * @tc.number: HandleGetOdidByBundleName_0001 + * @tc.name: test the HandleGetOdidByBundleName + * @tc.desc: 1. system running normally + * 2. test HandleGetOdidByBundleName + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetOdidByBundleName_0001, Function | MediumTest | Level0) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + auto ret = bundleMgrHost.HandleGetOdidByBundleName(data, reply); + EXPECT_EQ(ERR_OK, ret); +} + +/** + * @tc.number: HandleGetSignatureInfoByBundleName_0001 + * @tc.name: test the HandleGetSignatureInfoByBundleName + * @tc.desc: 1. system running normally + * 2. test HandleGetSignatureInfoByBundleName + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetSignatureInfoByBundleName_0001, Function | MediumTest | Level0) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + auto ret = bundleMgrHost.HandleGetSignatureInfoByBundleName(data, reply); + EXPECT_EQ(ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR, ret); +} + +/** + * @tc.number: HandleUpdateAppEncryptedStatus_0001 + * @tc.name: test the HandleUpdateAppEncryptedStatus + * @tc.desc: 1. system running normally + * 2. test HandleUpdateAppEncryptedStatus + */ +HWTEST_F(BmsBundleMgrHostTest, HandleUpdateAppEncryptedStatus_0001, Function | MediumTest | Level0) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + auto ret = bundleMgrHost.HandleUpdateAppEncryptedStatus(data, reply); + EXPECT_EQ(ERR_OK, ret); +} + +/** + * @tc.number: HandleGetBundleInfosForContinuation_0001 + * @tc.name: test the HandleGetBundleInfosForContinuation + * @tc.desc: 1. system running normally + * 2. test HandleGetBundleInfosForContinuation + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetBundleInfosForContinuation_0001, Function | MediumTest | Level0) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + auto ret = bundleMgrHost.HandleGetBundleInfosForContinuation(data, reply); + EXPECT_EQ(ERR_OK, ret); +} + +/** + * @tc.number: HandleGetContinueBundleNames_0001 + * @tc.name: test the HandleGetContinueBundleNames + * @tc.desc: 1. system running normally + * 2. test HandleGetContinueBundleNames + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetContinueBundleNames_0001, Function | MediumTest | Level0) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + auto ret = bundleMgrHost.HandleGetContinueBundleNames(data, reply); + EXPECT_EQ(ERR_OK, ret); +} + +/** + * @tc.number: HandleGetBundleMgrExtProxy_0001 + * @tc.name: test the HandleGetBundleMgrExtProxy + * @tc.desc: 1. system running normally + * 2. test HandleGetBundleMgrExtProxy + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetBundleMgrExtProxy_0001, Function | MediumTest | Level0) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + auto ret = bundleMgrHost.HandleGetBundleMgrExtProxy(data, reply); + EXPECT_EQ(ret, ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR); +} + +/** + * @tc.number: HandleGetSandboxDataDir_0001 + * @tc.name: test the HandleGetSandboxDataDir + * @tc.desc: 1. system running normally + * 2. test HandleGetSandboxDataDir + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetSandboxDataDir_0001, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetSandboxDataDir(data, reply); + EXPECT_EQ(res, ERR_OK); +} + +/** + * @tc.number: HandleCompileReset_0001 + * @tc.name: test the HandleCompileReset + * @tc.desc: 1. system running normally + * 2. test HandleCompileReset + */ + HWTEST_F(BmsBundleMgrHostTest, HandleResetAllAOT_0001, Function | MediumTest | Level1) + { + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleResetAllAOT(data, reply); + EXPECT_EQ(res, ERR_OK); + } + /** + * @tc.number: HandleGetPluginInfo_0001 + * @tc.name: test the HandleGetPluginInfo + * @tc.desc: 1. system running normally + * 2. test HandleGetPluginInfo + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetPluginInfo_0001, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetPluginInfo(data, reply); + EXPECT_EQ(res, ERR_OK); +} + + /** + * @tc.number: HandleGetAbilityResourceInfo_0001 + * @tc.name: test the HandleGetAbilityResourceInfo + * @tc.desc: 1. system running normally + * 2. test HandleGetAbilityResourceInfo + */ +HWTEST_F(BmsBundleMgrHostTest, HandleGetAbilityResourceInfo_0001, Function | MediumTest | Level1) +{ + BundleMgrHost bundleMgrHost; + MessageParcel data; + MessageParcel reply; + ErrCode res = bundleMgrHost.HandleGetAbilityResourceInfo(data, reply); + EXPECT_EQ(res, ERR_OK); +} +} // AppExecFwk } // OHOS \ No newline at end of file -- Gitee