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 "js_default_app.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 {
27
IsDefaultApplication(napi_env env,napi_callback_info info)28 napi_value IsDefaultApplication(napi_env env, napi_callback_info info)
29 {
30 APP_LOGE("SystemCapability.BundleManager.BundleFramework.DefaultApp not supported.");
31 napi_value error = BusinessError::CreateCommonError(env, ERROR_SYSTEM_ABILITY_NOT_FOUND,
32 "isDefaultApplication");
33 napi_throw(env, error);
34 return nullptr;
35 }
36
GetDefaultApplication(napi_env env,napi_callback_info info)37 napi_value GetDefaultApplication(napi_env env, napi_callback_info info)
38 {
39 APP_LOGE("SystemCapability.BundleManager.BundleFramework.DefaultApp not supported.");
40 napi_value error = BusinessError::CreateCommonError(env, ERROR_SYSTEM_ABILITY_NOT_FOUND,
41 "getDefaultApplication");
42 napi_throw(env, error);
43 return nullptr;
44 }
45
SetDefaultApplication(napi_env env,napi_callback_info info)46 napi_value SetDefaultApplication(napi_env env, napi_callback_info info)
47 {
48 APP_LOGE("SystemCapability.BundleManager.BundleFramework.DefaultApp not supported.");
49 napi_value error = BusinessError::CreateCommonError(env, ERROR_SYSTEM_ABILITY_NOT_FOUND,
50 "setDefaultApplication");
51 napi_throw(env, error);
52 return nullptr;
53 }
54
ResetDefaultApplication(napi_env env,napi_callback_info info)55 napi_value ResetDefaultApplication(napi_env env, napi_callback_info info)
56 {
57 APP_LOGE("SystemCapability.BundleManager.BundleFramework.DefaultApp not supported.");
58 napi_value error = BusinessError::CreateCommonError(env, ERROR_SYSTEM_ABILITY_NOT_FOUND,
59 "resetDefaultApplication");
60 napi_throw(env, error);
61 return nullptr;
62 }
63 } // AppExecFwk
64 } // OHOS