Remove explicit app closing function (#618)
This commit is contained in:
committed by
GitHub
parent
0ff1627385
commit
4fea48f433
@@ -217,7 +217,6 @@ int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
}
|
||||
switch (event.type) {
|
||||
case APP_EVENT_CLOSE:
|
||||
app_manager_finish(appInstanceId);
|
||||
shouldClose = true;
|
||||
break;
|
||||
case APP_EVENT_RESULT:
|
||||
|
||||
@@ -114,7 +114,6 @@ int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
break;
|
||||
}
|
||||
if (event.type == APP_EVENT_CLOSE) {
|
||||
app_manager_finish(appInstanceId); // no-op: modal children never supersede anything
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,7 +111,6 @@ int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
ctx.targetAppId = (argc > 0) ? argv[0] : std::string();
|
||||
if (app_manager_find_manifest(ctx.targetAppId.c_str(), &ctx.targetManifest) != ERROR_NONE) {
|
||||
LOG_W(TAG, "App %s not found", ctx.targetAppId.c_str());
|
||||
app_manager_finish(appInstanceId);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -129,14 +128,12 @@ int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
}
|
||||
switch (event.type) {
|
||||
case APP_EVENT_CLOSE:
|
||||
app_manager_finish(appInstanceId);
|
||||
shouldClose = true;
|
||||
break;
|
||||
case APP_EVENT_RESULT:
|
||||
if (event.result.launch_id == ctx.pendingUninstallDialogId) {
|
||||
if (event.result.result == 0) { // 0 = Yes
|
||||
app_uninstall(ctx.targetManifest.id);
|
||||
app_manager_finish(appInstanceId);
|
||||
shouldClose = true;
|
||||
}
|
||||
app_manager_stop(event.result.launch_id);
|
||||
|
||||
@@ -215,7 +215,6 @@ int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
}
|
||||
switch (event.type) {
|
||||
case APP_EVENT_CLOSE:
|
||||
app_manager_finish(appInstanceId);
|
||||
shouldClose = true;
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -244,7 +244,6 @@ int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
}
|
||||
switch (event.type) {
|
||||
case APP_EVENT_CLOSE:
|
||||
app_manager_finish(appInstanceId);
|
||||
shouldClose = true;
|
||||
break;
|
||||
case APP_EVENT_RESULT: {
|
||||
|
||||
@@ -93,7 +93,6 @@ int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
break;
|
||||
}
|
||||
if (event.type == APP_EVENT_CLOSE) {
|
||||
app_manager_finish(appInstanceId);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,7 +104,6 @@ int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
}
|
||||
switch (event.type) {
|
||||
case APP_EVENT_CLOSE:
|
||||
app_manager_finish(appInstanceId);
|
||||
shouldClose = true;
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -140,7 +140,6 @@ int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
}
|
||||
switch (event.type) {
|
||||
case APP_EVENT_CLOSE:
|
||||
app_manager_finish(appInstanceId);
|
||||
shouldClose = true;
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -229,7 +229,6 @@ int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
}
|
||||
switch (event.type) {
|
||||
case APP_EVENT_CLOSE:
|
||||
app_manager_finish(appInstanceId);
|
||||
shouldClose = true;
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -310,7 +310,6 @@ int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
break;
|
||||
}
|
||||
if (event.type == APP_EVENT_CLOSE) {
|
||||
app_manager_finish(appInstanceId);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -249,7 +249,6 @@ int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
}
|
||||
switch (event.type) {
|
||||
case APP_EVENT_CLOSE:
|
||||
app_manager_finish(appInstanceId);
|
||||
shouldClose = true;
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -213,7 +213,6 @@ int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
}
|
||||
switch (event.type) {
|
||||
case APP_EVENT_CLOSE:
|
||||
app_manager_finish(appInstanceId);
|
||||
shouldClose = true;
|
||||
break;
|
||||
case APP_EVENT_RESULT:
|
||||
@@ -226,7 +225,6 @@ int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
}
|
||||
}
|
||||
bluetooth::unpair(ctx.addr);
|
||||
app_manager_finish(appInstanceId);
|
||||
shouldClose = true;
|
||||
}
|
||||
app_manager_stop(event.result.launch_id);
|
||||
|
||||
@@ -199,7 +199,6 @@ int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
}
|
||||
switch (event.type) {
|
||||
case APP_EVENT_CLOSE:
|
||||
app_manager_finish(appInstanceId);
|
||||
shouldClose = true;
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -168,15 +168,12 @@ int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
}
|
||||
switch (event.type) {
|
||||
case APP_EVENT_CLOSE:
|
||||
app_manager_finish(appInstanceId);
|
||||
shouldClose = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
app_manager_finish(appInstanceId);
|
||||
}
|
||||
|
||||
window_manager_remove(window);
|
||||
|
||||
@@ -171,7 +171,6 @@ int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
LOG_E(TAG, "Service not found");
|
||||
// No window/subscription was ever created - matches the old model, where onCreate()
|
||||
// aborting the app meant onShow() was never called either.
|
||||
app_manager_finish(appInstanceId);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -204,7 +203,6 @@ int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
}
|
||||
switch (event.type) {
|
||||
case APP_EVENT_CLOSE:
|
||||
app_manager_finish(appInstanceId);
|
||||
shouldClose = true;
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -44,7 +44,6 @@ int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
}
|
||||
switch (event.type) {
|
||||
case APP_EVENT_CLOSE:
|
||||
app_manager_finish(appInstanceId);
|
||||
shouldClose = true;
|
||||
break;
|
||||
case APP_EVENT_RESULT:
|
||||
|
||||
@@ -74,7 +74,6 @@ int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
break;
|
||||
}
|
||||
if (event.type == APP_EVENT_CLOSE) {
|
||||
app_manager_finish(appInstanceId); // no-op: modal children never supersede anything
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -282,7 +282,6 @@ int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
}
|
||||
switch (event.type) {
|
||||
case APP_EVENT_CLOSE:
|
||||
app_manager_finish(appInstanceId);
|
||||
shouldClose = true;
|
||||
break;
|
||||
case APP_EVENT_RESULT:
|
||||
|
||||
@@ -107,7 +107,6 @@ int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
}
|
||||
switch (event.type) {
|
||||
case APP_EVENT_CLOSE:
|
||||
app_manager_finish(appInstanceId);
|
||||
shouldClose = true;
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -403,7 +403,6 @@ int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
switch (event.type) {
|
||||
case APP_EVENT_CLOSE:
|
||||
stopScanningIfRunning(&ctx);
|
||||
app_manager_finish(appInstanceId);
|
||||
shouldClose = true;
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -103,7 +103,6 @@ int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
}
|
||||
switch (event.type) {
|
||||
case APP_EVENT_CLOSE:
|
||||
app_manager_finish(appInstanceId);
|
||||
shouldClose = true;
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -123,7 +123,6 @@ int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
break;
|
||||
}
|
||||
if (event.type == APP_EVENT_CLOSE) {
|
||||
app_manager_finish(appInstanceId); // no-op: modal children never supersede anything
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -323,7 +323,6 @@ int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
switch (event.type) {
|
||||
case APP_EVENT_CLOSE:
|
||||
persistIfUpdated(ctx);
|
||||
app_manager_finish(appInstanceId);
|
||||
shouldClose = true;
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -224,7 +224,6 @@ int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
switch (event.type) {
|
||||
case APP_EVENT_CLOSE:
|
||||
persistIfUpdated(ctx);
|
||||
app_manager_finish(appInstanceId);
|
||||
shouldClose = true;
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -248,7 +248,6 @@ int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
break;
|
||||
}
|
||||
if (event.type == APP_EVENT_CLOSE) {
|
||||
app_manager_finish(appInstanceId);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,7 +159,6 @@ int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
}
|
||||
switch (event.type) {
|
||||
case APP_EVENT_CLOSE:
|
||||
app_manager_finish(appInstanceId);
|
||||
shouldClose = true;
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -204,7 +204,6 @@ int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
}
|
||||
switch (event.type) {
|
||||
case APP_EVENT_CLOSE:
|
||||
app_manager_finish(appInstanceId);
|
||||
shouldClose = true;
|
||||
break;
|
||||
case APP_EVENT_RESULT:
|
||||
|
||||
@@ -255,7 +255,6 @@ int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
}
|
||||
switch (event.type) {
|
||||
case APP_EVENT_CLOSE:
|
||||
app_manager_finish(appInstanceId);
|
||||
shouldClose = true;
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -150,7 +150,6 @@ int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
}
|
||||
switch (event.type) {
|
||||
case APP_EVENT_CLOSE:
|
||||
app_manager_finish(appInstanceId);
|
||||
shouldClose = true;
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -264,7 +264,6 @@ int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
}
|
||||
switch (event.type) {
|
||||
case APP_EVENT_CLOSE:
|
||||
app_manager_finish(appInstanceId);
|
||||
shouldClose = true;
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -116,7 +116,6 @@ int32_t appMain(AppInstanceId appInstanceId, int argc, char* argv[]) {
|
||||
break;
|
||||
}
|
||||
if (event.type == APP_EVENT_CLOSE) {
|
||||
app_manager_finish(appInstanceId); // no-op: modal children never supersede anything
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,7 +91,6 @@ int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
break;
|
||||
}
|
||||
if (event.type == APP_EVENT_CLOSE) {
|
||||
app_manager_finish(appInstanceId);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -157,9 +157,9 @@ void onContinueClicked(lv_event_t* event) {
|
||||
break;
|
||||
case Phase::Done: {
|
||||
markCompleted();
|
||||
// Async, non-blocking - must NOT call app_manager_stop()/app_manager_finish()
|
||||
// directly here: this callback runs ON the LVGL task, and app-lifecycle
|
||||
// transitions must happen on this app's own thread (woken via app_event_await()).
|
||||
// Async, non-blocking - must NOT call app_manager_stop() directly here: this
|
||||
// callback runs ON the LVGL task, and app-lifecycle transitions must happen on this
|
||||
// app's own thread (woken via app_event_await()), which closes by returning.
|
||||
AppEvent closeEvent { .type = APP_EVENT_CLOSE, .timestamp = 0, .result = {} };
|
||||
app_event_emit(ctx->appInstanceId, &closeEvent);
|
||||
break;
|
||||
@@ -243,7 +243,6 @@ int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
}
|
||||
switch (event.type) {
|
||||
case APP_EVENT_CLOSE:
|
||||
app_manager_finish(appInstanceId);
|
||||
shouldClose = true;
|
||||
break;
|
||||
case APP_EVENT_RESULT:
|
||||
|
||||
@@ -433,7 +433,6 @@ int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
}
|
||||
switch (event.type) {
|
||||
case APP_EVENT_CLOSE:
|
||||
app_manager_finish(appInstanceId);
|
||||
shouldClose = true;
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -171,7 +171,6 @@ int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
}
|
||||
switch (event.type) {
|
||||
case APP_EVENT_CLOSE:
|
||||
app_manager_finish(appInstanceId);
|
||||
shouldClose = true;
|
||||
break;
|
||||
case APP_EVENT_RESULT:
|
||||
|
||||
@@ -253,7 +253,6 @@ int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
break;
|
||||
}
|
||||
if (event.type == APP_EVENT_CLOSE) {
|
||||
app_manager_finish(appInstanceId); // no-op: modal children never supersede anything
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,10 +172,10 @@ void onPress(lv_event_t* event) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Async, non-blocking - must NOT call app_manager_stop()/app_manager_finish() directly
|
||||
// here: this callback runs ON the LVGL task, and app-lifecycle transitions must happen on
|
||||
// this app's own thread (woken up via app_event_await() below). The result (Ok/Error) is
|
||||
// reported by appMain() itself when it returns, based on ctx.calibrationApplied.
|
||||
// Async, non-blocking - must NOT call app_manager_stop() directly here: this callback runs
|
||||
// ON the LVGL task, and app-lifecycle transitions must happen on this app's own thread
|
||||
// (woken up via app_event_await() below), which closes by returning. The result (Ok/Error)
|
||||
// is reported by appMain() itself when it returns, based on ctx.calibrationApplied.
|
||||
AppEvent closeEvent { .type = APP_EVENT_CLOSE, .timestamp = 0, .result = {} };
|
||||
app_event_emit(ctx->appInstanceId, &closeEvent);
|
||||
}
|
||||
@@ -247,7 +247,6 @@ int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
}
|
||||
switch (event.type) {
|
||||
case APP_EVENT_CLOSE:
|
||||
app_manager_finish(appInstanceId);
|
||||
shouldClose = true;
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -287,7 +287,6 @@ int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
switch (event.type) {
|
||||
case APP_EVENT_CLOSE:
|
||||
persistIfUpdated(ctx);
|
||||
app_manager_finish(appInstanceId);
|
||||
shouldClose = true;
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -99,7 +99,6 @@ int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
}
|
||||
switch (event.type) {
|
||||
case APP_EVENT_CLOSE:
|
||||
app_manager_finish(appInstanceId);
|
||||
shouldClose = true;
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -376,7 +376,6 @@ int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
}
|
||||
switch (event.type) {
|
||||
case APP_EVENT_CLOSE:
|
||||
app_manager_finish(appInstanceId);
|
||||
shouldClose = true;
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -228,7 +228,6 @@ int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
}
|
||||
switch (event.type) {
|
||||
case APP_EVENT_CLOSE:
|
||||
app_manager_finish(appInstanceId);
|
||||
shouldClose = true;
|
||||
break;
|
||||
case APP_EVENT_RESULT:
|
||||
@@ -243,7 +242,6 @@ int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
) {
|
||||
service::wifi::disconnect();
|
||||
}
|
||||
app_manager_finish(appInstanceId);
|
||||
shouldClose = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -334,7 +334,6 @@ int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
}
|
||||
switch (event.type) {
|
||||
case APP_EVENT_CLOSE:
|
||||
app_manager_finish(appInstanceId);
|
||||
shouldClose = true;
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -160,7 +160,6 @@ int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
}
|
||||
switch (event.type) {
|
||||
case APP_EVENT_CLOSE:
|
||||
app_manager_finish(appInstanceId);
|
||||
shouldClose = true;
|
||||
break;
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user