requestCellInfoUpdate: always check location perms Check for fine location permission on all api levels -- this api is new to api level 29, so older apps won't be tripped up by it. Fixes: 154934934 Test: atest TelephonyLocationTest Change-Id: Ia4edcf9ac5b5e3c4c2a3bfb79abb31242484f14f (cherry picked from commit d60acc9f3247eaa64626d2c119114e31f47b30c1)
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java index 31eea78..768e868 100755 --- a/src/com/android/phone/PhoneInterfaceManager.java +++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -108,6 +108,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; import android.util.Slog; @@ -2187,12 +2188,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) {