1 /* 2 * Copyright (c) 2022 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_ATOMIC_SERVICE_STATUS_CALLBACK_INTERFACE_H 17 #define OHOS_ABILITY_RUNTIME_ATOMIC_SERVICE_STATUS_CALLBACK_INTERFACE_H 18 19 #include <iremote_broker.h> 20 21 #include "ability_info.h" 22 #include "element_name.h" 23 #include "want.h" 24 25 namespace OHOS { 26 namespace AAFwk { 27 /** 28 * @class IAtomicServiceStatusCallback 29 * IAtomicServiceStatusCallback is used to notify caller ability that free install is complete. 30 */ 31 class IAtomicServiceStatusCallback : public IRemoteBroker { 32 public: 33 DECLARE_INTERFACE_DESCRIPTOR(u"ohos.IAtomicServiceStatusCallback"); 34 35 /** 36 * OnInstallFinished, FreeInstall is complete. 37 * 38 * @param resultCode, ERR_OK on success, others on failure. 39 * @param want, installed ability. 40 * @param userId, user`s id. 41 */ 42 virtual void OnInstallFinished(int resultCode, const Want &want, int32_t userId) = 0; 43 44 /** 45 * OnRemoteInstallFinished, DMS has finished. 46 * 47 * @param resultCode, ERR_OK on success, others on failure. 48 * @param want, installed ability. 49 * @param userId, user`s id. 50 */ 51 virtual void OnRemoteInstallFinished(int resultCode, const Want &want, int32_t userId) = 0; 52 53 protected: 54 enum IAtomicServiceStatusCallbackCmd { 55 ON_FREE_INSTALL_DONE = 0, 56 ON_REMOTE_FREE_INSTALL_DONE, 57 CMD_MAX, 58 }; 59 }; 60 } // namespace AAFwk 61 } // namespace OHOS 62 #endif // OHOS_ABILITY_RUNTIME_ATOMIC_SERVICE_STATUS_CALLBACK_INTERFACE_H 63