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

Fix: Handle exception if Context.registerReceiver throws #1747

Merged
merged 3 commits into from
Oct 4, 2021

Conversation

marandaneto
Copy link
Contributor

@marandaneto marandaneto commented Oct 1, 2021

📜 Description

Fix: Handle exception if Context.registerReceiver throws

💡 Motivation and Context

Caused by: java.lang.SecurityException:
at android.os.Parcel.createExceptionOrNull (Parcel.java:2385)
at android.os.Parcel.createException (Parcel.java:2369)
at android.os.Parcel.readException (Parcel.java:2352)
at android.os.Parcel.readException (Parcel.java:2294)
at android.app.IActivityManager$Stub$Proxy.registerReceiverWithFeature (IActivityManager.java:6381)
at android.app.ContextImpl.registerReceiverInternal (ContextImpl.java:1696)
at android.app.ContextImpl.registerReceiver (ContextImpl.java:1650)
at android.app.ContextImpl.registerReceiver (ContextImpl.java:1638)
at android.content.ContextWrapper.registerReceiver (ContextWrapper.java:686)
at io.sentry.android.core.SystemEventsBreadcrumbsIntegration.register (SystemEventsBreadcrumbsIntegration.java:98)
at io.sentry.Sentry.init (Sentry.java:181)
at io.sentry.Sentry.init (Sentry.java:110)
at io.sentry.android.core.SentryAndroid.init (SentryAndroid.java:59)
at io.sentry.android.core.SentryAndroid.init (SentryAndroid.java:44)
at com.png.sportsbook.app.App.onCreate (App.kt:73)
at android.app.Instrumentation.callApplicationOnCreate (Instrumentation.java:1192)
at android.app.ActivityThread.handleBindApplication (ActivityThread.java:7535)
at android.app.ActivityThread.access$1500 (ActivityThread.java:301)
at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2158)
at android.os.Handler.dispatchMessage (Handler.java:106)
at android.os.Looper.loop (Looper.java:246)
at android.app.ActivityThread.main (ActivityThread.java:8595)
at java.lang.reflect.Method.invoke (Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:602)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1130)

💚 How did you test it?

unit test

📝 Checklist

  • I reviewed the submitted code
  • I added tests to verify the changes
  • I updated the docs if needed
  • No breaking changes

🔮 Next steps

@marandaneto marandaneto requested a review from a team October 1, 2021 06:21
Copy link
Contributor

@maciejwalkowiak maciejwalkowiak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@marandaneto marandaneto merged commit 7b4b8c2 into main Oct 4, 2021
@marandaneto marandaneto deleted the fix/registerreceiver-throws branch October 4, 2021 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants