Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FL-3055] Getter for application data path #2181

Merged
merged 53 commits into from
Mar 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
2d3a62b
Threads: application id
DrZlo13 Dec 22, 2022
9cbf3f2
Unit tests: appsdata getter test
DrZlo13 Dec 22, 2022
6e180c2
Unit tests: moar test cases for appsdata getter
DrZlo13 Dec 23, 2022
9d22f31
typo
DrZlo13 Dec 23, 2022
5e54cd4
Merge branch 'dev' into zlo/3055-applications-data
DrZlo13 Feb 8, 2023
0e1d060
Update api_symbols
DrZlo13 Feb 8, 2023
307de71
Merge branch 'dev' into zlo/3055-applications-data
DrZlo13 Feb 9, 2023
72e8d03
bump api
DrZlo13 Feb 9, 2023
949c56b
Unit tests: remove folders after test
DrZlo13 Feb 9, 2023
19d5d15
Music Player: use apps_data
DrZlo13 Feb 9, 2023
3083411
HID Bt: use apps_data path
DrZlo13 Feb 9, 2023
fa21161
Picopass: use apps_data path
DrZlo13 Feb 9, 2023
8b46af2
Toolbox: path_helper
DrZlo13 Feb 14, 2023
11a8093
Storage, apps_data getter: allow NULL output arg
DrZlo13 Feb 14, 2023
6d011fc
spi_mem_manager: use apps_data folder
DrZlo13 Feb 14, 2023
0cfb51d
Music player, HID: use path_helper
DrZlo13 Feb 14, 2023
260c22e
Merge branch 'dev' into zlo/3055-applications-data
DrZlo13 Feb 14, 2023
527015a
Merge branch 'dev' into zlo/3055-applications-data
DrZlo13 Feb 15, 2023
16ef8b3
apps_data: example
DrZlo13 Feb 15, 2023
4bc3c19
PVS: pleased
DrZlo13 Feb 15, 2023
9e577bd
Small writing changes for the readme
Astrrra Feb 15, 2023
60cd0de
Returned the line break in the readme
Astrrra Feb 15, 2023
a989782
Merge branch 'dev' into zlo/3055-applications-data
DrZlo13 Feb 16, 2023
71205a9
make pvs happy
DrZlo13 Feb 16, 2023
d6699cd
make pvs happy [2]
DrZlo13 Feb 16, 2023
d576c29
Storage: dir_is_exist, migrate, + unit_tests
DrZlo13 Feb 17, 2023
2dfa16a
Plugins: migration
DrZlo13 Feb 17, 2023
c369d9c
Storage: common_exists, moar unit_tests 4 "common_migrate", "common_m…
DrZlo13 Feb 20, 2023
75d7b0e
Merge branch 'dev' into zlo/3055-applications-data
DrZlo13 Feb 20, 2023
c228deb
Merge remote-tracking branch 'origin/dev' into zlo/3055-applications-…
skotopes Feb 25, 2023
f46f0a9
Storage: use FuriString for path handling
DrZlo13 Feb 27, 2023
9fc1efc
Storage API: send caller thread id with path
DrZlo13 Feb 27, 2023
bb6e67f
Storage: remove StorageType field in storage file list
DrZlo13 Feb 27, 2023
ea1cd66
Storage: simplify processing
DrZlo13 Feb 27, 2023
570bc63
Storage API: send caller thread id with path everywhere
DrZlo13 Feb 28, 2023
64a4728
Storage: /app alias
DrZlo13 Feb 28, 2023
41986f7
Storage: /app alias, unit tests and path creation
DrZlo13 Feb 28, 2023
13e3cb4
Storage, path helper: remove unused
DrZlo13 Feb 28, 2023
9263bee
Examples: app data example
DrZlo13 Feb 28, 2023
a00e7a3
App plugins: use new VFS path
DrZlo13 Feb 28, 2023
cef79cf
Merge branch 'dev' into zlo/3055-applications-data
DrZlo13 Feb 28, 2023
897a715
Bump api
DrZlo13 Feb 28, 2023
f8939a9
Storage: file_info_is_dir
DrZlo13 Feb 28, 2023
d364a3f
Services: handle alias if the service accepts a path.
DrZlo13 Mar 1, 2023
63588d6
App plugins: fixes
DrZlo13 Mar 1, 2023
135412d
Make PVS happy
DrZlo13 Mar 1, 2023
e63497b
Storage: fix storage_merge_recursive
DrZlo13 Mar 1, 2023
7204f90
Storage: rename process_aliases to resolve_path. Rename APPS_DATA to …
DrZlo13 Mar 1, 2023
ed7cad7
Apps: use predefined macro instead of raw paths. Example Apps Data: R…
DrZlo13 Mar 1, 2023
0d9796b
Storage: rename storage_common_resolve_path to storage_common_resolve…
DrZlo13 Mar 1, 2023
6436318
Api: fix version
DrZlo13 Mar 1, 2023
dfd16b5
Storage: rename alias message
DrZlo13 Mar 1, 2023
9728587
Storage: do not create app folders in path resolving process in certa…
DrZlo13 Mar 1, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .pvsconfig
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,6 @@

# Functions that always return the same error code
//-V:picopass_device_decrypt:1048

# Examples
//V_EXCLUDE_PATH applications/examples/
9 changes: 4 additions & 5 deletions applications/debug/unit_tests/rpc/rpc_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ static void clean_directory(Storage* fs_api, const char* clean_dir) {
size_t size = strlen(clean_dir) + strlen(name) + 1 + 1;
char* fullname = malloc(size);
snprintf(fullname, size, "%s/%s", clean_dir, name);
if(fileinfo.flags & FSF_DIRECTORY) {
if(file_info_is_dir(&fileinfo)) {
clean_directory(fs_api, fullname);
}
FS_Error error = storage_common_remove(fs_api, fullname);
Expand Down Expand Up @@ -608,9 +608,8 @@ static void test_rpc_storage_list_create_expected_list(
}

if(path_contains_only_ascii(name)) {
list->file[i].type = (fileinfo.flags & FSF_DIRECTORY) ?
PB_Storage_File_FileType_DIR :
PB_Storage_File_FileType_FILE;
list->file[i].type = file_info_is_dir(&fileinfo) ? PB_Storage_File_FileType_DIR :
PB_Storage_File_FileType_FILE;
list->file[i].size = fileinfo.size;
list->file[i].data = NULL;
/* memory free inside rpc_encode_and_send() -> pb_release() */
Expand Down Expand Up @@ -873,7 +872,7 @@ static void test_rpc_storage_stat_run(const char* path, uint32_t command_id) {
if(error == FSE_OK) {
response->which_content = PB_Main_storage_stat_response_tag;
response->content.storage_stat_response.has_file = true;
response->content.storage_stat_response.file.type = (fileinfo.flags & FSF_DIRECTORY) ?
response->content.storage_stat_response.file.type = file_info_is_dir(&fileinfo) ?
PB_Storage_File_FileType_DIR :
PB_Storage_File_FileType_FILE;
response->content.storage_stat_response.file.size = fileinfo.size;
Expand Down
8 changes: 4 additions & 4 deletions applications/debug/unit_tests/storage/dirwalk_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ MU_TEST_1(test_dirwalk_full, Storage* storage) {

while(dir_walk_read(dir_walk, path, &fileinfo) == DirWalkOK) {
furi_string_right(path, strlen(EXT_PATH("dirwalk/")));
mu_check(storage_test_paths_mark(paths, path, (fileinfo.flags & FSF_DIRECTORY)));
mu_check(storage_test_paths_mark(paths, path, file_info_is_dir(&fileinfo)));
}

dir_walk_free(dir_walk);
Expand All @@ -204,7 +204,7 @@ MU_TEST_1(test_dirwalk_no_recursive, Storage* storage) {

while(dir_walk_read(dir_walk, path, &fileinfo) == DirWalkOK) {
furi_string_right(path, strlen(EXT_PATH("dirwalk/")));
mu_check(storage_test_paths_mark(paths, path, (fileinfo.flags & FSF_DIRECTORY)));
mu_check(storage_test_paths_mark(paths, path, file_info_is_dir(&fileinfo)));
}

dir_walk_free(dir_walk);
Expand All @@ -219,7 +219,7 @@ static bool test_dirwalk_filter_no_folder_ext(const char* name, FileInfo* filein
UNUSED(ctx);

// only files
if(!(fileinfo->flags & FSF_DIRECTORY)) {
if(!file_info_is_dir(fileinfo)) {
// with ".test" in name
if(strstr(name, ".test") != NULL) {
return true;
Expand All @@ -243,7 +243,7 @@ MU_TEST_1(test_dirwalk_filter, Storage* storage) {

while(dir_walk_read(dir_walk, path, &fileinfo) == DirWalkOK) {
furi_string_right(path, strlen(EXT_PATH("dirwalk/")));
mu_check(storage_test_paths_mark(paths, path, (fileinfo.flags & FSF_DIRECTORY)));
mu_check(storage_test_paths_mark(paths, path, file_info_is_dir(&fileinfo)));
}

dir_walk_free(dir_walk);
Expand Down
Loading