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

Lock after inactivity #10

Open
4 tasks
tomalabaster opened this issue Oct 4, 2020 · 4 comments
Open
4 tasks

Lock after inactivity #10

tomalabaster opened this issue Oct 4, 2020 · 4 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@tomalabaster
Copy link
Owner

tomalabaster commented Oct 4, 2020

Is your feature request related to a problem? Please describe.
It would be a useful feature to lock the screen after X amount of time of inactivity.

Describe the solution you'd like
Something akin to setting inactivityLockLatency on AppLock

Describe alternatives you've considered
Requiring users of this package to manually measure inactivity and make calls to AppLock.of(context).showLockScreen()

Additional context
Requested as part of #7.

Methods of measuring activity that need to be considered:

  • Screen interactions
  • Keyboard interactions
  • Media interactions (e.g. videos being played, camera being used)
  • Semantic navigation (e.g. tabbing between focusable components)
@tomalabaster
Copy link
Owner Author

After more thought about this, inactivity at an app level maybe isn't all that useful, as if people are security conscious their system auto lock timers will be set to something small.

Even the banking apps I've tried don't incorporate reshowing of their own biometric/passcode locks after a period of inactivity.

I'll leave this issue open for a period of time, if this is something that people want I'll do some more investigation. I know this is possible using a Listener and then I've found a possible way which could check for keyboard interactions, media is still an issue though as will be things like screen readers or other semantic navigation methods.

I think if an app wants this done, it could be done without requiring AppLock to implement it and the app using AppLock can make the best decision about measuring inactivity for its own context.

There's a showLockScreen() method which could be activated after a Listener hasn't received any events in a given amount of time, and if necessary it's also possible to get the primary FocusNode, check if it's got a TextEditingController and periodically compare it's current text (not an ideal method I know, which is why I'm reluctant to implement this first-hand into AppLock).

What are your thoughts @zhaoshenhao, as you originally requested this?

If this doesn't get much more interest I'll close this issue.

@tomalabaster tomalabaster added the enhancement New feature or request label Oct 4, 2020
@zhaoshenhao
Copy link

@tomalabaster,

I built my app for all supported platform (win/mac/linux). This enhancement will be very useful in desktop version.

Forgot to mention: AppLock perfectly works on all platform ;-)

Regards,

Allen

@tobiasht
Copy link

tobiasht commented Nov 9, 2022

This functionality is what lead me to this package in the first place and i think it is an excellent feature to add to the package. Even though your banking app doesn't have it, they definitely should and I am happy mine does.

I think the right implementation would be to implement a listener on touch and click events in the app, which will reset the lock timer. Then expose this function so developers can reset the timer on other events, like button presses. This will give users the flexibility that you mentioned above.

@tomalabaster
Copy link
Owner Author

@tobiasht sure thing, thank you for joining the conversation!

I'll give this a revisit.

@tomalabaster tomalabaster self-assigned this Nov 23, 2022
@tomalabaster tomalabaster added this to the 4.0.0 milestone Nov 23, 2022
@tomalabaster tomalabaster modified the milestones: 4.0.0, 5.0.0 Dec 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants