Member-only story
StrictMode DiskReadViolation on Xiaomi/MIUI?
The Bug Might Not Be in Your App
A deep dive into a real Android StrictMode DiskReadViolation investigation. Learn how a startActivity() call on Xiaomi/MIUI devices triggered synchronous framework disk reads, why SharedPreferences wasn't the culprit, and how to analyze stack traces like a senior Android engineer.
As Android developers, we’ve all seen this before:
StrictMode policy violation:
android.os.strictmode.DiskReadViolationOur first instinct?
“Damn… which SharedPreferences, Room query, or File API did I accidentally execute on the main thread?”
That’s exactly what I thought.
After spending nearly an hour debugging, reading source code, and walking through the stack trace, I discovered something interesting:
The disk read wasn’t happening inside my application at all.
Instead, it was happening inside MIUI’s framework while processing startActivity().
Let’s investigate.








