Skip to content

Commit

Permalink
fix: Rename and move comment
Browse files Browse the repository at this point in the history
  • Loading branch information
mrousavy committed Aug 20, 2024
1 parent 43d625b commit cd73f15
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class CameraSession(internal val context: Context, internal val callback: Callba
override fun close() {
Log.i(TAG, "Closing CameraSession...")
isDestroyed = true
orientationManager.clearListeners()
orientationManager.stopOrientationUpdates()
runOnUiThread {
lifecycleRegistry.currentState = Lifecycle.State.DESTROYED
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ class OrientationManager(private val context: Context, private val callback: Cal
}
}

// remove previous listeners if attached
fun clearListeners() {
fun stopOrientationUpdates() {
displayManager.unregisterDisplayListener(displayListener)
orientationListener.disable()
}
Expand All @@ -77,7 +76,8 @@ class OrientationManager(private val context: Context, private val callback: Cal
Log.i(TAG, "Target Orientation changed $targetOutputOrientation -> $targetOrientation!")
targetOutputOrientation = targetOrientation

clearListeners()
// remove previous listeners if we have any
stopOrientationUpdates()

when (targetOrientation) {
OutputOrientation.DEVICE -> {
Expand Down

0 comments on commit cd73f15

Please sign in to comment.