Skip to content

Commit

Permalink
fix(geofence): initial trigger enabled is now stored in sharedPref
Browse files Browse the repository at this point in the history
SUITEDEV-28886

Co-authored-by: davidSchuppa <[email protected]>
Co-authored-by: LasOri <[email protected]>
Co-authored-by: megamegax <[email protected]>
  • Loading branch information
4 people committed Aug 25, 2021
1 parent ebd29f4 commit 5966af0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@ class DefaultGeofenceInternalTest {
geofenceInternal.setInitialEnterTriggerEnabled(true)
geofenceInternal.registerGeofences(nearestGeofencesWithoutRefreshArea + refreshArea)

verify(mockInitialEnterTriggerEnabledStorage).set(true)
argumentCaptor<GeofencingRequest>().apply {
verify(mockGeofencingClient).addGeofences(capture(), any())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class DefaultGeofenceInternal(private val requestModelFactory: MobileEngageReque
private val geofencePendingIntentProvider: GeofencePendingIntentProvider,
coreSdkHandler: CoreSdkHandler,
private val uiHandler: Handler,
initialEnterTriggerEnabledStorage: Storage<Boolean?>
private val initialEnterTriggerEnabledStorage: Storage<Boolean?>
) : GeofenceInternal, LocationListener {
private companion object {
const val FASTEST_INTERNAL: Long = 15_000
Expand Down Expand Up @@ -272,6 +272,7 @@ class DefaultGeofenceInternal(private val requestModelFactory: MobileEngageReque

override fun setInitialEnterTriggerEnabled(enabled: Boolean) {
this.initialEnterTriggerEnabled = enabled
initialEnterTriggerEnabledStorage.set(enabled)
}

private fun createActionsFromTriggers(geofence: MEGeofence, triggerType: TriggerType): List<Runnable?> {
Expand Down

0 comments on commit 5966af0

Please sign in to comment.