1686862fbSopenharmony_ci/* 2686862fbSopenharmony_ci * Copyright (c) 2024 Huawei Device Co., Ltd. 3686862fbSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 4686862fbSopenharmony_ci * you may not use this file except in compliance with the License. 5686862fbSopenharmony_ci * You may obtain a copy of the License at 6686862fbSopenharmony_ci * 7686862fbSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 8686862fbSopenharmony_ci * 9686862fbSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 10686862fbSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 11686862fbSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12686862fbSopenharmony_ci * See the License for the specific language governing permissions and 13686862fbSopenharmony_ci * limitations under the License. 14686862fbSopenharmony_ci */ 15686862fbSopenharmony_ci 16686862fbSopenharmony_ci#include "distributedschedstub_fuzzer.h" 17686862fbSopenharmony_ci 18686862fbSopenharmony_ci#include <cstddef> 19686862fbSopenharmony_ci#include <cstdint> 20686862fbSopenharmony_ci#include <singleton.h> 21686862fbSopenharmony_ci 22686862fbSopenharmony_ci#include "distributed_sched_interface.h" 23686862fbSopenharmony_ci#include "distributed_sched_service.h" 24686862fbSopenharmony_ci#include "distributed_sched_stub.h" 25686862fbSopenharmony_ci#include "distributedWant/distributed_want.h" 26686862fbSopenharmony_ci#include "mock_fuzz_util.h" 27686862fbSopenharmony_ci#include "mock_distributed_sched.h" 28686862fbSopenharmony_ci#include "parcel_helper.h" 29686862fbSopenharmony_ci#include "dms_continue_time_dumper.h" 30686862fbSopenharmony_ci 31686862fbSopenharmony_ciusing namespace OHOS::AAFwk; 32686862fbSopenharmony_ciusing namespace OHOS::AppExecFwk; 33686862fbSopenharmony_ci 34686862fbSopenharmony_cinamespace OHOS { 35686862fbSopenharmony_cinamespace DistributedSchedule { 36686862fbSopenharmony_ciconst std::string TAG = "DistributedSchedFuzzTest"; 37686862fbSopenharmony_cinamespace { 38686862fbSopenharmony_ciconst std::u16string DMS_STUB_INTERFACE_TOKEN = u"ohos.distributedschedule.accessToken"; 39686862fbSopenharmony_ciconst uint32_t ONE = 1; 40686862fbSopenharmony_ciconstexpr size_t FOO_MAX_LEN = 1024; 41686862fbSopenharmony_ciconstexpr size_t U32_AT_SIZE = 4; 42686862fbSopenharmony_ci} 43686862fbSopenharmony_ci 44686862fbSopenharmony_ciuint32_t GetU32Data(const uint8_t* ptr, size_t size) 45686862fbSopenharmony_ci{ 46686862fbSopenharmony_ci if (size > FOO_MAX_LEN || size < U32_AT_SIZE) { 47686862fbSopenharmony_ci return 0; 48686862fbSopenharmony_ci } 49686862fbSopenharmony_ci char *ch = (char *)malloc(size + 1); 50686862fbSopenharmony_ci if (ch == nullptr) { 51686862fbSopenharmony_ci std::cout << "malloc failed." << std::endl; 52686862fbSopenharmony_ci return 0; 53686862fbSopenharmony_ci } 54686862fbSopenharmony_ci (void)memset_s(ch, size + 1, 0x00, size + 1); 55686862fbSopenharmony_ci if (memcpy_s(ch, size + 1, ptr, size) != EOK) { 56686862fbSopenharmony_ci std::cout << "copy failed." << std::endl; 57686862fbSopenharmony_ci free(ch); 58686862fbSopenharmony_ci ch = nullptr; 59686862fbSopenharmony_ci return 0; 60686862fbSopenharmony_ci } 61686862fbSopenharmony_ci uint32_t data = (ch[0] << 24) | (ch[1] << 16) | (ch[2] << 8) | ch[3]; 62686862fbSopenharmony_ci free(ch); 63686862fbSopenharmony_ci ch = nullptr; 64686862fbSopenharmony_ci return data; 65686862fbSopenharmony_ci} 66686862fbSopenharmony_ci 67686862fbSopenharmony_cibool StartRemoteAbilityInnerFuzzTest(const uint8_t* data, size_t size) 68686862fbSopenharmony_ci{ 69686862fbSopenharmony_ci if ((data == nullptr) || (size < sizeof(int32_t))) { 70686862fbSopenharmony_ci return false; 71686862fbSopenharmony_ci } 72686862fbSopenharmony_ci MessageParcel dataParcel; 73686862fbSopenharmony_ci MessageParcel reply; 74686862fbSopenharmony_ci Want want; 75686862fbSopenharmony_ci int32_t int32Data = *(reinterpret_cast<const int32_t*>(data)); 76686862fbSopenharmony_ci uint32_t uint32Data = *(reinterpret_cast<const uint32_t*>(data)); 77686862fbSopenharmony_ci 78686862fbSopenharmony_ci PARCEL_WRITE_HELPER(dataParcel, Parcelable, &want); 79686862fbSopenharmony_ci PARCEL_WRITE_HELPER(dataParcel, Int32, int32Data); 80686862fbSopenharmony_ci PARCEL_WRITE_HELPER(dataParcel, Int32, int32Data); 81686862fbSopenharmony_ci PARCEL_WRITE_HELPER(dataParcel, Uint32, uint32Data); 82686862fbSopenharmony_ci DistributedSchedService::GetInstance().StartRemoteAbilityInner(dataParcel, reply); 83686862fbSopenharmony_ci FuzzUtil::MockPermission(); 84686862fbSopenharmony_ci DistributedSchedService::GetInstance().StartRemoteAbilityInner(dataParcel, reply); 85686862fbSopenharmony_ci return true; 86686862fbSopenharmony_ci} 87686862fbSopenharmony_ci 88686862fbSopenharmony_civoid ConnectRemoteAbilityInnerFuzzTest(const uint8_t* data, size_t size) 89686862fbSopenharmony_ci{ 90686862fbSopenharmony_ci if ((data == nullptr) || (size < sizeof(int32_t))) { 91686862fbSopenharmony_ci return; 92686862fbSopenharmony_ci } 93686862fbSopenharmony_ci FuzzUtil::MockPermission(); 94686862fbSopenharmony_ci MessageParcel dataParcel; 95686862fbSopenharmony_ci MessageParcel reply; 96686862fbSopenharmony_ci MessageOption option; 97686862fbSopenharmony_ci Want want; 98686862fbSopenharmony_ci sptr<IRemoteObject> connect(new MockDistributedSched()); 99686862fbSopenharmony_ci int32_t int32Data = *(reinterpret_cast<const int32_t*>(data)); 100686862fbSopenharmony_ci uint32_t uint32Data = *(reinterpret_cast<const uint32_t*>(data)); 101686862fbSopenharmony_ci 102686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Parcelable, &want); 103686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, RemoteObject, connect); 104686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Int32, int32Data); 105686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Int32, int32Data); 106686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Uint32, uint32Data); 107686862fbSopenharmony_ci DistributedSchedService::GetInstance().ConnectRemoteAbilityInner(dataParcel, reply); 108686862fbSopenharmony_ci std::string devId(reinterpret_cast<const char*>(data), size); 109686862fbSopenharmony_ci DistributedSchedService::GetInstance().InitDataShareManager(); 110686862fbSopenharmony_ci DistributedSchedService::GetInstance().InitCommonEventListener(); 111686862fbSopenharmony_ci DistributedSchedService::GetInstance().InitWifiStateListener(); 112686862fbSopenharmony_ci DistributedSchedService::GetInstance().GetFormMgrProxy(); 113686862fbSopenharmony_ci DistributedSchedService::GetInstance().ProcessFreeInstallOffline(devId); 114686862fbSopenharmony_ci DistributedSchedService::GetInstance().ProcessCalleeOffline(devId); 115686862fbSopenharmony_ci} 116686862fbSopenharmony_ci 117686862fbSopenharmony_civoid DisconnectRemoteAbilityInnerFuzzTest(const uint8_t* data, size_t size) 118686862fbSopenharmony_ci{ 119686862fbSopenharmony_ci if ((data == nullptr) || (size < sizeof(int32_t))) { 120686862fbSopenharmony_ci return; 121686862fbSopenharmony_ci } 122686862fbSopenharmony_ci FuzzUtil::MockPermission(); 123686862fbSopenharmony_ci MessageParcel dataParcel; 124686862fbSopenharmony_ci MessageParcel reply; 125686862fbSopenharmony_ci MessageOption option; 126686862fbSopenharmony_ci sptr<IRemoteObject> connect(new MockDistributedSched()); 127686862fbSopenharmony_ci int32_t int32Data = *(reinterpret_cast<const int32_t*>(data)); 128686862fbSopenharmony_ci uint32_t uint32Data = *(reinterpret_cast<const uint32_t*>(data)); 129686862fbSopenharmony_ci 130686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, RemoteObject, connect); 131686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Int32, int32Data); 132686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Uint32, uint32Data); 133686862fbSopenharmony_ci DistributedSchedService::GetInstance().DisconnectRemoteAbilityInner(dataParcel, reply); 134686862fbSopenharmony_ci 135686862fbSopenharmony_ci std::string networkId(reinterpret_cast<const char*>(data), size); 136686862fbSopenharmony_ci std::string bundleName(reinterpret_cast<const char*>(data), size); 137686862fbSopenharmony_ci DistributedSchedService::GetInstance().IsRemoteInstall(networkId, bundleName); 138686862fbSopenharmony_ci DistributedSchedService::GetInstance().GetContinueInfo(networkId, networkId); 139686862fbSopenharmony_ci} 140686862fbSopenharmony_ci 141686862fbSopenharmony_civoid StartContinuationInnerFuzzTest(const uint8_t* data, size_t size) 142686862fbSopenharmony_ci{ 143686862fbSopenharmony_ci if ((data == nullptr) || (size < sizeof(int32_t))) { 144686862fbSopenharmony_ci return; 145686862fbSopenharmony_ci } 146686862fbSopenharmony_ci FuzzUtil::MockPermission(); 147686862fbSopenharmony_ci MessageParcel dataParcel; 148686862fbSopenharmony_ci MessageParcel reply; 149686862fbSopenharmony_ci MessageOption option; 150686862fbSopenharmony_ci Want want; 151686862fbSopenharmony_ci int32_t missionId = *(reinterpret_cast<const int32_t*>(data)); 152686862fbSopenharmony_ci int32_t callerUid = *(reinterpret_cast<const int32_t*>(data)); 153686862fbSopenharmony_ci int32_t status = *(reinterpret_cast<const int32_t*>(data)); 154686862fbSopenharmony_ci uint32_t accessToken = *(reinterpret_cast<const int32_t*>(data)); 155686862fbSopenharmony_ci 156686862fbSopenharmony_ci dataParcel.WriteParcelable(&want); 157686862fbSopenharmony_ci dataParcel.WriteInt32(missionId); 158686862fbSopenharmony_ci dataParcel.WriteInt32(callerUid); 159686862fbSopenharmony_ci dataParcel.WriteInt32(status); 160686862fbSopenharmony_ci dataParcel.WriteUint32(accessToken); 161686862fbSopenharmony_ci DistributedSchedService::GetInstance().StartContinuationInner(dataParcel, reply); 162686862fbSopenharmony_ci DistributedSchedService::GetInstance().StartAbility(want, callerUid); 163686862fbSopenharmony_ci DistributedSchedService::GetInstance().GetAppManager(); 164686862fbSopenharmony_ci} 165686862fbSopenharmony_ci 166686862fbSopenharmony_civoid NotifyCompleteContinuationInnerFuzzTest(const uint8_t* data, size_t size) 167686862fbSopenharmony_ci{ 168686862fbSopenharmony_ci if ((data == nullptr) || (size < sizeof(int32_t))) { 169686862fbSopenharmony_ci return; 170686862fbSopenharmony_ci } 171686862fbSopenharmony_ci FuzzUtil::MockPermission(); 172686862fbSopenharmony_ci std::string devId(reinterpret_cast<const char*>(data), size); 173686862fbSopenharmony_ci bool isSuccess = *(reinterpret_cast<const bool*>(data)); 174686862fbSopenharmony_ci MessageParcel dataParcel; 175686862fbSopenharmony_ci MessageParcel reply; 176686862fbSopenharmony_ci MessageOption option; 177686862fbSopenharmony_ci int32_t sessionId = *(reinterpret_cast<const int32_t*>(data)); 178686862fbSopenharmony_ci 179686862fbSopenharmony_ci dataParcel.WriteString16(Str8ToStr16(devId)); 180686862fbSopenharmony_ci dataParcel.WriteInt32(sessionId); 181686862fbSopenharmony_ci dataParcel.WriteBool(isSuccess); 182686862fbSopenharmony_ci DistributedSchedService::GetInstance().NotifyCompleteContinuationInner(dataParcel, reply); 183686862fbSopenharmony_ci} 184686862fbSopenharmony_ci 185686862fbSopenharmony_civoid ContinueMissionInnerFuzzTest(const uint8_t* data, size_t size) 186686862fbSopenharmony_ci{ 187686862fbSopenharmony_ci if ((data == nullptr) || (size < sizeof(int32_t))) { 188686862fbSopenharmony_ci return; 189686862fbSopenharmony_ci } 190686862fbSopenharmony_ci FuzzUtil::MockPermission(); 191686862fbSopenharmony_ci MessageParcel dataParcel; 192686862fbSopenharmony_ci MessageParcel reply; 193686862fbSopenharmony_ci MessageOption option; 194686862fbSopenharmony_ci int32_t int32Data = *(reinterpret_cast<const int32_t*>(data)); 195686862fbSopenharmony_ci std::string str(reinterpret_cast<const char*>(data), size); 196686862fbSopenharmony_ci std::string deviceId(reinterpret_cast<const char*>(data), size); 197686862fbSopenharmony_ci std::string bundleName(reinterpret_cast<const char*>(data), size); 198686862fbSopenharmony_ci sptr<IRemoteObject> callback(new MockDistributedSched()); 199686862fbSopenharmony_ci WantParams wantParams; 200686862fbSopenharmony_ci 201686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, String, str); 202686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, String, str); 203686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Int32, int32Data); 204686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, RemoteObject, callback); 205686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Parcelable, &wantParams); 206686862fbSopenharmony_ci DistributedSchedService::GetInstance().ContinueMissionInner(dataParcel, reply); 207686862fbSopenharmony_ci DistributedSchedService::GetInstance().ContinueLocalMission(deviceId, int32Data, callback, wantParams); 208686862fbSopenharmony_ci DistributedSchedService::GetInstance().ContinueRemoteMission(deviceId, deviceId, int32Data, callback, wantParams); 209686862fbSopenharmony_ci DistributedSchedService::GetInstance().ContinueMission(deviceId, deviceId, int32Data, callback, wantParams); 210686862fbSopenharmony_ci} 211686862fbSopenharmony_ci 212686862fbSopenharmony_civoid ContinueMissionOfBundleNameInnerFuzzTest(const uint8_t* data, size_t size) 213686862fbSopenharmony_ci{ 214686862fbSopenharmony_ci if ((data == nullptr) || (size < sizeof(int32_t))) { 215686862fbSopenharmony_ci return; 216686862fbSopenharmony_ci } 217686862fbSopenharmony_ci FuzzUtil::MockPermission(); 218686862fbSopenharmony_ci MessageParcel dataParcel; 219686862fbSopenharmony_ci MessageParcel reply; 220686862fbSopenharmony_ci MessageOption option; 221686862fbSopenharmony_ci std::string str(reinterpret_cast<const char*>(data), size); 222686862fbSopenharmony_ci std::string deviceId(reinterpret_cast<const char*>(data), size); 223686862fbSopenharmony_ci std::string bundleName(reinterpret_cast<const char*>(data), size); 224686862fbSopenharmony_ci sptr<IRemoteObject> callback(new MockDistributedSched()); 225686862fbSopenharmony_ci WantParams wantParams; 226686862fbSopenharmony_ci 227686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, String, str); 228686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, String, str); 229686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, String, str); 230686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, RemoteObject, callback); 231686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Parcelable, &wantParams); 232686862fbSopenharmony_ci DistributedSchedService::GetInstance().ContinueMissionOfBundleNameInner(dataParcel, reply); 233686862fbSopenharmony_ci DistributedSchedService::GetInstance().ContinueRemoteMission(deviceId, deviceId, bundleName, 234686862fbSopenharmony_ci callback, wantParams); 235686862fbSopenharmony_ci DistributedSchedService::GetInstance().ProcessContinueLocalMission(deviceId, deviceId, bundleName, 236686862fbSopenharmony_ci callback, wantParams); 237686862fbSopenharmony_ci DistributedSchedService::GetInstance().ProcessContinueRemoteMission(deviceId, deviceId, bundleName, 238686862fbSopenharmony_ci callback, wantParams); 239686862fbSopenharmony_ci} 240686862fbSopenharmony_ci 241686862fbSopenharmony_civoid GetMissionInfosInnerFuzzTest(const uint8_t* data, size_t size) 242686862fbSopenharmony_ci{ 243686862fbSopenharmony_ci if ((data == nullptr) || (size < sizeof(int32_t))) { 244686862fbSopenharmony_ci return; 245686862fbSopenharmony_ci } 246686862fbSopenharmony_ci FuzzUtil::MockPermission(); 247686862fbSopenharmony_ci MessageParcel dataParcel; 248686862fbSopenharmony_ci MessageParcel reply; 249686862fbSopenharmony_ci MessageOption option; 250686862fbSopenharmony_ci int32_t int32Data = *(reinterpret_cast<const int32_t*>(data)); 251686862fbSopenharmony_ci std::string str(reinterpret_cast<const char*>(data), size); 252686862fbSopenharmony_ci 253686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, String16, Str8ToStr16(str)); 254686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Int32, int32Data); 255686862fbSopenharmony_ci DistributedSchedService::GetInstance().GetMissionInfosInner(dataParcel, reply); 256686862fbSopenharmony_ci} 257686862fbSopenharmony_ci 258686862fbSopenharmony_civoid RegisterMissionListenerInnerFuzzTest(const uint8_t* data, size_t size) 259686862fbSopenharmony_ci{ 260686862fbSopenharmony_ci if ((data == nullptr) || (size < sizeof(int32_t))) { 261686862fbSopenharmony_ci return; 262686862fbSopenharmony_ci } 263686862fbSopenharmony_ci FuzzUtil::MockPermission(); 264686862fbSopenharmony_ci MessageParcel dataParcel; 265686862fbSopenharmony_ci MessageParcel reply; 266686862fbSopenharmony_ci MessageOption option; 267686862fbSopenharmony_ci Want want; 268686862fbSopenharmony_ci int32_t missionId = *(reinterpret_cast<const int32_t*>(data)); 269686862fbSopenharmony_ci uint32_t uint32Data = *(reinterpret_cast<const uint32_t*>(data)); 270686862fbSopenharmony_ci std::string str(reinterpret_cast<const char*>(data), size); 271686862fbSopenharmony_ci sptr<IRemoteObject> obj(new MockDistributedSched()); 272686862fbSopenharmony_ci 273686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, String16, Str8ToStr16(str)); 274686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, RemoteObject, obj); 275686862fbSopenharmony_ci DistributedSchedService::GetInstance().RegisterMissionListenerInner(dataParcel, reply); 276686862fbSopenharmony_ci DistributedSchedService::GetInstance().ContinueLocalMissionDealFreeInstall(want, missionId, str, obj); 277686862fbSopenharmony_ci DistributedSchedService::GetInstance().ContinueAbilityWithTimeout(str, missionId, obj, uint32Data); 278686862fbSopenharmony_ci} 279686862fbSopenharmony_ci 280686862fbSopenharmony_civoid UnRegisterMissionListenerInnerFuzzTest(const uint8_t* data, size_t size) 281686862fbSopenharmony_ci{ 282686862fbSopenharmony_ci if ((data == nullptr) || (size < sizeof(int32_t))) { 283686862fbSopenharmony_ci return; 284686862fbSopenharmony_ci } 285686862fbSopenharmony_ci FuzzUtil::MockPermission(); 286686862fbSopenharmony_ci MessageParcel dataParcel; 287686862fbSopenharmony_ci MessageParcel reply; 288686862fbSopenharmony_ci MessageOption option; 289686862fbSopenharmony_ci std::string str(reinterpret_cast<const char*>(data), size); 290686862fbSopenharmony_ci sptr<IRemoteObject> obj(new MockDistributedSched()); 291686862fbSopenharmony_ci 292686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, String16, Str8ToStr16(str)); 293686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, RemoteObject, obj); 294686862fbSopenharmony_ci DistributedSchedService::GetInstance().UnRegisterMissionListenerInner(dataParcel, reply); 295686862fbSopenharmony_ci} 296686862fbSopenharmony_ci 297686862fbSopenharmony_civoid StartSyncRemoteMissionsInnerFuzzTest(const uint8_t* data, size_t size) 298686862fbSopenharmony_ci{ 299686862fbSopenharmony_ci if ((data == nullptr) || (size < sizeof(int32_t))) { 300686862fbSopenharmony_ci return; 301686862fbSopenharmony_ci } 302686862fbSopenharmony_ci FuzzUtil::MockPermission(); 303686862fbSopenharmony_ci MessageParcel dataParcel; 304686862fbSopenharmony_ci MessageParcel reply; 305686862fbSopenharmony_ci MessageOption option; 306686862fbSopenharmony_ci bool boolData = *(reinterpret_cast<const bool*>(data)); 307686862fbSopenharmony_ci int64_t int64Data = static_cast<int64_t>(GetU32Data(data, size)); 308686862fbSopenharmony_ci std::string str(reinterpret_cast<const char*>(data), size); 309686862fbSopenharmony_ci 310686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, String16, Str8ToStr16(str)); 311686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Bool, boolData); 312686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Int64, int64Data); 313686862fbSopenharmony_ci DistributedSchedService::GetInstance().StartSyncRemoteMissionsInner(dataParcel, reply); 314686862fbSopenharmony_ci} 315686862fbSopenharmony_ci 316686862fbSopenharmony_civoid StopSyncRemoteMissionsInnerFuzzTest(const uint8_t* data, size_t size) 317686862fbSopenharmony_ci{ 318686862fbSopenharmony_ci if ((data == nullptr) || (size < sizeof(int32_t))) { 319686862fbSopenharmony_ci return; 320686862fbSopenharmony_ci } 321686862fbSopenharmony_ci FuzzUtil::MockPermission(); 322686862fbSopenharmony_ci MessageParcel dataParcel; 323686862fbSopenharmony_ci MessageParcel reply; 324686862fbSopenharmony_ci MessageOption option; 325686862fbSopenharmony_ci std::string str(reinterpret_cast<const char*>(data), size); 326686862fbSopenharmony_ci 327686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, String16, Str8ToStr16(str)); 328686862fbSopenharmony_ci DistributedSchedService::GetInstance().StopSyncRemoteMissionsInner(dataParcel, reply); 329686862fbSopenharmony_ci 330686862fbSopenharmony_ci Want want; 331686862fbSopenharmony_ci CallerInfo callerInfo; 332686862fbSopenharmony_ci IDistributedSched::AccountInfo accountInfo; 333686862fbSopenharmony_ci int32_t flag = *(reinterpret_cast<const int32_t*>(data)); 334686862fbSopenharmony_ci DistributedSchedService::GetInstance().CheckTargetPermission(want, callerInfo, accountInfo, flag, true); 335686862fbSopenharmony_ci} 336686862fbSopenharmony_ci 337686862fbSopenharmony_civoid GetRemoteMissionSnapshotInfoInnerFuzzTest(const uint8_t* data, size_t size) 338686862fbSopenharmony_ci{ 339686862fbSopenharmony_ci if ((data == nullptr) || (size < sizeof(int32_t))) { 340686862fbSopenharmony_ci return; 341686862fbSopenharmony_ci } 342686862fbSopenharmony_ci FuzzUtil::MockPermission(); 343686862fbSopenharmony_ci MessageParcel dataParcel; 344686862fbSopenharmony_ci MessageParcel reply; 345686862fbSopenharmony_ci MessageOption option; 346686862fbSopenharmony_ci std::string networkId(reinterpret_cast<const char*>(data), size); 347686862fbSopenharmony_ci int32_t missionId = *(reinterpret_cast<const int32_t*>(data)); 348686862fbSopenharmony_ci 349686862fbSopenharmony_ci dataParcel.WriteString(networkId); 350686862fbSopenharmony_ci dataParcel.WriteInt32(missionId); 351686862fbSopenharmony_ci DistributedSchedService::GetInstance().GetRemoteMissionSnapshotInfoInner(dataParcel, reply); 352686862fbSopenharmony_ci DistributedSchedService::GetInstance().DurationStart(networkId, networkId); 353686862fbSopenharmony_ci} 354686862fbSopenharmony_ci 355686862fbSopenharmony_civoid StartRemoteAbilityByCallInnerFuzzTest(const uint8_t* data, size_t size) 356686862fbSopenharmony_ci{ 357686862fbSopenharmony_ci if ((data == nullptr) || (size < sizeof(int32_t))) { 358686862fbSopenharmony_ci return; 359686862fbSopenharmony_ci } 360686862fbSopenharmony_ci FuzzUtil::MockPermission(); 361686862fbSopenharmony_ci MessageParcel dataParcel; 362686862fbSopenharmony_ci MessageParcel reply; 363686862fbSopenharmony_ci MessageOption option; 364686862fbSopenharmony_ci Want want; 365686862fbSopenharmony_ci sptr<IRemoteObject> obj(new MockDistributedSched()); 366686862fbSopenharmony_ci int32_t int32Data = *(reinterpret_cast<const int32_t*>(data)); 367686862fbSopenharmony_ci uint32_t uint32Data = *(reinterpret_cast<const uint32_t*>(data)); 368686862fbSopenharmony_ci 369686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Parcelable, &want); 370686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, RemoteObject, obj); 371686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Int32, int32Data); 372686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Int32, int32Data); 373686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Uint32, uint32Data); 374686862fbSopenharmony_ci DistributedSchedService::GetInstance().StartRemoteAbilityByCallInner(dataParcel, reply); 375686862fbSopenharmony_ci DistributedSchedService::GetInstance().SetWantForContinuation(want, int32Data); 376686862fbSopenharmony_ci} 377686862fbSopenharmony_ci 378686862fbSopenharmony_civoid ReleaseRemoteAbilityInnerFuzzTest(const uint8_t* data, size_t size) 379686862fbSopenharmony_ci{ 380686862fbSopenharmony_ci if ((data == nullptr) || (size < sizeof(int32_t))) { 381686862fbSopenharmony_ci return; 382686862fbSopenharmony_ci } 383686862fbSopenharmony_ci FuzzUtil::MockPermission(); 384686862fbSopenharmony_ci MessageParcel dataParcel; 385686862fbSopenharmony_ci MessageParcel reply; 386686862fbSopenharmony_ci MessageOption option; 387686862fbSopenharmony_ci sptr<IRemoteObject> connect(new MockDistributedSched()); 388686862fbSopenharmony_ci Want want; 389686862fbSopenharmony_ci AppExecFwk::ElementName element; 390686862fbSopenharmony_ci CallerInfo callerInfo; 391686862fbSopenharmony_ci std::string deviceId(reinterpret_cast<const char*>(data), size); 392686862fbSopenharmony_ci 393686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, RemoteObject, connect); 394686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Parcelable, &element); 395686862fbSopenharmony_ci DistributedSchedService::GetInstance().ReleaseRemoteAbilityInner(dataParcel, reply); 396686862fbSopenharmony_ci callerInfo.uid = ONE; 397686862fbSopenharmony_ci DistributedSchedService::GetInstance().CheckDistributedConnectLocked(callerInfo); 398686862fbSopenharmony_ci DistributedSchedService::GetInstance().DecreaseConnectLocked(ONE); 399686862fbSopenharmony_ci DistributedSchedService::GetInstance().RemoteConnectAbilityMappingLocked(connect, deviceId, 400686862fbSopenharmony_ci deviceId, element, callerInfo, TargetComponent::HARMONY_COMPONENT); 401686862fbSopenharmony_ci DistributedSchedService::GetInstance().NotifyProcessDied(deviceId, callerInfo, TargetComponent::HARMONY_COMPONENT); 402686862fbSopenharmony_ci DistributedSchedService::GetInstance().ProcessDeviceOffline(deviceId); 403686862fbSopenharmony_ci} 404686862fbSopenharmony_ci 405686862fbSopenharmony_civoid GetDistributedComponentListInnerFuzzTest(const uint8_t* data, size_t size) 406686862fbSopenharmony_ci{ 407686862fbSopenharmony_ci if ((data == nullptr) || (size < sizeof(int32_t))) { 408686862fbSopenharmony_ci return; 409686862fbSopenharmony_ci } 410686862fbSopenharmony_ci FuzzUtil::MockPermission(); 411686862fbSopenharmony_ci MessageParcel dataParcel; 412686862fbSopenharmony_ci MessageParcel reply; 413686862fbSopenharmony_ci MessageOption option; 414686862fbSopenharmony_ci 415686862fbSopenharmony_ci DistributedSchedService::GetInstance().GetDistributedComponentListInner(dataParcel, reply); 416686862fbSopenharmony_ci} 417686862fbSopenharmony_ci 418686862fbSopenharmony_civoid StartRemoteFreeInstallInnerFuzzTest(const uint8_t* data, size_t size) 419686862fbSopenharmony_ci{ 420686862fbSopenharmony_ci if ((data == nullptr) || (size < sizeof(int32_t))) { 421686862fbSopenharmony_ci return; 422686862fbSopenharmony_ci } 423686862fbSopenharmony_ci FuzzUtil::MockPermission(); 424686862fbSopenharmony_ci MessageParcel dataParcel; 425686862fbSopenharmony_ci MessageParcel reply; 426686862fbSopenharmony_ci MessageOption option; 427686862fbSopenharmony_ci int32_t int32Data = *(reinterpret_cast<const int32_t*>(data)); 428686862fbSopenharmony_ci uint32_t uint32Data = *(reinterpret_cast<const uint32_t*>(data)); 429686862fbSopenharmony_ci sptr<IRemoteObject> obj(new MockDistributedSched()); 430686862fbSopenharmony_ci Want want; 431686862fbSopenharmony_ci 432686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Parcelable, &want); 433686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Int32, int32Data); 434686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Int32, int32Data); 435686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Uint32, uint32Data); 436686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, RemoteObject, obj); 437686862fbSopenharmony_ci DistributedSchedService::GetInstance().StartRemoteFreeInstallInner(dataParcel, reply); 438686862fbSopenharmony_ci DistributedSchedService::GetInstance().ProcessCallResult(obj, obj); 439686862fbSopenharmony_ci} 440686862fbSopenharmony_ci 441686862fbSopenharmony_civoid StartRemoteShareFormInnerFuzzTest(const uint8_t* data, size_t size) 442686862fbSopenharmony_ci{ 443686862fbSopenharmony_ci if ((data == nullptr) || (size < sizeof(int32_t))) { 444686862fbSopenharmony_ci return; 445686862fbSopenharmony_ci } 446686862fbSopenharmony_ci FuzzUtil::MockPermission(); 447686862fbSopenharmony_ci int32_t code = static_cast<uint32_t>(IDSchedInterfaceCode::START_REMOTE_SHARE_FORM); 448686862fbSopenharmony_ci MessageParcel dataParcel; 449686862fbSopenharmony_ci MessageParcel reply; 450686862fbSopenharmony_ci MessageOption option; 451686862fbSopenharmony_ci std::string str(reinterpret_cast<const char*>(data), size); 452686862fbSopenharmony_ci Want want; 453686862fbSopenharmony_ci dataParcel.WriteInterfaceToken(DMS_STUB_INTERFACE_TOKEN); 454686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, String, str); 455686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Parcelable, &want); 456686862fbSopenharmony_ci DistributedSchedService::GetInstance().OnRemoteRequest(code, dataParcel, reply, option); 457686862fbSopenharmony_ci} 458686862fbSopenharmony_ci 459686862fbSopenharmony_civoid StopRemoteExtensionAbilityInnerFuzzTest(const uint8_t* data, size_t size) 460686862fbSopenharmony_ci{ 461686862fbSopenharmony_ci if ((data == nullptr) || (size < sizeof(int32_t))) { 462686862fbSopenharmony_ci return; 463686862fbSopenharmony_ci } 464686862fbSopenharmony_ci FuzzUtil::MockPermission(); 465686862fbSopenharmony_ci MessageParcel dataParcel; 466686862fbSopenharmony_ci MessageParcel reply; 467686862fbSopenharmony_ci MessageOption option; 468686862fbSopenharmony_ci Want want; 469686862fbSopenharmony_ci int32_t callerUid = *(reinterpret_cast<const int32_t*>(data)); 470686862fbSopenharmony_ci int32_t serviceType = *(reinterpret_cast<const int32_t*>(data)); 471686862fbSopenharmony_ci uint32_t accessToken = *(reinterpret_cast<const int32_t*>(data)); 472686862fbSopenharmony_ci dataParcel.WriteParcelable(&want); 473686862fbSopenharmony_ci dataParcel.WriteInt32(callerUid); 474686862fbSopenharmony_ci dataParcel.WriteUint32(accessToken); 475686862fbSopenharmony_ci dataParcel.WriteInt32(serviceType); 476686862fbSopenharmony_ci DistributedSchedService::GetInstance().StopRemoteExtensionAbilityInner(dataParcel, reply); 477686862fbSopenharmony_ci 478686862fbSopenharmony_ci CallerInfo callerInfo; 479686862fbSopenharmony_ci std::string localDeviceId(reinterpret_cast<const char*>(data), size); 480686862fbSopenharmony_ci DistributedSchedService::GetInstance().GetCallerInfo(localDeviceId, callerUid, accessToken, callerInfo); 481686862fbSopenharmony_ci DistributedSchedService::GetInstance().CheckDeviceIdFromRemote(localDeviceId, localDeviceId, localDeviceId); 482686862fbSopenharmony_ci} 483686862fbSopenharmony_ci 484686862fbSopenharmony_civoid RegisterOnListenerInnerFuzzTest(const uint8_t* data, size_t size) 485686862fbSopenharmony_ci{ 486686862fbSopenharmony_ci if ((data == nullptr) || (size < sizeof(int32_t))) { 487686862fbSopenharmony_ci return; 488686862fbSopenharmony_ci } 489686862fbSopenharmony_ci FuzzUtil::MockPermission(); 490686862fbSopenharmony_ci MessageParcel dataParcel; 491686862fbSopenharmony_ci MessageParcel reply; 492686862fbSopenharmony_ci MessageOption option; 493686862fbSopenharmony_ci std::string str(reinterpret_cast<const char*>(data), size); 494686862fbSopenharmony_ci sptr<IRemoteObject> obj(new MockDistributedSched()); 495686862fbSopenharmony_ci 496686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, String, str); 497686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, RemoteObject, obj); 498686862fbSopenharmony_ci DistributedSchedService::GetInstance().RegisterOnListenerInner(dataParcel, reply); 499686862fbSopenharmony_ci DistributedSchedService::GetInstance().HandleLocalCallerDied(obj); 500686862fbSopenharmony_ci DistributedSchedService::GetInstance().RemoveCallerComponent(obj); 501686862fbSopenharmony_ci DistributedSchedService::GetInstance().RemoveConnectAbilityInfo(str); 502686862fbSopenharmony_ci DistributedSchedService::GetInstance().DumpConnectInfo(str); 503686862fbSopenharmony_ci} 504686862fbSopenharmony_ci 505686862fbSopenharmony_civoid RegisterOffListenerInnerFuzzTest(const uint8_t* data, size_t size) 506686862fbSopenharmony_ci{ 507686862fbSopenharmony_ci if ((data == nullptr) || (size < sizeof(int32_t))) { 508686862fbSopenharmony_ci return; 509686862fbSopenharmony_ci } 510686862fbSopenharmony_ci FuzzUtil::MockPermission(); 511686862fbSopenharmony_ci MessageParcel dataParcel; 512686862fbSopenharmony_ci MessageParcel reply; 513686862fbSopenharmony_ci MessageOption option; 514686862fbSopenharmony_ci std::string str(reinterpret_cast<const char*>(data), size); 515686862fbSopenharmony_ci sptr<IRemoteObject> obj(new MockDistributedSched()); 516686862fbSopenharmony_ci 517686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, String, str); 518686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, RemoteObject, obj); 519686862fbSopenharmony_ci DistributedSchedService::GetInstance().RegisterOffListenerInner(dataParcel, reply); 520686862fbSopenharmony_ci} 521686862fbSopenharmony_ci 522686862fbSopenharmony_civoid RegisterDSchedEventListenerInnerFuzzTest(const uint8_t* data, size_t size) 523686862fbSopenharmony_ci{ 524686862fbSopenharmony_ci if ((data == nullptr) || (size < sizeof(int32_t))) { 525686862fbSopenharmony_ci return; 526686862fbSopenharmony_ci } 527686862fbSopenharmony_ci FuzzUtil::MockPermission(); 528686862fbSopenharmony_ci MessageParcel dataParcel; 529686862fbSopenharmony_ci MessageParcel reply; 530686862fbSopenharmony_ci MessageOption option; 531686862fbSopenharmony_ci uint8_t uint8Data = *(reinterpret_cast<const uint8_t*>(data)); 532686862fbSopenharmony_ci sptr<IRemoteObject> obj(new MockDistributedSched()); 533686862fbSopenharmony_ci 534686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Uint8, uint8Data); 535686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, RemoteObject, obj); 536686862fbSopenharmony_ci DistributedSchedService::GetInstance().RegisterDSchedEventListenerInner(dataParcel, reply); 537686862fbSopenharmony_ci} 538686862fbSopenharmony_ci 539686862fbSopenharmony_civoid UnRegisterDSchedEventListenerInnerFuzzTest(const uint8_t* data, size_t size) 540686862fbSopenharmony_ci{ 541686862fbSopenharmony_ci if ((data == nullptr) || (size < sizeof(int32_t))) { 542686862fbSopenharmony_ci return; 543686862fbSopenharmony_ci } 544686862fbSopenharmony_ci FuzzUtil::MockPermission(); 545686862fbSopenharmony_ci MessageParcel dataParcel; 546686862fbSopenharmony_ci MessageParcel reply; 547686862fbSopenharmony_ci MessageOption option; 548686862fbSopenharmony_ci uint8_t uint8Data = *(reinterpret_cast<const uint8_t*>(data)); 549686862fbSopenharmony_ci sptr<IRemoteObject> obj(new MockDistributedSched()); 550686862fbSopenharmony_ci 551686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Uint8, uint8Data); 552686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, RemoteObject, obj); 553686862fbSopenharmony_ci DistributedSchedService::GetInstance().UnRegisterDSchedEventListenerInner(dataParcel, reply); 554686862fbSopenharmony_ci} 555686862fbSopenharmony_ci 556686862fbSopenharmony_civoid SetMissionContinueStateInnerFuzzTest(const uint8_t* data, size_t size) 557686862fbSopenharmony_ci{ 558686862fbSopenharmony_ci if ((data == nullptr) || (size < sizeof(int32_t))) { 559686862fbSopenharmony_ci return; 560686862fbSopenharmony_ci } 561686862fbSopenharmony_ci FuzzUtil::MockPermission(); 562686862fbSopenharmony_ci MessageParcel dataParcel; 563686862fbSopenharmony_ci MessageParcel reply; 564686862fbSopenharmony_ci MessageOption option; 565686862fbSopenharmony_ci int32_t missionId = *(reinterpret_cast<const int32_t*>(data)); 566686862fbSopenharmony_ci int32_t state = *(reinterpret_cast<const int32_t*>(data)); 567686862fbSopenharmony_ci int32_t timeout = *(reinterpret_cast<const int32_t*>(data)); 568686862fbSopenharmony_ci 569686862fbSopenharmony_ci dataParcel.WriteInt32(missionId); 570686862fbSopenharmony_ci dataParcel.WriteInt32(state); 571686862fbSopenharmony_ci DistributedSchedService::GetInstance().SetMissionContinueStateInner(dataParcel, reply); 572686862fbSopenharmony_ci DistributedSchedService::GetInstance().RemoveContinuationTimeout(missionId); 573686862fbSopenharmony_ci DistributedSchedService::GetInstance().SetContinuationTimeout(missionId, timeout); 574686862fbSopenharmony_ci DistributedSchedService::GetInstance().GetContinuaitonDevice(missionId); 575686862fbSopenharmony_ci} 576686862fbSopenharmony_ci 577686862fbSopenharmony_civoid StartAbilityFromRemoteInnerFuzzTest(const uint8_t* data, size_t size) 578686862fbSopenharmony_ci{ 579686862fbSopenharmony_ci if ((data == nullptr) || (size < sizeof(int32_t))) { 580686862fbSopenharmony_ci return; 581686862fbSopenharmony_ci } 582686862fbSopenharmony_ci FuzzUtil::MockPermission(); 583686862fbSopenharmony_ci MessageParcel dataParcel; 584686862fbSopenharmony_ci MessageParcel reply; 585686862fbSopenharmony_ci MessageOption option; 586686862fbSopenharmony_ci DistributedWant dstbWant; 587686862fbSopenharmony_ci AppExecFwk::CompatibleAbilityInfo compatibleAbilityInfo; 588686862fbSopenharmony_ci int32_t int32Data = *(reinterpret_cast<const int32_t*>(data)); 589686862fbSopenharmony_ci std::string str(reinterpret_cast<const char*>(data), size); 590686862fbSopenharmony_ci std::vector<std::string> strVector = {str}; 591686862fbSopenharmony_ci 592686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Parcelable, &dstbWant); 593686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Parcelable, &compatibleAbilityInfo); 594686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Int32, int32Data); 595686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Int32, int32Data); 596686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, String, str); 597686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Int32, int32Data); 598686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, StringVector, strVector); 599686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, String, str); 600686862fbSopenharmony_ci DistributedSchedService::GetInstance().StartAbilityFromRemoteInner(dataParcel, reply); 601686862fbSopenharmony_ci} 602686862fbSopenharmony_ci 603686862fbSopenharmony_civoid SendResultFromRemoteInnerFuzzTest(const uint8_t* data, size_t size) 604686862fbSopenharmony_ci{ 605686862fbSopenharmony_ci if ((data == nullptr) || (size < sizeof(int32_t))) { 606686862fbSopenharmony_ci return; 607686862fbSopenharmony_ci } 608686862fbSopenharmony_ci FuzzUtil::MockPermission(); 609686862fbSopenharmony_ci MessageParcel dataParcel; 610686862fbSopenharmony_ci MessageParcel reply; 611686862fbSopenharmony_ci MessageOption option; 612686862fbSopenharmony_ci AppExecFwk::CompatibleAbilityInfo compatibleAbilityInfo; 613686862fbSopenharmony_ci int32_t int32Data = *(reinterpret_cast<const int32_t*>(data)); 614686862fbSopenharmony_ci std::string str(reinterpret_cast<const char*>(data), size); 615686862fbSopenharmony_ci std::vector<std::string> strVector = {str}; 616686862fbSopenharmony_ci DistributedWant dstbWant; 617686862fbSopenharmony_ci 618686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Parcelable, &dstbWant); 619686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Int32, int32Data); 620686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Int32, int32Data); 621686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, String, str); 622686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Int32, int32Data); 623686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, StringVector, strVector); 624686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, String, str); 625686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Int32, int32Data); 626686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, String, str); 627686862fbSopenharmony_ci DistributedSchedService::GetInstance().SendResultFromRemoteInner(dataParcel, reply); 628686862fbSopenharmony_ci} 629686862fbSopenharmony_ci 630686862fbSopenharmony_civoid NotifyDSchedEventResultFromRemoteInnerFuzzTest(const uint8_t* data, size_t size) 631686862fbSopenharmony_ci{ 632686862fbSopenharmony_ci if ((data == nullptr) || (size < sizeof(int32_t))) { 633686862fbSopenharmony_ci return; 634686862fbSopenharmony_ci } 635686862fbSopenharmony_ci FuzzUtil::MockPermission(); 636686862fbSopenharmony_ci MessageParcel dataParcel; 637686862fbSopenharmony_ci MessageParcel reply; 638686862fbSopenharmony_ci MessageOption option; 639686862fbSopenharmony_ci int32_t int32Data = *(reinterpret_cast<const int32_t*>(data)); 640686862fbSopenharmony_ci std::string str(reinterpret_cast<const char*>(data), size); 641686862fbSopenharmony_ci 642686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, String, str); 643686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Int32, int32Data); 644686862fbSopenharmony_ci DistributedSchedService::GetInstance().NotifyDSchedEventResultFromRemoteInner(dataParcel, reply); 645686862fbSopenharmony_ci} 646686862fbSopenharmony_ci 647686862fbSopenharmony_civoid NotifyContinuationResultFromRemoteInnerFuzzTest(const uint8_t* data, size_t size) 648686862fbSopenharmony_ci{ 649686862fbSopenharmony_ci if ((data == nullptr) || (size < sizeof(int32_t))) { 650686862fbSopenharmony_ci return; 651686862fbSopenharmony_ci } 652686862fbSopenharmony_ci FuzzUtil::MockPermission(); 653686862fbSopenharmony_ci DmsContinueTime::GetInstance().Init(); 654686862fbSopenharmony_ci MessageParcel dataParcel; 655686862fbSopenharmony_ci MessageParcel reply; 656686862fbSopenharmony_ci MessageOption option; 657686862fbSopenharmony_ci AppExecFwk::CompatibleAbilityInfo compatibleAbilityInfo; 658686862fbSopenharmony_ci bool boolData = *(reinterpret_cast<const bool*>(data)); 659686862fbSopenharmony_ci int32_t int32Data = *(reinterpret_cast<const int32_t*>(data)); 660686862fbSopenharmony_ci std::string str(reinterpret_cast<const char*>(data), size); 661686862fbSopenharmony_ci 662686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Int32, int32Data); 663686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Bool, boolData); 664686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, String, str); 665686862fbSopenharmony_ci DistributedSchedService::GetInstance().NotifyContinuationResultFromRemoteInner(dataParcel, reply); 666686862fbSopenharmony_ci} 667686862fbSopenharmony_ci 668686862fbSopenharmony_civoid ConnectAbilityFromRemoteInnerFuzzTest(const uint8_t* data, size_t size) 669686862fbSopenharmony_ci{ 670686862fbSopenharmony_ci if ((data == nullptr) || (size < sizeof(int32_t))) { 671686862fbSopenharmony_ci return; 672686862fbSopenharmony_ci } 673686862fbSopenharmony_ci FuzzUtil::MockPermission(); 674686862fbSopenharmony_ci MessageParcel dataParcel; 675686862fbSopenharmony_ci MessageParcel reply; 676686862fbSopenharmony_ci MessageOption option; 677686862fbSopenharmony_ci AppExecFwk::CompatibleAbilityInfo compatibleAbilityInfo; 678686862fbSopenharmony_ci int32_t int32Data = *(reinterpret_cast<const int32_t*>(data)); 679686862fbSopenharmony_ci std::string str(reinterpret_cast<const char*>(data), size); 680686862fbSopenharmony_ci std::vector<std::string> strVector = {str}; 681686862fbSopenharmony_ci DistributedWant dstbWant; 682686862fbSopenharmony_ci const sptr<IRemoteObject> connect(new MockDistributedSched()); 683686862fbSopenharmony_ci 684686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Parcelable, &dstbWant); 685686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Parcelable, &compatibleAbilityInfo); 686686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, RemoteObject, connect); 687686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Int32, int32Data); 688686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Int32, int32Data); 689686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, String, str); 690686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Int32, int32Data); 691686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, StringVector, strVector); 692686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, String, str); 693686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, String, str); 694686862fbSopenharmony_ci DistributedSchedService::GetInstance().ConnectAbilityFromRemoteInner(dataParcel, reply); 695686862fbSopenharmony_ci} 696686862fbSopenharmony_ci 697686862fbSopenharmony_civoid DisconnectAbilityFromRemoteInnerFuzzTest(const uint8_t* data, size_t size) 698686862fbSopenharmony_ci{ 699686862fbSopenharmony_ci if ((data == nullptr) || (size < sizeof(int32_t))) { 700686862fbSopenharmony_ci return; 701686862fbSopenharmony_ci } 702686862fbSopenharmony_ci FuzzUtil::MockPermission(); 703686862fbSopenharmony_ci MessageParcel dataParcel; 704686862fbSopenharmony_ci MessageParcel reply; 705686862fbSopenharmony_ci MessageOption option; 706686862fbSopenharmony_ci AppExecFwk::CompatibleAbilityInfo compatibleAbilityInfo; 707686862fbSopenharmony_ci int32_t int32Data = *(reinterpret_cast<const int32_t*>(data)); 708686862fbSopenharmony_ci std::string str(reinterpret_cast<const char*>(data), size); 709686862fbSopenharmony_ci 710686862fbSopenharmony_ci sptr<IRemoteObject> connect(new MockDistributedSched()); 711686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, RemoteObject, connect); 712686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Int32, int32Data); 713686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, String, str); 714686862fbSopenharmony_ci DistributedSchedService::GetInstance().DisconnectAbilityFromRemoteInner(dataParcel, reply); 715686862fbSopenharmony_ci DistributedSchedService::GetInstance().ProcessCallerDied(connect, int32Data); 716686862fbSopenharmony_ci DistributedSchedService::GetInstance().ProcessCalleeDied(connect); 717686862fbSopenharmony_ci} 718686862fbSopenharmony_ci 719686862fbSopenharmony_civoid NotifyProcessDiedFromRemoteInnerFuzzTest(const uint8_t* data, size_t size) 720686862fbSopenharmony_ci{ 721686862fbSopenharmony_ci if ((data == nullptr) || (size < sizeof(int32_t))) { 722686862fbSopenharmony_ci return; 723686862fbSopenharmony_ci } 724686862fbSopenharmony_ci FuzzUtil::MockPermission(); 725686862fbSopenharmony_ci MessageParcel dataParcel; 726686862fbSopenharmony_ci MessageParcel reply; 727686862fbSopenharmony_ci MessageOption option; 728686862fbSopenharmony_ci int32_t int32Data = *(reinterpret_cast<const int32_t*>(data)); 729686862fbSopenharmony_ci std::string str(reinterpret_cast<const char*>(data), size); 730686862fbSopenharmony_ci 731686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Int32, int32Data); 732686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Int32, int32Data); 733686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, String, str); 734686862fbSopenharmony_ci DistributedSchedService::GetInstance().NotifyProcessDiedFromRemoteInner(dataParcel, reply); 735686862fbSopenharmony_ci} 736686862fbSopenharmony_ci 737686862fbSopenharmony_civoid GetContinueInfoInnerFuzzTest(const uint8_t* data, size_t size) 738686862fbSopenharmony_ci{ 739686862fbSopenharmony_ci if ((data == nullptr) || (size < sizeof(int32_t))) { 740686862fbSopenharmony_ci return; 741686862fbSopenharmony_ci } 742686862fbSopenharmony_ci FuzzUtil::MockPermission(); 743686862fbSopenharmony_ci MessageParcel dataParcel; 744686862fbSopenharmony_ci MessageParcel reply; 745686862fbSopenharmony_ci MessageOption option; 746686862fbSopenharmony_ci std::string str(reinterpret_cast<const char*>(data), size); 747686862fbSopenharmony_ci 748686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, String, str); 749686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, String, str); 750686862fbSopenharmony_ci DistributedSchedService::GetInstance().GetContinueInfoInner(dataParcel, reply); 751686862fbSopenharmony_ci} 752686862fbSopenharmony_ci 753686862fbSopenharmony_civoid NotifyMissionsChangedFromRemoteInnerFuzzTest(const uint8_t* data, size_t size) 754686862fbSopenharmony_ci{ 755686862fbSopenharmony_ci if ((data == nullptr) || (size < sizeof(int32_t))) { 756686862fbSopenharmony_ci return; 757686862fbSopenharmony_ci } 758686862fbSopenharmony_ci FuzzUtil::MockPermission(); 759686862fbSopenharmony_ci MessageParcel dataParcel; 760686862fbSopenharmony_ci MessageParcel reply; 761686862fbSopenharmony_ci MessageOption option; 762686862fbSopenharmony_ci int32_t int32Data = *(reinterpret_cast<const int32_t*>(data)); 763686862fbSopenharmony_ci std::string str(reinterpret_cast<const char*>(data), size); 764686862fbSopenharmony_ci std::vector<DstbMissionInfo> missionInfos; 765686862fbSopenharmony_ci CallerInfo callerInfo; 766686862fbSopenharmony_ci DistributedWant dstbWant; 767686862fbSopenharmony_ci 768686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Parcelable, &dstbWant); 769686862fbSopenharmony_ci if (!DstbMissionInfo::WriteDstbMissionInfosToParcel(dataParcel, missionInfos)) { 770686862fbSopenharmony_ci return; 771686862fbSopenharmony_ci } 772686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Int32, int32Data); 773686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, String, str); 774686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Int32, int32Data); 775686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Int32, int32Data); 776686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Int32, int32Data); 777686862fbSopenharmony_ci DistributedSchedService::GetInstance().NotifyMissionsChangedFromRemoteInner(dataParcel, reply); 778686862fbSopenharmony_ci} 779686862fbSopenharmony_ci 780686862fbSopenharmony_civoid ReleaseAbilityFromRemoteInnerFuzzTest(const uint8_t* data, size_t size) 781686862fbSopenharmony_ci{ 782686862fbSopenharmony_ci if ((data == nullptr) || (size < sizeof(int32_t))) { 783686862fbSopenharmony_ci return; 784686862fbSopenharmony_ci } 785686862fbSopenharmony_ci FuzzUtil::MockPermission(); 786686862fbSopenharmony_ci MessageParcel dataParcel; 787686862fbSopenharmony_ci MessageParcel reply; 788686862fbSopenharmony_ci MessageOption option; 789686862fbSopenharmony_ci sptr<IRemoteObject> connect(new MockDistributedSched()); 790686862fbSopenharmony_ci AppExecFwk::ElementName element; 791686862fbSopenharmony_ci Want want; 792686862fbSopenharmony_ci const CallerInfo callerInfo; 793686862fbSopenharmony_ci std::string str(reinterpret_cast<const char*>(data), size); 794686862fbSopenharmony_ci int32_t int32Data = *(reinterpret_cast<const int32_t*>(data)); 795686862fbSopenharmony_ci 796686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, RemoteObject, connect); 797686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Parcelable, &element); 798686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, String, str); 799686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, String, str); 800686862fbSopenharmony_ci DistributedSchedService::GetInstance().ReleaseAbilityFromRemoteInner(dataParcel, reply); 801686862fbSopenharmony_ci DistributedSchedService::GetInstance().TryStartRemoteAbilityByCall(want, connect, callerInfo); 802686862fbSopenharmony_ci DistributedSchedService::GetInstance().SaveCallerComponent(want, connect, callerInfo); 803686862fbSopenharmony_ci DistributedSchedService::GetInstance().SaveConnectToken(want, connect); 804686862fbSopenharmony_ci DistributedSchedService::GetInstance().NotifyStateChanged(int32Data, element, connect); 805686862fbSopenharmony_ci DistributedSchedService::GetInstance().SetCleanMissionFlag(want, int32Data); 806686862fbSopenharmony_ci} 807686862fbSopenharmony_ci 808686862fbSopenharmony_civoid NotifyStateChangedFromRemoteInnerFuzzTest(const uint8_t* data, size_t size) 809686862fbSopenharmony_ci{ 810686862fbSopenharmony_ci if ((data == nullptr) || (size < sizeof(int32_t))) { 811686862fbSopenharmony_ci return; 812686862fbSopenharmony_ci } 813686862fbSopenharmony_ci FuzzUtil::MockPermission(); 814686862fbSopenharmony_ci MessageParcel dataParcel; 815686862fbSopenharmony_ci MessageParcel reply; 816686862fbSopenharmony_ci MessageOption option; 817686862fbSopenharmony_ci const AppExecFwk::ElementName element; 818686862fbSopenharmony_ci sptr<IRemoteObject> connect(new MockDistributedSched()); 819686862fbSopenharmony_ci int32_t int32Data = *(reinterpret_cast<const int32_t*>(data)); 820686862fbSopenharmony_ci std::string str(reinterpret_cast<const char*>(data), size); 821686862fbSopenharmony_ci 822686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Int32, int32Data); 823686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Int32, int32Data); 824686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Parcelable, &element); 825686862fbSopenharmony_ci DistributedSchedService::GetInstance().NotifyStateChangedFromRemoteInner(dataParcel, reply); 826686862fbSopenharmony_ci DistributedSchedService::GetInstance().NotifyApp(connect, element, int32Data); 827686862fbSopenharmony_ci} 828686862fbSopenharmony_ci 829686862fbSopenharmony_civoid StartFreeInstallFromRemoteInnerFuzzTest(const uint8_t* data, size_t size) 830686862fbSopenharmony_ci{ 831686862fbSopenharmony_ci if ((data == nullptr) || (size < sizeof(int32_t))) { 832686862fbSopenharmony_ci return; 833686862fbSopenharmony_ci } 834686862fbSopenharmony_ci FuzzUtil::MockPermission(); 835686862fbSopenharmony_ci MessageParcel dataParcel; 836686862fbSopenharmony_ci MessageParcel reply; 837686862fbSopenharmony_ci MessageOption option; 838686862fbSopenharmony_ci int32_t int32Data = *(reinterpret_cast<const int32_t*>(data)); 839686862fbSopenharmony_ci int64_t int64Data = static_cast<int64_t>(GetU32Data(data, size)); 840686862fbSopenharmony_ci std::string str(reinterpret_cast<const char*>(data), size); 841686862fbSopenharmony_ci std::vector<std::string> strVector = {str}; 842686862fbSopenharmony_ci DistributedWant dstbWant; 843686862fbSopenharmony_ci 844686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Parcelable, &dstbWant); 845686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Int32, int32Data); 846686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, String, str); 847686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Int32, int32Data); 848686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, StringVector, strVector); 849686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, String, str); 850686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Int64, int64Data); 851686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Parcelable, &dstbWant); 852686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, String, str); 853686862fbSopenharmony_ci DistributedSchedService::GetInstance().StartFreeInstallFromRemoteInner(dataParcel, reply); 854686862fbSopenharmony_ci} 855686862fbSopenharmony_ci 856686862fbSopenharmony_civoid NotifyCompleteFreeInstallFromRemoteInnerFuzzTest(const uint8_t* data, size_t size) 857686862fbSopenharmony_ci{ 858686862fbSopenharmony_ci if ((data == nullptr) || (size < sizeof(int32_t))) { 859686862fbSopenharmony_ci return; 860686862fbSopenharmony_ci } 861686862fbSopenharmony_ci FuzzUtil::MockPermission(); 862686862fbSopenharmony_ci MessageParcel dataParcel; 863686862fbSopenharmony_ci MessageParcel reply; 864686862fbSopenharmony_ci MessageOption option; 865686862fbSopenharmony_ci int32_t int32Data = *(reinterpret_cast<const int32_t*>(data)); 866686862fbSopenharmony_ci int64_t int64Data = static_cast<int64_t>(GetU32Data(data, size)); 867686862fbSopenharmony_ci 868686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Int64, int64Data); 869686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Int32, int32Data); 870686862fbSopenharmony_ci DistributedSchedService::GetInstance().NotifyCompleteFreeInstallFromRemoteInner(dataParcel, reply); 871686862fbSopenharmony_ci} 872686862fbSopenharmony_ci 873686862fbSopenharmony_civoid GetDSchedEventInfoInnerFuzzTest(const uint8_t* data, size_t size) 874686862fbSopenharmony_ci{ 875686862fbSopenharmony_ci if ((data == nullptr) || (size < sizeof(int32_t))) { 876686862fbSopenharmony_ci return; 877686862fbSopenharmony_ci } 878686862fbSopenharmony_ci FuzzUtil::MockPermission(); 879686862fbSopenharmony_ci MessageParcel dataParcel; 880686862fbSopenharmony_ci MessageParcel reply; 881686862fbSopenharmony_ci MessageOption option; 882686862fbSopenharmony_ci int32_t int32Data = *(reinterpret_cast<const int32_t*>(data)) % DMS_ALL; 883686862fbSopenharmony_ci 884686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Int32, int32Data); 885686862fbSopenharmony_ci DistributedSchedService::GetInstance().GetDSchedEventInfoInner(dataParcel, reply); 886686862fbSopenharmony_ci} 887686862fbSopenharmony_ci 888686862fbSopenharmony_civoid StartAbilityByCallFromRemoteInnerFuzzTest(const uint8_t* data, size_t size) 889686862fbSopenharmony_ci{ 890686862fbSopenharmony_ci if ((data == nullptr) || (size < sizeof(int32_t))) { 891686862fbSopenharmony_ci return; 892686862fbSopenharmony_ci } 893686862fbSopenharmony_ci FuzzUtil::MockPermission(); 894686862fbSopenharmony_ci MessageParcel dataParcel; 895686862fbSopenharmony_ci MessageParcel reply; 896686862fbSopenharmony_ci MessageOption option; 897686862fbSopenharmony_ci int32_t int32Data = *(reinterpret_cast<const int32_t*>(data)); 898686862fbSopenharmony_ci std::string str(reinterpret_cast<const char*>(data), size); 899686862fbSopenharmony_ci std::vector<std::string> strVector = {str}; 900686862fbSopenharmony_ci DistributedWant dstbWant; 901686862fbSopenharmony_ci sptr<IRemoteObject> connect(new MockDistributedSched()); 902686862fbSopenharmony_ci 903686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, RemoteObject, connect); 904686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Int32, int32Data); 905686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Int32, int32Data); 906686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, String, str); 907686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Int32, int32Data); 908686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, StringVector, strVector); 909686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, String, str); 910686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, String, str); 911686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Parcelable, &dstbWant); 912686862fbSopenharmony_ci DistributedSchedService::GetInstance().StartAbilityByCallFromRemoteInner(dataParcel, reply); 913686862fbSopenharmony_ci DistributedSchedService::GetInstance().ProcessConnectDied(connect); 914686862fbSopenharmony_ci DistributedSchedService::GetInstance().DisconnectEachRemoteAbilityLocked(str, str, connect); 915686862fbSopenharmony_ci} 916686862fbSopenharmony_ci 917686862fbSopenharmony_civoid StartSyncMissionsFromRemoteInnerFuzzTest(const uint8_t* data, size_t size) 918686862fbSopenharmony_ci{ 919686862fbSopenharmony_ci if ((data == nullptr) || (size < sizeof(int32_t))) { 920686862fbSopenharmony_ci return; 921686862fbSopenharmony_ci } 922686862fbSopenharmony_ci FuzzUtil::MockPermission(); 923686862fbSopenharmony_ci MessageParcel dataParcel; 924686862fbSopenharmony_ci MessageParcel reply; 925686862fbSopenharmony_ci MessageOption option; 926686862fbSopenharmony_ci int32_t int32Data = *(reinterpret_cast<const int32_t*>(data)); 927686862fbSopenharmony_ci std::string str(reinterpret_cast<const char*>(data), size); 928686862fbSopenharmony_ci 929686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Int32, int32Data); 930686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Int32, int32Data); 931686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Int32, int32Data); 932686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, String, str); 933686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Int32, int32Data); 934686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, String, str); 935686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Int32, int32Data); 936686862fbSopenharmony_ci DistributedSchedService::GetInstance().StartSyncMissionsFromRemoteInner(dataParcel, reply); 937686862fbSopenharmony_ci} 938686862fbSopenharmony_ci 939686862fbSopenharmony_civoid StopSyncMissionsFromRemoteInnerFuzzTest(const uint8_t* data, size_t size) 940686862fbSopenharmony_ci{ 941686862fbSopenharmony_ci if ((data == nullptr) || (size < sizeof(int32_t))) { 942686862fbSopenharmony_ci return; 943686862fbSopenharmony_ci } 944686862fbSopenharmony_ci FuzzUtil::MockPermission(); 945686862fbSopenharmony_ci MessageParcel dataParcel; 946686862fbSopenharmony_ci MessageParcel reply; 947686862fbSopenharmony_ci MessageOption option; 948686862fbSopenharmony_ci int32_t int32Data = *(reinterpret_cast<const int32_t*>(data)); 949686862fbSopenharmony_ci std::string str(reinterpret_cast<const char*>(data), size); 950686862fbSopenharmony_ci 951686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Int32, int32Data); 952686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Int32, int32Data); 953686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Int32, int32Data); 954686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, String, str); 955686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Int32, int32Data); 956686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, String, str); 957686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Int32, int32Data); 958686862fbSopenharmony_ci 959686862fbSopenharmony_ci DistributedSchedService::GetInstance().StopSyncMissionsFromRemoteInner(dataParcel, reply); 960686862fbSopenharmony_ci} 961686862fbSopenharmony_ci 962686862fbSopenharmony_civoid StartShareFormFromRemoteInnerFuzzTest(const uint8_t* data, size_t size) 963686862fbSopenharmony_ci{ 964686862fbSopenharmony_ci if ((data == nullptr) || (size < sizeof(int32_t))) { 965686862fbSopenharmony_ci return; 966686862fbSopenharmony_ci } 967686862fbSopenharmony_ci FuzzUtil::MockPermission(); 968686862fbSopenharmony_ci MessageParcel dataParcel; 969686862fbSopenharmony_ci MessageParcel reply; 970686862fbSopenharmony_ci std::string str(reinterpret_cast<const char*>(data), size); 971686862fbSopenharmony_ci DistributedWant dstbWant; 972686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, String, str); 973686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Parcelable, &dstbWant); 974686862fbSopenharmony_ci DistributedSchedService::GetInstance().StartShareFormFromRemoteInner(dataParcel, reply); 975686862fbSopenharmony_ci} 976686862fbSopenharmony_ci 977686862fbSopenharmony_civoid StopExtensionAbilityFromRemoteInnerFuzzTest(const uint8_t* data, size_t size) 978686862fbSopenharmony_ci{ 979686862fbSopenharmony_ci if ((data == nullptr) || (size < sizeof(int32_t))) { 980686862fbSopenharmony_ci return; 981686862fbSopenharmony_ci } 982686862fbSopenharmony_ci FuzzUtil::MockPermission(); 983686862fbSopenharmony_ci MessageParcel dataParcel; 984686862fbSopenharmony_ci MessageParcel reply; 985686862fbSopenharmony_ci MessageOption option; 986686862fbSopenharmony_ci int32_t int32Data = *(reinterpret_cast<const int32_t*>(data)); 987686862fbSopenharmony_ci std::string str(reinterpret_cast<const char*>(data), size); 988686862fbSopenharmony_ci std::vector<std::string> strVector = {str}; 989686862fbSopenharmony_ci DistributedWant dstbWant; 990686862fbSopenharmony_ci 991686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Parcelable, &dstbWant); 992686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Int32, int32Data); 993686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Int32, int32Data); 994686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, String, str); 995686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, Int32, int32Data); 996686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, StringVector, strVector); 997686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, String, str); 998686862fbSopenharmony_ci PARCEL_WRITE_HELPER_NORET(dataParcel, String, str); 999686862fbSopenharmony_ci DistributedSchedService::GetInstance().StopExtensionAbilityFromRemoteInner(dataParcel, reply); 1000686862fbSopenharmony_ci} 1001686862fbSopenharmony_ci} 1002686862fbSopenharmony_ci} 1003686862fbSopenharmony_ci 1004686862fbSopenharmony_ci/* Fuzzer entry point */ 1005686862fbSopenharmony_ciextern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) 1006686862fbSopenharmony_ci{ 1007686862fbSopenharmony_ci OHOS::DistributedSchedule::StartRemoteAbilityInnerFuzzTest(data, size); 1008686862fbSopenharmony_ci OHOS::DistributedSchedule::ConnectRemoteAbilityInnerFuzzTest(data, size); 1009686862fbSopenharmony_ci OHOS::DistributedSchedule::DisconnectRemoteAbilityInnerFuzzTest(data, size); 1010686862fbSopenharmony_ci OHOS::DistributedSchedule::StartContinuationInnerFuzzTest(data, size); 1011686862fbSopenharmony_ci OHOS::DistributedSchedule::NotifyCompleteContinuationInnerFuzzTest(data, size); 1012686862fbSopenharmony_ci OHOS::DistributedSchedule::ContinueMissionInnerFuzzTest(data, size); 1013686862fbSopenharmony_ci OHOS::DistributedSchedule::ContinueMissionOfBundleNameInnerFuzzTest(data, size); 1014686862fbSopenharmony_ci OHOS::DistributedSchedule::GetMissionInfosInnerFuzzTest(data, size); 1015686862fbSopenharmony_ci OHOS::DistributedSchedule::RegisterMissionListenerInnerFuzzTest(data, size); 1016686862fbSopenharmony_ci OHOS::DistributedSchedule::UnRegisterMissionListenerInnerFuzzTest(data, size); 1017686862fbSopenharmony_ci OHOS::DistributedSchedule::StartSyncRemoteMissionsInnerFuzzTest(data, size); 1018686862fbSopenharmony_ci OHOS::DistributedSchedule::StopSyncRemoteMissionsInnerFuzzTest(data, size); 1019686862fbSopenharmony_ci OHOS::DistributedSchedule::GetRemoteMissionSnapshotInfoInnerFuzzTest(data, size); 1020686862fbSopenharmony_ci OHOS::DistributedSchedule::StartRemoteAbilityByCallInnerFuzzTest(data, size); 1021686862fbSopenharmony_ci OHOS::DistributedSchedule::ReleaseRemoteAbilityInnerFuzzTest(data, size); 1022686862fbSopenharmony_ci OHOS::DistributedSchedule::GetDistributedComponentListInnerFuzzTest(data, size); 1023686862fbSopenharmony_ci OHOS::DistributedSchedule::StartRemoteFreeInstallInnerFuzzTest(data, size); 1024686862fbSopenharmony_ci OHOS::DistributedSchedule::StartRemoteShareFormInnerFuzzTest(data, size); 1025686862fbSopenharmony_ci OHOS::DistributedSchedule::StopRemoteExtensionAbilityInnerFuzzTest(data, size); 1026686862fbSopenharmony_ci OHOS::DistributedSchedule::RegisterOnListenerInnerFuzzTest(data, size); 1027686862fbSopenharmony_ci OHOS::DistributedSchedule::RegisterOffListenerInnerFuzzTest(data, size); 1028686862fbSopenharmony_ci OHOS::DistributedSchedule::RegisterDSchedEventListenerInnerFuzzTest(data, size); 1029686862fbSopenharmony_ci OHOS::DistributedSchedule::UnRegisterDSchedEventListenerInnerFuzzTest(data, size); 1030686862fbSopenharmony_ci OHOS::DistributedSchedule::SetMissionContinueStateInnerFuzzTest(data, size); 1031686862fbSopenharmony_ci OHOS::DistributedSchedule::StartAbilityFromRemoteInnerFuzzTest(data, size); 1032686862fbSopenharmony_ci OHOS::DistributedSchedule::SendResultFromRemoteInnerFuzzTest(data, size); 1033686862fbSopenharmony_ci OHOS::DistributedSchedule::NotifyDSchedEventResultFromRemoteInnerFuzzTest(data, size); 1034686862fbSopenharmony_ci OHOS::DistributedSchedule::NotifyContinuationResultFromRemoteInnerFuzzTest(data, size); 1035686862fbSopenharmony_ci OHOS::DistributedSchedule::ConnectAbilityFromRemoteInnerFuzzTest(data, size); 1036686862fbSopenharmony_ci OHOS::DistributedSchedule::DisconnectAbilityFromRemoteInnerFuzzTest(data, size); 1037686862fbSopenharmony_ci OHOS::DistributedSchedule::NotifyProcessDiedFromRemoteInnerFuzzTest(data, size); 1038686862fbSopenharmony_ci OHOS::DistributedSchedule::GetContinueInfoInnerFuzzTest(data, size); 1039686862fbSopenharmony_ci OHOS::DistributedSchedule::NotifyMissionsChangedFromRemoteInnerFuzzTest(data, size); 1040686862fbSopenharmony_ci OHOS::DistributedSchedule::ReleaseAbilityFromRemoteInnerFuzzTest(data, size); 1041686862fbSopenharmony_ci OHOS::DistributedSchedule::NotifyStateChangedFromRemoteInnerFuzzTest(data, size); 1042686862fbSopenharmony_ci OHOS::DistributedSchedule::StartFreeInstallFromRemoteInnerFuzzTest(data, size); 1043686862fbSopenharmony_ci OHOS::DistributedSchedule::NotifyCompleteFreeInstallFromRemoteInnerFuzzTest(data, size); 1044686862fbSopenharmony_ci OHOS::DistributedSchedule::GetDSchedEventInfoInnerFuzzTest(data, size); 1045686862fbSopenharmony_ci OHOS::DistributedSchedule::StartAbilityByCallFromRemoteInnerFuzzTest(data, size); 1046686862fbSopenharmony_ci OHOS::DistributedSchedule::StartSyncMissionsFromRemoteInnerFuzzTest(data, size); 1047686862fbSopenharmony_ci OHOS::DistributedSchedule::StopSyncMissionsFromRemoteInnerFuzzTest(data, size); 1048686862fbSopenharmony_ci OHOS::DistributedSchedule::StartShareFormFromRemoteInnerFuzzTest(data, size); 1049686862fbSopenharmony_ci OHOS::DistributedSchedule::StopExtensionAbilityFromRemoteInnerFuzzTest(data, size); 1050686862fbSopenharmony_ci return 0; 1051686862fbSopenharmony_ci}