MCPcopy Create free account
hub / github.com/TactilityProject/Tactility / onStartAppMessage

Method onStartAppMessage

Tactility/Source/service/loader/Loader.cpp:46–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46void LoaderService::onStartAppMessage(const std::string& id, app::LaunchId launchId, std::shared_ptr<const Bundle> parameters) {
47 LOGGER.info("Start by id {}", id);
48
49 auto app_manifest = app::findAppManifestById(id);
50 if (app_manifest == nullptr) {
51 LOGGER.error("App not found: {}", id);
52 return;
53 }
54
55 auto lock = mutex.asScopedLock();
56 if (!lock.lock(LOADER_TIMEOUT)) {
57 LOGGER.error(LOG_MESSAGE_MUTEX_LOCK_FAILED);
58 return;
59 }
60
61 auto previous_app = !appStack.empty() ? appStack[appStack.size() - 1]: nullptr;
62 auto new_app = std::make_shared<app::AppInstance>(app_manifest, launchId, parameters);
63
64 new_app->mutableFlags().hideStatusbar = (app_manifest->appFlags & app::AppManifest::Flags::HideStatusBar);
65
66 // We might have to hide the previous app first
67 if (previous_app != nullptr) {
68 transitionAppToState(previous_app, app::State::Hiding);
69 }
70
71 appStack.push_back(new_app);
72 transitionAppToState(new_app, app::State::Created);
73 transitionAppToState(new_app, app::State::Showing);
74}
75
76void LoaderService::onStopTopAppMessage(const std::string& id) {
77 auto lock = mutex.asScopedLock();

Callers

nothing calls this directly

Calls 5

findAppManifestByIdFunction · 0.85
infoMethod · 0.80
errorMethod · 0.80
asScopedLockMethod · 0.80
lockMethod · 0.45

Tested by

no test coverage detected