New I/LocationManagerInjector: addGpsStatusListener(...) is blocked by policy


pasniak

Members
May 1, 2021
2
3
My app uses NMEA messages (to extract better elevation and stats; the app can get precise location)

Java:
internalGps?.addNmeaListener(OnNmeaMessageListener { timestamp, nmea ->

    parseNmeaGpggaMessage(nmea, timestamp)

})

But on MIUI 12.0.1 at addNmeaListener call I get
2021-05-01 09:13:20.055 2066-3595/? I/LocationManagerInjector: ... addGpsStatusListener(android.location.IGnssStatusListener$Stub$Proxy@ecc6b6b) is blocked by policy

Which policy is it? and why I get no exception (for example SecurityException) to report to the user?
 
Take a look at /data/system/locationpolicy.xml file, might give you some clue.
 
Thanks guys!

Android 10 QKQ1.190910.002
MIUI by xiaomi.eu 12.0.1Stable 12.0.1.0(QWDCNXM)
MI MAX 3

XML:
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<policy-list version="1" restrictBackground="false">
<location-policy provider="network" high-power="false" minIntervalMs="10000" />
<uid-policy uid="10058" policy="255" />
<uid-policy uid="10072" policy="255" />
<uid-policy uid="10080" policy="255" />
<uid-policy uid="10107" policy="255" />
<uid-policy uid="10183" policy="255" />
<uid-policy uid="10185" policy="255" />
<uid-policy uid="10186" policy="255" />
<uid-policy uid="10187" policy="255" />
<uid-policy uid="10188" policy="255" />
<uid-policy uid="10189" policy="255" />
<uid-policy uid="10190" policy="255" />
<uid-policy uid="10191" policy="255" />
<uid-policy uid="10192" policy="255" />
<uid-policy uid="10194" policy="255" />
<uid-policy uid="10196" policy="255" />
<uid-policy uid="10197" policy="255" />
<uid-policy uid="10200" policy="255" />
</policy-list>