MCPcopy Create free account
hub / github.com/TheOfficialFloW/VitaShell / refresh_thread

Function refresh_thread

refresh.c:329–394  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

327}
328
329int refresh_thread(SceSize args, void *argp)
330{
331 SceUID thid = -1;
332 refresh_data_t refresh_data = { 0, 0, 0, 0 };
333
334 // Lock power timers
335 powerLock();
336
337 // Set progress to 0%
338 sceMsgDialogProgressBarSetValue(SCE_MSG_DIALOG_PROGRESSBAR_TARGET_BAR_DEFAULT, 0);
339 sceKernelDelayThread(DIALOG_WAIT); // Needed to see the percentage
340
341 // Get the app count
342 if (parse_dir_with_callback(SCE_S_IFDIR, "ux0:app", app_callback, &refresh_data) < 0)
343 goto EXIT;
344
345 // Get the dlc count
346 if (parse_dir_with_callback(SCE_S_IFDIR, "ux0:addcont", dlc_callback_outer, &refresh_data) < 0)
347 goto EXIT;
348
349 // Get the patch count
350 if (parse_dir_with_callback(SCE_S_IFDIR, "ux0:patch", patch_callback, &refresh_data) < 0)
351 goto EXIT;
352
353 // Update thread
354 thid = createStartUpdateThread(refresh_data.count, 0);
355
356 // Make sure we have the temp directories we need
357 sceIoMkdir("ux0:temp", 0006);
358 sceIoMkdir("ux0:temp/addcont", 0006);
359 sceIoMkdir("ux0:temp/patch", 0006);
360 refresh_data.refresh_pass = 1;
361
362 // Refresh apps
363 if (parse_dir_with_callback(SCE_S_IFDIR, "ux0:app", app_callback, &refresh_data) < 0)
364 goto EXIT;
365
366 // Refresh dlc
367 if (parse_dir_with_callback(SCE_S_IFDIR, "ux0:addcont", dlc_callback_outer, &refresh_data) < 0)
368 goto EXIT;
369
370 // Refresh patch
371 if (parse_dir_with_callback(SCE_S_IFDIR, "ux0:patch", patch_callback, &refresh_data) < 0)
372 goto EXIT;
373
374 sceIoRmdir("ux0:temp/addcont");
375 sceIoRmdir("ux0:temp/patch");
376
377 // Set progress to 100%
378 sceMsgDialogProgressBarSetValue(SCE_MSG_DIALOG_PROGRESSBAR_TARGET_BAR_DEFAULT, 100);
379 sceKernelDelayThread(COUNTUP_WAIT);
380
381 // Close
382 closeWaitDialog();
383
384 infoDialog(language_container[REFRESHED], refresh_data.refreshed);
385
386EXIT:

Callers

nothing calls this directly

Calls 7

powerLockFunction · 0.85
parse_dir_with_callbackFunction · 0.85
createStartUpdateThreadFunction · 0.85
closeWaitDialogFunction · 0.85
infoDialogFunction · 0.85
powerUnlockFunction · 0.85

Tested by

no test coverage detected