mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 21:15:48 +00:00
Safely run VoiceNoteProximityWakeLockManager cleanup.
This commit is contained in:
@@ -117,8 +117,10 @@ class VoiceNoteMediaController(val activity: FragmentActivity, private var postp
|
||||
}
|
||||
|
||||
override fun onDestroy(owner: LifecycleOwner) {
|
||||
voiceNoteProximityWakeLockManager.unregisterCallbacksAndRelease()
|
||||
voiceNoteProximityWakeLockManager.unregisterFromLifecycle()
|
||||
if (this::voiceNoteProximityWakeLockManager.isInitialized) {
|
||||
voiceNoteProximityWakeLockManager.unregisterCallbacksAndRelease()
|
||||
voiceNoteProximityWakeLockManager.unregisterFromLifecycle()
|
||||
}
|
||||
activity.lifecycle.removeObserver(this)
|
||||
super.onDestroy(owner)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user