

package com.ejada.hmg.geofence.intent_receivers

import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.location.LocationManager
import com.ejada.hmg.geofence.HMG_Geofence
import com.ejada.hmg.utils.HMGUtils
import com.ejada.hmg.utils.PREFS_STORAGE

class LocationProviderChangeReceiver : BroadcastReceiver() {
  private val LOG_TAG = "LocationProviderChangeReceiver"
  override fun onReceive(context: Context, intent: Intent) {

    if (LocationManager.PROVIDERS_CHANGED_ACTION.equals(intent.action)) {
      val pref = context.getSharedPreferences(PREFS_STORAGE, Context.MODE_PRIVATE)
      pref.edit().putString("LOCATION_PROVIDER_CHANGE","YES").apply()

      HMG_Geofence.shared(context).register(){ s, e -> }
    }
  }

}