Skip to content

Commit a36ad1b

Browse files
committed
RDKEMW-6787: [AI2.0] Create IPreInstallerManager interface
1 parent 9e68cdc commit a36ad1b

File tree

2 files changed

+116
-1
lines changed

2 files changed

+116
-1
lines changed

apis/Ids.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,11 @@ namespace Exchange {
296296
ID_MIRACAST_SERVICE_NOTIFICATION = ID_MIRACAST_SERVICE + 1,
297297
ID_MIRACAST_PLAYER = ID_MIRACAST_SERVICE + 2,
298298
ID_MIRACAST_PLAYER_NOTIFICATION = ID_MIRACAST_SERVICE + 3,
299-
ID_MIRACAST_PLAYER_ENV_ARGUMENTS_ITERATOR = ID_MIRACAST_SERVICE + 4
299+
ID_MIRACAST_PLAYER_ENV_ARGUMENTS_ITERATOR = ID_MIRACAST_SERVICE + 4,
300+
301+
ID_PREINSTALL_MANAGER = ID_ENTOS_OFFSET + 0x3E0,
302+
ID_PREINSTALL_MANAGER_NOTIFICATION = ID_PREINSTALL_MANAGER + 1,
303+
ID_PREINSTALL_MANAGER_INSTALL_INFO_ITERATOR = ID_PREINSTALL_MANAGER + 2,
300304
};
301305
}
302306
}
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
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+
#ifndef RUNTIME_CONFIG
30+
struct RuntimeConfig {
31+
bool dial;
32+
bool wanLanAccess;
33+
bool thunder;
34+
int32_t systemMemoryLimit;
35+
int32_t gpuMemoryLimit;
36+
std::string envVariables;
37+
uint32_t userId;
38+
uint32_t groupId;
39+
uint32_t dataImageSize;
40+
41+
bool resourceManagerClientEnabled;
42+
std::string dialId;
43+
std::string command;
44+
std::string appType;
45+
std::string appPath;
46+
std::string runtimePath;
47+
48+
std::string logFilePath;
49+
uint32_t logFileMaxSize;
50+
std::string logLevels; //json array of strings
51+
bool mapi;
52+
std::string fkpsFiles; //json array of strings
53+
54+
std::string fireboltVersion;
55+
bool enableDebugger;
56+
};
57+
#define RUNTIME_CONFIG
58+
#endif
59+
60+
// @json 1.0.0 @text:keep
61+
struct EXTERNAL IPreinstallManager : virtual public Core::IUnknown {
62+
enum { ID = ID_PREINSTALL_MANAGER };
63+
64+
enum PreinstallState : uint8_t {
65+
PREINSTALL_STATE_UNKNOWN = 0 /* @text PREINSTALL_STATE_UNKNOWN */, //required?
66+
PREINSTALL_STATE_INSTALLED = 1 /* @text PREINSTALL_STATE_INSTALLED */,
67+
PREINSTALL_STATE_INSTALL_FAILURE = 2 /* @text PREINSTALL_STATE_INSTALL_FAILURE */
68+
};
69+
70+
enum PreinstallFailReason : uint8_t {
71+
PREINSTALL_FAIL_REASON_NONE = 0 /* @text PREINSTALL_FAIL_REASON_NONE */,
72+
PREINSTALL_FAIL_REASON_UNKNOWN = 1 /* @text PREINSTALL_FAIL_REASON_UNKNOWN */,
73+
PREINSTALL_FAIL_REASON_SIGNATURE_VERIFICATION_FAILURE = 2 /* @text PREINSTALL_FAIL_REASON_SIGNATURE_VERIFICATION_FAILURE */,
74+
PREINSTALL_FAIL_REASON_PERSISTENCE_FAILURE = 3 /* @text PREINSTALL_FAIL_REASON_PERSISTENCE_FAILURE */
75+
};
76+
77+
78+
struct AppInstallInfo {
79+
string packageId;
80+
string version;
81+
PreinstallState state;
82+
PreinstallFailReason failReason;
83+
};
84+
85+
86+
// using IAppInstallInfoIterator = RPC::IIteratorType<AppInstallInfo, ID_PREINSTALL_MANAGER_INSTALL_INFO_ITERATOR>;
87+
88+
// @event
89+
struct EXTERNAL INotification : virtual public Core::IUnknown {
90+
enum { ID = ID_PREINSTALL_MANAGER_NOTIFICATION };
91+
92+
93+
// @text onAppInstallationStatus
94+
// @brief Emitted when the installation of a preinstalled app succeeds or fails.
95+
// @param appInstallInfoArray: Output installation status details as string object
96+
virtual void OnAppInstallationStatus(const string& jsonresponse) {};
97+
};
98+
99+
/** Register notification interface */
100+
virtual Core::hresult Register(INotification *notification) = 0;
101+
/** Unregister notification interface */
102+
virtual Core::hresult Unregister(INotification *notification) = 0;
103+
104+
// @text startPreinstall
105+
// @brief Checks the preinstall directory for packages to be preinstalled and installs them as needed.
106+
// @param[in] forceInstall: If true always install the app; if false then install only if not installed or existing is older version
107+
// @return Core::ERROR_NONE on success, Core::ERROR_GENERAL on error.
108+
virtual Core::hresult StartPreinstall(bool forceInstall) = 0;
109+
};
110+
} // namespace Exchange
111+
} // namespace WPEFramework

0 commit comments

Comments
 (0)