-
- All Implemented Interfaces:
-
cz.mroczis.netmonster.core.telephony.mapper.ICellMapper
public final class CellLocationMapper implements ICellMapper<Int>
Transforms TelephonyManager.getCellLocation into our representation.
In older days signal, identity and PLMN info were separated into pieces and most of terminals did not update them synchronously which led to false-positive results. This class attempts to lower the overall error ratio.
Generally I recommend to avoid using this data source when terminal has android.os.Build.VERSION_CODES.N or newer -> it's better to rely on CellInfoMapper.
-
-
Constructor Summary
Constructors Constructor Description CellLocationMapper(TelephonyManager telephony, CellLocationSource cellLocationSource, SignalStrengthsSource signalStrengthSource, Function0<Network> getNetworkOperator)
-
Method Summary
Modifier and Type Method Description List<ICell>map(Integer model)Maps CellLocation to our format using multiple other methods from TelephonyManager. -
-
Constructor Detail
-
CellLocationMapper
CellLocationMapper(TelephonyManager telephony, CellLocationSource cellLocationSource, SignalStrengthsSource signalStrengthSource, Function0<Network> getNetworkOperator)
-
-
Method Detail
-
map
@WorkerThread()@RequiresPermission(allOf = {android.permission.READ_PHONE_STATE, android.permission.ACCESS_FINE_LOCATION, android.permission.ACCESS_COARSE_LOCATION}) List<ICell> map(Integer model)
Maps CellLocation to our format using multiple other methods from TelephonyManager. This method is blocking and processing might take ~500 ms on devices with Android O and older. The processing is a bit faster on other devices with Android P+ and newer.
-
-
-
-