1 /*
2 * Copyright (c) 2023 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
16 #include "js_app_overlay.h"
17
18 #include <string>
19
20 #include "app_log_wrapper.h"
21 #include "bundle_errors.h"
22 #include "business_error.h"
23 #include "common_func.h"
24
25 namespace OHOS {
26 namespace AppExecFwk {
SetOverlayEnabled(napi_env env,napi_callback_info info)27 napi_value SetOverlayEnabled(napi_env env, napi_callback_info info)
28 {
29 APP_LOGE("SystemCapability.BundleManager.BundleFramework.Overlay not supported");
30 napi_value error = BusinessError::CreateCommonError(env, ERROR_SYSTEM_ABILITY_NOT_FOUND,
31 "setOverlayEnabled");
32 napi_throw(env, error);
33 return nullptr;
34 }
35
SetOverlayEnabledByBundleName(napi_env env,napi_callback_info info)36 napi_value SetOverlayEnabledByBundleName(napi_env env, napi_callback_info info)
37 {
38 APP_LOGE("SystemCapability.BundleManager.BundleFramework.Overlay not supported");
39 napi_value error = BusinessError::CreateCommonError(env, ERROR_SYSTEM_ABILITY_NOT_FOUND,
40 "setOverlayEnabledByBundleName");
41 napi_throw(env, error);
42 return nullptr;
43 }
44
GetOverlayModuleInfo(napi_env env,napi_callback_info info)45 napi_value GetOverlayModuleInfo(napi_env env, napi_callback_info info)
46 {
47 APP_LOGE("SystemCapability.BundleManager.BundleFramework.Overlay not supported");
48 napi_value error = BusinessError::CreateCommonError(env, ERROR_SYSTEM_ABILITY_NOT_FOUND,
49 "getOverlayModuleInfo");
50 napi_throw(env, error);
51 return nullptr;
52 }
53
GetTargetOverlayModuleInfos(napi_env env,napi_callback_info info)54 napi_value GetTargetOverlayModuleInfos(napi_env env, napi_callback_info info)
55 {
56 APP_LOGE("SystemCapability.BundleManager.BundleFramework.Overlay not supported");
57 napi_value error = BusinessError::CreateCommonError(env, ERROR_SYSTEM_ABILITY_NOT_FOUND,
58 "getTargetOverlayModuleInfos");
59 napi_throw(env, error);
60 return nullptr;
61 }
62
GetOverlayModuleInfoByBundleName(napi_env env,napi_callback_info info)63 napi_value GetOverlayModuleInfoByBundleName(napi_env env, napi_callback_info info)
64 {
65 APP_LOGE("SystemCapability.BundleManager.BundleFramework.Overlay not supported");
66 napi_value error = BusinessError::CreateCommonError(env, ERROR_SYSTEM_ABILITY_NOT_FOUND,
67 "getOverlayModuleInfoByBundleName");
68 napi_throw(env, error);
69 return nullptr;
70 }
71
GetTargetOverlayModuleInfosByBundleName(napi_env env,napi_callback_info info)72 napi_value GetTargetOverlayModuleInfosByBundleName(napi_env env, napi_callback_info info)
73 {
74 APP_LOGE("SystemCapability.BundleManager.BundleFramework.Overlay not supported");
75 napi_value error = BusinessError::CreateCommonError(env, ERROR_SYSTEM_ABILITY_NOT_FOUND,
76 "getTargetOverlayModuleInfosByBundleName");
77 napi_throw(env, error);
78 return nullptr;
79 }
80 } // AppExecFwk
81 } // OHOS
82