I'm developing a custom BLE sensor on an nRF52832 (E73-2G4M04S1B module, SoftDevice S132
7.2.0) with a companion Android app. On Xiaomi/HyperOS devices (confirmed on this exact
phone), when the phone enters real Deep Doze (confirmed via
`adb shell dumpsys deviceidle force-idle` / `get deep` -> IDLE), MIUI's own ScanManager
unconditionally refuses to start any BLE scan from a non-system app:
```
W/ScanManager: is Deep Doze, non-system software won't start scan!
```
This fires for every scan attempt from my own app - live `ScanCallback`, `PendingIntent`-based
delivery, a `foregroundServiceType="connectedDevice"` (and `connectedDevice|location`) service,
regardless of permissions held.
However, **nRF Connect for Android** (installed from Google Play on the same phone) keeps
receiving advertisements and updating its device list throughout confirmed Deep Doze - verified
directly via `dumpsys bluetooth_manager` showing 0ms suspended time and hundreds of delivered
scan results during a ~45s Deep Doze window, while my own app's scanner got 0 results in the
same window.
I've spent a long debugging session trying to find what's different, and ruled out everything
I could test:
- Matched `ACCESS_FINE_LOCATION`/`ACCESS_BACKGROUND_LOCATION` grants - no effect.
- Matched `foregroundServiceType="connectedDevice|location"` - no effect (and decompiling your
APK shows the actual persistently-running `BluetoothLeService` only declares
`connectedDevice`, not `location`, so this wasn't the mechanism anyway).
- Matched `BLUETOOTH_SCAN` **without** `neverForLocation` (as your manifest has it) - no effect.
- Reinstalled my app with `installerPackageName` spoofed to `com.android.vending` - no effect.
- Matched `targetSdkVersion` to 35 - no effect.
- Checked the signing certificate - it's just your normal Nordic Semiconductor ASA company
certificate, nothing unusual.
So from what I can tell, nothing in the APK itself or in any manifest/permission declaration
explains it. That leaves either something OS/certificate-level that MIUI special-cases outside
the app (publisher allowlist, Play Protect reputation, etc.), or something I haven't thought to
check.
Since I'm building on your own chip, I'd really appreciate it if someone on the Android app
team could share whether there's a known technique here - even just confirming "we don't do
anything special, it's purely external to the app" would save me from chasing this further.
Device: Xiaomi running HyperOS (MIUI), nRF Connect version 4.29.1.
Thanks!