In runtime, Play Store reports ANR in org.prebid.mobile.rendering.utils.helpers.AppInfoManager.initUserAgent. We don't see that in our testing. We start to see it when deploy to production. The call eventually call file system which causes ANR.
There is a Preferences function call and JSLibraryManager call in main thread inside UserConsentManager. This results in ANR showing up every time when in strict policy mode.
To Reproduce
Only the second complaint seems to be reproduced under the strict policy mode. Although not sure this will be reproduced with the demo app, it might be that only with the publisher's app.
Original Publisher Complaint
In runtime, Play Store reports ANR in
org.prebid.mobile.rendering.utils.helpers.AppInfoManager.initUserAgent
. We don't see that in our testing. We start to see it when deploy to production. The call eventually call file system which causes ANR.There is a
Preferences
function call andJSLibraryManager
call in main thread insideUserConsentManager
. This results in ANR showing up every time when in strict policy mode.To Reproduce
Only the second complaint seems to be reproduced under the strict policy mode. Although not sure this will be reproduced with the demo app, it might be that only with the publisher's app.
Remedy
[ ]
initUserAgent
call creates a WebView and then retrieves the User-Agent from it. This can't be done on the background thread, instead this method should be used: https://developer.android.com/reference/android/webkit/WebSettings.html#getDefaultUserAgent(android.content.Context) - it also does some heavy lifting internally, and then it should be moved to a background thread that will not cause the ANR.[ ]
JSLibraryManager
reads some files from disk on the main thread that too should be moved to the background thread.[ ] Preferences reading apparently also can be moved to a background thread.
These 3 changes should relieve apps from the ANRs during the initialization of the SDK.
Additional Context
affected devices, OS versions, etc.
to be provided
additional notes
to be provided