How to get device model in AndroidManifest and make condition?



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

Answer

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/



Source: stackoverflow