Loading services/core/java/com/android/server/TelephonyRegistry.java +0 −6 Original line number Diff line number Diff line Loading @@ -1036,12 +1036,6 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub { callingFeatureId, callback, eventList, notifyNow, subId); } private void listen(String callingPackage, @Nullable String callingFeatureId, IPhoneStateListener callback, Set<Integer> events, boolean notifyNow, int subId) { listen(false, false, callingPackage, callingFeatureId, callback, events, notifyNow, subId); } private void listen(boolean renounceFineLocationAccess, boolean renounceCoarseLocationAccess, String callingPackage, @Nullable String callingFeatureId, IPhoneStateListener callback, Loading telephony/java/android/telephony/TelephonyManager.java +15 −19 Original line number Diff line number Diff line Loading @@ -12190,15 +12190,7 @@ public class TelephonyManager { }) @RequiresFeature(PackageManager.FEATURE_TELEPHONY_RADIO_ACCESS) public @Nullable ServiceState getServiceState() { if (getRenouncedPermissions().contains(Manifest.permission.ACCESS_FINE_LOCATION)) { if (getRenouncedPermissions().contains(Manifest.permission.ACCESS_COARSE_LOCATION)) { return getServiceState(INCLUDE_LOCATION_DATA_NONE); } else { return getServiceState(INCLUDE_LOCATION_DATA_COARSE); } } return getServiceState(INCLUDE_LOCATION_DATA_FINE); return getServiceState(getLocationData()); } /** Loading Loading @@ -16189,19 +16181,23 @@ public class TelephonyManager { */ public void registerTelephonyCallback(@NonNull @CallbackExecutor Executor executor, @NonNull TelephonyCallback callback) { if (getRenouncedPermissions().contains(Manifest.permission.ACCESS_FINE_LOCATION)) { if (getRenouncedPermissions().contains(Manifest.permission.ACCESS_COARSE_LOCATION)) { registerTelephonyCallback(INCLUDE_LOCATION_DATA_NONE, executor, callback); return; registerTelephonyCallback(getLocationData(), executor, callback); } private int getLocationData() { boolean renounceCoarseLocation = getRenouncedPermissions().contains(Manifest.permission.ACCESS_COARSE_LOCATION); boolean renounceFineLocation = getRenouncedPermissions().contains(Manifest.permission.ACCESS_FINE_LOCATION); if (renounceCoarseLocation) { return INCLUDE_LOCATION_DATA_NONE; } else if (renounceFineLocation) { return INCLUDE_LOCATION_DATA_COARSE; } else { registerTelephonyCallback(INCLUDE_LOCATION_DATA_COARSE, executor, callback); return; return INCLUDE_LOCATION_DATA_FINE; } } registerTelephonyCallback(INCLUDE_LOCATION_DATA_FINE, executor, callback); } /** @hide */ @Retention(RetentionPolicy.SOURCE) @IntDef(prefix = {"INCLUDE_LOCATION_DATA_"}, value = { Loading
services/core/java/com/android/server/TelephonyRegistry.java +0 −6 Original line number Diff line number Diff line Loading @@ -1036,12 +1036,6 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub { callingFeatureId, callback, eventList, notifyNow, subId); } private void listen(String callingPackage, @Nullable String callingFeatureId, IPhoneStateListener callback, Set<Integer> events, boolean notifyNow, int subId) { listen(false, false, callingPackage, callingFeatureId, callback, events, notifyNow, subId); } private void listen(boolean renounceFineLocationAccess, boolean renounceCoarseLocationAccess, String callingPackage, @Nullable String callingFeatureId, IPhoneStateListener callback, Loading
telephony/java/android/telephony/TelephonyManager.java +15 −19 Original line number Diff line number Diff line Loading @@ -12190,15 +12190,7 @@ public class TelephonyManager { }) @RequiresFeature(PackageManager.FEATURE_TELEPHONY_RADIO_ACCESS) public @Nullable ServiceState getServiceState() { if (getRenouncedPermissions().contains(Manifest.permission.ACCESS_FINE_LOCATION)) { if (getRenouncedPermissions().contains(Manifest.permission.ACCESS_COARSE_LOCATION)) { return getServiceState(INCLUDE_LOCATION_DATA_NONE); } else { return getServiceState(INCLUDE_LOCATION_DATA_COARSE); } } return getServiceState(INCLUDE_LOCATION_DATA_FINE); return getServiceState(getLocationData()); } /** Loading Loading @@ -16189,19 +16181,23 @@ public class TelephonyManager { */ public void registerTelephonyCallback(@NonNull @CallbackExecutor Executor executor, @NonNull TelephonyCallback callback) { if (getRenouncedPermissions().contains(Manifest.permission.ACCESS_FINE_LOCATION)) { if (getRenouncedPermissions().contains(Manifest.permission.ACCESS_COARSE_LOCATION)) { registerTelephonyCallback(INCLUDE_LOCATION_DATA_NONE, executor, callback); return; registerTelephonyCallback(getLocationData(), executor, callback); } private int getLocationData() { boolean renounceCoarseLocation = getRenouncedPermissions().contains(Manifest.permission.ACCESS_COARSE_LOCATION); boolean renounceFineLocation = getRenouncedPermissions().contains(Manifest.permission.ACCESS_FINE_LOCATION); if (renounceCoarseLocation) { return INCLUDE_LOCATION_DATA_NONE; } else if (renounceFineLocation) { return INCLUDE_LOCATION_DATA_COARSE; } else { registerTelephonyCallback(INCLUDE_LOCATION_DATA_COARSE, executor, callback); return; return INCLUDE_LOCATION_DATA_FINE; } } registerTelephonyCallback(INCLUDE_LOCATION_DATA_FINE, executor, callback); } /** @hide */ @Retention(RetentionPolicy.SOURCE) @IntDef(prefix = {"INCLUDE_LOCATION_DATA_"}, value = {