summaryrefslogtreecommitdiff
path: root/apps/action.c
diff options
context:
space:
mode:
authorDana Conrad <dconrad@fastmail.com>2021-04-03 13:54:03 -0500
committerSolomon Peachy <pizza@shaftnet.org>2021-04-05 11:09:32 +0000
commit1aed109fa8c2a9e5a788295f523642bc71269351 (patch)
tree2f164d9346e7aa487d277afa28ac18c47bed5c66 /apps/action.c
parent962d412917a5cbb923847163a2beafaa3301dd8f (diff)
downloadrockbox-1aed109fa8c2a9e5a788295f523642bc71269351.tar.gz
rockbox-1aed109fa8c2a9e5a788295f523642bc71269351.zip
Add ability to always have autolock on
Tested on ErosQ Added a setting in the Advanced Softlock menu to always have autolock on, rather than having to "arm" it with the softlock button. Lock/Unlock still works the same with this on, but when the screen turns off, the device always ends up in the locked state. Requires Autolock On to be set as well, and the normal Autolock functionality is unchanged with this off. Caveat: the power/softlock button must be pressed at least once after powering on the device or enabling the feature. After that, it should consistently always "arm" the autolock. Added feature to manual in manual/configure_rockbox/system_options.tex. Also updated some labels I had changed in the Advanced Key Lock menu and added information for Disable All Lock Notifications in a previous commit. Shared items also updated in manual/configure_rockbox/display_options.tex for selective backlight. Change-Id: I09dc6814bee803e40c7088157e1fe9d01d5f3474
Diffstat (limited to 'apps/action.c')
-rw-r--r--apps/action.c37
1 files changed, 22 insertions, 15 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)
675 } 675 }
676 else if (action == ACTION_STD_KEYLOCK) 676 else if (action == ACTION_STD_KEYLOCK)
677 { 677 {
678 last->unlock_combo = cur->button;/* set unlock combo to allow unlock */ 678 if (!has_flag(last->softlock_mask, SEL_ACTION_ALWAYSAUTOLOCK)) // normal operation, clear/arm autolock
679 last->softlock_mask ^= SEL_ACTION_ALOCK_OK;
680 action_handle_backlight(true, false);
681 /* If we don't wait for a moment for the backlight queue
682 * to process, the user will never see the message */
683 if (!is_backlight_on(false))
684 { 679 {
685 sleep(HZ/2); 680 last->unlock_combo = cur->button;/* set unlock combo to allow unlock */
686 } 681 last->softlock_mask ^= SEL_ACTION_ALOCK_OK;
682 action_handle_backlight(true, false);
683 /* If we don't wait for a moment for the backlight queue
684 * to process, the user will never see the message */
685 if (!is_backlight_on(false))
686 {
687 sleep(HZ/2);
688 }
687 689
688 if (has_flag(last->softlock_mask, SEL_ACTION_ALOCK_OK)) 690 if (has_flag(last->softlock_mask, SEL_ACTION_ALOCK_OK))
689 { 691 {
690 splash(HZ/2, ID2P(LANG_ACTION_AUTOLOCK_ON)); 692 splash(HZ/2, ID2P(LANG_ACTION_AUTOLOCK_ON));
691 action = ACTION_REDRAW; 693 action = ACTION_REDRAW;
692 } 694 }
693 else 695 else
696 {
697 splash(HZ/2, ID2P(LANG_ACTION_AUTOLOCK_OFF));
698 }
699 } else if (!has_flag(last->softlock_mask, SEL_ACTION_ALOCK_OK)) // always autolock, but not currently armed
694 { 700 {
695 splash(HZ/2, ID2P(LANG_ACTION_AUTOLOCK_OFF)); 701 last->unlock_combo = cur->button;/* set unlock combo to allow unlock */
702 last->softlock_mask ^= SEL_ACTION_ALOCK_OK;
696 } 703 }
697 } 704 }
698 705