-
- All Implemented Interfaces:
-
cz.mroczis.netmonster.core.feature.postprocess.ICellPostprocessor
public final class SubDuplicitiesPostprocessor implements ICellPostprocessor
Solves the case for Dual SIM phones when android.telephony.TelephonyManager.getAllCellInfo returns list with same data totally ignoring the subscription id that is bound to the instance.
Since Android 10 TelephonyManager allows to request update and that delivers subscription-bound data. On older versions we usually get 2 equal lists and we need to decide which cell belongs to which subscription. Fortunately data are in 90 % cases sorted meaning that cells bound to 1st subscription are first in the list, then serving cell for 2nd subscription ar listed etc.
Using this predicate we can filter duplicities effectively - in this postprocessors we get list of (PLMN, subscription id) and filter out cells that belong to different subscription
Complexity: O(s * c), where 's' is size to subscriptions list and 'c' size of all cells list
-
-
Constructor Summary
Constructors Constructor Description SubDuplicitiesPostprocessor(ISubscriptionManagerCompat subscription, Function1<Integer, Network> networkOperatorGetter)
-
Method Summary
Modifier and Type Method Description List<ICell>postprocess(List<ICell> list)Postprocessing method that allows data modification within the list -
-
Constructor Detail
-
SubDuplicitiesPostprocessor
SubDuplicitiesPostprocessor(ISubscriptionManagerCompat subscription, Function1<Integer, Network> networkOperatorGetter)
-
-
Method Detail
-
postprocess
@RequiresPermission(allOf = {android.permission.READ_PHONE_STATE, android.permission.ACCESS_COARSE_LOCATION}) List<ICell> postprocess(List<ICell> list)
Postprocessing method that allows data modification within the list
-
-
-
-