summaryrefslogtreecommitdiff
path: root/fakelocation/src/main/java
diff options
context:
space:
mode:
authorGuillaume Jacquart <guillaume.jacquart-ext@mousquetaires.com>2022-10-07 08:45:15 +0200
committerGuillaume Jacquart <guillaume.jacquart-ext@mousquetaires.com>2022-10-26 14:01:43 +0200
commit5f02fd142ca438a48423340aeb9a36b017a6be83 (patch)
tree793326be63e878c880298f075f9c0de3413bb6e4 /fakelocation/src/main/java
parentf8d19823ea9be0c8700a69a215fac7d3af4d6d87 (diff)
Fix lint.
Diffstat (limited to 'fakelocation/src/main/java')
-rw-r--r--fakelocation/src/main/java/foundation/e/privacymodules/fakelocation/FakeLocationModule.kt12
-rw-r--r--fakelocation/src/main/java/foundation/e/privacymodules/fakelocation/FakeLocationService.kt6
2 files changed, 8 insertions, 10 deletions
diff --git a/fakelocation/src/main/java/foundation/e/privacymodules/fakelocation/FakeLocationModule.kt b/fakelocation/src/main/java/foundation/e/privacymodules/fakelocation/FakeLocationModule.kt
index 709963d..4245836 100644
--- a/fakelocation/src/main/java/foundation/e/privacymodules/fakelocation/FakeLocationModule.kt
+++ b/fakelocation/src/main/java/foundation/e/privacymodules/fakelocation/FakeLocationModule.kt
@@ -34,7 +34,7 @@ import android.util.Log
*
* @param context an Android context, to retrieve system services for example.
*/
-class FakeLocationModule(private val context: Context): IFakeLocationModule {
+class FakeLocationModule(private val context: Context) : IFakeLocationModule {
companion object {
private const val TAG = "FakeLocationModule"
}
@@ -60,11 +60,10 @@ class FakeLocationModule(private val context: Context): IFakeLocationModule {
providers.forEach { provider ->
try {
locationManager.removeTestProvider(provider)
- } catch(e: Exception) {
+ } catch (e: Exception) {
Log.w(TAG, "Test provider $provider already removed.")
}
-
locationManager.addTestProvider(
provider,
false,
@@ -75,12 +74,13 @@ class FakeLocationModule(private val context: Context): IFakeLocationModule {
true,
true,
ProviderProperties.POWER_USAGE_LOW,
- ProviderProperties.ACCURACY_FINE)
+ ProviderProperties.ACCURACY_FINE
+ )
try {
locationManager.setTestProviderEnabled(provider, true)
} catch (e: Exception) {
- Log.e(TAG, "Can't enable test $provider", e)
- }
+ Log.e(TAG, "Can't enable test $provider", e)
+ }
}
}
diff --git a/fakelocation/src/main/java/foundation/e/privacymodules/fakelocation/FakeLocationService.kt b/fakelocation/src/main/java/foundation/e/privacymodules/fakelocation/FakeLocationService.kt
index 1337ddd..34620fe 100644
--- a/fakelocation/src/main/java/foundation/e/privacymodules/fakelocation/FakeLocationService.kt
+++ b/fakelocation/src/main/java/foundation/e/privacymodules/fakelocation/FakeLocationService.kt
@@ -17,7 +17,6 @@
package foundation.e.privacymodules.fakelocation
-
import android.app.Service
import android.content.Context
import android.content.Intent
@@ -25,7 +24,7 @@ import android.os.CountDownTimer
import android.os.IBinder
import android.util.Log
-class FakeLocationService: Service() {
+class FakeLocationService : Service() {
enum class Actions {
START_FAKE_LOCATION
@@ -83,10 +82,9 @@ class FakeLocationService: Service() {
super.onDestroy()
}
-
private fun initTimer() {
countDownTimer?.cancel()
- countDownTimer = object: CountDownTimer(PERIOD_UPDATES_SERIE, PERIOD_LOCATION_UPDATE) {
+ countDownTimer = object : CountDownTimer(PERIOD_UPDATES_SERIE, PERIOD_LOCATION_UPDATE) {
override fun onTick(millisUntilFinished: Long) {
fakeLocation?.let {
try {