2

I use Sentry, and last 3 months receive ANR (Application Not Responding) with two devices (Xiaomi Mi A2 Lite, Samsung SM-A605FN). I think the problem with time waiting for respond(problem maybe occurred with hardware or slow internet ), and want to make one condition for those two devices for extend timeout time.

<application>
    <meta-data android:name="io.sentry.anr.timeout-interval-mills" android:value="15000" />
</application>

I want to set this timeout only for two devices.

enter image description here

Thanks

Molotow
  • 23
  • 4
  • Please share code for better understanding so it will be easy to resolve your problem. Also please try to make your question more clear and readable. – Muhammad Zahab Jun 09 '21 at 13:31

2 Answers2

2

In the Android there is a class called Build, which provide all device information

for more information - check Build Class| Developer.Android

Example - Log.d("Vivek ", "Device -> " + Build.MANUFACTURER + " Brand ->" + Build.BRAND + " Display -> " + Build.DISPLAY); Log.d("Vivek ", " FINGERPRINT -> " + Build.FINGERPRINT + " Model ->" + Build.MODEL + " Bootloader -> " + Build.BOOTLOADER);

Vivek Hande
  • 929
  • 9
  • 11
2

You'll need to opt-out from the auto init, and call SentryAndroid.init by yourself to add the condition to the ANR timeout option conditionally by the device the code is running (using the approach from @VivekHande's answer):

https://docs.sentry.io/platforms/android/configuration/manual-init/

Bruno Garcia
  • 6,029
  • 3
  • 25
  • 38