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 "bundle_resource.h"
17
18 #include <string>
19
20 #include "app_log_wrapper.h"
21 #include "bundle_errors.h"
22 #include "business_error.h"
23
24 namespace OHOS {
25 namespace AppExecFwk {
GetBundleResourceInfo(napi_env env,napi_callback_info info)26 napi_value GetBundleResourceInfo(napi_env env, napi_callback_info info)
27 {
28 APP_LOGE("SystemCapability.BundleManager.BundleFramework.Resource not supported");
29 napi_value error = BusinessError::CreateCommonError(env, ERROR_SYSTEM_ABILITY_NOT_FOUND,
30 "getBundleResourceInfo");
31 napi_throw(env, error);
32 return nullptr;
33 }
34
GetLauncherAbilityResourceInfo(napi_env env,napi_callback_info info)35 napi_value GetLauncherAbilityResourceInfo(napi_env env, napi_callback_info info)
36 {
37 APP_LOGE("SystemCapability.BundleManager.BundleFramework.Resource not supported");
38 napi_value error = BusinessError::CreateCommonError(env, ERROR_SYSTEM_ABILITY_NOT_FOUND,
39 "getLauncherAbilityResourceInfo");
40 napi_throw(env, error);
41 return nullptr;
42 }
43
GetAllBundleResourceInfo(napi_env env,napi_callback_info info)44 napi_value GetAllBundleResourceInfo(napi_env env, napi_callback_info info)
45 {
46 APP_LOGE("SystemCapability.BundleManager.BundleFramework.Resource not supported");
47 napi_value error = BusinessError::CreateCommonError(env, ERROR_SYSTEM_ABILITY_NOT_FOUND,
48 "getAllBundleResourceInfo");
49 napi_throw(env, error);
50 return nullptr;
51 }
52
GetAllLauncherAbilityResourceInfo(napi_env env,napi_callback_info info)53 napi_value GetAllLauncherAbilityResourceInfo(napi_env env, napi_callback_info info)
54 {
55 APP_LOGE("SystemCapability.BundleManager.BundleFramework.Resource not supported");
56 napi_value error = BusinessError::CreateCommonError(env, ERROR_SYSTEM_ABILITY_NOT_FOUND,
57 "getAllLauncherAbilityResourceInfo");
58 napi_throw(env, error);
59 return nullptr;
60 }
61
CreateBundleResourceFlagObject(napi_env env,napi_value value)62 void CreateBundleResourceFlagObject(napi_env env, napi_value value)
63 {
64 NAPI_CALL_RETURN_VOID(env, napi_get_undefined(env, &value));
65 }
66 } // AppExecFwk
67 } // OHOS
68