ShaderEditor icon indicating copy to clipboard operation
ShaderEditor copied to clipboard

App crashes after plugging in charger

Open lajonss opened this issue 7 years ago • 9 comments

Gear: Samsung GT-i5510 Galaxy, Cyanogenmod 7 (Android 2.3.7) Shader Editor version: 2.8.1 Logcat:

W/ActivityManager( 1717): Permission Denial: Accessing service ComponentInfo{de.markusfisch.android.shadereditor/de.markusfisch.android.shadereditor.service.ShaderWallpaperService} from pid=1717, uid=1000 requires android.permission.BIND_WALLPAPER
E/AndroidRuntime( 2557): java.lang.RuntimeException: Unable to start receiver de.markusfisch.android.shadereditor.receiver.BatteryLevelReceiver: java.lang.SecurityException: Not allowed to start service Intent { cmp=de.markusfisch.android.shadereditor/.service.ShaderWallpaperService (has extras) } without permission android.permission.BIND_WALLPAPER
E/AndroidRuntime( 2557): Caused by: java.lang.SecurityException: Not allowed to start service Intent { cmp=de.markusfisch.android.shadereditor/.service.ShaderWallpaperService (has extras) } without permission android.permission.BIND_WALLPAPER
E/AndroidRuntime( 2557): 	at de.markusfisch.android.shadereditor.receiver.BatteryLevelReceiver.a(Unknown Source)
E/AndroidRuntime( 2557): 	at de.markusfisch.android.shadereditor.receiver.BatteryLevelReceiver.onReceive(Unknown Source)
I/WindowManager( 1717): WIN DEATH: Window{407f62a0 de.markusfisch.android.shadereditor/de.markusfisch.android.shadereditor.activity.MainActivity paused=false}
I/ActivityManager( 1717): Process de.markusfisch.android.shadereditor (pid 2557) has died.
W/ActivityManager( 1717): Scheduling restart of crashed service de.markusfisch.android.shadereditor/.service.ShaderWallpaperService in 5000ms
W/WallpaperService( 1717): Wallpaper service gone: ComponentInfo{de.markusfisch.android.shadereditor/de.markusfisch.android.shadereditor.service.ShaderWallpaperService}
I/WindowManager( 1717): WIN DEATH: Window{407f0fd8 de.markusfisch.android.shadereditor.service.ShaderWallpaperService paused=false}

Used wallpaper:

#ifdef GL_FRAGMENT_PRECISION_HIGH
precision highp float;
#else
precision mediump float;
#endif

uniform vec2 resolution;
uniform float battery;
uniform float time;
uniform vec3 gravity;

void main(void) {
  vec2 uv = gl_FragCoord.xy / resolution.xy - 0.5;
  const float pi = 3.14;
  const float pih = 1.57;
  float grot = gravity.y / length(gravity.xy) * pih;
  float a = gravity.x > 0.0 ? grot : pi - grot;
  float b = battery;
  vec2 uvr = vec2(
    uv.x * cos(a) - uv.y * sin(a),
    uv.x * sin(a) + uv.y * cos(a)
  );
  float t = time;
  float c = ((uvr.y+ 0.5)/b + 1.0 - 1.0/b + sin(t) *uvr.x*0.2);
  float cs = abs(sin(t)) * c;
  float cr = (1.0 - 2.0 * b) * cs;
  float cg = b * cs;
  gl_FragColor = vec4(cr, cg, 0.0, 1.0);
}

This app is amazing by the way :)

lajonss avatar Sep 17 '17 19:09 lajonss

That's odd - it's a SecurityException because the service is missing the android.permission.BIND_WALLPAPER permission ... but it's specified in the app's Manifest. Can it be because of some permission setting in Cyanogen maybe?

markusfisch avatar Sep 18 '17 10:09 markusfisch

I've been witnessing a similar behavior lately. I thought it was Android simply unloading itself, but suspect it could be triggering a crash when charging on my Pixel 3, stock Android at the most current version. This ran fine until the more recent Feb/Mar/Apr updates but now whenever I charge there's a 50/50 chance that this will cause the application to crash and I'll come back to find my phone fully charged but with the stock wallpaper set but no error notifications.

If there's an easy way for me to get logs to help trace this, let me know.

lech avatar May 09 '20 23:05 lech

I've got a Pixel 3a with the same problem 😔 Unfortunately, I haven't found out what is causing the issue but it seems to be a system bug: https://issuetracker.google.com/issues/153361057

markusfisch avatar May 10 '20 10:05 markusfisch

I've browsed through the comments on that bug report, and coincidentally I also have the Google One app installed which can let me try a few things. However I have noticed that while running the Wave Live Wallpaper or just using a static image that this doesn't happen to me.

Shader Editor seems to be the only live wallpaper app I have which is triggering this for me at the moment, I suspect if Google One is trying to back something up in use, it might be causing SE to silently crash and Android gracefully resets the wallpaper without giving any notification. I thought this was first triggered by slow charging, but fast charging has the same effect.

I've just updated to the May 5th, 2020 update while writing this so I'll see if that fixes it and try a few other things and report back.

lech avatar May 10 '20 16:05 lech

That's interesting 🤔 Unfortunately, I don't see any crashes in the Google Play Console that would give me a lead on this. Hm. I'll try to find out if there's something I can do about it.

markusfisch avatar May 10 '20 17:05 markusfisch

Alright, it's been a week since I've been testing and I suspect the May 5th update might have addressed this. I'm not seeing it reset now. How strange.

lech avatar May 15 '20 02:05 lech

Good to know! Thanks for reporting! Let's hope it stays that way.

markusfisch avatar May 15 '20 07:05 markusfisch

You're going to dislike this, but I plugged my phone in this afternoon, checked on it this evening and it looks like this is persisting. I got a week's worth of live wallpaper though, so it's not resetting daily which is nice. I'll keep you posted.

lech avatar May 19 '20 00:05 lech

OK, so oddly enough on my Pixel 3 XL under Android Q there's two places which needed update attention. In addition to the previous which made things happy.

Settings > System > ~Advanced / System Update

However, there's also this to consider:

Settings > Security > Security update and Settings > Security > Google Play system update

It seems like if those last two aren't relatively current (May 5 or May 1, 2020, respectively) or in need of attention (yellow or red), this behavior may persist. However, I recall after I last posted I found one of those needed attention and since I updated that, everything seems peachy, again.

  • Additionally after I wrote this I received the June 5, 2020 update and the shader live background was restored post-restart. :smile:

lech avatar Jun 08 '20 22:06 lech