mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Set front facing camera as default one each time last calls end
This commit is contained in:
parent
6b0bae9c3d
commit
fbf2d39640
1 changed files with 15 additions and 0 deletions
|
|
@ -185,6 +185,21 @@ class CoreContext @UiThread constructor(val context: Context) : HandlerThread("C
|
|||
greenToastToShowEvent.postValue(Event(Pair(message, icon)))
|
||||
}
|
||||
}
|
||||
|
||||
@WorkerThread
|
||||
override fun onLastCallEnded(core: Core) {
|
||||
Log.i("$TAG Last call ended")
|
||||
val currentCamera = core.videoDevice
|
||||
if (currentCamera != "FrontFacingCamera") {
|
||||
val frontFacing = core.videoDevicesList.find { it == "FrontFacingCamera" }
|
||||
if (frontFacing == null) {
|
||||
Log.w("$TAG Failed to find [FrontFacingCamera] camera, doing nothing...")
|
||||
} else {
|
||||
Log.i("$TAG Last call ended, setting [$frontFacing] as the default one")
|
||||
core.videoDevice = frontFacing
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private val loggingServiceListener = object : LoggingServiceListenerStub() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue