Show application on lock screen #1928
Labels
No labels
Accessibility
Accessibility
Address
Address
Android
Android
Android Auto
Android Auto
Android Automotive (AAOS)
Android Automotive (AAOS)
API
API
AppGallery
AppGallery
AppStore
AppStore
Battery and Performance
Battery and Performance
Blocker
Blocker
Bookmarks and Tracks
Bookmarks and Tracks
Borders
Borders
Bug
Bug
Build
Build
CarPlay
CarPlay
Classificator
Classificator
Community
Community
Core
Core
CrashReports
CrashReports
Cycling
Cycling
Desktop
Desktop
DevEx
DevEx
DevOps
DevOps
dev_sandbox
dev_sandbox
Directions
Directions
Documentation
Documentation
Downloader
Downloader
Drape
Drape
Driving
Driving
Duplicate
Duplicate
Editor
Editor
Elevation
Elevation
Enhancement
Enhancement
Epic
Epic
External Map Datasets
External Map Datasets
F-Droid
F-Droid
Fonts
Fonts
Frequently User Reported
Frequently User Reported
Fund
Fund
Generator
Generator
Good first issue
Good first issue
Google Play
Google Play
GPS
GPS
GSoC
GSoC
iCloud
iCloud
Icons
Icons
iOS
iOS
Legal
Legal
Linux Desktop
Linux Desktop
Linux packaging
Linux packaging
Linux Phone
Linux Phone
Mac OS
Mac OS
Map Data
Map Data
Metro
Metro
Navigation
Navigation
Need Feedback
Need Feedback
Night Mode
Night Mode
NLnet 2024-06-281
NLnet 2024-06-281
No Feature Parity
No Feature Parity
Opening Hours
Opening Hours
Outdoors
Outdoors
POI Info
POI Info
Privacy
Privacy
Public Transport
Public Transport
Raw Idea
Raw Idea
Refactoring
Refactoring
Regional
Regional
Regression
Regression
Releases
Releases
RoboTest
RoboTest
Route Planning
Route Planning
Routing
Routing
Ruler
Ruler
Search
Search
Security
Security
Styles
Styles
Tests
Tests
Track Recording
Track Recording
Translations
Translations
TTS
TTS
UI
UI
UX
UX
Walk Navigation
Walk Navigation
Watches
Watches
Web
Web
Wikipedia
Wikipedia
Windows
Windows
Won't fix
Won't fix
World Map
World Map
No milestone
No project
No assignees
2 participants
Due date
No due date set.
Dependencies
No dependencies set.
Reference: organicmaps/organicmaps-tmp#1928
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "show_on_lock_screen"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Allows to show app on lock screen, enabled in the settings.
Closes #558
For me it's useful while using a phone in navigation mode on a bicycle inside phone case/enclosure.
Description of steps in the video:
Show application on lock screen
disabled.Show application on lock screen
enabled.https://user-images.githubusercontent.com/2798728/152066003-0085a98f-45a1-4377-9abd-f77627e60b3f.mp4
When is this case possible?
I think only if there is a bug: either called before preferences have been initialized or there is no such preference in xml defined.
I copied it from other preference case
I would prefer a clear crash if it is caused by the wrong code instead of silent return and complaining users. What does git blame say for another preference case?
Checking for nulls was added in
3547acb16c
This could be related: https://github.com/mapsme/omim/pull/4558#discussion_r88602086
This check looks unnecessary for me, and it would be great to find this bug (if it's still there).
A TODO about removing this check (everywhere) could be added, or you can do it in another commit.
Hi @starsep, thanks for the contribution! I have tried this patch on my Android 11 and Android 12 devices and found absolutely no difference with this option enabled. I don't see the app on the lock screen.
According to documentation, this flag is deprecated in API level 27.
Does it work for you? What version of Android do you use? Please attach a video, if you can. Thanks!
Ideally, the code should use a non-deprecated flag on 27+
Flag is deprecated because
setShowWhenLocked
has been added.I use it just above for API 27+. This approach allows to support all Android versions.
I use Android 11, I will share video in the evening.
I added video in the description of pull request
Shouldn't flags be set once in onCreate?
Thank you, I tested and it works well! The most confusing part was the wording, so even we, developers, didn't understand that feature :) I tried to reword the setting to make it more clear for our users.
I don't understand how to use this feature. It doesn't work on my Android 11/Android 12 device. Please help.
Thanks for the video. I still don't see any UX changes on my Android 11/Android 12 devices. I lock the screen while running the app and nothing happens. I see absolutely no difference with or without flag enabled.
@rtsisyk
When this setting is OFF:
When this setting is ON:
There is no "unlock your device with your … " step 4. Please confirm that you tried it and what actually happens on your devices.
It finally works for me after playing with security settings on the device. Good feature! My proposal is to enable this feature globally without adding new configuration options. Do we need a config option at all?
@ -77,2 +77,4 @@
android:defaultValue="false"
android:order="16"/>
<SwitchPreferenceCompat
Do we need this option at all? Just enable this feature by default without adding the option.
I was able to get it working after playing with "Lock" settings on Samsung. Good feature, thanks!
@ -77,2 +77,4 @@
android:defaultValue="false"
android:order="16"/>
<SwitchPreferenceCompat
We need it for security.
@starsep can you please fix the suggestions? We plan to make a release soon.
Or we can help if you're busy.
@ -77,2 +77,4 @@
android:defaultValue="false"
android:order="16"/>
<SwitchPreferenceCompat
I also think it should be configurable. This behaviour is surprising to the user. Therefore I think it should be opt-in and preference title/description is good place to let user know what will happen once enabled.
I will fix them, I am indeed a bit busy. The only one which seems to need not-trivial effort is checking for nulls.
I agree it would be great long-term to check whether it's needed and find a bug if it still can be triggered.
Maybe let's do that as a follow-up and just check for null for now? I would just create separate issue to explain this problem.
I think it's needed.
Such scenario
onCreate
wouldn't be called and therefore flags are in a state before preference change.As always with questions about Android/Activity lifecycle it's not obvious.
I haven't actually tested whether
onCreate
is called - I think it would be only if the system decided to kill this activity which shouldn't be the case for an active app.I added TODO and created an issue organicmaps/organicmaps#2049. It would be done in a separate PR. Is it ok?