WallpaperService - Engine - Distinguish system and lockscreen

317 Views Asked by At

I am building a wallpaper change app (with live wallpapers support - I am using WallpaperService for the purpose) and I need to know, what Engine is used to display lock screen or system background (to provide correct wallpaper to be displayed to the user). Or can I create two services (one for lock screen, one for system) and limit the user to allow only one option?

1

There are 1 best solutions below

1
Marek Teuchner On

TLDR: Live wallpaper are always treated as system ones, but will be shown on lock screen if user has not specified a bitmap (static image) for it.

After hours of research, I finally found an answer inside WallpaperManagerService class.

Live wallpapers are treated specially.

  • If user has no lock screen wallpaper, it will be set as both (lock+system) regardless the choice.
  • If user has lock screen wallpaper, it can be set to system only, or user can choose to override both.
  • If user has live wallpaper active and wants to set lock screen wallpaper, lock screen wallpaper gets changed while system (= live) remains intact
  • If user has live wallpaper active and wants to set system wallpaper, both lock+system will be replaced.