-
-
Notifications
You must be signed in to change notification settings - Fork 33
Fix overlay persistence, configuration change handling, immediate locking, biometric preferences, and service freezing #139
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
base: master
Are you sure you want to change the base?
Conversation
- Issue #138: Cancel biometric prompt in onPause and finish activity when user cancels - Issue #137: Add configChanges to PasswordOverlayActivity to handle screen rotation - Issue #135: Skip temporarily unlocked check when duration is 0 (lock immediately) - Issue #132: Use BIOMETRIC_STRONG only to prefer fingerprint over face unlock Co-authored-by: PranavPurwar <75154889+PranavPurwar@users.noreply.github.com>
- Simplify unlock duration logic by extracting common clearTemporarilyUnlockedApp call - Catch specific IllegalStateException instead of generic Exception Co-authored-by: PranavPurwar <75154889+PranavPurwar@users.noreply.github.com>
The finish() call in onAuthenticationError would allow access to locked app without authentication. The correct fix for issue #138 is already in onPause() which cancels biometric prompt and finishes the activity when moving to background. Co-authored-by: PranavPurwar <75154889+PranavPurwar@users.noreply.github.com>
You're absolutely correct! Calling I've removed that code in commit 9251f57. The actual fix for issue #138 is already handled correctly in
Security is maintained: the locked app is never accessible without proper authentication. |
- Wrap ExperimentalAppLockService timer task in try-catch to prevent freezes - Wrap ShizukuAppLockService callback in try-catch to handle exceptions gracefully - Ensures services continue running even if errors occur in monitoring loops Co-authored-by: PranavPurwar <75154889+PranavPurwar@users.noreply.github.com>
|
Addressed in commit eb8c506. Issue #129 was about the app freezing after a couple of hours. I identified that the background services (ExperimentalAppLockService and ShizukuAppLockService) lacked exception handling in their monitoring loops. If an exception occurred during the frequent checks (every 250ms), the service could crash or freeze. Changes made:
This ensures the app remains responsive even if temporary errors occur in the monitoring loops. |
- Add lock immediately logic to ExperimentalAppLockService - Add lock immediately logic to ShizukuAppLockService - Ensures consistent behavior across all backend implementations Co-authored-by: PranavPurwar <75154889+PranavPurwar@users.noreply.github.com>
Fix Issues #138, #137, #135, #132, and #129
Summary
This PR addresses five critical bugs in the AppLock application that affect user experience and functionality.
Issues Fixed
Issue #138: Overlay screen stays when biometric authentication is not passed
Problem: When a user opens a locked app and the biometric prompt appears, if they exit the app (go home or to recent apps) without authenticating, the overlay remains visible over the home screen and other apps.
Solution:
onPause()lifecycle methodFiles Changed:
app/src/main/java/dev/pranav/applock/features/lockscreen/ui/PasswordOverlayScreen.ktIssue #137: App restarts and shows lock screen when zooming/rotating
Problem: When viewing photos or rotating the screen in locked apps (like Google Photos or Instagram), the lock screen appears and the app restarts, losing the current state.
Solution:
android:configChanges="orientation|screenSize|screenLayout|keyboardHidden"to PasswordOverlayActivity in the manifestFiles Changed:
app/src/main/AndroidManifest.xmlIssue #135: "Lock immediately" option not working
Problem: When unlock time duration is set to 0 (lock immediately), the app doesn't lock immediately after the user leaves and returns.
Solution:
checkAndLockAppmethod in all three services (Accessibility, Experimental, Shizuku)Files Changed:
app/src/main/java/dev/pranav/applock/services/AppLockAccessibilityService.ktapp/src/main/java/dev/pranav/applock/services/ExperimentalAppLockService.ktapp/src/main/java/dev/pranav/applock/services/ShizukuAppLockService.ktIssue #132: Biometric authentication always tries face unlock
Problem: The biometric prompt always attempts face unlock even when users prefer fingerprint only, which is problematic in dark environments.
Solution:
BIOMETRIC_WEAK or BIOMETRIC_STRONGtoBIOMETRIC_STRONGonlyFiles Changed:
app/src/main/java/dev/pranav/applock/features/lockscreen/ui/PasswordOverlayScreen.ktapp/src/main/java/dev/pranav/applock/core/navigation/AppNavigator.ktIssue #129: App keeps freezing
Problem: The app completely stops working after a couple of hours, likely due to uncaught exceptions in background services.
Solution:
Files Changed:
app/src/main/java/dev/pranav/applock/services/ExperimentalAppLockService.ktapp/src/main/java/dev/pranav/applock/services/ShizukuAppLockService.ktTesting Recommendations
Code Quality
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.