I'm trying to disable one of Android StrictMode checks - detection of untagged sockets.
I have several reasons to do this:
Some libraries used in our app e.g. Crashlytics / Picasso e.t.c. are using OkHttp internally and StrictMode detects untagged socket problem in OkHttp code (I don't have access to code of third party libraries to fix this problem there)
I need to clear my logs from strict mode untagged socket errors which I can't fix to remove noise for other StrictMode problem detection
To enable VmPolicy We use VmPolicy.Builder.detectAll() method
By looking in sources of StrictMode I've found method VmPolicy.Builder.permitUntaggedSockets but it annotated as @hidden
and can't be used on API = 28
The only solution to this problem I've found is to copy detectAll()
method body to my code and remove call to detectUntaggedSockets()
but it seems to me error prone and weakly maintainable.
May be some one can suggest better solution to described problem?
Any information about "Why permitUntaggedSockets()
became hidden in API 28" are really appreciated.