1 /*
2 * Copyright (c) 2023-2024 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 "drag_server.h"
17
18 #include "tokenid_kit.h"
19
20 #include "accesstoken_kit.h"
21 #include "drag_params.h"
22 #include "devicestatus_define.h"
23
24 #undef LOG_TAG
25 #define LOG_TAG "DragServer"
26
27 namespace OHOS {
28 namespace Msdp {
29 namespace DeviceStatus {
30
DragServer(IContext * env)31 DragServer::DragServer(IContext *env)
32 : env_(env)
33 {}
34
Enable(CallingContext & context,MessageParcel & data,MessageParcel & reply)35 int32_t DragServer::Enable(CallingContext &context, MessageParcel &data, MessageParcel &reply)
36 {
37 CALL_DEBUG_ENTER;
38 return RET_ERR;
39 }
40
Disable(CallingContext & context,MessageParcel & data,MessageParcel & reply)41 int32_t DragServer::Disable(CallingContext &context, MessageParcel &data, MessageParcel &reply)
42 {
43 CALL_DEBUG_ENTER;
44 return RET_ERR;
45 }
46
Start(CallingContext & context,MessageParcel & data,MessageParcel & reply)47 int32_t DragServer::Start(CallingContext &context, MessageParcel &data, MessageParcel &reply)
48 {
49 CALL_DEBUG_ENTER;
50 DragData dragData {};
51 StartDragParam param { dragData };
52
53 if (!param.Unmarshalling(data)) {
54 FI_HILOGE("Failed to unmarshalling param");
55 return RET_ERR;
56 }
57 CHKPR(env_, RET_ERR);
58 auto session = env_->GetSocketSessionManager().FindSessionByPid(context.pid);
59 CHKPR(session, RET_ERR);
60 session->SetProgramName(GetPackageName(context.tokenId));
61 return env_->GetDragManager().StartDrag(dragData, context.pid);
62 }
63
Stop(CallingContext & context,MessageParcel & data,MessageParcel & reply)64 int32_t DragServer::Stop(CallingContext &context, MessageParcel &data, MessageParcel &reply)
65 {
66 CALL_DEBUG_ENTER;
67 StopDragParam param {};
68
69 if (!param.Unmarshalling(data)) {
70 FI_HILOGE("Failed to unmarshalling param");
71 return RET_ERR;
72 }
73 CHKPR(env_, RET_ERR);
74 return env_->GetDragManager().StopDrag(param.dropResult_, GetPackageName(context.tokenId), context.pid);
75 }
76
AddWatch(CallingContext & context,uint32_t id,MessageParcel & data,MessageParcel & reply)77 int32_t DragServer::AddWatch(CallingContext &context, uint32_t id, MessageParcel &data, MessageParcel &reply)
78 {
79 CALL_DEBUG_ENTER;
80 switch (id) {
81 case DragRequestID::ADD_DRAG_LISTENER: {
82 return AddListener(context, data);
83 }
84 case DragRequestID::ADD_SUBSCRIPT_LISTENER: {
85 FI_HILOGD("Add subscript listener, from:%{public}d", context.pid);
86 return env_->GetDragManager().AddSubscriptListener(context.pid);
87 }
88 default: {
89 FI_HILOGE("Unexpected request ID (%{public}u)", id);
90 return RET_ERR;
91 }
92 }
93 }
94
RemoveWatch(CallingContext & context,uint32_t id,MessageParcel & data,MessageParcel & reply)95 int32_t DragServer::RemoveWatch(CallingContext &context, uint32_t id, MessageParcel &data, MessageParcel &reply)
96 {
97 CALL_DEBUG_ENTER;
98 switch (id) {
99 case DragRequestID::REMOVE_DRAG_LISTENER: {
100 return RemoveListener(context, data);
101 }
102 case DragRequestID::REMOVE_SUBSCRIPT_LISTENER: {
103 FI_HILOGD("Remove subscript listener, from:%{public}d", context.pid);
104 return env_->GetDragManager().RemoveSubscriptListener(context.pid);
105 }
106 default: {
107 FI_HILOGE("Unexpected request ID (%{public}u)", id);
108 return RET_ERR;
109 }
110 }
111 }
112
SetParam(CallingContext & context,uint32_t id,MessageParcel & data,MessageParcel & reply)113 int32_t DragServer::SetParam(CallingContext &context, uint32_t id, MessageParcel &data, MessageParcel &reply)
114 {
115 CALL_DEBUG_ENTER;
116 switch (id) {
117 case DragRequestID::SET_DRAG_WINDOW_VISIBLE: {
118 return SetDragWindowVisible(context, data, reply);
119 }
120 case DragRequestID::UPDATE_DRAG_STYLE: {
121 return UpdateDragStyle(context, data, reply);
122 }
123 case DragRequestID::UPDATE_SHADOW_PIC: {
124 return UpdateShadowPic(context, data, reply);
125 }
126 case DragRequestID::UPDATE_PREVIEW_STYLE: {
127 return UpdatePreviewStyle(context, data, reply);
128 }
129 case DragRequestID::UPDATE_PREVIEW_STYLE_WITH_ANIMATION: {
130 return UpdatePreviewAnimation(context, data, reply);
131 }
132 case DragRequestID::SET_DRAG_WINDOW_SCREEN_ID: {
133 return SetDragWindowScreenId(context, data, reply);
134 }
135 default: {
136 FI_HILOGE("Unexpected request ID (%{public}u)", id);
137 return RET_ERR;
138 }
139 }
140 }
141
GetParam(CallingContext & context,uint32_t id,MessageParcel & data,MessageParcel & reply)142 int32_t DragServer::GetParam(CallingContext &context, uint32_t id, MessageParcel &data, MessageParcel &reply)
143 {
144 CALL_DEBUG_ENTER;
145 switch (id) {
146 case DragRequestID::GET_DRAG_TARGET_PID: {
147 FI_HILOGI("Get drag target pid, from:%{public}d", context.pid);
148 return GetDragTargetPid(context, data, reply);
149 }
150 case DragRequestID::GET_UDKEY: {
151 FI_HILOGI("Get udkey, from:%{public}d", context.pid);
152 return GetUdKey(context, data, reply);
153 }
154 case DragRequestID::GET_SHADOW_OFFSET: {
155 FI_HILOGD("Get shadow offset, from:%{public}d", context.pid);
156 return GetShadowOffset(context, data, reply);
157 }
158 case DragRequestID::GET_DRAG_DATA: {
159 FI_HILOGD("Get drag data, from:%{public}d", context.pid);
160 return GetDragData(context, data, reply);
161 }
162 case DragRequestID::GET_DRAG_STATE: {
163 FI_HILOGD("Get drag state, from:%{public}d", context.pid);
164 return GetDragState(context, data, reply);
165 }
166 case DragRequestID::GET_DRAG_SUMMARY: {
167 FI_HILOGD("Get drag summary, from:%{public}d", context.pid);
168 return GetDragSummary(context, data, reply);
169 }
170 case DragRequestID::GET_DRAG_ACTION: {
171 FI_HILOGI("Get drag action, from:%{public}d", context.pid);
172 return GetDragAction(context, data, reply);
173 }
174 case DragRequestID::GET_EXTRA_INFO: {
175 FI_HILOGI("Get extra info, from:%{public}d", context.pid);
176 return GetExtraInfo(context, data, reply);
177 }
178 default: {
179 FI_HILOGE("Unexpected request ID (%{public}u)", id);
180 return RET_ERR;
181 }
182 }
183 }
184
Control(CallingContext & context,uint32_t id,MessageParcel & data,MessageParcel & reply)185 int32_t DragServer::Control(CallingContext &context, uint32_t id, MessageParcel &data, MessageParcel &reply)
186 {
187 CALL_DEBUG_ENTER;
188 switch (id) {
189 case DragRequestID::ADD_PRIVILEGE: {
190 FI_HILOGI("Add privilege, from:%{public}d", context.pid);
191 return env_->GetDragManager().AddPrivilege(context.tokenId);
192 }
193 case DragRequestID::ENTER_TEXT_EDITOR_AREA: {
194 FI_HILOGI("Enter text editor area, from:%{public}d", context.pid);
195 return EnterTextEditorArea(context, data, reply);
196 }
197 case DragRequestID::ROTATE_DRAG_WINDOW_SYNC: {
198 FI_HILOGI("Rotate drag window sync, from:%{public}d", context.pid);
199 return RotateDragWindowSync(context, data, reply);
200 }
201 case DragRequestID::ERASE_MOUSE_ICON: {
202 FI_HILOGI("Erase mouse, from:%{public}d", context.pid);
203 return env_->GetDragManager().EraseMouseIcon();
204 }
205 case DragRequestID::SET_MOUSE_DRAG_MONITOR_STATE: {
206 FI_HILOGI("Set mouse drag monitor state, from:%{public}d", context.pid);
207 return SetMouseDragMonitorState(context, data, reply);
208 }
209 default: {
210 FI_HILOGE("Unexpected request ID (%{public}u)", id);
211 return RET_ERR;
212 }
213 }
214 }
215
AddListener(CallingContext & context,MessageParcel & data)216 int32_t DragServer::AddListener(CallingContext &context, MessageParcel &data)
217 {
218 AddDraglistenerParam param {};
219 if (!param.Unmarshalling(data)) {
220 FI_HILOGE("AddDraglistenerParam::Unmarshalling fail");
221 return RET_ERR;
222 }
223
224 if (param.isJsCaller_ && !IsSystemHAPCalling(context)) {
225 FI_HILOGE("The caller is not system hap");
226 return COMMON_NOT_SYSTEM_APP;
227 }
228 FI_HILOGI("Add drag listener, from:%{public}d", context.pid);
229 return env_->GetDragManager().AddListener(context.pid);
230 }
231
RemoveListener(CallingContext & context,MessageParcel & data)232 int32_t DragServer::RemoveListener(CallingContext &context, MessageParcel &data)
233 {
234 RemoveDraglistenerParam param {};
235 if (!param.Unmarshalling(data)) {
236 FI_HILOGE("RemoveDraglistenerParam::Unmarshalling fail");
237 return RET_ERR;
238 }
239
240 if (param.isJsCaller_ && !IsSystemHAPCalling(context)) {
241 FI_HILOGE("The caller is not system hap");
242 return COMMON_NOT_SYSTEM_APP;
243 }
244 FI_HILOGD("Remove drag listener, from:%{public}d", context.pid);
245 return env_->GetDragManager().RemoveListener(context.pid);
246 }
247
SetDragWindowVisible(CallingContext & context,MessageParcel & data,MessageParcel & reply)248 int32_t DragServer::SetDragWindowVisible(CallingContext &context, MessageParcel &data, MessageParcel &reply)
249 {
250 SetDragWindowVisibleParam param {};
251
252 if (!param.Unmarshalling(data)) {
253 FI_HILOGE("SetDragWindowVisibleParam::Unmarshalling fail");
254 return RET_ERR;
255 }
256 FI_HILOGI("SetDragWindowVisible(%{public}d, %{public}d)", param.visible_, param.isForce_);
257 return env_->GetDragManager().OnSetDragWindowVisible(param.visible_, param.isForce_);
258 }
259
UpdateDragStyle(CallingContext & context,MessageParcel & data,MessageParcel & reply)260 int32_t DragServer::UpdateDragStyle(CallingContext &context, MessageParcel &data, MessageParcel &reply)
261 {
262 UpdateDragStyleParam param {};
263
264 if (!param.Unmarshalling(data)) {
265 FI_HILOGE("UpdateDragStyleParam::Unmarshalling fail");
266 return RET_ERR;
267 }
268 FI_HILOGI("UpdateDragStyle(%{public}d)", static_cast<int32_t>(param.cursorStyle_));
269 return env_->GetDragManager().UpdateDragStyle(param.cursorStyle_, context.pid, context.tokenId, param.eventId_);
270 }
271
UpdateShadowPic(CallingContext & context,MessageParcel & data,MessageParcel & reply)272 int32_t DragServer::UpdateShadowPic(CallingContext &context, MessageParcel &data, MessageParcel &reply)
273 {
274 UpdateShadowPicParam param {};
275
276 if (!param.Unmarshalling(data)) {
277 FI_HILOGE("UpdateShadowPicParam::Unmarshalling fail");
278 return RET_ERR;
279 }
280 FI_HILOGD("Updata shadow pic");
281 return env_->GetDragManager().UpdateShadowPic(param.shadowInfo_);
282 }
283
UpdatePreviewStyle(CallingContext & context,MessageParcel & data,MessageParcel & reply)284 int32_t DragServer::UpdatePreviewStyle(CallingContext &context, MessageParcel &data, MessageParcel &reply)
285 {
286 UpdatePreviewStyleParam param {};
287
288 if (!param.Unmarshalling(data)) {
289 FI_HILOGE("UpdatePreviewStyleParam::Unmarshalling fail");
290 return RET_ERR;
291 }
292 return env_->GetDragManager().UpdatePreviewStyle(param.previewStyle_);
293 }
294
UpdatePreviewAnimation(CallingContext & context,MessageParcel & data,MessageParcel & reply)295 int32_t DragServer::UpdatePreviewAnimation(CallingContext &context, MessageParcel &data, MessageParcel &reply)
296 {
297 UpdatePreviewAnimationParam param {};
298
299 if (!param.Unmarshalling(data)) {
300 FI_HILOGE("UpdatePreviewAnimationParam::Unmarshalling fail");
301 return RET_ERR;
302 }
303 return env_->GetDragManager().UpdatePreviewStyleWithAnimation(param.previewStyle_, param.previewAnimation_);
304 }
305
RotateDragWindowSync(CallingContext & context,MessageParcel & data,MessageParcel & reply)306 int32_t DragServer::RotateDragWindowSync(CallingContext &context, MessageParcel &data, MessageParcel &reply)
307 {
308 RotateDragWindowSyncParam param {};
309
310 if (!param.Unmarshalling(data)) {
311 FI_HILOGE("RotateDragWindowSync::Unmarshalling fail");
312 return RET_ERR;
313 }
314 return env_->GetDragManager().RotateDragWindowSync(param.rsTransaction_);
315 }
316
SetDragWindowScreenId(CallingContext & context,MessageParcel & data,MessageParcel & reply)317 int32_t DragServer::SetDragWindowScreenId(CallingContext &context, MessageParcel &data, MessageParcel &reply)
318 {
319 SetDragWindowScreenIdParam param {};
320
321 if (!param.Unmarshalling(data)) {
322 FI_HILOGE("SetDragWindowScreenId::Unmarshalling fail");
323 return RET_ERR;
324 }
325 env_->GetDragManager().SetDragWindowScreenId(param.displayId_, param.screenId_);
326 return RET_OK;
327 }
328
GetDragTargetPid(CallingContext & context,MessageParcel & data,MessageParcel & reply)329 int32_t DragServer::GetDragTargetPid(CallingContext &context, MessageParcel &data, MessageParcel &reply)
330 {
331 int32_t targetPid = env_->GetDragManager().GetDragTargetPid();
332 GetDragTargetPidReply targetPidReply { targetPid };
333
334 if (!targetPidReply.Marshalling(reply)) {
335 FI_HILOGE("GetDragTargetPidReply::Marshalling fail");
336 return RET_ERR;
337 }
338 return RET_OK;
339 }
340
GetUdKey(CallingContext & context,MessageParcel & data,MessageParcel & reply)341 int32_t DragServer::GetUdKey(CallingContext &context, MessageParcel &data, MessageParcel &reply)
342 {
343 std::string udKey;
344
345 int32_t ret = env_->GetDragManager().GetUdKey(udKey);
346 if (ret != RET_OK) {
347 FI_HILOGE("IDragManager::GetUdKey fail, error:%{public}d", ret);
348 return ret;
349 }
350 GetUdKeyReply udKeyReply { std::move(udKey) };
351
352 if (!udKeyReply.Marshalling(reply)) {
353 FI_HILOGE("GetUdKeyReply::Marshalling fail");
354 return RET_ERR;
355 }
356 return RET_OK;
357 }
358
GetShadowOffset(CallingContext & context,MessageParcel & data,MessageParcel & reply)359 int32_t DragServer::GetShadowOffset(CallingContext &context, MessageParcel &data, MessageParcel &reply)
360 {
361 ShadowOffset shadowOffset {};
362
363 int32_t ret = env_->GetDragManager().OnGetShadowOffset(shadowOffset);
364 if (ret != RET_OK) {
365 FI_HILOGE("IDragManager::GetShadowOffset fail, error:%{public}d", ret);
366 return ret;
367 }
368 GetShadowOffsetReply shadowOffsetReply { shadowOffset };
369
370 if (!shadowOffsetReply.Marshalling(reply)) {
371 FI_HILOGE("GetShadowOffsetReply::Marshalling fail");
372 return RET_ERR;
373 }
374 return RET_OK;
375 }
376
GetDragData(CallingContext & context,MessageParcel & data,MessageParcel & reply)377 int32_t DragServer::GetDragData(CallingContext &context, MessageParcel &data, MessageParcel &reply)
378 {
379 DragData dragData {};
380
381 int32_t ret = env_->GetDragManager().GetDragData(dragData);
382 if (ret != RET_OK) {
383 FI_HILOGE("IDragManager::GetDragData fail, error:%{public}d", ret);
384 return ret;
385 }
386 GetDragDataReply dragDataReply { static_cast<const DragData&>(dragData) };
387
388 if (!dragDataReply.Marshalling(reply)) {
389 FI_HILOGE("GetDragDataReply::Marshalling fail");
390 return RET_ERR;
391 }
392 return RET_OK;
393 }
394
GetDragState(CallingContext & context,MessageParcel & data,MessageParcel & reply)395 int32_t DragServer::GetDragState(CallingContext &context, MessageParcel &data, MessageParcel &reply)
396 {
397 DragState dragState {};
398
399 int32_t ret = env_->GetDragManager().GetDragState(dragState);
400 if (ret != RET_OK) {
401 FI_HILOGE("IDragManager::GetDragState fail, error:%{public}d", ret);
402 return ret;
403 }
404 GetDragStateReply dragStateReply { dragState };
405
406 if (!dragStateReply.Marshalling(reply)) {
407 FI_HILOGE("GetDragStateReply::Marshalling fail");
408 return RET_ERR;
409 }
410 return RET_OK;
411 }
412
GetDragSummary(CallingContext & context,MessageParcel & data,MessageParcel & reply)413 int32_t DragServer::GetDragSummary(CallingContext &context, MessageParcel &data, MessageParcel &reply)
414 {
415 GetDragSummaryParam param {};
416
417 if (!param.Unmarshalling(data)) {
418 FI_HILOGE("GetDragSummary::Unmarshalling fail");
419 return RET_ERR;
420 }
421 if (param.isJsCaller_ && !IsSystemHAPCalling(context)) {
422 FI_HILOGE("The caller is not system hap");
423 return COMMON_NOT_SYSTEM_APP;
424 }
425 std::map<std::string, int64_t> summaries;
426
427 int32_t ret = env_->GetDragManager().GetDragSummary(summaries);
428 if (ret != RET_OK) {
429 FI_HILOGE("IDragManager::GetDragSummary fail, error:%{public}d", ret);
430 return ret;
431 }
432 GetDragSummaryReply summaryReply { std::move(summaries) };
433
434 if (!summaryReply.Marshalling(reply)) {
435 FI_HILOGE("GetDragSummaryReply::Marshalling fail");
436 return RET_ERR;
437 }
438 return RET_OK;
439 }
440
GetDragAction(CallingContext & context,MessageParcel & data,MessageParcel & reply)441 int32_t DragServer::GetDragAction(CallingContext &context, MessageParcel &data, MessageParcel &reply)
442 {
443 DragAction dragAction {};
444
445 int32_t ret = env_->GetDragManager().GetDragAction(dragAction);
446 if (ret != RET_OK) {
447 FI_HILOGE("IDragManager::GetDragSummary fail, error:%{public}d", ret);
448 return ret;
449 }
450 GetDragActionReply dragActionReply { dragAction };
451
452 if (!dragActionReply.Marshalling(reply)) {
453 FI_HILOGE("GetDragActionReply::Marshalling fail");
454 return RET_ERR;
455 }
456 return RET_OK;
457 }
458
GetExtraInfo(CallingContext & context,MessageParcel & data,MessageParcel & reply)459 int32_t DragServer::GetExtraInfo(CallingContext &context, MessageParcel &data, MessageParcel &reply)
460 {
461 std::string extraInfo;
462
463 int32_t ret = env_->GetDragManager().GetExtraInfo(extraInfo);
464 if (ret != RET_OK) {
465 FI_HILOGE("IDragManager::GetExtraInfo fail, error:%{public}d", ret);
466 return ret;
467 }
468 GetExtraInfoReply extraInfoReply { std::move(extraInfo) };
469
470 if (!extraInfoReply.Marshalling(reply)) {
471 FI_HILOGE("GetExtraInfoReply::Marshalling fail");
472 return RET_ERR;
473 }
474 return RET_OK;
475 }
476
EnterTextEditorArea(CallingContext & context,MessageParcel & data,MessageParcel & reply)477 int32_t DragServer::EnterTextEditorArea(CallingContext &context, MessageParcel &data, MessageParcel &reply)
478 {
479 EnterTextEditorAreaParam param {};
480
481 if (!param.Unmarshalling(data)) {
482 FI_HILOGE("EnterTextEditorAreaParam::Unmarshalling fail");
483 return RET_ERR;
484 }
485 return env_->GetDragManager().EnterTextEditorArea(param.state);
486 }
487
SetMouseDragMonitorState(CallingContext & context,MessageParcel & data,MessageParcel & reply)488 int32_t DragServer::SetMouseDragMonitorState(CallingContext &context, MessageParcel &data, MessageParcel &reply)
489 {
490 SetMouseDragMonitorStateParam param {};
491
492 if (!param.Unmarshalling(data)) {
493 FI_HILOGE("SetMouseDragMonitorStateParam::Unmarshalling fail");
494 return RET_ERR;
495 }
496 return env_->GetDragManager().SetMouseDragMonitorState(param.state);
497 }
498
GetPackageName(Security::AccessToken::AccessTokenID tokenId)499 std::string DragServer::GetPackageName(Security::AccessToken::AccessTokenID tokenId)
500 {
501 std::string packageName = std::string();
502 int32_t tokenType = Security::AccessToken::AccessTokenKit::GetTokenTypeFlag(tokenId);
503 switch (tokenType) {
504 case Security::AccessToken::ATokenTypeEnum::TOKEN_HAP: {
505 Security::AccessToken::HapTokenInfo hapInfo;
506 if (Security::AccessToken::AccessTokenKit::GetHapTokenInfo(tokenId, hapInfo) != 0) {
507 FI_HILOGE("Get hap token info failed");
508 } else {
509 packageName = hapInfo.bundleName;
510 }
511 break;
512 }
513 case Security::AccessToken::ATokenTypeEnum::TOKEN_NATIVE:
514 case Security::AccessToken::ATokenTypeEnum::TOKEN_SHELL: {
515 Security::AccessToken::NativeTokenInfo tokenInfo;
516 if (Security::AccessToken::AccessTokenKit::GetNativeTokenInfo(tokenId, tokenInfo) != 0) {
517 FI_HILOGE("Get native token info failed");
518 } else {
519 packageName = tokenInfo.processName;
520 }
521 break;
522 }
523 default: {
524 FI_HILOGW("token type not match");
525 break;
526 }
527 }
528 return packageName;
529 }
530
IsSystemServiceCalling(CallingContext & context)531 bool DragServer::IsSystemServiceCalling(CallingContext &context)
532 {
533 auto flag = Security::AccessToken::AccessTokenKit::GetTokenTypeFlag(context.tokenId);
534 if ((flag == Security::AccessToken::ATokenTypeEnum::TOKEN_NATIVE) ||
535 (flag == Security::AccessToken::ATokenTypeEnum::TOKEN_SHELL)) {
536 FI_HILOGI("system service calling, flag:%{public}u", flag);
537 return true;
538 }
539 return false;
540 }
541
IsSystemHAPCalling(CallingContext & context)542 bool DragServer::IsSystemHAPCalling(CallingContext &context)
543 {
544 if (IsSystemServiceCalling(context)) {
545 return true;
546 }
547 return Security::AccessToken::TokenIdKit::IsSystemAppByFullTokenID(context.fullTokenId);
548 }
549 } // namespace DeviceStatus
550 } // namespace Msdp
551 } // namespace OHOS