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

[Bug]: ANR related to location services #1791

Open
1 task done
AlexTip opened this issue Aug 1, 2023 · 2 comments
Open
1 task done

[Bug]: ANR related to location services #1791

AlexTip opened this issue Aug 1, 2023 · 2 comments

Comments

@AlexTip
Copy link

AlexTip commented Aug 1, 2023

What happened?

Sometimes app track ANR issue
this related to #1612
but problem in another place

Steps to reproduce?

No simple way to reproduce it. But you can see problem place by trace

What did you expect to happen?

Calculating in background thread

OneSignal Android SDK version

4.8.6

Android version

13, 12, 11, 10

Specific Android models

No specific configurations

Relevant log output

"main" tid=1 Blocked
  at com.onesignal.LocationController.onFocusChange (LocationController.java)
  at com.onesignal.OneSignal.onAppFocus (OneSignal.java)
  at com.onesignal.OSFocusHandler.startOnFocusWork (OSFocusHandler.java)
  at com.onesignal.ActivityLifecycleHandler.handleFocus (ActivityLifecycleHandler.java)
  at com.onesignal.ActivityLifecycleHandler.onActivityResumed (ActivityLifecycleHandler.java)
  at com.onesignal.ActivityLifecycleListener.onActivityResumed (ActivityLifecycleListener.java)
  at android.app.Application.dispatchActivityResumed (Application.java:438)
  at android.app.Activity.dispatchActivityResumed (Activity.java:1446)
  at android.app.Activity.onResume (Activity.java:1985)
  at androidx.fragment.app.FragmentActivity.onResume (FragmentActivity.java)
  at android.app.Instrumentation.callActivityOnResume (Instrumentation.java:1457)
  at android.app.Activity.performResume (Activity.java:8312)
  at android.app.ActivityThread.performResumeActivity (ActivityThread.java:4553)
  at android.app.ActivityThread.handleResumeActivity (ActivityThread.java:4595)
  at android.app.servertransaction.ResumeActivityItem.execute (ResumeActivityItem.java:52)
  at android.app.servertransaction.TransactionExecutor.executeLifecycleState (TransactionExecutor.java:176)
  at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:97)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2146)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loop (Looper.java:236)
  at android.app.ActivityThread.main (ActivityThread.java:8057)
  at java.lang.reflect.Method.invoke (Native method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:656)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:967)

Code of Conduct

  • I agree to follow this project's Code of Conduct
@jennantilla
Copy link
Contributor

Hello @AlexTip thank you for reaching out! This does indeed appear to be related to #1612.

As a workaround while we investigate solutions, if you don't need location points in OneSignal, you can call OneSignal.setLocationShared(false) to disable these location updates.

Thanks!

@AlexTip
Copy link
Author

AlexTip commented Aug 7, 2023

@jennantilla Thanks, I'll try

Another point, you marked this issue as duplicate #1612
But I think I have different root cause place (not sure but my opinion)

in my case it happened on handleFocus (ActivityLifecycleHandler.java)
in #1612 - handleLostFocus (ActivityLifecycleHandler.java) - already fixed in previous release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants