From fdb8692b59aae8563e680c1a593ce73f48e82848 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Mon, 21 Oct 2024 20:32:30 +0200 Subject: [PATCH] Remove dead code to set the call state MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "IN_CONVERSATION" was set when the activity was created and "state" in the intent extras had the value "resume". However, there is no "state" extra set by default in Android intents, it should be explicitly set, but as it is not set anywhere in Talk Android code that would make it dead code and safe to remove. Moreover, the connection to the call should be initialized again in any case rather than resumed when "onCreate" is called, as it is likely that any previous connection would have been ended if the previous activity instance was destroyed. Signed-off-by: Daniel Calviño Sánchez --- .../java/com/nextcloud/talk/activities/CallActivity.kt | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/nextcloud/talk/activities/CallActivity.kt b/app/src/main/java/com/nextcloud/talk/activities/CallActivity.kt index 74fbfa91e..839d1e05d 100644 --- a/app/src/main/java/com/nextcloud/talk/activities/CallActivity.kt +++ b/app/src/main/java/com/nextcloud/talk/activities/CallActivity.kt @@ -393,11 +393,9 @@ class CallActivity : CallBaseActivity() { baseUrl = conversationUser!!.baseUrl } powerManagerUtils = PowerManagerUtils() - if ("resume".equals(extras.getString("state", ""), ignoreCase = true)) { - setCallState(CallStatus.IN_CONVERSATION) - } else { - setCallState(CallStatus.CONNECTING) - } + + setCallState(CallStatus.CONNECTING) + raiseHandViewModel = ViewModelProvider(this, viewModelFactory).get(RaiseHandViewModel::class.java) raiseHandViewModel!!.setData(roomToken!!, isBreakoutRoom) raiseHandViewModel!!.viewState.observe(this) { viewState: RaiseHandViewModel.ViewState? ->