|
| 1 | +/* |
| 2 | + * If not stated otherwise in this file or this component's LICENSE file the |
| 3 | + * following copyright and licenses apply: |
| 4 | + * |
| 5 | + * Copyright 2025 RDK Management |
| 6 | + * |
| 7 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | + * you may not use this file except in compliance with the License. |
| 9 | + * You may obtain a copy of the License at |
| 10 | + * |
| 11 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | + * |
| 13 | + * Unless required by applicable law or agreed to in writing, software |
| 14 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | + * See the License for the specific language governing permissions and |
| 17 | + * limitations under the License. |
| 18 | + */ |
| 19 | + |
| 20 | +#pragma once |
| 21 | + |
| 22 | +#include "Module.h" |
| 23 | + |
| 24 | +// @stubgen:include <com/IIteratorType.h> |
| 25 | + |
| 26 | +namespace WPEFramework { |
| 27 | +namespace Exchange { |
| 28 | + |
| 29 | + |
| 30 | +// @json 1.0.0 @text:keep |
| 31 | +struct EXTERNAL IPreinstallManager : virtual public Core::IUnknown { |
| 32 | + enum { ID = ID_PREINSTALL_MANAGER }; |
| 33 | + |
| 34 | + enum PreinstallState : uint8_t { |
| 35 | + PREINSTALL_STATE_UNKNOWN = 0 /* @text PREINSTALL_STATE_UNKNOWN */, //required? |
| 36 | + PREINSTALL_STATE_INSTALLED = 1 /* @text PREINSTALL_STATE_INSTALLED */, |
| 37 | + PREINSTALL_STATE_INSTALL_FAILURE = 2 /* @text PREINSTALL_STATE_INSTALL_FAILURE */ |
| 38 | + }; |
| 39 | + |
| 40 | + enum PreinstallFailReason : uint8_t { |
| 41 | + PREINSTALL_FAIL_REASON_NONE = 0 /* @text PREINSTALL_FAIL_REASON_NONE */, |
| 42 | + PREINSTALL_FAIL_REASON_UNKNOWN = 1 /* @text PREINSTALL_FAIL_REASON_UNKNOWN */, |
| 43 | + PREINSTALL_FAIL_REASON_SIGNATURE_VERIFICATION_FAILURE = 2 /* @text PREINSTALL_FAIL_REASON_SIGNATURE_VERIFICATION_FAILURE */, |
| 44 | + PREINSTALL_FAIL_REASON_PERSISTENCE_FAILURE = 3 /* @text PREINSTALL_FAIL_REASON_PERSISTENCE_FAILURE */ |
| 45 | + }; |
| 46 | + |
| 47 | + |
| 48 | + // struct AppInstallInfo { |
| 49 | + // string packageId; |
| 50 | + // string version; |
| 51 | + // PreinstallState state; |
| 52 | + // PreinstallFailReason failReason; |
| 53 | + // }; |
| 54 | + |
| 55 | + |
| 56 | + // using IAppInstallInfoIterator = RPC::IIteratorType<AppInstallInfo, ID_PREINSTALL_MANAGER_INSTALL_INFO_ITERATOR>; |
| 57 | + |
| 58 | + // @event |
| 59 | + struct EXTERNAL INotification : virtual public Core::IUnknown { |
| 60 | + enum { ID = ID_PREINSTALL_MANAGER_NOTIFICATION }; |
| 61 | + |
| 62 | + |
| 63 | + // @text onAppInstallationStatus |
| 64 | + // @brief Emitted when the installation of a preinstalled app succeeds or fails. |
| 65 | + // @param appInstallInfoArray: Output installation status details as string object |
| 66 | + virtual void OnAppInstallationStatus(const string& appInstallInfoArray) {}; |
| 67 | + }; |
| 68 | + |
| 69 | + /** Register notification interface */ |
| 70 | + virtual Core::hresult Register(INotification *notification) = 0; |
| 71 | + /** Unregister notification interface */ |
| 72 | + virtual Core::hresult Unregister(INotification *notification) = 0; |
| 73 | + |
| 74 | + // @text startPreinstall |
| 75 | + // @brief Checks the preinstall directory for packages to be preinstalled and installs them as needed. |
| 76 | + // @param[in] forceInstall: If true always install the app; if false then install only if not installed or existing is older version |
| 77 | + // @return Core::ERROR_NONE on success, Core::ERROR_GENERAL on error. |
| 78 | + virtual Core::hresult StartPreinstall(bool forceInstall) = 0; |
| 79 | +}; |
| 80 | +} // namespace Exchange |
| 81 | +} // namespace WPEFramework |
0 commit comments