[FL-2494, FL-2497] PIN Lock refactoring, IR library fix (#1167)
* PIN Lock refactoring * Change tv.ir file type to prevent opening from archive * Manifest update * Assets: enforce sorting in fs traversal Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
@@ -41,15 +41,3 @@ typedef struct {
|
||||
PinCode pin_code;
|
||||
uint32_t auto_lock_delay_ms;
|
||||
} DesktopSettings;
|
||||
|
||||
static inline bool pins_are_equal(const PinCode* pin_code1, const PinCode* pin_code2) {
|
||||
furi_assert(pin_code1);
|
||||
furi_assert(pin_code2);
|
||||
bool result = false;
|
||||
|
||||
if(pin_code1->length == pin_code2->length) {
|
||||
result = !memcmp(pin_code1->data, pin_code2->data, pin_code1->length);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#include <stdint.h>
|
||||
#include <furi/check.h>
|
||||
#include <gui/scene_manager.h>
|
||||
|
||||
#include "../../helpers/pin_lock.h"
|
||||
#include "../desktop_settings_app.h"
|
||||
#include "desktop/desktop_settings/desktop_settings.h"
|
||||
#include "desktop/views/desktop_view_pin_input.h"
|
||||
@@ -18,7 +18,7 @@ static void pin_auth_done_callback(const PinCode* pin_code, void* context) {
|
||||
DesktopSettingsApp* app = context;
|
||||
|
||||
app->pincode_buffer = *pin_code;
|
||||
if(pins_are_equal(&app->settings.pin_code, pin_code)) {
|
||||
if(desktop_pins_are_equal(&app->settings.pin_code, pin_code)) {
|
||||
view_dispatcher_send_custom_event(app->view_dispatcher, SCENE_EVENT_PINS_EQUAL);
|
||||
} else {
|
||||
view_dispatcher_send_custom_event(app->view_dispatcher, SCENE_EVENT_PINS_DIFFERENT);
|
||||
|
@@ -6,7 +6,7 @@
|
||||
#include "desktop/views/desktop_view_pin_input.h"
|
||||
#include "desktop_settings_scene.h"
|
||||
#include "desktop_settings_scene_i.h"
|
||||
#include "../../desktop_helpers.h"
|
||||
#include "../../helpers/pin_lock.h"
|
||||
#include "../desktop_settings_app.h"
|
||||
|
||||
#define SCENE_EVENT_EXIT (0U)
|
||||
@@ -25,7 +25,7 @@ static void pin_error_done_callback(const PinCode* pin_code, void* context) {
|
||||
|
||||
void desktop_settings_scene_pin_error_on_enter(void* context) {
|
||||
DesktopSettingsApp* app = context;
|
||||
desktop_helpers_emit_error_notification();
|
||||
desktop_pin_lock_error_notify();
|
||||
|
||||
desktop_view_pin_input_set_context(app->pin_input_view, app);
|
||||
desktop_view_pin_input_set_back_callback(app->pin_input_view, pin_error_back_callback);
|
||||
|
@@ -7,6 +7,7 @@
|
||||
#include "desktop/views/desktop_view_pin_input.h"
|
||||
#include "desktop_settings_scene.h"
|
||||
#include "desktop_settings_scene_i.h"
|
||||
#include "../../helpers/pin_lock.h"
|
||||
|
||||
#define SCENE_EVENT_EXIT (0U)
|
||||
#define SCENE_EVENT_1ST_PIN_ENTERED (1U)
|
||||
@@ -24,7 +25,7 @@ static void pin_setup_done_callback(const PinCode* pin_code, void* context) {
|
||||
view_dispatcher_send_custom_event(app->view_dispatcher, SCENE_EVENT_1ST_PIN_ENTERED);
|
||||
} else {
|
||||
app->pincode_buffer_filled = false;
|
||||
if(pins_are_equal(&app->pincode_buffer, pin_code)) {
|
||||
if(desktop_pins_are_equal(&app->pincode_buffer, pin_code)) {
|
||||
view_dispatcher_send_custom_event(app->view_dispatcher, SCENE_EVENT_PINS_EQUAL);
|
||||
} else {
|
||||
view_dispatcher_send_custom_event(app->view_dispatcher, SCENE_EVENT_PINS_DIFFERENT);
|
||||
|
Reference in New Issue
Block a user