System UI crash when opening/using device controls
See original GitHub issueHome 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:
- Created 2 years ago
- Reactions:2
- Comments:10 (7 by maintainers)
Top GitHub Comments
Good to hear it’s working now!
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.
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