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

Not really issues -- more like a couple questions #30

Closed
synman opened this issue Dec 16, 2017 · 1 comment
Closed

Not really issues -- more like a couple questions #30

synman opened this issue Dec 16, 2017 · 1 comment

Comments

@synman
Copy link

synman commented Dec 16, 2017

Android typically traps ANRs (at least for touch events) after 500ms. By having our ANR timeout higher than that is it possible we could ANR, present a wait/close message, answer close, before the watchdog's ANR event fires?

My thought is yes. Do you see any ramifications about running with a 500 ms timeout in production? I'm only talking about the main thread monitor. I do my own sleeps in other threads that would definitely trip it if I were monitoring them too.

The next comment is really more an annoyance with Google. I absolutely hate not being able to interrupt and join ANRWatchDog onTerminate() because for whatever reason Google refuses to give us a means of (easily / logically) determining when an application closes.

I have the following in my onTerminate() but I know it will never be called. I'm guessing this why you simply just create an anonymous instance in all your examples, correct?

    anrWatchDog.interrupt();

    try {
        anrWatchDog.join();
    } catch (InterruptedException e) {
        Crashlytics.logException(e);
    }
@jeffdgr8
Copy link

Android detects ANRs after 5 seconds, same as this library: "While your activity is in the foreground, your app has not responded to an input event or BroadcastReceiver (such as key press or screen touch events) within 5 seconds." https://developer.android.com/topic/performance/vitals/anr.html

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

No branches or pull requests

3 participants