Sitemap

Member-only story

StrictMode DiskReadViolation on Xiaomi/MIUI?

The Bug Might Not Be in Your App

5 min readJun 23, 2026

--

Press enter or click to view image in full size

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.DiskReadViolation

Our 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.

Press enter or click to view image in full size
Free Short Link and LinkInBio Page. COUPON — MEDIUM50 for 50% discount on any plan.

The Original Stack Trace

--

--

Romman Sabbir
Romman Sabbir

Written by Romman Sabbir

Android Lead | Kotlin Enthusiast (Android, iOS, Backend - Spring Boot)