1 /* 2 * Copyright (c) 2025 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 STREAM_INSTALLER_MANAGER_H 17 #define STREAM_INSTALLER_MANAGER_H 18 19 #include "stream_installer_manager_helper.h" 20 #include "macros_updater.h" 21 #include "stream_status_manager.h" 22 23 namespace OHOS { 24 namespace SysInstaller { 25 class StreamInstallerManager { 26 DISALLOW_COPY_MOVE(StreamInstallerManager); 27 public: 28 void RegisterDump(std::unique_ptr<StreamInstallerManagerHelper> ptr); 29 static StreamInstallerManager &GetInstance(); 30 31 virtual int32_t SysInstallerInit(); 32 virtual int32_t StartStreamUpdate(); 33 virtual int32_t StopStreamUpdate(); 34 virtual int32_t ProcessStreamData(const uint8_t *buffer, uint32_t size); 35 virtual int32_t SetUpdateCallback(const sptr<ISysInstallerCallback> &updateCallback); 36 virtual int32_t GetUpdateStatus(); 37 38 protected: 39 std::unique_ptr<StreamInstallerManagerHelper> helper_ {}; 40 41 private: 42 StreamInstallerManager() = default; 43 ~StreamInstallerManager() = default; 44 }; 45 } // SysInstaller 46 } // namespace OHOS 47 #endif // SYS_INSTALLER_MANAGER_HELPER_H 48