Skip to content

Commit

Permalink
Remove sensor trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
KCeh committed Mar 6, 2024
1 parent 3d28a7e commit 4dbbe12
Showing 1 changed file with 0 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,10 @@ internal abstract class SensorTrigger(

abstract fun processEvent(event: SensorEvent): Boolean

private var activeHolder: Boolean? = null

override fun start() {
sensorManager = (context.getSystemService(Context.SENSOR_SERVICE) as? SensorManager)
sensorManager?.let {
registerSensor(it)
if (activeHolder == null) {
activeHolder = active
}
this.active = activeHolder ?: true // use remembered active state
} ?: run {
this.active = false
}
Expand All @@ -39,8 +33,6 @@ internal abstract class SensorTrigger(
queue?.clear()
unregisterSensor()
sensorManager = null
activeHolder = active // remember active state
this.active = false
}

override fun onSensorChanged(event: SensorEvent) {
Expand Down

0 comments on commit 4dbbe12

Please sign in to comment.