1 /*
2  * Copyright (c) 2022 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 #include "free_install.h"
16 
17 #include <string>
18 
19 #include "app_log_wrapper.h"
20 #include "bundle_errors.h"
21 #include "business_error.h"
22 #include "common_func.h"
23 
24 namespace OHOS {
25 namespace AppExecFwk {
26 
IsHapModuleRemovable(napi_env env,napi_callback_info info)27 napi_value IsHapModuleRemovable(napi_env env, napi_callback_info info)
28 {
29     APP_LOGE("SystemCapability.BundleManager.BundleFramework.FreeInstall not supported");
30     napi_value error = BusinessError::CreateCommonError(env, ERROR_SYSTEM_ABILITY_NOT_FOUND, "isHapModuleRemovable");
31     napi_throw(env, error);
32     return nullptr;
33 }
34 
SetHapModuleUpgradeFlag(napi_env env,napi_callback_info info)35 napi_value SetHapModuleUpgradeFlag(napi_env env, napi_callback_info info)
36 {
37     APP_LOGE("SystemCapability.BundleManager.BundleFramework.FreeInstall not supported");
38     napi_value error = BusinessError::CreateCommonError(env, ERROR_SYSTEM_ABILITY_NOT_FOUND, "setHapModuleUpgradeFlag");
39     napi_throw(env, error);
40     return nullptr;
41 }
42 
GetBundlePackInfo(napi_env env,napi_callback_info info)43 napi_value GetBundlePackInfo(napi_env env, napi_callback_info info)
44 {
45     APP_LOGE("SystemCapability.BundleManager.BundleFramework.FreeInstall not supported");
46     napi_value error = BusinessError::CreateCommonError(env, ERROR_SYSTEM_ABILITY_NOT_FOUND, "getBundlePackInfo");
47     napi_throw(env, error);
48     return nullptr;
49 }
50 
GetDispatchInfo(napi_env env,napi_callback_info info)51 napi_value GetDispatchInfo(napi_env env, napi_callback_info info)
52 {
53     APP_LOGE("SystemCapability.BundleManager.BundleFramework.FreeInstall not supported");
54     napi_value error = BusinessError::CreateCommonError(env, ERROR_SYSTEM_ABILITY_NOT_FOUND, "getDispatchInfo");
55     napi_throw(env, error);
56     return nullptr;
57 }
58 
CreateUpgradeFlagObject(napi_env env,napi_value value)59 void CreateUpgradeFlagObject(napi_env env, napi_value value)
60 {}
61 
CreateBundlePackFlagObject(napi_env env,napi_value value)62 void CreateBundlePackFlagObject(napi_env env, napi_value value)
63 {}
64 } // AppExecFwk
65 } // OHOS
66