David Liu

sample app cleanup

@@ -6,11 +6,7 @@ import kotlinx.coroutines.Dispatchers @@ -6,11 +6,7 @@ import kotlinx.coroutines.Dispatchers
6 import javax.inject.Named 6 import javax.inject.Named
7 7
8 @Module 8 @Module
9 -class CoroutinesModule {  
10 - companion object {  
11 -  
12 -  
13 - 9 +object CoroutinesModule {
14 @Provides 10 @Provides
15 @Named(InjectionNames.DISPATCHER_DEFAULT) 11 @Named(InjectionNames.DISPATCHER_DEFAULT)
16 fun defaultDispatcher() = Dispatchers.Default 12 fun defaultDispatcher() = Dispatchers.Default
@@ -26,6 +22,4 @@ class CoroutinesModule { @@ -26,6 +22,4 @@ class CoroutinesModule {
26 @Provides 22 @Provides
27 @Named(InjectionNames.DISPATCHER_UNCONFINED) 23 @Named(InjectionNames.DISPATCHER_UNCONFINED)
28 fun unconfinedDispatcher() = Dispatchers.Unconfined 24 fun unconfinedDispatcher() = Dispatchers.Unconfined
29 -  
30 - }  
31 } 25 }
1 package io.livekit.android.dagger 1 package io.livekit.android.dagger
2 2
3 -class InjectionNames {  
4 - companion object { 3 +object InjectionNames {
5 4
6 - const val DISPATCHER_DEFAULT = "dispatcher_default"  
7 - const val DISPATCHER_IO = "dispatcher_io";  
8 - const val DISPATCHER_MAIN = "dispatcher_main"  
9 - const val DISPATCHER_UNCONFINED = "dispatcher_unconfined" 5 + internal const val DISPATCHER_DEFAULT = "dispatcher_default"
  6 + internal const val DISPATCHER_IO = "dispatcher_io";
  7 + internal const val DISPATCHER_MAIN = "dispatcher_main"
  8 + internal const val DISPATCHER_UNCONFINED = "dispatcher_unconfined"
10 9
11 - const val SIGNAL_JSON_ENABLED = "signal_json_enabled" 10 + internal const val SIGNAL_JSON_ENABLED = "signal_json_enabled"
12 11
13 - const val OPTIONS_VIDEO_HW_ACCEL = "options_video_hw_accel"  
14 - } 12 + internal const val OPTIONS_VIDEO_HW_ACCEL = "options_video_hw_accel"
15 } 13 }
@@ -87,7 +87,12 @@ class CallActivity : AppCompatActivity() { @@ -87,7 +87,12 @@ class CallActivity : AppCompatActivity() {
87 87
88 binding.pipVideoView.release() 88 binding.pipVideoView.release()
89 val audioManager = getSystemService(AUDIO_SERVICE) as AudioManager 89 val audioManager = getSystemService(AUDIO_SERVICE) as AudioManager
90 - audioManager.abandonAudioFocus(focusChangeListener) 90 + with(audioManager) {
  91 + isSpeakerphoneOn = false
  92 + isMicrophoneMute = true
  93 + abandonAudioFocus(focusChangeListener)
  94 + mode = AudioManager.MODE_NORMAL
  95 + }
91 } 96 }
92 97
93 companion object { 98 companion object {