• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-2025 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_control.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 {
GetDisposedStatus(napi_env env,napi_callback_info info)27 napi_value GetDisposedStatus(napi_env env, napi_callback_info info)
28 {
29     APP_LOGE("AppControl not supported");
30     napi_value error = BusinessError::CreateCommonError(env, ERROR_SYSTEM_ABILITY_NOT_FOUND,
31         "getDisposedStatus");
32     napi_throw(env, error);
33     return nullptr;
34 }
35 
SetDisposedStatus(napi_env env,napi_callback_info info)36 napi_value SetDisposedStatus(napi_env env, napi_callback_info info)
37 {
38     APP_LOGE("AppControl not supported");
39     napi_value error = BusinessError::CreateCommonError(env, ERROR_SYSTEM_ABILITY_NOT_FOUND,
40         "setDisposedStatus");
41     napi_throw(env, error);
42     return nullptr;
43 }
44 
DeleteDisposedStatus(napi_env env,napi_callback_info info)45 napi_value DeleteDisposedStatus(napi_env env, napi_callback_info info)
46 {
47     APP_LOGE("AppControl not supported");
48     napi_value error = BusinessError::CreateCommonError(env, ERROR_SYSTEM_ABILITY_NOT_FOUND,
49         "deleteDisposedStatus");
50     napi_throw(env, error);
51     return nullptr;
52 }
53 
GetDisposedStatusSync(napi_env env,napi_callback_info info)54 napi_value GetDisposedStatusSync(napi_env env, napi_callback_info info)
55 {
56     APP_LOGE("AppControl not supported");
57     napi_value error = BusinessError::CreateCommonError(env, ERROR_SYSTEM_ABILITY_NOT_FOUND,
58         "getDisposedStatusSync");
59     napi_throw(env, error);
60     return nullptr;
61 }
62 
SetDisposedStatusSync(napi_env env,napi_callback_info info)63 napi_value SetDisposedStatusSync(napi_env env, napi_callback_info info)
64 {
65     APP_LOGE("AppControl not supported");
66     napi_value error = BusinessError::CreateCommonError(env, ERROR_SYSTEM_ABILITY_NOT_FOUND,
67         "setDisposedStatusSync");
68     napi_throw(env, error);
69     return nullptr;
70 }
71 
DeleteDisposedStatusSync(napi_env env,napi_callback_info info)72 napi_value DeleteDisposedStatusSync(napi_env env, napi_callback_info info)
73 {
74     APP_LOGE("AppControl not supported");
75     napi_value error = BusinessError::CreateCommonError(env, ERROR_SYSTEM_ABILITY_NOT_FOUND,
76         "deleteDisposedStatusSync");
77     napi_throw(env, error);
78     return nullptr;
79 }
80 
GetDisposedRule(napi_env env,napi_callback_info info)81 napi_value GetDisposedRule(napi_env env, napi_callback_info info)
82 {
83     APP_LOGE("AppControl not supported");
84     napi_value error = BusinessError::CreateCommonError(env, ERROR_SYSTEM_ABILITY_NOT_FOUND,
85         "GetDisposedRule");
86     napi_throw(env, error);
87     return nullptr;
88 }
89 
SetDisposedRule(napi_env env,napi_callback_info info)90 napi_value SetDisposedRule(napi_env env, napi_callback_info info)
91 {
92     APP_LOGE("AppControl not supported");
93     napi_value error = BusinessError::CreateCommonError(env, ERROR_SYSTEM_ABILITY_NOT_FOUND,
94         "SetDisposedRule");
95     napi_throw(env, error);
96     return nullptr;
97 }
98 
SetDisposedRules(napi_env env,napi_callback_info info)99 napi_value SetDisposedRules(napi_env env, napi_callback_info info)
100 {
101     APP_LOGE("AppControl not supported");
102     napi_value error = BusinessError::CreateCommonError(env, ERROR_SYSTEM_ABILITY_NOT_FOUND,
103         "SetDisposedRules");
104     napi_throw(env, error);
105     return nullptr;
106 }
107 
GetUninstallDisposedRule(napi_env env,napi_callback_info info)108 napi_value GetUninstallDisposedRule(napi_env env, napi_callback_info info)
109 {
110     APP_LOGE("AppControl not supported");
111     napi_value error = BusinessError::CreateCommonError(env, ERROR_SYSTEM_ABILITY_NOT_FOUND,
112         "GetUninstallDisposedRule");
113     napi_throw(env, error);
114     return nullptr;
115 }
116 
SetUninstallDisposedRule(napi_env env,napi_callback_info info)117 napi_value SetUninstallDisposedRule(napi_env env, napi_callback_info info)
118 {
119     APP_LOGE("AppControl not supported");
120     napi_value error = BusinessError::CreateCommonError(env, ERROR_SYSTEM_ABILITY_NOT_FOUND,
121         "SetUninstallDisposedRule");
122     napi_throw(env, error);
123     return nullptr;
124 }
125 
DeleteUninstallDisposedRule(napi_env env,napi_callback_info info)126 napi_value DeleteUninstallDisposedRule(napi_env env, napi_callback_info info)
127 {
128     APP_LOGE("AppControl not supported");
129     napi_value error = BusinessError::CreateCommonError(env, ERROR_SYSTEM_ABILITY_NOT_FOUND,
130         "deleteUninstallDisposedRule");
131     napi_throw(env, error);
132     return nullptr;
133 }
134 
CreateComponentType(napi_env env,napi_value value)135 void CreateComponentType(napi_env env, napi_value value)
136 {
137     NAPI_CALL_RETURN_VOID(env, napi_get_undefined(env, &value));
138 }
139 
CreateUninstallComponentType(napi_env env,napi_value value)140 void CreateUninstallComponentType(napi_env env, napi_value value)
141 {
142     NAPI_CALL_RETURN_VOID(env, napi_get_undefined(env, &value));
143 }
144 
CreateDisposedType(napi_env env,napi_value value)145 void CreateDisposedType(napi_env env, napi_value value)
146 {
147     NAPI_CALL_RETURN_VOID(env, napi_get_undefined(env, &value));
148 }
149 
CreateControlType(napi_env env,napi_value value)150 void CreateControlType(napi_env env, napi_value value)
151 {
152     NAPI_CALL_RETURN_VOID(env, napi_get_undefined(env, &value));
153 }
154 } // AppExecFwk
155 } // OHOS
156