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 
16 #include "launcher_bundle_manager.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 {
GetLauncherAbilityInfo(napi_env env,napi_callback_info info)27 napi_value GetLauncherAbilityInfo(napi_env env, napi_callback_info info)
28 {
29     APP_LOGE("SystemCapability.BundleManager.BundleFramework.Launcher not supported");
30     napi_value error = BusinessError::CreateCommonError(env, ERROR_SYSTEM_ABILITY_NOT_FOUND,
31         "GetLauncherAbilityInfo");
32     napi_throw(env, error);
33     return nullptr;
34 }
35 
GetLauncherAbilityInfoSync(napi_env env,napi_callback_info info)36 napi_value GetLauncherAbilityInfoSync(napi_env env, napi_callback_info info)
37 {
38     APP_LOGE("SystemCapability.BundleManager.BundleFramework.Launcher not supported");
39     napi_value error = BusinessError::CreateCommonError(env, ERROR_SYSTEM_ABILITY_NOT_FOUND,
40         "GetLauncherAbilityInfoSync");
41     napi_throw(env, error);
42     return nullptr;
43 }
44 
GetAllLauncherAbilityInfo(napi_env env,napi_callback_info info)45 napi_value GetAllLauncherAbilityInfo(napi_env env, napi_callback_info info)
46 {
47     APP_LOGE("SystemCapability.BundleManager.BundleFramework.Launcher not supported");
48     napi_value error = BusinessError::CreateCommonError(env, ERROR_SYSTEM_ABILITY_NOT_FOUND,
49         "GetAllLauncherAbilityInfo");
50     napi_throw(env, error);
51     return nullptr;
52 }
53 
GetShortcutInfo(napi_env env,napi_callback_info info)54 napi_value GetShortcutInfo(napi_env env, napi_callback_info info)
55 {
56     APP_LOGE("SystemCapability.BundleManager.BundleFramework.Launcher not supported");
57     napi_value error = BusinessError::CreateCommonError(env, ERROR_SYSTEM_ABILITY_NOT_FOUND,
58         "GetShortcutInfo");
59     napi_throw(env, error);
60     return nullptr;
61 }
62 
GetShortcutInfoSync(napi_env env,napi_callback_info info)63 napi_value GetShortcutInfoSync(napi_env env, napi_callback_info info)
64 {
65     APP_LOGE("SystemCapability.BundleManager.BundleFramework.Launcher not supported");
66     napi_value error = BusinessError::CreateCommonError(env, ERROR_SYSTEM_ABILITY_NOT_FOUND,
67         "GetShortcutInfoSync");
68     napi_throw(env, error);
69     return nullptr;
70 }
71 
StartShortcut(napi_env env,napi_callback_info info)72 napi_value StartShortcut(napi_env env, napi_callback_info info)
73 {
74     APP_LOGE("SystemCapability.BundleManager.BundleFramework.Launcher not supported");
75     napi_value error = BusinessError::CreateCommonError(env, ERROR_SYSTEM_ABILITY_NOT_FOUND,
76         "StartShortcut");
77     napi_throw(env, error);
78     return nullptr;
79 }
80 } // AppExecFwk
81 } // OHOS
82