mirror of
https://github.com/Stypox/dicio-android.git
synced 2026-01-09 06:12:01 +08:00
Fix some deprecations
This commit is contained in:
parent
98651bfe3f
commit
88602e1bc9
@ -66,6 +66,7 @@ android {
|
||||
|
||||
kotlinOptions {
|
||||
jvmTarget = libs.versions.java.get()
|
||||
freeCompilerArgs = listOf("-XXLanguage:+PropertyParamAnnotationDefaultTargetMode")
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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
|
||||
)
|
||||
|
||||
@ -36,6 +36,7 @@ class AndroidTtsSpeechDevice(private var context: Context, locale: Locale) : Spe
|
||||
}
|
||||
}
|
||||
|
||||
@Suppress("OVERRIDE_DEPRECATION")
|
||||
@Deprecated("")
|
||||
override fun onError(utteranceId: String) {
|
||||
}
|
||||
|
||||
@ -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>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user