Fix Location Check for Barring and RegFail
For both Barring and for Registration Failure, fine
location access is required; however, by only checking
apps that target the R SDK or later, there is a bypass
that devices can target a lower SDK level and still get
access by reflection.
Since this API isn't public yet, just fix in RVC.
Bug: 157272471
Test: compilation
Change-Id: I22d36498b88abfb1beb836979e40ffce04022c2b
This commit is contained in:
@@ -1083,7 +1083,7 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
||||
if (VDBG) log("listen: call onBarringInfoChanged=" + barringInfo);
|
||||
try {
|
||||
r.callback.onBarringInfoChanged(
|
||||
checkFineLocationAccess(r, Build.VERSION_CODES.R)
|
||||
checkFineLocationAccess(r, Build.VERSION_CODES.BASE)
|
||||
? barringInfo : biNoLocation);
|
||||
} catch (RemoteException ex) {
|
||||
remove(r.binder);
|
||||
@@ -2277,7 +2277,7 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
||||
&& idMatch(r.subId, subId, phoneId)) {
|
||||
try {
|
||||
r.callback.onRegistrationFailed(
|
||||
checkFineLocationAccess(r, Build.VERSION_CODES.R)
|
||||
checkFineLocationAccess(r, Build.VERSION_CODES.BASE)
|
||||
? cellIdentity : noLocationCi,
|
||||
chosenPlmn, domain, causeCode,
|
||||
additionalCauseCode);
|
||||
@@ -2324,7 +2324,7 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
||||
+ barringInfo + " r=" + r);
|
||||
}
|
||||
r.callback.onBarringInfoChanged(
|
||||
checkFineLocationAccess(r, Build.VERSION_CODES.R)
|
||||
checkFineLocationAccess(r, Build.VERSION_CODES.BASE)
|
||||
? barringInfo : biNoLocation);
|
||||
} catch (RemoteException ex) {
|
||||
mRemoveList.add(r.binder);
|
||||
|
||||
Reference in New Issue
Block a user