Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Commit

Permalink
Battery Info > About from FAP -1.4kb DFU
Browse files Browse the repository at this point in the history
  • Loading branch information
Willy-JL committed Feb 14, 2024
1 parent 216baf1 commit 20d898a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
1 change: 0 additions & 1 deletion applications/settings/power_settings_app/about.c

This file was deleted.

24 changes: 22 additions & 2 deletions applications/settings/power_settings_app/power_settings_app.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "power_settings_app.h"
#include <applications/settings/about/about.h>
#include <flipper_application/flipper_application.h>
#include <loader/firmware_api/firmware_api.h>

static bool power_settings_custom_event_callback(void* context, uint32_t event) {
furi_assert(context);
Expand Down Expand Up @@ -112,7 +113,26 @@ int32_t power_settings_app(void* p) {
view_dispatcher_run(app->view_dispatcher);
if(app->battery_info->exit_to_about) {
app->battery_info->exit_to_about = false;
if(about_settings_app("about_battery")) {

bool stay = false;
FlipperApplication* fap = flipper_application_alloc(
furi_record_open(RECORD_STORAGE), firmware_api_interface);
do {
FlipperApplicationPreloadStatus preload_res =
flipper_application_preload(fap, EXT_PATH("apps/assets/about.fap"));
if(preload_res != FlipperApplicationPreloadStatusSuccess) break;
FlipperApplicationLoadStatus load_status = flipper_application_map_to_memory(fap);
if(load_status != FlipperApplicationLoadStatusSuccess) break;
FuriThread* thread = flipper_application_alloc_thread(fap, NULL);
furi_thread_set_appid(thread, "about");
furi_thread_start(thread);
furi_thread_join(thread);
if(furi_thread_get_return_code(thread) == 1) stay = true;
} while(0);
flipper_application_free(fap);
furi_record_close(RECORD_STORAGE);

if(stay) {
scene_manager_next_scene(app->scene_manager, first_scene);
continue;
}
Expand Down

0 comments on commit 20d898a

Please sign in to comment.