mirror of
https://github.com/kavishdevar/librepods.git
synced 2026-01-28 22:01:50 +00:00
android: fix head gestures not working
This commit is contained in:
@@ -87,13 +87,13 @@ fun startDetection(doNotStop: Boolean = false, onGestureDetected: (Boolean) -> U
|
||||
isRunning = true
|
||||
gestureDetectedCallback = onGestureDetected
|
||||
|
||||
Log.d(TAG, "started: ${airPodsService.startHeadTracking()}")
|
||||
|
||||
clearData()
|
||||
|
||||
prevHorizontal = 0.0
|
||||
prevVertical = 0.0
|
||||
|
||||
airPodsService.aacpManager.sendStartHeadTracking()
|
||||
|
||||
detectionJob = CoroutineScope(Dispatchers.Default).launch {
|
||||
while (isRunning) {
|
||||
delay(50)
|
||||
@@ -117,7 +117,7 @@ fun startDetection(doNotStop: Boolean = false, onGestureDetected: (Boolean) -> U
|
||||
Log.d(TAG, "Stopping gesture detection")
|
||||
isRunning = false
|
||||
|
||||
if (!doNotStop) airPodsService.aacpManager.sendStopHeadTracking()
|
||||
if (!doNotStop) airPodsService.stopHeadTracking()
|
||||
|
||||
detectionJob?.cancel()
|
||||
detectionJob = null
|
||||
|
||||
Reference in New Issue
Block a user