xref: /ide/tools/previewer/mock/lite/AblityKit.cpp (revision 7c804472)
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
17#include "ability_kit.h"
18
19#include "CommandParser.h"
20#include "PreviewerEngineLog.h"
21#include "VirtualMessageImpl.h"
22
23int32_t OHOS::AbilityKit::RegisterReceiver(const char* bundleName, SuccessCallback success, FailCallback fail,
24                                           uint32_t successCallbackFunc, uint32_t failCallbackFunc, uint32_t context)
25{
26    (void)successCallbackFunc;
27    (void)failCallbackFunc;
28    (void)context;
29    VirtualMessageImpl::GetInstance().RegistBundle(bundleName, success, fail);
30    return 0;
31}
32
33int32_t OHOS::AbilityKit::UnregisterReceiver(const char* bundleName)
34{
35    VirtualMessageImpl::GetInstance().UnregistBundle(bundleName);
36    return 0;
37}
38
39int32_t OHOS::AbilityKit::SendMsgToPeerApp(bool isLocalMsg, const char* callingPkgName, const char* calledPkgName,
40                                           const uint8_t* msgBody, uint32_t length, uint32_t successCallbackFunc,
41                                           uint32_t failCallbackFunc, uint32_t context)
42{
43    (void)isLocalMsg;
44    (void)length;
45    (void)successCallbackFunc;
46    (void)failCallbackFunc;
47    (void)context;
48    ILOG("Message from %s to %s : %s", callingPkgName, calledPkgName,
49         reinterpret_cast<const char*>(msgBody));
50    return 0;
51}
52
53int32_t OHOS::AbilityKit::DetectPhoneApp(const char* callingPkgName, const char* calledPkgName,
54                                         uint32_t successCallbackFunc, uint32_t failCallbackFunc, uint32_t context)
55{
56    (void)callingPkgName;
57    (void)calledPkgName;
58    (void)successCallbackFunc;
59    (void)failCallbackFunc;
60    (void)context;
61    return 0;
62}
63
64int32_t OHOS::AbilityKit::DetectResourceRelease()
65{
66    return 0;
67}
68
69int32_t OHOS::AbilityKit::SendMsgResourceRelease()
70{
71    return 0;
72}
73