phhusson / platform_frameworks_base

Other
10 stars 32 forks source link

SystemUI crashes while releasing a wakelock #12

Closed ponces closed 3 years ago

ponces commented 3 years ago

SystemUI is crashing and restarting everytime the device receives a new notification and the user expands it to be able to read it from the lockscreen.

It seems caused by a wakelock not being correctly released...

This is the stack at the time the exception was thrown:

--------- beginning of crash 01-18 17:47:54.445 4691 4691 E AndroidRuntime: FATAL EXCEPTION: main 01-18 17:47:54.445 4691 4691 E AndroidRuntime: Process: com.android.systemui, PID: 4691 01-18 17:47:54.445 4691 4691 E AndroidRuntime: java.lang.RuntimeException: WakeLock under-locked Doze 01-18 17:47:54.445 4691 4691 E AndroidRuntime: at android.os.PowerManager$WakeLock.release(PowerManager.java:2461) 01-18 17:47:54.445 4691 4691 E AndroidRuntime: at android.os.PowerManager$WakeLock.release(PowerManager.java:2423) 01-18 17:47:54.445 4691 4691 E AndroidRuntime: at com.android.systemui.util.wakelock.WakeLock$1.release(WakeLock.java:112) 01-18 17:47:54.445 4691 4691 E AndroidRuntime: at com.android.systemui.util.wakelock.DelayedWakeLock.lambda$release$0(DelayedWakeLock.java:47) 01-18 17:47:54.445 4691 4691 E AndroidRuntime: at com.android.systemui.util.wakelock.DelayedWakeLock.lambda$release$0$DelayedWakeLock(Unknown Source:0) 01-18 17:47:54.445 4691 4691 E AndroidRuntime: at com.android.systemui.util.wakelock.-$$Lambda$DelayedWakeLock$aTG9u0wfrNahXJF_VixBxfvFqfg.run(Unknown Source:4) 01-18 17:47:54.445 4691 4691 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:938) 01-18 17:47:54.445 4691 4691 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:99) 01-18 17:47:54.445 4691 4691 E AndroidRuntime: at android.os.Looper.loop(Looper.java:223) 01-18 17:47:54.445 4691 4691 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:7660) 01-18 17:47:54.445 4691 4691 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method) 01-18 17:47:54.445 4691 4691 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) 01-18 17:47:54.445 4691 4691 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

Attached is the full log - wakelock.txt

phhusson commented 3 years ago

Someone else reported this crash on a Galaxy S20 FE What's your device?

ponces commented 3 years ago

Someone else reported this crash on a Galaxy S20 FE What's your device?

Samsung Galaxy A40

ponces commented 3 years ago

@phhusson Is this a solution? If so, could you please compile an image with this fix so I can test it? Following some advices from here, here and here

image

phhusson commented 3 years ago

I don't think that this is the issue, the lock is "under-locked", so i'd guess it's held?

ponces commented 3 years ago

All those references that I mentioned are also "under-locked"... 🤔

ponces commented 3 years ago

Can confirm the fix is working using an updated SystemUI version!

ponces commented 3 years ago

@phhusson do you want me to create a PR for this or do you have a proper fix in mind?

phhusson commented 3 years ago

Nope go ahead with the pr

2 févr. 2021 01:44:51 Alberto Ponces notifications@github.com:

@phhusson[https://github.com/phhusson] do you want me to create a PR for this or do you have a proper fix in mind?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub[https://github.com/phhusson/platform_frameworks_base/issues/12#issuecomment-771263925], or unsubscribe[https://github.com/notifications/unsubscribe-auth/AAAA4OT3AJOVG3KTIE5VQ3DS45DIFANCNFSM4WH7JBNQ]. [data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAA4CAYAAACohjseAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAAjSURBVGiB7cEBDQAAAMKg909tDwcUAAAAAAAAAAAAAADApwExOAABR9ZGcwAAAABJRU5ErkJggg==###24x24:true###][Image de pistage][https://github.com/notifications/beacon/AAAA4OVCQNLII6N6GUEOPJTS45DIFA5CNFSM4WH7JBN2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOFX4I3NI.gif]

ponces commented 3 years ago

Done and closed! Thank you!

ghost commented 3 years ago

for me too on Zenfone Max Shot

ponces commented 3 years ago

for me too on Zenfone Max Shot

For me it was fixed with v300.m which has the commit mentioned in this thread. Which version are you running?