1/* 2 * Copyright (c) 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 "devicedebug_stub.h" 17 18#include "appspawn.h" 19 20#ifdef __cplusplus 21extern "C" { 22#endif 23 24int g_isDeveloperModeOpen = 0; 25 26void DeveloperModeOpenSet(int developerMode) 27{ 28 g_isDeveloperModeOpen = developerMode; 29} 30 31int IsDeveloperModeOpenStub() 32{ 33 return g_isDeveloperModeOpen; 34} 35 36int g_appSpawnClientInitRet = 0; 37 38void AppSpawnClientInitRetSet(int appSpawnClientInitRet) 39{ 40 g_appSpawnClientInitRet = appSpawnClientInitRet; 41} 42 43int AppSpawnClientInitStub(const char *serviceName, AppSpawnClientHandle *handle) 44{ 45 (void)serviceName; 46 (void)handle; 47 48 return g_appSpawnClientInitRet; 49} 50 51int g_appSpawnReqMsgCreateRet = 0; 52 53void AppSpawnReqMsgCreateRetSet(int appSpawnReqMsgCreateRet) 54{ 55 g_appSpawnReqMsgCreateRet = appSpawnReqMsgCreateRet; 56} 57 58int AppSpawnReqMsgCreateStub(AppSpawnMsgType msgType, const char *processName, AppSpawnReqMsgHandle *reqHandle) 59{ 60 (void)msgType; 61 (void)processName; 62 (void)reqHandle; 63 64 return g_appSpawnReqMsgCreateRet; 65} 66 67int g_appSpawnReqMsgAddExtInfoRet = 0; 68 69void AppSpawnReqMsgAddExtInfoRetSet(int appSpawnReqMsgAddExtInfoRet) 70{ 71 g_appSpawnReqMsgAddExtInfoRet = appSpawnReqMsgAddExtInfoRet; 72} 73 74int AppSpawnReqMsgAddExtInfoStub(AppSpawnReqMsgHandle reqHandle, const char *name, const uint8_t *value, 75 uint32_t valueLen) 76{ 77 (void)reqHandle; 78 (void)name; 79 (void)value; 80 (void)valueLen; 81 82 return g_appSpawnReqMsgAddExtInfoRet; 83} 84 85int g_appSpawnClientSendMsgResulte = 0; 86int g_appSpawnClientSendMsgRet = 0; 87 88void AppSpawnClientSendMsgResultSet(int appSpawnClientSendMsgResult) 89{ 90 g_appSpawnClientSendMsgResulte = appSpawnClientSendMsgResult; 91} 92 93void AppSpawnClientSendMsgRetSet(int appSpawnClientSendMsgRet) 94{ 95 g_appSpawnClientSendMsgRet = appSpawnClientSendMsgRet; 96} 97 98int AppSpawnClientSendMsgStub(AppSpawnClientHandle handle, AppSpawnReqMsgHandle reqHandle, AppSpawnResult *result) 99{ 100 (void)handle; 101 (void)reqHandle; 102 result->result = g_appSpawnClientSendMsgResulte; 103 104 return g_appSpawnClientSendMsgRet; 105} 106 107#ifdef __cplusplus 108} 109#endif 110