Skip to content

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.

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

I want to set this timeout only for two devices.

enter image description here




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):

User contributions licensed under: CC BY-SA
10 People found this is helpful