summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/action.c37
-rw-r--r--apps/action.h2
-rw-r--r--apps/lang/english.lang14
-rw-r--r--apps/menus/settings_menu.c1
4 files changed, 38 insertions, 16 deletions
diff --git a/apps/action.c b/apps/action.c
index f9602b967f..34897b938c 100644
--- a/apps/action.c
+++ b/apps/action.c
@@ -675,24 +675,31 @@ static inline int do_auto_softlock(action_last_t *last, action_cur_t *cur)
}
else if (action == ACTION_STD_KEYLOCK)
{
- last->unlock_combo = cur->button;/* set unlock combo to allow unlock */
- last->softlock_mask ^= SEL_ACTION_ALOCK_OK;
- action_handle_backlight(true, false);
- /* If we don't wait for a moment for the backlight queue
- * to process, the user will never see the message */
- if (!is_backlight_on(false))
+ if (!has_flag(last->softlock_mask, SEL_ACTION_ALWAYSAUTOLOCK)) // normal operation, clear/arm autolock
{
- sleep(HZ/2);
- }
+ last->unlock_combo = cur->button;/* set unlock combo to allow unlock */
+ last->softlock_mask ^= SEL_ACTION_ALOCK_OK;
+ action_handle_backlight(true, false);
+ /* If we don't wait for a moment for the backlight queue
+ * to process, the user will never see the message */
+ if (!is_backlight_on(false))
+ {
+ sleep(HZ/2);
+ }
- if (has_flag(last->softlock_mask, SEL_ACTION_ALOCK_OK))
- {
- splash(HZ/2, ID2P(LANG_ACTION_AUTOLOCK_ON));
- action = ACTION_REDRAW;
- }
- else
+ if (has_flag(last->softlock_mask, SEL_ACTION_ALOCK_OK))
+ {
+ splash(HZ/2, ID2P(LANG_ACTION_AUTOLOCK_ON));
+ action = ACTION_REDRAW;
+ }
+ else
+ {
+ splash(HZ/2, ID2P(LANG_ACTION_AUTOLOCK_OFF));
+ }
+ } else if (!has_flag(last->softlock_mask, SEL_ACTION_ALOCK_OK)) // always autolock, but not currently armed
{
- splash(HZ/2, ID2P(LANG_ACTION_AUTOLOCK_OFF));
+ last->unlock_combo = cur->button;/* set unlock combo to allow unlock */
+ last->softlock_mask ^= SEL_ACTION_ALOCK_OK;
}
}
diff --git a/apps/action.h b/apps/action.h
index da4565c28b..e4ad29504b 100644
--- a/apps/action.h
+++ b/apps/action.h
@@ -51,7 +51,7 @@
#define SEL_ACTION_SKIP 0x008U
#define SEL_ACTION_NOUNMAPPED 0x010U/* disable backlight on unmapped buttons */
#define SEL_ACTION_ALLNONOTIFY 0x020U/* disable switch for all softlock notifications */
- /* Available 0x040U*/
+#define SEL_ACTION_ALWAYSAUTOLOCK 0x040U/* always prime autolock, requires autolock enabled */
#define SEL_ACTION_NOTOUCH 0x080U/* disable touch screen/pad on screen lock */
#define SEL_ACTION_AUTOLOCK 0x100U/* autolock on backlight off */
#define SEL_ACTION_NOEXT 0x200U/* disable selective backlight while charge*/
diff --git a/apps/lang/english.lang b/apps/lang/english.lang
index 327584c4f6..9ca4c84430 100644
--- a/apps/lang/english.lang
+++ b/apps/lang/english.lang
@@ -15767,3 +15767,17 @@
*: "Exempt Volume"
</voice>
</phrase>
+<phrase>
+ id: LANG_ACTION_ALWAYSAUTOLOCK
+ desc: always prime autolock
+ user: core
+ <source>
+ *: "Always Autolock"
+ </source>
+ <dest>
+ *: "Always Autolock"
+ </dest>
+ <voice>
+ *: "Always Autolock"
+ </voice>
+</phrase>
diff --git a/apps/menus/settings_menu.c b/apps/menus/settings_menu.c
index a5daad01ce..0b7516f749 100644
--- a/apps/menus/settings_menu.c
+++ b/apps/menus/settings_menu.c
@@ -89,6 +89,7 @@ int mask = global_settings.bt_selective_softlock_actions_mask;
{ID2P(LANG_ACTION_SKIP), SEL_ACTION_SKIP},
#ifdef HAVE_BACKLIGHT
{ID2P(LANG_ACTION_AUTOLOCK_ON), SEL_ACTION_AUTOLOCK},
+ {ID2P(LANG_ACTION_ALWAYSAUTOLOCK), SEL_ACTION_ALWAYSAUTOLOCK},
#endif
#if defined(HAVE_TOUCHPAD) || defined(HAVE_TOUCHSCREEN)
{ID2P(LANG_ACTION_DISABLE_TOUCH), SEL_ACTION_NOTOUCH},