Fix Red Border Flash on Custom ROM: Step-by-Step
In this article
The red border flash on a custom ROM is usually a debugging overlay from Android's StrictMode, indicating that the system detected a slow operation or a violation on the main thread. It is not a hardware failure or a sign of a broken ROM. The fix is simple: disable StrictMode's visual indicators, either through Developer Options or by editing a system setting via ADB. Below is a practical guide to remove it, with steps that work on most custom ROMs (LineageOS, Pixel Experience, crDroid, etc.).
What You'll Need
- A device running a custom ROM (the steps assume you have already installed it).
- Access to the Settings app on the device.
- For the ADB method: a computer with ADB (Android Debug Bridge) installed, USB debugging enabled on the phone, and the phone connected via USB.
Step-by-Step
- Check if Developer Options are enabled. Go to Settings > About phone and tap Build number seven times. You may need to enter your PIN/pattern. This unlocks the hidden Developer Options menu.
- Open Developer Options. Go to Settings > System > Developer options (the exact path may vary slightly by ROM, but it is usually under System or Additional Settings).
- Locate the StrictMode toggle. Scroll through the list and look for a setting named Strict mode enabled, StrictMode, or Show all ANRs (ANR stands for Application Not Responding). The red border is triggered by StrictMode's visual indicator, so disabling it should stop the flash. If you see Show all ANRs, that is a different thing – leave it alone unless you want to see ANR dialogs.
- Turn off the toggle. Tap the switch next to Strict mode enabled (or similar) to turn it off. The red border should disappear immediately. If you cannot find this toggle, proceed to the ADB method below.
- Alternative: Use ADB to disable StrictMode. If the Developer Options toggle is missing or not working, connect your phone to your computer with USB debugging enabled (you can enable it in Developer Options). Open a command prompt/terminal on your computer and type:
adb shell settings put global strict_mode_enabled 0then press Enter. This directly sets the global setting to off. Reboot your phone afterward to ensure it takes effect. - Reboot the device. After either method, restart your phone. The red border should no longer appear.
Common Mistakes
- Enabling Developer Options but not toggling the right setting: Some ROMs name the setting differently (e.g., “StrictMode” vs. “Strict mode”). Read carefully; it is usually the only one with “Strict” in the name.
- Turning off “Show all ANRs” instead: That setting shows a dialog when an app stops responding, not a red border. Disabling it does nothing for the red flash.
- Forgetting to reboot: Some ROMs apply the change only after a reboot. If the border persists, restart.
- Using ADB without USB debugging enabled: ADB will not work unless you have enabled USB debugging in Developer Options and authorized your computer.
Tips
- If you are a developer and actually want to see StrictMode violations, keep the red border on – it is a useful debugging tool. Only disable it if it annoys you.
- On some ROMs, the red border appears only when an app is doing heavy work on the main thread. If it flashes occasionally, it might be a specific app misbehaving. Try uninstalling recently installed apps to see if it stops.
- If you are using a custom kernel or a Magisk module that enables StrictMode by default, you may need to disable it there as well. Check your kernel manager app or Magisk modules for any “StrictMode” or “debug” options.
Troubleshooting
If the red border persists after following the steps:
- Reboot into safe mode. Press and hold the power button, then tap and hold “Power off” until the “Reboot to safe mode” prompt appears. If the red border disappears in safe mode, a third-party app or module is causing it. Uninstall recent apps or modules.
- Check for a custom kernel setting. If you have a custom kernel, open its companion app (e.g., EX Kernel Manager, Franco Kernel Manager) and look for a “StrictMode” or “debug” toggle. Disable it.
- Clear cache of the Settings app. Go to Settings > Apps > Settings and tap “Storage” then “Clear cache”. This can reset any corrupted settings state.
- Re-apply the ADB command. Sometimes the setting gets overwritten. Run
adb shell settings put global strict_mode_enabled 0again, then reboot. - If nothing works, reflash the ROM. This is a last resort. Back up your data first, then reinstall the ROM without wiping data (dirty flash) or do a full wipe. This usually resets all system settings.
Frequently Asked Questions
Is the red border harmful to my phone?
No, it is purely a visual indicator from Android's debugging tool. It does not affect performance or battery life.
Why does the red border appear only sometimes?
It appears when an app performs a slow operation on the main thread (like a network call or disk I/O). If it happens rarely, it's likely an app issue, not a ROM problem.
Will disabling StrictMode affect my ROM's stability?
No, it only hides the visual warning. The underlying detection is still active in the background, but you won't see the border.
Can I disable it without a computer?
Yes, if your ROM has the Developer Options toggle. If not, you need ADB.
Does this work on all custom ROMs?
Most custom ROMs based on AOSP include the same StrictMode setting. Some OEM ROMs (like MIUI or OneUI) may have it hidden, but the ADB method generally works.
I don't have Developer Options. How do I enable them?
Go to Settings > About phone and tap “Build number” seven times. You'll see a toast saying “You are now a developer!”