feat: integrar mejoras de SOS, PTT, autenticacion y video M530

This commit is contained in:
Miguel Angel 2026-09-26 10:49:54 -05:00
parent a12ae5da8f
commit 51ccd80070
17 changed files with 695 additions and 202 deletions

View file

@ -1,4 +1,4 @@
package com.bodycamera.twentyfoulabs
package com.bodycamera.twentyfoulabs
import android.Manifest
import android.content.BroadcastReceiver
@ -275,7 +275,7 @@ class MainActivity : ComponentActivity() {
pttManager.stop()
}
if (isAuthenticated && !frontPreviewOpened) {
if (false && isAuthenticated && !frontPreviewOpened) {
frontPreviewOpened = true
runOnUiThread {
openFrontPreview()
@ -479,10 +479,18 @@ class MainActivity : ComponentActivity() {
)
}
private fun handleSosButton() {
// F7 alterna SOS/DETENER. La misma orden de parada que usa la pantalla.
if (viewModel.isSosSessionActive()) {
Log.i(TAG, "F7 DETENER SOS: solicitando cierre de WebRTC")
viewModel.stopVideoFromUi()
toast("Deteniendo video SOS...")
return
}
Log.i(TAG, "F7 INICIAR SOS")
toast("Enviando SOS...")
deviceController.triggerSos { result ->
viewModel.triggerSosFromUi { result ->
runOnUiThread {
@ -633,6 +641,8 @@ fun AppNavigation(viewModel: MainViewModel, onOpenPhotoCamera: () -> Unit, onOpe
onOpenPhotoCamera = onOpenPhotoCamera,
onOpenVideoCamera = onOpenVideoCamera,
onLogout = {
// Liberar WebRTC antes de mostrar nuevamente el lector del fotocheck.
viewModel.stopVideoFromUi()
authViewModel.logout()
navController.navigate("login") { popUpTo("main") { inclusive = true } }
}