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 #ifndef OHOS_ABILITY_RUNTIME_NATIVE_CHILD_NOTIFY_INTERFACE_H 17 #define OHOS_ABILITY_RUNTIME_NATIVE_CHILD_NOTIFY_INTERFACE_H 18 19 #include "iremote_broker.h" 20 21 namespace OHOS { 22 namespace AppExecFwk { 23 24 class INativeChildNotify : public IRemoteBroker { 25 public: 26 DECLARE_INTERFACE_DESCRIPTOR(u"ohos.appexecfwk.NativeChildNotify"); 27 28 /** 29 * Notify native child process started. 30 * 31 * @param nativeChild child process ipc object 32 */ 33 virtual void OnNativeChildStarted(const sptr<IRemoteObject> &nativeChild) = 0; 34 35 /** 36 * Notify native child process start failed. 37 * 38 * @param errCode failed error code 39 */ 40 virtual void OnError(int32_t errCode) = 0; 41 42 protected: 43 static constexpr uint32_t IPC_ID_ON_NATIVE_CHILD_STARTED = 0; 44 static constexpr uint32_t IPC_ID_ON_ERROR = 1; 45 }; 46 47 } // OHOS 48 } // AppExecFwk 49 50 #endif // OHOS_ABILITY_RUNTIME_NATIVE_CHILD_NOTIFY_INTERFACE_H