requestCellInfoUpdate: always check location perms am: d60acc9f32 am: 76edcdd50f
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/services/Telephony/+/11578327
Change-Id: Iab1c15769ba1ccaa2c5ccac992d0e519da1a321d
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index b045c0f..7ed7aec 100755
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -115,6 +115,7 @@
import android.telephony.ims.stub.ImsRegistrationImplBase;
import android.text.TextUtils;
import android.util.ArraySet;
+import android.util.EventLog;
import android.util.Log;
import android.util.Pair;
@@ -2500,12 +2501,21 @@
.setCallingPid(Binder.getCallingPid())
.setCallingUid(Binder.getCallingUid())
.setMethod("requestCellInfoUpdate")
- .setMinSdkVersionForFine(Build.VERSION_CODES.Q)
+ .setMinSdkVersionForCoarse(Build.VERSION_CODES.BASE)
+ .setMinSdkVersionForFine(Build.VERSION_CODES.BASE)
.build());
switch (locationResult) {
case DENIED_HARD:
+ if (getTargetSdk(callingPackage) < Build.VERSION_CODES.Q) {
+ // Safetynet logging for b/154934934
+ EventLog.writeEvent(0x534e4554, "154934934", Binder.getCallingUid());
+ }
throw new SecurityException("Not allowed to access cell info");
case DENIED_SOFT:
+ if (getTargetSdk(callingPackage) < Build.VERSION_CODES.Q) {
+ // Safetynet logging for b/154934934
+ EventLog.writeEvent(0x534e4554, "154934934", Binder.getCallingUid());
+ }
try {
cb.onCellInfo(new ArrayList<CellInfo>());
} catch (RemoteException re) {