Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App crashes with specific Intent URI scheme data #3797

Closed
dshokouhi opened this issue Aug 18, 2023 · 1 comment · Fixed by #3799
Closed

App crashes with specific Intent URI scheme data #3797

dshokouhi opened this issue Aug 18, 2023 · 1 comment · Fixed by #3799
Labels
bug Something isn't working notifications

Comments

@dshokouhi
Copy link
Member

Home Assistant Android app version(s):

2023.8.2-full

Android version(s):

13

Device model(s):

Pixel 7 Pro

Home Assistant version:

2023.7.x

Last working Home Assistant release (if known):

n/a

Description of problem, include YAML if issue is related to notifications:

When sending the following service call the app crashes

service: notify.mobile_app_dannys_pixel_7_pro
data:
  message: test
  data:
    clickAction: "intent:sms:+4123123///#Intent;sms_body=testing123;action=android.intent.action.SENDTO;end"

Companion App Logs:

2023-08-18 13:03:27.744 31786-31786 AndroidRuntime          io.homeassistant.companion.android   E  FATAL EXCEPTION: main
                                                                                                    Process: io.homeassistant.companion.android, PID: 31786
                                                                                                    java.net.URISyntaxException: unknown EXTRA type at index 36: intent:sms:+4916212345678///#Intent;sms_body=testing123;action=android.intent.action.SENDTO;end
                                                                                                    	at android.content.Intent.parseUriInternal(Intent.java:7738)
                                                                                                    	at android.content.Intent.parseUri(Intent.java:7595)
                                                                                                    	at io.homeassistant.companion.android.notifications.MessagingManager.createOpenUriPendingIntent(MessagingManager.kt:1492)
                                                                                                    	at io.homeassistant.companion.android.notifications.MessagingManager.handleContentIntent(MessagingManager.kt:1044)
                                                                                                    	at io.homeassistant.companion.android.notifications.MessagingManager.sendNotification(MessagingManager.kt:952)
                                                                                                    	at io.homeassistant.companion.android.notifications.MessagingManager.access$sendNotification(MessagingManager.kt:101)
                                                                                                    	at io.homeassistant.companion.android.notifications.MessagingManager$handleMessage$4.invokeSuspend(MessagingManager.kt:535)
                                                                                                    	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
                                                                                                    	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
                                                                                                    	at android.os.Handler.handleCallback(Handler.java:942)
                                                                                                    	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:7918)
                                                                                                    	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:936)
                                                                                                    	Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@ef73fd9, Dispatchers.Main]

Screenshot or video of problem:

Additional information:

@dshokouhi dshokouhi added bug Something isn't working notifications labels Aug 18, 2023
@dshokouhi
Copy link
Member Author

This crash occurs because the intent extra type is not specified explicitly.

clickAction: "intent:sms:+4916212345678///#Intent;S.sms_body=testing123;action=android.intent.action.SENDTO;end"

will not cause the app to crash as we are explicitly stating the extra is a string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working notifications
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant