running adb logcat in the shell i see something like this
StrictMode policy violation; ~duration=337 ms: android.os.StrictMode$StrictModeDiskReadViolation: policy=23 violation=2
- what the policy=23 means ?
- what is violation=2 ?
I was searching for the meanings of this values but I couldn't find any documentation whit violation and policy list, or maybe I interpreted the results from my search in a bad way, but I will appreciate some explanation about this
You can configure StrictMode to notify you of certain things and you can tell it how you'd like to get notified (simple log message, exception, ...). See the Enabling StrictMode section in this blog post for reference.
Policy is a bitmask that keeps track of that configuration internally. Since it's a mask it more intuitive to interpret it in binary, which is 10111. Then you can look up the relevant bits within the
BlockGuard.java
source file. Here is a short copy from this site (not sure what android version that is, there might be more things in newer versions; I don't have the current source on my machine right now):With that you can tell that your StrictMode is configured to notify you of DISK_READ, DISK_WRITE and NETWORK violations via a log message.
This ist just the type of the vialolation as some internal int constant. It doesn't help you much since the name of the exception gives that away already. The author just defined one
getMessage()
method that's used across all the different, subclassed StrictMode exceptions. Just for reference, these constants are defined within StrictMode.java.