Doubi88 / SlideshowWallpaper

A Live Wallpaper for Android showing a slideshow of user-selected images
https://doubi88.github.io/SlideshowWallpaper/
GNU General Public License v3.0
41 stars 10 forks source link

Black screen on startup #36

Closed TypicalScenario closed 7 months ago

TypicalScenario commented 1 year ago

First of all, thanks for the amazing application! It works perfectly except the issue I'm writing about below.

When I go into the preview and try to set-up the wallpaper, Android gives me 2 choices, either set Slideshow Wallpaper as a "Home screen" background, or as a "Home screen and lock screen" background, and when I choose the latter, the changes only apply to my Home screen.

There may be no corellation, but built in miui applications show a third "Set as Lock screen" option too. That might worth chenking out.

Device details: Xiaomi Pad 5 Pro MIUI V14.0.4.0.TKYCNXM CHINA Stable MIUI Optimization ON AndroNative_com android wallpaper livepicker MIUI_com android thememanager

TypicalScenario commented 1 year ago

I've found the culprit, It's a specific permission which was never asked for (see picture). After I granted the permission manually, the "Home screen and lock screen" option started to do what It's supposed to.

However, I've also found another problem with the application. After a device restart, the lock screen gets reverted to the system original every time, even though the application now has the permission to change that.

Scedit

Doubi88 commented 1 year ago

Hi @TypicalScenario, thanks for reaching out. Unfortunately, I have no influence on what Android suggests, where to put the wallpaper. That's because the preview button only opens the native wallpaper preview screen that is completely provided by Android.

Other apps solve this by setting the wallpaper themselves. I didn't want to do that, because that would need the set wallpaper permission, which an app that is the wallpaper itself should not need. To name another app with that problem: e.g. Wallpaper Changer isn't a wallpaper, but an app that changes the wallpaper, whereas Slideshow Wallpaper is a live wallpaper. I also don't think the "Show on lock screen" permission should be needed, because not the app shows itself on the lockscreen, but the lockscreen uses it as the wallpaper. Also that permission seems to be specific to MIUI, or giving it to apps that didn't ask for it is specific to MIUI. At least I can't find it on my phone. For more information, please read issues #10 and #11.

Doubi88 commented 1 year ago

Hey, I'm sorry, I forgot the other issue you described. That it reverts to the default background usually happens when the app crashes for some reason. The problem is, that it's very hard to reproduce for me, because these crashes don't happen on my devices. Do you coincidentally happen to know how to debug an Android device? This way you could track down the reason of the crash and send me the stack trace.

TypicalScenario commented 1 year ago

From what I can see with logcat, It doesn't seem like It's crashing at all. The only relevant lines I could find were these:

10-19 04:05:51.521 1917 1917 D WallpaperManagerService: Wallpaper_switch-user-0 10-19 04:05:51.522 1917 1917 W WallpaperManagerService: Attempted wallpaper ComponentInfo{io.github.doubi88.slideshowwallpaper/io.github.doubi88.slideshowwallpaper.SlideshowWallpaperService} is unavailable 10-19 04:05:51.522 1917 1917 W WallpaperManagerService: Wallpaper isn't direct boot aware; using fallback until unlocked

And here starts the service:

10-19 04:05:58.932 1917 1971 I ActivityManager: Start proc 3634:io.github.doubi88.slideshowwallpaper/u0a237 for service {io.github.doubi88.slideshowwallpaper/io.github.doubi88.slideshowwallpaper.SlideshowWallpaperService} caller=android

Again, no errors or worse in sight. To reiterate what I said previously, the wallpaper only gets reverted on the lock screen, the home screen is pitch black on startup. After a considerable amount of time, a picture does get set, but definitely not on the first android.intent.action.WALLPAPER_CHANGED .

Maybe this could serve as a clue: 10-19 04:29:30.136 1922 5119 W ImageReader_JNI: Unable to acquire a buffer item, very likely client tried to acquire more than maxImages buffers

I can provide you with the raw output if you're interested, as the device is clean of all accounts and personal information.

Doubi88 commented 11 months ago

Thanks for the detailed information. That really helps. That the lock screen shows the default image directly after boot is normal ("Wallpaper isn't direct boot aware; using fallback until unlocked"), but it should change, as soon as you unlock your phone. I have the black home screen at startup on my device, too. I will futher investigate this.

Doubi88 commented 7 months ago

The black screen stays until the image changes. Perhaps it doesn't check, if the current image could be loaded and doesn't try again.

For "Direct-Boot aware", Issue #53 is used.

Doubi88 commented 7 months ago

Black screen on startup problem solved.

TypicalScenario commented 7 months ago

If you ever need my device for testing a new version, I'd be happy to help.

Doubi88 commented 7 months ago

Thank you 😊