Comment on AI Wallpaper Changer for Android
trolololol@lemmy.world 7 months agoI wonder how you’re using workmanager , and expect you to not be using services directly. These are the ones that could have an impact.
Wallpapers have their own instance of WallpaperEngine which is kept in use as long as the user is seeing the wallpaper. That’s my experience with my own wallpaper.
rikudou@lemmings.world 7 months ago
I schedule the job using an inexact alarm which then triggers the work manager job. Anyway, Samsung kills pretty much anything in the background unless you go out of your way to prevent it. I have no recent experience with other vendors. It would kill yours, too, no matter what code you use to write it.
trolololol@lemmy.world 7 months ago
You’ve got like 10 seconds to do what you need, should be enough to download your image?
rikudou@lemmings.world 7 months ago
You don’t seem to understand that the job will be killed before it’s even triggered. Like the scheduled job will not run at all.
trolololol@lemmy.world 7 months ago
I think the msg sent yesterday didn’t get through;
periodic alarms is the old way; periodic work manager is the new way.
trigger your workmanager schedule by either alarm or by opening the app. but use the alarm only once if you must.
my wallpaper used to handle reboots by listening to a boot event, which would trigger workmanager. Unfortunately I haven’t come to find an alternative for that for general apps. However, if your wallpaper is set to your app I bet there’s a way to check if you have any workmanager scheduled, and if it’s not, do it from there. I don’t mean from
Application
or anyActivity
, I mean fromWallpaperService
. Anyways, ifWallpaperService
never runs you shouldn’t have workmanager set and consume horde resources anyways.