mirror of
https://github.com/ev-map/EVMap.git
synced 2026-09-12 21:37:01 -04:00
use GMS security provider if available
This commit is contained in:
1 parent
1f6a515480
commit
5d9b3a4a68
1 file changed
+15
@@ -6,11 +6,26 @@ import android.util.Log
|
||||
import com.google.android.gms.common.ConnectionResult
|
||||
import com.google.android.gms.common.GoogleApiAvailability
|
||||
import com.google.android.gms.maps.MapsInitializer
|
||||
import com.google.android.gms.security.ProviderInstaller
|
||||
import com.google.android.libraries.places.api.Places
|
||||
|
||||
fun init(context: Context) {
|
||||
Places.initialize(context, context.getString(R.string.google_maps_key))
|
||||
MapsInitializer.initialize(context, MapsInitializer.Renderer.LATEST, null)
|
||||
ProviderInstaller.installIfNeededAsync(
|
||||
context,
|
||||
object : ProviderInstaller.ProviderInstallListener {
|
||||
override fun onProviderInstalled() {
|
||||
Log.d("EVMap", "Google Play Security provider installed")
|
||||
}
|
||||
|
||||
override fun onProviderInstallFailed(
|
||||
errorCode: Int,
|
||||
recoveryIntent: android.content.Intent?
|
||||
) {
|
||||
Log.e("EVMap", "Google Play Security provider installation failed: $errorCode")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fun checkPlayServices(activity: Activity): Boolean {
|
||||
|
||||
Reference in new issue
Block a user