question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

System UI crash when opening/using device controls

See original GitHub issue

Home Assistant Android version: 2022.1.1-full, beta-2046-c76248f6

Android version: 12, after installing the February 2022 patch (build SQ1A.220205.002)

Phone model: Google Pixel 4a

Home Assistant version: 2022.2.3 (not relevant)

Last working Home Assistant release (if known): it worked with the same versions on the January 2022 patch

Description of problem:

When I long press on a device control, the System UI crashes 50% of the time with an exception (see below). Other apps (Google Home, Cat Controls easter egg) don’t cause a crash. When I’ve only added 1 control, it doesn’t crash when interacting with it. In testing, if I use PendingIntent.FLAG_UPDATE_CURRENT like in the samples instead of PendingIntent.FLAG_CANCEL_CURRENT it doesn’t crash: https://github.com/home-assistant/android/blob/c76248f6efe8307a073d3b8c1b2e1d74749f7ab6/app/src/main/java/io/homeassistant/companion/android/controls/HaControl.kt#L26

Traceback (if applicable, to get the logs you may refer to: https://companion.home-assistant.io/docs/troubleshooting/faqs/#android-crash-logs):

2022-02-08 22:31:20.561 13537-13537/? E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.android.systemui, PID: 13537
    java.lang.RuntimeException: android.app.PendingIntent$CanceledException
        at com.android.wm.shell.TaskView.startActivity(TaskView.java:152)
        at com.android.systemui.controls.ui.DetailDialog$stateCallback$1.onInitialized(DetailDialog.kt:85)
        at com.android.wm.shell.TaskView.lambda$surfaceCreated$7(TaskView.java:343)
        at com.android.wm.shell.TaskView.$r8$lambda$Qt9euhM2L1QPAFyAHU1Pbi2emQc(Unknown Source:0)
        at com.android.wm.shell.TaskView$$ExternalSyntheticLambda1.run(Unknown Source:2)
        at android.os.Handler.handleCallback(Handler.java:938)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loopOnce(Looper.java:201)
        at android.os.Looper.loop(Looper.java:288)
        at android.app.ActivityThread.main(ActivityThread.java:7839)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
     Caused by: android.app.PendingIntent$CanceledException
        at android.app.PendingIntent.send(PendingIntent.java:959)
        at com.android.wm.shell.TaskView.startActivity(TaskView.java:148)
        at com.android.systemui.controls.ui.DetailDialog$stateCallback$1.onInitialized(DetailDialog.kt:85) 
        at com.android.wm.shell.TaskView.lambda$surfaceCreated$7(TaskView.java:343) 
        at com.android.wm.shell.TaskView.$r8$lambda$Qt9euhM2L1QPAFyAHU1Pbi2emQc(Unknown Source:0) 
        at com.android.wm.shell.TaskView$$ExternalSyntheticLambda1.run(Unknown Source:2) 
        at android.os.Handler.handleCallback(Handler.java:938) 
        at android.os.Handler.dispatchMessage(Handler.java:99) 
        at android.os.Looper.loopOnce(Looper.java:201) 
        at android.os.Looper.loop(Looper.java:288) 
        at android.app.ActivityThread.main(ActivityThread.java:7839) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003) 

Screenshot of problem: Unable to take a screenshot

Additional information:

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
jpelgromcommented, May 9, 2022

Good to hear it’s working now!

IMO that is not intuitive at all. It should be the other way around.

I agree, but how the controls are presented is decided by the manufacturer. The app only tells what is available to control and the current status. The example you’ve linked is Google’s implementation and is also what I see on my Pixel 4a, I believe your screen recordings are for a Samsung device who has decided to use a different layout.

1reaction
jpelgromcommented, Feb 8, 2022

Submitted to the Google issue tracker because I don’t see how this is a bug for the HA app: https://issuetracker.google.com/issues/218542096

Read more comments on GitHub >

github_iconTop Results From Across the Web

System UI crash when long pressing on device control
220205.002), long pressing on a device control to open the app will frequently cause the system UI to crash with an exception. Using...
Read more >
System UI crashing with quick access device controls - General
The app that stopped responding is “System UI”; it seems to be behaving as if there's no function assigned to that button. This...
Read more >
How to Fix System UI Has Stopped Working On Android
1. Clear Cache · 1. Open the Settings app on your Android phone and select Apps or Apps and notifications option · 2....
Read more >
How to Fix System UI Has Stopped Working ... - SoftwareKeep
If your Android phone's System UI stopped working, don't panic, you're not alone. There are a few quick fixes you can try before...
Read more >
System UI app still crashes : r/GooglePixel - Reddit
I've been getting constant almost daily lockups on my 3a that require me to hard-reboot the phone by holding the power button for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found