Call quality survey integration.

This commit is contained in:
Alex Hart
2025-11-26 13:51:03 -04:00
committed by jeffrey-signal
parent 804f479cb0
commit 54fb7ff23f
24 changed files with 772 additions and 159 deletions

View File

@@ -0,0 +1,28 @@
/*
* Copyright 2025 Signal Messenger, LLC
* SPDX-License-Identifier: AGPL-3.0-only
*/
package org.thoughtcrime.securesms.keyvalue
import org.signal.storageservice.protos.calls.quality.SubmitCallQualitySurveyRequest
import kotlin.time.Duration
class CallQualityValues(store: KeyValueStore) : SignalStoreValues(store) {
companion object {
const val SURVEY_REQUEST = "callQualityValues.survey_request"
const val IS_CALL_QUALITY_SURVEY_ENABLED = "callQualityValues.is_call_quality_survey_enabled"
const val LAST_FAILURE_REPORT_TIME = "callQualityValues.last_failure_report_time"
const val LAST_SURVEY_PROMPT_TIME = "callQualityValues.last_survey_prompt_time"
}
var surveyRequest: SubmitCallQualitySurveyRequest? by protoValue(SURVEY_REQUEST, SubmitCallQualitySurveyRequest.ADAPTER)
var isQualitySurveyEnabled: Boolean by booleanValue(IS_CALL_QUALITY_SURVEY_ENABLED, true)
var lastFailureReportTime: Duration? by durationValue(LAST_FAILURE_REPORT_TIME, null)
var lastSurveyPromptTime: Duration? by durationValue(LAST_SURVEY_PROMPT_TIME, null)
public override fun onFirstEverAppLaunch() = Unit
public override fun getKeysToIncludeInBackup(): List<String> = emptyList()
}

View File

@@ -32,6 +32,7 @@ class InternalValues internal constructor(store: KeyValueStore) : SignalStoreVal
const val WEB_SOCKET_SHADOWING_STATS: String = "internal.web_socket_shadowing_stats"
const val ENCODE_HEVC: String = "internal.hevc_encoding"
const val NEW_CALL_UI: String = "internal.new.call.ui"
const val CALL_QUALITY_SURVEYS: String = "internal.call_quality_surveys"
const val FORCE_SPLIT_PANE_ON_COMPACT_LANDSCAPE: String = "internal.force.split.pane.on.compact.landscape.ui"
const val SHOW_ARCHIVE_STATE_HINT: String = "internal.show_archive_state_hint"
const val INCLUDE_DEBUGLOG_IN_BACKUP: String = "internal.include_debuglog_in_backup"
@@ -170,6 +171,8 @@ class InternalValues internal constructor(store: KeyValueStore) : SignalStoreVal
var newCallingUi: Boolean by booleanValue(NEW_CALL_UI, false).defaultForExternalUsers()
var callQualitySurveys: Boolean by booleanValue(CALL_QUALITY_SURVEYS, false).defaultForExternalUsers()
var lastScrollPosition: Int by integerValue(LAST_SCROLL_POSITION, 0).defaultForExternalUsers()
var useConversationItemV2Media by booleanValue(CONVERSATION_ITEM_V2_MEDIA, false).defaultForExternalUsers()

View File

@@ -37,6 +37,7 @@ class SignalStore(context: Application, private val store: KeyValueStore) {
val storyValues = StoryValues(store)
val apkUpdateValues = ApkUpdateValues(store)
val backupValues = BackupValues(store)
val callQualityValues = CallQualityValues(store)
val plainTextValues = PlainTextSharedPrefsDataStore(context)
@@ -84,6 +85,7 @@ class SignalStore(context: Application, private val store: KeyValueStore) {
story.onFirstEverAppLaunch()
apkUpdate.onFirstEverAppLaunch()
backup.onFirstEverAppLaunch()
callQuality.onFirstEverAppLaunch()
}
@JvmStatic
@@ -115,7 +117,8 @@ class SignalStore(context: Application, private val store: KeyValueStore) {
releaseChannel.keysToIncludeInBackup +
story.keysToIncludeInBackup +
apkUpdate.keysToIncludeInBackup +
backup.keysToIncludeInBackup
backup.keysToIncludeInBackup +
callQuality.keysToIncludeInBackup
}
/**
@@ -266,6 +269,11 @@ class SignalStore(context: Application, private val store: KeyValueStore) {
val backup: BackupValues
get() = instance!!.backupValues
@JvmStatic
@get:JvmName("callQuality")
val callQuality: CallQualityValues
get() = instance!!.callQualityValues
val groupsV2AciAuthorizationCache: GroupsV2AuthorizationSignalStoreCache
get() = GroupsV2AuthorizationSignalStoreCache.createAciCache(instance!!.store)