summaryrefslogtreecommitdiffstats
path: root/src/manager-lib
Commit message (Collapse)AuthorAgeFilesLines
* dbus: do not silently ignore invalid parametersHEADdevRobert Griebl6 days2-1/+15
| | | | | | | | | | | | | Requesting to stop an application with an unknown id would just result in the appman-controller exiting with code '0', instead of complaining. This patch fixes all those cases, where an invalid id parameter or even a missing installer sub-system would silently be accepted on a DBus call. Change-Id: I1ffc8cec970a79c23fde82c7523b2a69519a5583 Pick-to: 6.10 Reviewed-by: Dominik Holland <[email protected]>
* Add identifiers to both the Runtime and Container objectsRobert Griebl2025-07-244-1/+46
| | | | | | | | | | | This makes it possible to detect the current runtime environment for an app at runtime. Also added the missing documentation for hasDebugWrapper Change-Id: If6646d4e5985c12e42cc8a9e769fa5b8d8745322 Pick-to: 6.10 Reviewed-by: Dominik Holland <[email protected]>
* Write the installation-report into its own folderDominik Holland2025-07-112-4/+29
| | | | | Change-Id: Ie31346041346cae368c9ce29977ed321e64d7cdc Reviewed-by: Robert Griebl <[email protected]>
* Move the temporary dir used for installations into the apps dirRobert Griebl2025-07-111-2/+3
| | | | | | | | When using extended security attributes, some may not survive the cross-filesystem move from /tmp to the final location. Change-Id: I2bacf844b56b6fa4f5bbc86b96a19bb5129ad09d Reviewed-by: Dominik Holland <[email protected]>
* Move info.yaml and appIcon during installation instead of copying itDominik Holland2025-07-111-2/+2
| | | | | | | This will preserve the extended attributes set on the files. Change-Id: I623f8b8494040cd6a9e18220b606bf340558006b Reviewed-by: Robert Griebl <[email protected]>
* Add an option to package up and install extended file attributesRobert Griebl2025-07-113-0/+45
| | | | | | | | | | | | Just run the packager with the additonal option --include-extended-attributes As for libarchive: we have to switch from the plain "ustar" to the "restricted-pax" (aka "bsdtar") format, which is actually just "ustar" plus xattr support. Change-Id: I07f77abb491cbd515689c986c59253b4d0244555 Reviewed-by: Dominik Holland <[email protected]>
* Sudo: enforce singleton instantiation and cleanupRobert Griebl2025-07-118-25/+35
| | | | | | | | | | | | | We already have the fallback (non-root) implementation for Sudo, so it does make sense to always have a SudoClient instance available, which simplifies the code using it. This also made it possible to get rid of the magic removeRecursiveHelper function and call into SudoClient explicitly where needed. Change-Id: I48ad48edb35e5ddca2c8b171649d5d785e1b3f14 Pick-to: 6.10 Reviewed-by: Dominik Holland <[email protected]>
* bwrap: move the DBus and Wayland socket parsing to ContainerHelpersRobert Griebl2025-06-062-0/+29
| | | | | | | | | We had to bump the plugin iid for the stop() change, so now's the perfect time to extend the Helpers API. Change-Id: I3070bbb12c721027594d629311f67890c6924696 Pick-to: 6.10 Reviewed-by: Dominik Holland <[email protected]>
* Make watchdog kills use a distinct Unix signal and ExitStatusRobert Griebl2025-06-0615-79/+127
| | | | | | | | | | | | | By raising an otherwise unused system signal (*), the System UI can now distinguish between crashes, forced kills from the sys-ui and also kills by the watchdog. (*) SIGSTKFLT on Linux x86 and ARM and SIGEMT on Linux MIPS, BSD and QNX. Change-Id: I5cdb9084c1f822c36d24cbb0905479e18a3f1b69 Pick-to: 6.10 Reviewed-by: Dominik Holland <[email protected]>
* Use the incubator to load in-process QML applicationsRobert Griebl2025-06-052-61/+167
| | | | | | | | | | | | This helps with Qt's event loop being blocked when huge in-process applications are first loaded. (The incubator API has no way to be notified on completion, so we have to "poll" the status) Change-Id: I2272ab68830670df087b848c01c288d380b2189c Pick-to: 6.10 Reviewed-by: Dominik Holland <[email protected]>
* Mark security critical files according to QUIP 23Zoltan Gera2025-05-155-1/+5
| | | | | | | Fixes: QTBUG-135747 Pick-to: 6.9 6.8 Change-Id: I3254d2607b6c80d3fec003263a91f0cee4dd69c6 Reviewed-by: Robert Griebl <[email protected]>
* Tests: stabilize tst_applicationmanagerRobert Griebl2025-02-281-0/+1
| | | | | | Change-Id: I272342df895be33983af459497f195c920e3022d Pick-to: 6.9 6.8 Reviewed-by: Dominik Holland <[email protected]>
* Consistent debug outputRobert Griebl2025-02-241-3/+4
| | | | | | Change-Id: I91ca88ccb6863d883bbc0b7a04ea3b633365c434 Pick-to: 6.9 6.8 Reviewed-by: Dominik Holland <[email protected]>
* Consistent, easy to read debug output on application startRobert Griebl2025-02-171-2/+6
| | | | | | Pick-to: 6.9 Change-Id: Ib008c548c0d6dc04123ae62ab509ba23879fde0c Reviewed-by: Dominik Holland <[email protected]>
* Fix ProcessContainer::setControlGroup not working with cgroups v2Robert Griebl2025-02-173-6/+37
| | | | | | | | | | | cgroups v1 are mostly obsolete by now. Moving processes into v2 cgroups is quite similar to v1, but the whole controller mapping is not needed anymore. Support for v1 will be removed in a future AppMan release. Change-Id: I53e46823bba04b736b7607c23a5a79706bd178ca Pick-to: 6.8 6.9 Reviewed-by: Dominik Holland <[email protected]>
* Adapt to QtWaylandCompositor behavior changes in 6.9+Robert Griebl2025-02-096-69/+99
| | | | | | | | | | | | Hidden windows are now behaving as in Qt 5.8 back in the day, as well as in any other toolkit or Qt's own other platform plugins: the Wayland surface stays alive, but a null buffer is attached to it. Closing or destroying windows still kills the Wayland surface though. Change-Id: I816a319ace7027af4886a3009794729eb1776092 Pick-to: 6.9 Reviewed-by: Dominik Holland <[email protected]>
* Fix deprecation of filter model invalidationZoltan Gera2025-01-272-0/+14
| | | | | | | Fixes: QTBUG-133208 Change-Id: I4f25ef3ae0804d11fa7ad4165f66117236b599db Pick-to: 6.9 Reviewed-by: Robert Griebl <[email protected]>
* Fix more compilation issues with Qt 6.10 (nodiscard)Volker Hilsheimer2025-01-091-1/+2
| | | | | | | | | Amends ba88f9e584f2ff593c680024ca25d85434be2c53. Fixes: QTBUG-132693 Pick-to: 6.9 6.8 Change-Id: I988ba476ec5d51c019047b2eab1c9a03459c4d0b Reviewed-by: Robert Griebl <[email protected]>
* Make application stop behavior deterministicRobert Griebl2024-12-022-5/+9
| | | | | | | | | | | | | | | | | App::stop() will now make sure that the app is really stopped after the configurable "quitTime" timeout via SIGKILL. Before this change the AM would only send a SIGTERM, but this signal can be blocked, which rendered the stop(false) method unusable in many scenarios. Also extended this behavior for non-QML native applications: they are still sent a SIGTERM as before, but now sending SIGKILL after "quitTime" also applies here. (The auto-test needed more tweaks than expected to accept a 3rd app) Change-Id: I76b3c59073b7e91ec6acd798ed22b7da585881ae Pick-to: 6.8 Reviewed-by: Dominik Holland <[email protected]>
* Disable watchdog when a debug-wrapper is usedRobert Griebl2024-12-026-4/+22
| | | | | | | | | | There might be debug-wrappers that don't interfere with the watchdog, but for most of the debug use cases, disabling the watchdog completely is the better solution. Change-Id: I2d9ce1da1be0b06631091aa46ce793ddb7d7a0b5 Pick-to: 6.8 Reviewed-by: Dominik Holland <[email protected]>
* 6.9 cleanup commitRobert Griebl2024-12-012-7/+1
| | | | | | | | | | | - bumped the minimum Qt version to 6.8 (latest LTS) - went through and fixed all TODO comments for 6.9 work - removed deprecated functions slated for removal in 6.9 - due to the growing number of deprecated command-line options, their handling is now unified and removed from --help Change-Id: I1fad746beab6d62e0a37161f5c18179c6fc90a56 Reviewed-by: Bernd Weimer <[email protected]>
* Fix icon handling for installable packagesRobert Griebl2024-11-281-7/+9
| | | | | | | | | | | | | | | | | | | | | * The package format documentation and code had drifted apart over time and did not match very well. Mostly fixed the code to behave as documented, but relaxed the (documented) requirement that every package must have an icon. * Also clarified the difference between package and app/intent icons. * Most crucially, the packager did not check that the package's icon cannot be in a sub-directory, which led to broken packages in case the icon was put in a sub-directory. * Added unit new tests to prevent future regressions. * Increased the icon size limit from 256KB to 1MB while at it. Change-Id: I8b789f47330c1bf7c2e8a76ecd2c49a5bbf29412 Pick-to: 6.8 Reviewed-by: Dominik Holland <[email protected]>
* Doc: fix import version and improve MonitorModel and friendsRobert Griebl2024-11-191-21/+20
| | | | | | Change-Id: I44c772234d86d187bf6c8f93ab7fb72a6b2c2572 Pick-to: 6.8 Reviewed-by: Bernd Weimer <[email protected]>
* Do not compile the build directory into the appman binaryRobert Griebl2024-10-301-2/+0
| | | | | | | | | | | | | This was a hack to make it possible to always use the freshly compiled runtimes, when building against a installed Qt, but without installing the AM itself into the Qt directory. Because we already put the appman's binary directory in the search path, even this niche use-case does still work. Change-Id: Ia53b89d2fa7f77ac96eb17f9493e9dbd2569baaa Pick-to: 6.8 Fixes: QTBUG-130117 Reviewed-by: Dominik Holland <[email protected]>
* Crash handler: use our thread-safe strsignal wrapper everywhereRobert Griebl2024-10-291-1/+2
| | | | | | Pick-to: 6.8 Change-Id: Ia815b734d6d65a516043dfbb3fc660ae6d7cedb9 Reviewed-by: Dominik Holland <[email protected]>
* Fix crashing quick launcher not reporting the fatal Unix signalRobert Griebl2024-10-241-1/+1
| | | | | | Change-Id: I36d0557eb45c8c2a0d0b2452bd8e33607442649f Pick-to: 6.8 Reviewed-by: Bernd Weimer <[email protected]>
* Prevent recursion on emission of aboutToBe... signalsRobert Griebl2024-10-247-9/+45
| | | | | | Change-Id: I449deb978fb1b72ff21c168fc8be2ea72a499d0c Pick-to: 6.8 Reviewed-by: Dominik Holland <[email protected]>
* CMake: Use relative paths for the dbus interfacesUlf Hermann2024-09-251-3/+3
| | | | | | | | CMAKE_SOURCE_DIR is not the "qtapplicationmanager" dir in a toplevel build. Change-Id: I18885caf0d97bec129db285d9263d82d29e63aab Reviewed-by: Robert Griebl <[email protected]>
* Fix the description model role documentation and availabilityRobert Griebl2024-09-122-0/+16
| | | | | | | | | ApplicationManager, PackageManager and IntentServer have very similar APIs, but the description role was somehow not in sync. Change-Id: Iddc9290ade4e47b7b105edd9dc140e7dd3282a17 Pick-to: 6.8.0 6.8 Reviewed-by: Dominik Holland <[email protected]>
* Cleanup runtime registration and debug outputRobert Griebl2024-09-108-30/+12
| | | | | | | | | | | The old debug output on app start was confusing for in-process apps. In addition the weird static defaultIdentifier() setup was scrapped. Also found an old in-process runtime fallback mechanism that doesn't make sense anymore nowadays. Change-Id: I706f37223115061533a090b03909603d28ec5c53 Pick-to: 6.8 Reviewed-by: Dominik Holland <[email protected]>
* Fix Axivion style violationsRobert Griebl2024-06-182-12/+13
| | | | | | Pick-to: 6.8 Change-Id: Idd59f26b3bccd58deae697d81627b99ef2c0d835 Reviewed-by: Dominik Holland <[email protected]>
* Watchdog: enable the watchdog for QML applications in MP modeRobert Griebl2024-06-181-0/+8
| | | | | | Change-Id: I1dbfa1d4ff947cc665dcc7fa9dbf47c55b2596e9 Pick-to: 6.8 Reviewed-by: Dominik Holland <[email protected]>
* Simplify the global configuration for all runtimesRobert Griebl2024-06-189-87/+58
| | | | | | | | | | | | Instead of dragging every bit of configuration through the factory -> managers -> runtimes chain, we now keep it in a global singleton. The old system just didn't scale when adding new bits of config, like the WatchdogConfiguration. Pick-to: 6.8 Change-Id: Ic1389c890333910cdaee284de1fa9880c62e444a Reviewed-by: Dominik Holland <[email protected]>
* Code cleanupRobert Griebl2024-06-181-3/+0
| | | | | | Pick-to: 6.8 Change-Id: Ib27a266a036830c0439457317ea7d538dd415d47 Reviewed-by: Dominik Holland <[email protected]>
* Fix data-race on taskRequestingInstallationAcknowledge parameterRobert Griebl2024-06-111-22/+26
| | | | | | | | | | | | | | The backing PackageInfo* for the 'package' parameter was modified in the installation thread (setBaseDir), AFTER the signal was emitted on the UI thread and QML was able to access the baseDir property. The idea of using a temporary Package object for that signal emission was not a wise choice, but we cannot easily change that now without breaking the QML API for PackageManager. Change-Id: Ib042292e11b42a89263360e501fe7eb90a4ca765 Pick-to: 6.8 6.7 6.5 6.2 5.15 Reviewed-by: Dominik Holland <[email protected]>
* Don't use DLT settings or command line arguments if DLT isn't availableRobert Griebl2024-06-111-5/+7
| | | | | | Change-Id: Ib06e0e3b85822a2737cc0a499b9e9f4e81cf09d8 Pick-to: 6.8 Reviewed-by: Dominik Holland <[email protected]>
* Clean up the NotificationManager public APIRobert Griebl2024-06-013-51/+65
| | | | | | | | | | | | | Removed the (internal) D-Bus API from the public QML API: - moved D-Bus specific functionality directly into the adapter - removed the "slot" designator from functions - used an "internalSignals" wrapper just like in ApplicationManager Also fixed the missing documentation for the 3 public signals: the docs are a copy of the correpsonding doc in ApplicationManager Change-Id: I91f9eb453a8ba332fe58296db6f9352374859058 Reviewed-by: Dominik Holland <[email protected]>
* Improve NotifcationManagerBernd Weimer2024-05-312-46/+92
| | | | | | | | | | | - Added "created" and "updated" properties - Added "actionList" property, that allows easier access to actionId and actionText compared to the "actions" property Task-number: QTBUG-118693 Fixes: QTBUG-118550 Change-Id: Ia4d2f1523f42f5c043fa3dd83f20b0bcce159271 Reviewed-by: Robert Griebl <[email protected]>
* Remove the deprecated installationLocations configurationRobert Griebl2024-05-291-1/+0
| | | | | | | | | | The support for multiple installation destinations was removed in 5.14 and the configuration field was deprecated back then (trying to map old configurations to the new single installation dir setup). It's time to remove that workaround now after 5 years. Change-Id: I1913c5bb97abd16a1d514bca871335e4309a06aa Reviewed-by: Dominik Holland <[email protected]>
* Refactor the representation of the YAML configurationRobert Griebl2024-05-299-17/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a bit of a kitchen sink commit for a lot of things touching the YAML parsing code. Splitting it up would have been a nightmare though and touched a lot of code lines multiple times. - Adding a new field to the YAML confguration was quite involved: 1) add it to the parser in loadFromSource() 2) add it to loadFromCache() 3) add it to saveToCache() (same order as in step 2) 4) add it to merge() 5) bump dataStreamVersion() 6) add one or more public getter function(s) to Configuration, depending on the complexity of the data-type. In order to get around this problem, a lot of fields just used an un-typed QVariantMap. This patch eliminates step 3) and 6) loadFromCache() and saveToCache() now use a common serialize() function and some template magic to do both tasks. - The YAML file is now mostly resembled by a publicly accessible nested struct of structs: this makes the code (a) more readable (as the C++ code matches the YAML structure) and (b) does away with the gazillions of getters. - This was also the perfect time to finally use a real data structure for the OpenGL config, replacing the QVariantMap hack. - While at it, the actual field parsing was made a lot more readble: - got rid of the unnecessary YamlParse* lambda arguments - added helper parseFoo() functions to make code more concise - used the same parseFields(<temp list>) syntax everywhere - added specialized parsing for time duration values Change-Id: Ia811056f7220bf7509af146f69f99c6f7e4b09ea Reviewed-by: Dominik Holland <[email protected]>
* Warn users about wrongly instantiating QML typesRobert Griebl2024-05-2311-41/+61
| | | | | | | | | | | | | Technically we cannot hide SystemUI types in an Application context and vice versa in single-process mode. To make matters worse, we also cannot reasonably check each invocation of a function or property accessor for singletons. But we CAN at least make sure that the instantiatable types are not instantiated in the wrong context. Change-Id: I44ea14f59578f1b3e5230ccfb52e0358896d3d37 Reviewed-by: Dominik Holland <[email protected]>
* Use existing functionality in Qt instead of a custom implementationRobert Griebl2024-05-232-4/+4
| | | | | Change-Id: Ia9ca910576836a5f67ed91e1e9c7a482bc4af72e Reviewed-by: Bernd Weimer <[email protected]>
* Remove our #pragma once workaround, as it is not needed anymoreRobert Griebl2024-05-151-3/+0
| | | | | | Change-Id: Ic8c6e2fe8aa97d7b04b02579b68c368b0115adaf Pick-to: 6.7 Reviewed-by: Dominik Holland <[email protected]>
* Remove all literal uses of /tmpRobert Griebl2024-05-151-3/+10
| | | | | | | | | | | | | - In am-configs, use QStandardPaths to avoid creating a mess in the filesystem on Windows. - In the C++ code, we really should be using $XDG_RUNTIME_DIR on Linux nowadays. While at it, the /tmp (and /run) subdirectories used by the appman have been harmonized and made less cryptic. Change-Id: Iab71aff81333653fb12bcecd3e94767b64f2c818 Reviewed-by: Dominik Holland <[email protected]>
* Refactor the ApplicationInterface root context propertyRobert Griebl2024-05-147-31/+58
| | | | | | | | | | | | | | | | In order to support full QML tooling, the root context property had to go. It is now replaced by a QML attached type of the same name, which for all intents and purposes acts exactly like the old root context property. There's a big difference implementation wise though: we can now have multiple ApplicationInterface objects, but their internal ApplicationInterfaceImpl objects point to the actual per-application data. Fixes: QTBUG-118426 Change-Id: I784eec946ab26e50df1d76364f5dc842bc1b3bed Reviewed-by: Dominik Holland <[email protected]>
* Fix D-Bus marshalling for taskRequestingInstallationAcknowledgeRobert Griebl2024-05-022-8/+19
| | | | | | | | | | | | | | | When a new package was installed, the D-Bus marshalling code for the signal tried to serialize the contained applications' metadata via the ids, but at that point, the ids are not known to the ApplicationManager yet. Instead we now do the same as in the PackageManager class: add a function that can serialize an Application * (that doesn't need to be known to the ApplicationManager). Change-Id: I5989c1e1d449d38d634fd00e7ed33bf66e9430a3 Pick-to: 6.7 6.6 6.5 6.2 5.15 Reviewed-by: Bernd Weimer <[email protected]>
* Replace all signals/slots keywords with Q_SIGNALS/Q_SLOTSRobert Griebl2024-04-2219-34/+34
| | | | | Change-Id: I92238b01155a2e43b8877576faf603957dcb95ba Reviewed-by: Bernd Weimer <[email protected]>
* Fix application quit behavior in single-process modeRobert Griebl2024-03-181-5/+30
| | | | | | | | | | | | | | Single-process mode QML applications had the finish() callback invoked twice, if a fade-out animation was running on a window. While at it, fixed the 'kill' stop flag to be more in line with the multi-process case and also updated the debug output on application stop to the newer, more readable style used by the native runtime. Change-Id: Iee44526d95b1416b213b897fb2b0542d2535c5e7 Fixes: QTBUG-123420 Pick-to: 6.7 6.6 Reviewed-by: Bernd Weimer <[email protected]>
* QVariants from QML often have QJSValues, which cannot be serializedRobert Griebl2024-03-181-3/+5
| | | | | | | | | | | | | Using anything more complex than a plain string or int for window properties stopped working with Qt 6, as those QJSValues cannot be serialized via QDataStream << anymore. Most QJSValues inside QVariant however can easily be converted to C++ datatypes inside QVariant, so we do that. Change-Id: Iacbc4331d1b5dee514b421db274288df7224f902 Pick-to: 6.7 6.6 6.5 Reviewed-by: Bernd Weimer <[email protected]>
* Rename the oddly named QVariant converter function for DBusRobert Griebl2024-03-182-5/+5
| | | | | | | | | | | | We need to tweak arbitrary QVariants for transmission via DBus, as some types are not serializable. The converter functions are only suitable for this use case, so name them "fromDBus" / "toDBus". (this needs cherry-picking because of the follow-up patch) Change-Id: Ia809242e175c20f236e6ab2b4268826650821d50 Pick-to: 6.7 6.6 6.5 Reviewed-by: Bernd Weimer <[email protected]>