Fix some deprecations

This commit is contained in:
Stypox 2025-10-08 11:07:28 +02:00
parent 98651bfe3f
commit 88602e1bc9
No known key found for this signature in database
GPG Key ID: 4BDF1B40A49FDD23
9 changed files with 9 additions and 6 deletions

View File

@ -66,6 +66,7 @@ android {
kotlinOptions {
jvmTarget = libs.versions.java.get()
freeCompilerArgs = listOf("-XXLanguage:+PropertyParamAnnotationDefaultTargetMode")
}
buildFeatures {

View File

@ -32,7 +32,7 @@ import javax.inject.Singleton
*/
@Singleton
class LocaleManager @Inject constructor(
@ApplicationContext private val appContext: Context,
@param:ApplicationContext private val appContext: Context,
dataStore: DataStore<UserSettings>,
) {
// We obtain the system locale list when the app starts (which is also when `LocaleManager` is

View File

@ -26,7 +26,7 @@ import javax.inject.Singleton
@Singleton
class SpeechOutputDeviceWrapper @Inject constructor(
@ApplicationContext private val context: Context,
@param:ApplicationContext private val context: Context,
private val dataStore: DataStore<UserSettings>,
private val localeManager: LocaleManager,
// this is always instantiated, but will do nothing if

View File

@ -48,7 +48,7 @@ interface SttInputDeviceWrapper {
}
class SttInputDeviceWrapperImpl(
@ApplicationContext private val appContext: Context,
@param:ApplicationContext private val appContext: Context,
dataStore: DataStore<UserSettings>,
private val localeManager: LocaleManager,
private val okHttpClient: OkHttpClient,

View File

@ -40,7 +40,7 @@ interface WakeDeviceWrapper {
typealias DataStoreWakeDevice = org.stypox.dicio.settings.datastore.WakeDevice
class WakeDeviceWrapperImpl(
@ApplicationContext private val appContext: Context,
@param:ApplicationContext private val appContext: Context,
dataStore: DataStore<UserSettings>,
private val okHttpClient: OkHttpClient,
) : WakeDeviceWrapper {

View File

@ -25,7 +25,7 @@ import java.util.Locale
class ExternalPopupInputDevice(
@ApplicationContext val context: Context,
@param:ApplicationContext val context: Context,
private val activityForResultManager: ActivityForResultManager,
localeManager: LocaleManager,
) : SttInputDevice {

View File

@ -96,6 +96,7 @@ class SttPopupActivity : BaseActivity() {
speechExtras.getBundle(RecognizerIntent.EXTRA_RESULTS_PENDINGINTENT_BUNDLE)
?.let { intent.putExtras(it) }
}
@Suppress("DEPRECATION") // improved API requires Android T
val resultIntent = speechExtras.getParcelable<PendingIntent>(
RecognizerIntent.EXTRA_RESULTS_PENDINGINTENT
)

View File

@ -36,6 +36,7 @@ class AndroidTtsSpeechDevice(private var context: Context, locale: Locale) : Spe
}
}
@Suppress("OVERRIDE_DEPRECATION")
@Deprecated("")
override fun onError(utteranceId: String) {
}

View File

@ -21,7 +21,7 @@ import java.io.File
import java.io.IOException
class OpenWakeWordDevice(
@ApplicationContext private val appContext: Context,
@param:ApplicationContext private val appContext: Context,
private val okHttpClient: OkHttpClient,
) : WakeDevice {
private val _state: MutableStateFlow<WakeState>