talk-android icon indicating copy to clipboard operation
talk-android copied to clipboard

Added option `Immediate` for passcode timeout.

Open parneet-guraya opened this issue 1 year ago • 12 comments

Fix: #4173

🏁 Checklist

  • [x] ⛑️ Tests (unit and/or integration) are included or not needed
  • [x] 🔖 Capability is checked or not needed
  • [ ] 🔙 Backport requests are created or not needed: /backport to stable-xx.x
  • [ ] 📅 Milestone is set
  • [x] 🌸 PR title is meaningful (if it should be in the changelog: is it meaningful to users?)

parneet-guraya avatar Sep 13 '24 11:09 parneet-guraya

@parneet-guraya - I tested this and lock screen is always active on my Samsung A52 (because inactivity time here is set 0, which practically means no inactive time?). It works when inactivity time is set to 1 sec.

sowjanyakch avatar Sep 15 '24 09:09 sowjanyakch

@parneet-guraya - I tested this and lock screen is always active on my Samsung A52 (because inactivity time here is set 0, which practically means no inactive time?). It works when inactivity time is set to 1 sec.

@sowjanyakch Hmm... If by always active you mean that if we leave and comeback to the app immediately , lock screen shows? then it is what I aimed for (basically no time window (timeout) i.e 0, lock will be active immediately). Let me know if you meant something else :)

parneet-guraya avatar Sep 16 '24 07:09 parneet-guraya

@parneet-guraya When the device's screen lock is set to "Immediately", the screen should lock as soon as you stop interacting with the app. That's the behavior you aimed for and this PR does this job. When I tested with my Samsung A52, screen lock sets immediately after I stop interacting with app. Then I entered password to unlock screen. Screen is unlocked and then immediately locks again, prompting me to re-enter password. This is a repeated behavior and I had to uninstall app to be able to use it again. What is your testing device and what is the output you are getting?

sowjanyakch avatar Sep 17 '24 06:09 sowjanyakch

the screen should lock as soon as you stop interacting with the app.

@sowjanyakch , okay this got me, 'by not interacting' I interpreted that the app's still in foreground but user's not using it. But, this is not what you meant right? Just to be on the same page, this is how the functionality should work ->

  • App goes to background when either user press the recent screen button/swipe and hold gesture or completely goes back to home. On return the lock should show.

It's a bit strange behavior that you're seeing. I have tested on these devices and works fine-->

  • Oneplus (Android 14)
  • Realme (Android 12)
  • Google pixel 6a (Android 14)

Although there's another bug that executes the dialog multiple times , this is how you can reproduce ->

  • When prompted for password try loosing the focus by either clicking on the home button or the one that shows recent apps. Now this happens regardless of what timeout preference we have.

Is that what you're seeing?

https://github.com/user-attachments/assets/ae1dd46f-02fb-4172-9944-27798f47efd0

parneet-guraya avatar Sep 17 '24 10:09 parneet-guraya

  • App goes to background when either user press the recent screen button/swipe and hold gesture or completely goes back to home. On return the lock should show.

You are right.

Is that what you're seeing?

copy.mp4

Open app and set screen lock inactivity timeout to "Immediate" and press recent screen button. Immediately open the app from the recents screen - I see this bug when I try to unlock screen. It happens only when timeout option is set to Immediate.

sowjanyakch avatar Sep 17 '24 14:09 sowjanyakch

Open app and set screen lock inactivity timeout to "Immediate" and press recent screen button. Immediately open the app from the recents screen - I see this bug when I try to unlock screen. It happens only when timeout option is set to Immediate.

Strange..., okay when you set immediate option it doesn't show the fingerprint dialog just after setting it? Because for me this bug only occurs when dialog is showing and then I try to loose focus by going back. Also, if it's possible could you post the video of the behavior too?

parneet-guraya avatar Sep 17 '24 14:09 parneet-guraya

Open app and set screen lock inactivity timeout to "Immediate" and press recent screen button. Immediately open the app from the recents screen - I see this bug when I try to unlock screen. It happens only when timeout option is set to Immediate.

Please change the Screen lock type to PIN or Pattern and try to reproduce the issue.

sowjanyakch avatar Sep 18 '24 10:09 sowjanyakch

Hello there, Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

github-actions[bot] avatar Sep 28 '24 02:09 github-actions[bot]

What's the state for this PR? @sowjanyakch @parneet-guraya IIRC setting the value to <item>1</item> and just call it <item>@string/nc_screen_lock_timeout_immediate</item> solved the problem that lock screen blocks the app and everything was just working as expected? Is thee any reason against this?

Edit: i added a comment on https://github.com/nextcloud/talk-android/issues/3815#issuecomment-2401640132 which could have a bigger impact on this topic. So the "immediate" option for the current implementation would be an interim solution at best.

mahibi avatar Oct 09 '24 07:10 mahibi

@mahibi , It worked fine on the devices I was testing on except @sowjanyakch 's samsung device. So, my idea was to fix the Lock screen first. Since, you proposed the idea (#3815) to integrate this functionality in the library. Until that finishes, it is blocked.

parneet-guraya avatar Oct 09 '24 09:10 parneet-guraya

we merge with setting immediate option to 1 sec and test this in the next RC Be aware the behavor will change in the future, see comment in https://github.com/nextcloud/talk-android/pull/4204#issuecomment-2401555587

mahibi avatar Jan 15 '25 10:01 mahibi

APK file: https://www.kaminsky.me/nc-dev/android-artifacts/4204-talk.apk

qrcode

To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud Talk app.

github-actions[bot] avatar Jan 15 '25 10:01 github-actions[bot]

Codacy

Lint

TypemasterPR
Warnings104104
Errors3636

SpotBugs

CategoryBaseNew
Bad practice66
Correctness222222
Dodgy code7171
Internationalization33
Malicious code vulnerability33
Performance44
Security11
Total310310

github-actions[bot] avatar Jan 15 '25 10:01 github-actions[bot]