Always reload backends on configuration change

This commit is contained in:
Marvin W 2022-02-01 20:06:13 +01:00
parent afac75f4bc
commit bdda930c87
No known key found for this signature in database
GPG Key ID: 072E9235DB996F2A
2 changed files with 7 additions and 3 deletions

View File

@ -154,7 +154,7 @@ class GeocodeServiceImpl(private val context: Context, private val lifecycle: Li
return@launchWhenStarted callback.onStatus(STATUS_PERMISSION_ERROR)
fuser.reset()
fuser.bind()
callback.onStatus(Constants.STATUS_OK)
callback.onStatus(STATUS_OK)
}
}
@ -164,7 +164,7 @@ class GeocodeServiceImpl(private val context: Context, private val lifecycle: Li
lifecycleScope.launchWhenStarted {
if (extras.checkPermission("org.microg.nlp.SERVICE_ADMIN") != PERMISSION_GRANTED)
return@launchWhenStarted callback.onStrings(STATUS_PERMISSION_ERROR, null)
callback.onStrings(Constants.STATUS_OK, Preferences(context).geocoderBackends.toList())
callback.onStrings(STATUS_OK, Preferences(context).geocoderBackends.toList())
}
}
@ -177,7 +177,9 @@ class GeocodeServiceImpl(private val context: Context, private val lifecycle: Li
if (backends == null)
return@launchWhenStarted callback.onStatus(STATUS_INVALID_ARGS)
Preferences(context).geocoderBackends = backends.toSet()
callback.onStatus(Constants.STATUS_OK)
fuser.reset()
fuser.bind()
callback.onStatus(STATUS_OK)
}
}

View File

@ -306,6 +306,8 @@ class LocationServiceImpl(private val context: Context, private val lifecycle: L
if (backends == null)
return@launchWhenStarted callback.onStatus(STATUS_INVALID_ARGS)
Preferences(context).locationBackends = backends.toSet()
fuser.reset()
fuser.bind()
callback.onStatus(STATUS_OK)
}
}