tommi1hirvonen / ExifNotes

Exif Notes is an Android application that let's you quickly make structured notes in the field when doing film photography. It has about 1,500 active installations through Google Play.
GNU General Public License v3.0
32 stars 4 forks source link

Option to allow interacting with the app without unlocking the device #31

Open tommi1hirvonen opened 1 year ago

tommi1hirvonen commented 1 year ago

Is your feature request related to a problem? Please describe.

Currently the user needs to unlock the device fully even when the app is running before they can interact with it to add rolls and frames etc. Being able to just wake the device without entering your PIN and start adding notes in the app saves time and improves the user experience.

Describe the solution you'd like

This should be an opt-in feature instead of being enabled by default. There should be a setting in the app's preferences whether unlocking the device is needed to interact with the app. The user can then decide whether they want to use this feature or keep the current more secure behaviour.

Describe alternatives you've considered

Nowadays most phones come with quite fast and reliable fingerprint sensors or face unlock for authentication. This makes unlocking the device usually pretty painless. But still, some users may find this feature useful.

Additional context

This feature was introduced in past versions of Exif Notes, but since then the code base has been refactored several times and the feature was removed. Below is a code snippet that can be used in an Activity to enable interacting with it even when the device is locked.

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1) {
    setShowWhenLocked(true)
    setTurnScreenOn(true)
} else {
    val window = window
    @Suppress("DEPRECATION") window.addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD)
    @Suppress("DEPRECATION") window.addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED)
    @Suppress("DEPRECATION") window.addFlags(WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON)
}