Loading privacymodulese/build.gradle +1 −1 Original line number Diff line number Diff line Loading @@ -10,7 +10,7 @@ android { minSdkVersion 30 targetSdkVersion 30 versionCode 3 versionName "0.4.2" versionName "0.4.3" consumerProguardFiles "consumer-rules.pro" } Loading privacymodulese/src/main/java/foundation/e/privacymodules/location/FakeLocationModule.kt +19 −7 Original line number Diff line number Diff line Loading @@ -20,13 +20,18 @@ class FakeLocationModule(protected val context: Context): IFakeLocationModule { /** * List of all the Location provider that will be mocked. */ private val providers = listOf(LocationManager.NETWORK_PROVIDER, LocationManager.GPS_PROVIDER) private val providers = listOf( LocationManager.NETWORK_PROVIDER, LocationManager.GPS_PROVIDER, LocationManager.FUSED_PROVIDER ) /** * Handy accessor to the locationManager service. * We avoid getting it on module initialization to wait for the context to be ready. */ private val locationManager: LocationManager get() = private val locationManager: LocationManager get() = context.getSystemService(LOCATION_SERVICE) as LocationManager /** Loading @@ -49,13 +54,20 @@ class FakeLocationModule(protected val context: Context): IFakeLocationModule { false, true, true, Criteria.POWER_LOW, Criteria.ACCURACY_FINE) Criteria.POWER_LOW, Criteria.ACCURACY_FINE ) locationManager.setTestProviderEnabled(provider, true) } } override fun setFakeLocation(latitude: Double, longitude: Double) { context.startService(FakeLocationService.buildFakeLocationIntent(context, latitude, longitude)) context.startService( FakeLocationService.buildFakeLocationIntent( context, latitude, longitude ) ) } internal fun setTestProviderLocation(latitude: Double, longitude: Double) { Loading Loading
privacymodulese/build.gradle +1 −1 Original line number Diff line number Diff line Loading @@ -10,7 +10,7 @@ android { minSdkVersion 30 targetSdkVersion 30 versionCode 3 versionName "0.4.2" versionName "0.4.3" consumerProguardFiles "consumer-rules.pro" } Loading
privacymodulese/src/main/java/foundation/e/privacymodules/location/FakeLocationModule.kt +19 −7 Original line number Diff line number Diff line Loading @@ -20,13 +20,18 @@ class FakeLocationModule(protected val context: Context): IFakeLocationModule { /** * List of all the Location provider that will be mocked. */ private val providers = listOf(LocationManager.NETWORK_PROVIDER, LocationManager.GPS_PROVIDER) private val providers = listOf( LocationManager.NETWORK_PROVIDER, LocationManager.GPS_PROVIDER, LocationManager.FUSED_PROVIDER ) /** * Handy accessor to the locationManager service. * We avoid getting it on module initialization to wait for the context to be ready. */ private val locationManager: LocationManager get() = private val locationManager: LocationManager get() = context.getSystemService(LOCATION_SERVICE) as LocationManager /** Loading @@ -49,13 +54,20 @@ class FakeLocationModule(protected val context: Context): IFakeLocationModule { false, true, true, Criteria.POWER_LOW, Criteria.ACCURACY_FINE) Criteria.POWER_LOW, Criteria.ACCURACY_FINE ) locationManager.setTestProviderEnabled(provider, true) } } override fun setFakeLocation(latitude: Double, longitude: Double) { context.startService(FakeLocationService.buildFakeLocationIntent(context, latitude, longitude)) context.startService( FakeLocationService.buildFakeLocationIntent( context, latitude, longitude ) ) } internal fun setTestProviderLocation(latitude: Double, longitude: Double) { Loading