Skip to content

Commit

Permalink
Provisioning: Internet-based location providers
Browse files Browse the repository at this point in the history
New provisioning extra "internet_location_enabled" will turn off or on
internet-based location providers, namely Mozilla Location Services
and Nominatim as of this writing.

Change-Id: I334c4f92437257dac261cbc9644641df9a9eaf55
  • Loading branch information
t-m-w committed Jul 31, 2023
1 parent 28ca324 commit 6e64fab
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions play-services-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ dependencies {
implementation project(':play-services-fido-core')
implementation project(':play-services-gmscompliance-core')
implementation project(':play-services-location-core')
implementation project(':play-services-location-core-base')
implementation project(':play-services-location-core-provider')
withNearbyImplementation project(':play-services-nearby-core')
implementation project(':play-services-oss-licenses-core')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import org.microg.gms.checkin.setCheckinServiceConfiguration
import org.microg.gms.droidguard.core.DroidGuardPreferences
import org.microg.gms.gcm.getGcmServiceInfo
import org.microg.gms.gcm.setGcmServiceConfiguration
import org.microg.gms.location.LocationSettings
import org.microg.gms.safetynet.SafetyNetPreferences

class ProvisionService : LifecycleService() {
Expand All @@ -38,6 +39,13 @@ class ProvisionService : LifecycleService() {
SafetyNetPreferences.setEnabled(this@ProvisionService, it)
DroidGuardPreferences.setEnabled(this@ProvisionService, it)
}
intent?.extras?.getBooleanOrNull("internet_location_enabled")?.let {
LocationSettings(this@ProvisionService).apply {
wifiMls = it
cellMls = it
geocoderNominatim = it
}
}
// What else?

delay(2 * 1000) // Wait 2 seconds to give provisioning some extra time
Expand Down

0 comments on commit 6e64fab

Please sign in to comment.