Wake word: what it tried and how it went is kept and shown; the screen comes on
CI / check (push) Canceled after 0s
CI / check (push) Canceled after 0s
The phrase was heard, LLeMbas was the assistant, and still only "Heard you. Tap to ask." came: wake() reached the notification when the assistant service was not connected or showSession threw, and kept neither reason. - WakeAttempt: when, the phrase, the way tried (wakeWay: session, the sheet's activity through the assistant service when the screen is off, the activity while the app is on screen, a notification), the outcome (opened / not connected / refused with the exception / no sheet came), the fallback, whether the role was held, and when Android last connected and disconnected the service in this process. The last five live in the settings, are logged under LLeMbasWake, and are shown as "Last wake". An attempt that found the service not connected is told when a later onReady arrives. - "Opened" is counted only once a sheet says it is up (AssistLink.shown, 2.5 s); otherwise the fallback follows. - Settings says when LLeMbas holds the role but the service is not connected, with the way to the system's assistant setting. - The sheet opened by the wake word turns the screen on: setTurnScreenOn on the activity; with the screen off and the service connected the activity is started through the service instead of a session, whose window wakes nothing. - The fallback notification says "Could not open by itself -- tap to ask" when LLeMbas is the assistant. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
23 files changed
+818
-50
No files matched your search
@@ -24,6 +24,26 @@ For LLeMbas server 2.0.0-beta.12 (harness spec 3.8.0); an older instance works a
|
||||
- A task's runs show the run's own note -- what it found, or why it filed no report -- and a way
|
||||
to its report when it filed one. The run's working chat can still be opened from the run.
|
||||
|
||||
- **Last wake** in Settings › Wake word: when the phrase was last heard, what the app tried
|
||||
(the assistant's sheet, the sheet as a screen of the app, a notification) and exactly how it
|
||||
went -- opened; Android had not connected LLeMbas as the assistant; Android refused, in its
|
||||
own words; or it did not refuse and still no sheet came -- with whether LLeMbas was the
|
||||
digital assistant app then and when Android had connected or dropped it. A tap shows the last
|
||||
five. Nothing from your account is in it.
|
||||
|
||||
### Fixed
|
||||
|
||||
- **The wake word heard you and only a notification came, though LLeMbas is the assistant.**
|
||||
The app can open the sheet from the background only through a connection Android keeps to
|
||||
the assistant app, and it threw away the reason when that was missing or refused. It now
|
||||
keeps it (*Last wake*), says in Settings when LLeMbas is the assistant but Android has not
|
||||
connected it right now -- with the way to the system's setting -- and checks that the sheet
|
||||
really came up before it counts the wake as opened; when it did not, the notification follows
|
||||
and says *Could not open by itself — tap to ask*. What makes a phone drop that connection is
|
||||
not fixed by this: the record is there to find out.
|
||||
- The screen is turned on when the wake word opens the sheet (with *Only while the screen is
|
||||
on* switched off, the phrase can come while it is dark).
|
||||
|
||||
### Changed
|
||||
|
||||
- **Notifications come from a report, not from a run**, on a *Reports* channel of their own:
|
||||
|
||||
@@ -6,6 +6,7 @@ import android.app.NotificationManager
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.os.SystemClock
|
||||
import androidx.activity.ComponentActivity
|
||||
import androidx.activity.compose.setContent
|
||||
import androidx.activity.enableEdgeToEdge
|
||||
@@ -18,6 +19,7 @@ import eu.llembas.android.AppLanguage
|
||||
import eu.llembas.android.auth.Prefs
|
||||
import eu.llembas.android.lembas
|
||||
import eu.llembas.android.ui.theme.LembasTheme
|
||||
import eu.llembas.android.wake.AssistLink
|
||||
import eu.llembas.android.wake.AssistPresence
|
||||
import eu.llembas.android.wake.WakeWordService
|
||||
|
||||
@@ -75,7 +77,11 @@ class AssistActivity : ComponentActivity() {
|
||||
controller = AssistController(this, lifecycleScope)
|
||||
keyguard = getSystemService(KeyguardManager::class.java)
|
||||
locked.value = keyguard.isKeyguardLocked
|
||||
// Opened by the wake word: the screen comes on with it (a spoken phrase is not a touch,
|
||||
// so nothing else has woken the phone).
|
||||
if (intent?.getBooleanExtra(EXTRA_WAKE, false) == true) setTurnScreenOn(true)
|
||||
AssistPresence.shown()
|
||||
AssistLink.sheetShown(SystemClock.elapsedRealtime())
|
||||
// The sheet is up: "Heard you. Tap to ask." has been answered, however it was opened.
|
||||
getSystemService(NotificationManager::class.java).cancel(WakeWordService.HEARD_ID)
|
||||
take(intent)
|
||||
@@ -172,6 +178,12 @@ class AssistActivity : ComponentActivity() {
|
||||
/** The sheet, listening. */
|
||||
fun listening(context: Context): Intent = Intent(context, AssistActivity::class.java).setAction(ACTION_LISTEN)
|
||||
|
||||
/** On the intent the wake word opens the sheet with: turn the screen on. */
|
||||
const val EXTRA_WAKE = "eu.llembas.android.WAKE"
|
||||
|
||||
/** The sheet, listening, as the wake word opens it. */
|
||||
fun woken(context: Context): Intent = listening(context).putExtra(EXTRA_WAKE, true).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
|
||||
/** The sheet, at the last assistant chat. */
|
||||
fun continuing(context: Context): Intent = Intent(context, AssistActivity::class.java).setAction(ACTION_CONTINUE)
|
||||
}
|
||||
|
||||
@@ -2,14 +2,17 @@ package eu.llembas.android.assist
|
||||
|
||||
import android.app.KeyguardManager
|
||||
import android.app.assist.AssistStructure
|
||||
import android.app.role.RoleManager
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.graphics.Bitmap
|
||||
import android.graphics.drawable.ColorDrawable
|
||||
import android.os.Bundle
|
||||
import android.os.SystemClock
|
||||
import android.service.voice.VoiceInteractionService
|
||||
import android.service.voice.VoiceInteractionSession
|
||||
import android.service.voice.VoiceInteractionSessionService
|
||||
import android.util.Log
|
||||
import android.view.View
|
||||
import android.view.WindowManager
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
@@ -27,12 +30,15 @@ import androidx.savedstate.setViewTreeSavedStateRegistryOwner
|
||||
import eu.llembas.android.AppLanguage
|
||||
import eu.llembas.android.lembas
|
||||
import eu.llembas.android.ui.theme.LembasTheme
|
||||
import eu.llembas.android.wake.AssistLink
|
||||
import eu.llembas.android.wake.AssistPresence
|
||||
import eu.llembas.android.wake.wakeLogConnected
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.SupervisorJob
|
||||
import kotlinx.coroutines.cancel
|
||||
import kotlinx.coroutines.flow.first
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.runBlocking
|
||||
|
||||
/**
|
||||
@@ -46,10 +52,18 @@ class LembasAssistService : VoiceInteractionService() {
|
||||
override fun onReady() {
|
||||
super.onReady()
|
||||
current = this
|
||||
// When Android connected it is kept: the wake word's record says whether it was, and an
|
||||
// attempt that found it not connected is told that it came later.
|
||||
val now = System.currentTimeMillis()
|
||||
AssistLink.ready(now)
|
||||
Log.i(TAG, "assistant service connected by Android")
|
||||
background.launch { runCatching { lembas.instances.savePrefs { it.copy(wakeLog = wakeLogConnected(it.wakeLog, now)) } } }
|
||||
}
|
||||
|
||||
override fun onShutdown() {
|
||||
if (current === this) current = null
|
||||
AssistLink.shutdown(System.currentTimeMillis())
|
||||
Log.i(TAG, "assistant service disconnected by Android")
|
||||
super.onShutdown()
|
||||
}
|
||||
|
||||
@@ -62,6 +76,13 @@ class LembasAssistService : VoiceInteractionService() {
|
||||
@Volatile
|
||||
var current: LembasAssistService? = null
|
||||
private set
|
||||
|
||||
private const val TAG = "LLeMbasWake"
|
||||
private val background = CoroutineScope(SupervisorJob() + Dispatchers.Default)
|
||||
|
||||
/** Whether Android says LLeMbas holds the assistant role (Settings › Default apps › Digital assistant app). */
|
||||
fun holdsRole(context: Context): Boolean =
|
||||
runCatching { context.getSystemService(RoleManager::class.java)?.isRoleHeld(RoleManager.ROLE_ASSISTANT) }.getOrNull() ?: false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,6 +153,7 @@ class LembasAssistSession(context: Context) :
|
||||
super.onShow(args, showFlags)
|
||||
registry.currentState = Lifecycle.State.RESUMED
|
||||
AssistPresence.shown()
|
||||
AssistLink.sheetShown(SystemClock.elapsedRealtime())
|
||||
// The wake word asks for the sheet listening, whatever Settings says about opening.
|
||||
controller.opened(locked(), listen = args?.getBoolean(AssistActivity.EXTRA_LISTEN) == true)
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import androidx.datastore.preferences.core.stringPreferencesKey
|
||||
import androidx.datastore.preferences.preferencesDataStore
|
||||
import eu.llembas.android.api.ApiClient
|
||||
import eu.llembas.android.api.LembasJson
|
||||
import eu.llembas.android.wake.WakeAttempt
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.flow.first
|
||||
import kotlinx.coroutines.flow.map
|
||||
@@ -93,6 +94,8 @@ data class Prefs(
|
||||
val wakePhrase: String = "hey_assistant",
|
||||
/** WakeSensitivity's id: low, normal or high. */
|
||||
val wakeSensitivity: String = "normal",
|
||||
/** What happened the last times the wake word was heard (WakeLog): shown in Settings, nothing of the account in it. */
|
||||
val wakeLog: List<WakeAttempt> = emptyList(),
|
||||
/** Listen only while the screen is on. */
|
||||
val wakeScreenOnly: Boolean = true,
|
||||
/** The assistant may read the notifications when asked (with Android's notification access). */
|
||||
|
||||
@@ -4,7 +4,6 @@ package eu.llembas.android.ui.settings
|
||||
|
||||
import android.Manifest
|
||||
import android.app.Activity
|
||||
import android.app.role.RoleManager
|
||||
import android.content.Intent
|
||||
import android.content.pm.PackageManager
|
||||
import android.os.SystemClock
|
||||
@@ -40,6 +39,7 @@ import androidx.compose.material.icons.filled.ErrorOutline
|
||||
import androidx.compose.material.icons.filled.Forum
|
||||
import androidx.compose.material.icons.filled.GraphicEq
|
||||
import androidx.compose.material.icons.filled.Hearing
|
||||
import androidx.compose.material.icons.filled.History
|
||||
import androidx.compose.material.icons.filled.Info
|
||||
import androidx.compose.material.icons.filled.Mic
|
||||
import androidx.compose.material.icons.filled.MyLocation
|
||||
@@ -93,6 +93,7 @@ import eu.llembas.android.AppLanguage
|
||||
import eu.llembas.android.BuildConfig
|
||||
import eu.llembas.android.R
|
||||
import eu.llembas.android.actions.NavApp
|
||||
import eu.llembas.android.assist.LembasAssistService
|
||||
import eu.llembas.android.assist.PhoneRecognizer
|
||||
import eu.llembas.android.auth.Instance
|
||||
import eu.llembas.android.auth.Prefs
|
||||
@@ -107,6 +108,8 @@ import eu.llembas.android.update.UpdateResult
|
||||
import eu.llembas.android.update.Updater
|
||||
import eu.llembas.android.update.checksUpdates
|
||||
import eu.llembas.android.update.offersBetas
|
||||
import eu.llembas.android.wake.AssistLink
|
||||
import eu.llembas.android.wake.WakeAttempt
|
||||
import eu.llembas.android.wake.WakeEngine
|
||||
import eu.llembas.android.wake.WakeFailure
|
||||
import eu.llembas.android.wake.WakePause
|
||||
@@ -117,6 +120,7 @@ import eu.llembas.android.wake.WakeState
|
||||
import eu.llembas.android.wake.WakeStatus
|
||||
import eu.llembas.android.wake.WakeWordService
|
||||
import eu.llembas.android.wake.WakeWords
|
||||
import eu.llembas.android.wake.wakeAttemptWords
|
||||
import eu.llembas.android.wake.wakeTitle
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.launch
|
||||
@@ -181,6 +185,8 @@ data class SettingsState(
|
||||
val wakeTest: WakeTestShown = WakeTestShown(),
|
||||
/** Whether LLeMbas is the phone's digital assistant app: only then can the wake word open it over other apps. */
|
||||
val isAssistant: Boolean = true,
|
||||
/** Whether Android has the assistant service connected right now: without it the wake word cannot open the sheet by itself. */
|
||||
val assistantConnected: Boolean = true,
|
||||
/** Whether Android's notification access is given to LLeMbas. */
|
||||
val notificationAccess: Boolean = false,
|
||||
/** Whether this build can read notifications at all (only the `notifications` build declares the listener). */
|
||||
@@ -198,6 +204,7 @@ fun SettingsScreen(onBack: () -> Unit, onAddInstance: () -> Unit) {
|
||||
val active by store.active.collectAsState(initial = null)
|
||||
val prefs by store.prefs.collectAsState(initial = Prefs())
|
||||
val wakeState by WakeStatus.state.collectAsState()
|
||||
val assistantConnected by AssistLink.connected.collectAsState()
|
||||
// The test's ten seconds: its deadline is WakeStatus's, the clock that watches it is here.
|
||||
val trial by WakeStatus.trial.collectAsState()
|
||||
var clock by remember { mutableStateOf(SystemClock.elapsedRealtime()) }
|
||||
@@ -403,7 +410,8 @@ fun SettingsScreen(onBack: () -> Unit, onAddInstance: () -> Unit) {
|
||||
wakeAvailable = WakeEngine.AVAILABLE,
|
||||
wakeState = wakeState,
|
||||
// Read again each time Settings is composed: the person comes back from the system's page.
|
||||
isAssistant = context.getSystemService(RoleManager::class.java)?.isRoleHeld(RoleManager.ROLE_ASSISTANT) ?: false,
|
||||
isAssistant = LembasAssistService.holdsRole(context),
|
||||
assistantConnected = assistantConnected,
|
||||
wakeTest = WakeTestShown(running = clock < trial.until, done = tested && clock >= trial.until, heard = if (tested) trial.heard else 0),
|
||||
// Read again each time Settings is composed: the person comes back from the system's page.
|
||||
notificationAccess = NotificationAccess.granted(context),
|
||||
@@ -733,6 +741,17 @@ internal fun WakeWordGroup(state: SettingsState, actions: SettingsActions, onCho
|
||||
subtitle = stringResource(R.string.wake_not_assistant_line),
|
||||
onClick = actions::assistantSettings,
|
||||
)
|
||||
} else if (!state.assistantConnected) {
|
||||
// The assistant in name, but Android holds no connection to it at this moment:
|
||||
// the one thing that lets the sheet open from the background is missing.
|
||||
Rule()
|
||||
SettingRow(
|
||||
Icons.Filled.Assistant,
|
||||
stringResource(R.string.wake_assistant_unbound),
|
||||
subtitle = stringResource(R.string.wake_assistant_unbound_line),
|
||||
tint = palette.warning,
|
||||
onClick = actions::assistantSettings,
|
||||
)
|
||||
}
|
||||
}
|
||||
if (state.wakeAvailable) {
|
||||
@@ -770,6 +789,8 @@ internal fun WakeWordGroup(state: SettingsState, actions: SettingsActions, onCho
|
||||
Rule()
|
||||
WakeTestRow(state, on, phrase.words, actions)
|
||||
Rule()
|
||||
WakeLogRow(state.prefs.wakeLog)
|
||||
Rule()
|
||||
SettingRow(
|
||||
Icons.Filled.ScreenLockPortrait,
|
||||
stringResource(R.string.wake_screen_only),
|
||||
@@ -1005,6 +1026,28 @@ private fun WakeTestRow(state: SettingsState, on: Boolean, phrase: String, actio
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* "Last wake": what happened the last time the phrase was heard -- what was tried and how it
|
||||
* went, in plain words, with Android's own where it refused -- and, on a tap, the few before it.
|
||||
*/
|
||||
@Composable
|
||||
private fun WakeLogRow(log: List<WakeAttempt>) {
|
||||
val context = LocalContext.current
|
||||
var all by remember { mutableStateOf(false) }
|
||||
val shown = if (all) log else log.take(1)
|
||||
SettingRow(
|
||||
Icons.Filled.History,
|
||||
stringResource(R.string.wake_last),
|
||||
subtitle = if (log.isEmpty()) {
|
||||
stringResource(R.string.wake_last_none)
|
||||
} else {
|
||||
shown.joinToString("\n\n") { wakeAttemptWords(context, it).joinToString("\n") }
|
||||
},
|
||||
enabled = log.isNotEmpty(),
|
||||
onClick = { all = !all },
|
||||
)
|
||||
}
|
||||
|
||||
private const val GOOGLE = "google"
|
||||
|
||||
private fun sensitivityLabel(sensitivity: WakeSensitivity): Int = when (sensitivity) {
|
||||
|
||||
@@ -14,6 +14,9 @@ import kotlinx.coroutines.launch
|
||||
import java.io.File
|
||||
import java.io.IOException
|
||||
import java.io.InputStream
|
||||
import java.time.Instant
|
||||
import java.time.ZoneId
|
||||
import java.time.format.DateTimeFormatter
|
||||
import java.util.Locale
|
||||
import java.util.concurrent.atomic.AtomicInteger
|
||||
import java.util.concurrent.atomic.AtomicLong
|
||||
@@ -147,27 +150,6 @@ object AssistPresence {
|
||||
}
|
||||
}
|
||||
|
||||
/** How the assistant is opened when the word was heard, from what Android will allow. */
|
||||
enum class WakeOpening {
|
||||
/** LLeMbas is the phone's assistant: its voice-interaction service shows the sheet, from anywhere. */
|
||||
Session,
|
||||
|
||||
/** The app is on screen: the sheet's activity may start. */
|
||||
Activity,
|
||||
|
||||
/**
|
||||
* Neither: Android blocks an activity started from the background, and says nothing when it
|
||||
* does -- so it is not relied on, and a notification to tap is posted.
|
||||
*/
|
||||
Notification,
|
||||
}
|
||||
|
||||
fun wakeOpening(isAssistant: Boolean, appVisible: Boolean): WakeOpening = when {
|
||||
isAssistant -> WakeOpening.Session
|
||||
appVisible -> WakeOpening.Activity
|
||||
else -> WakeOpening.Notification
|
||||
}
|
||||
|
||||
/** Whether the app has an activity on screen: counted from every activity's start and stop (LembasApp). */
|
||||
object AppVisibility {
|
||||
private val started = AtomicInteger(0)
|
||||
@@ -301,6 +283,34 @@ object WakeStatus {
|
||||
const val TRIAL_MS = 10_000L
|
||||
}
|
||||
|
||||
/**
|
||||
* One [attempt] in plain words, a line each: when and for which phrase; what was tried and how it
|
||||
* went (Android's own words where it refused); what was done instead; and, where the assistant
|
||||
* could not be used, what Android had said of it -- whether LLeMbas held the role, and when the
|
||||
* service was connected and disconnected in this run of the app.
|
||||
*/
|
||||
fun wakeAttemptWords(context: Context, attempt: WakeAttempt, zone: ZoneId = ZoneId.systemDefault(), locale: Locale = Locale.getDefault()): List<String> {
|
||||
fun time(at: Long): String = DateTimeFormatter.ofPattern("EEE d MMM, HH:mm:ss", locale).format(Instant.ofEpochMilli(at).atZone(zone))
|
||||
val lines = mutableListOf("${time(attempt.at)} · “${attempt.phrase}”")
|
||||
lines += when (attempt.outcome) {
|
||||
WakeAttempt.OUT_OPENED -> context.getString(R.string.wake_out_opened)
|
||||
WakeAttempt.OUT_TESTED -> context.getString(R.string.wake_out_tested)
|
||||
WakeAttempt.OUT_NO_SHEET -> context.getString(R.string.wake_out_no_sheet)
|
||||
WakeAttempt.OUT_REFUSED -> context.getString(R.string.wake_out_refused, attempt.detail)
|
||||
else -> context.getString(R.string.wake_out_not_connected)
|
||||
}
|
||||
when (attempt.fallback) {
|
||||
WakeWay.Activity.id -> lines += context.getString(R.string.wake_out_activity)
|
||||
WakeWay.Notification.id -> lines += context.getString(R.string.wake_out_notification)
|
||||
}
|
||||
if (attempt.outcome == WakeAttempt.OUT_OPENED || attempt.outcome == WakeAttempt.OUT_TESTED) return lines
|
||||
lines += context.getString(if (attempt.assistant) R.string.wake_role_held else R.string.wake_role_not_held)
|
||||
lines += if (attempt.readyAt == 0L) context.getString(R.string.wake_link_never) else context.getString(R.string.wake_link_ready, time(attempt.readyAt))
|
||||
if (attempt.shutdownAt != 0L) lines += context.getString(R.string.wake_link_shutdown, time(attempt.shutdownAt))
|
||||
if (attempt.connectedLater != 0L) lines += context.getString(R.string.wake_link_later, time(attempt.connectedLater))
|
||||
return lines
|
||||
}
|
||||
|
||||
/**
|
||||
* What the service's notification says the moment Android starts it (again): what is true --
|
||||
* [current], while its loop is [running]; "starting" for a service that has only just begun.
|
||||
|
||||
@@ -0,0 +1,139 @@
|
||||
package eu.llembas.android.wake
|
||||
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.flow.StateFlow
|
||||
import kotlinx.coroutines.flow.asStateFlow
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
/**
|
||||
* What happened the last times the wake word was heard: kept (the last [WAKE_LOG_SIZE], in the
|
||||
* phone's settings) and shown in Settings › Wake word, because "it heard me and nothing opened"
|
||||
* cannot be put right without knowing which step said no. Nothing of the account is in it: the
|
||||
* phrase, clock times, and Android's own words where it refused.
|
||||
*/
|
||||
@Serializable
|
||||
data class WakeAttempt(
|
||||
/** When the phrase was heard (wall clock, ms). */
|
||||
val at: Long = 0,
|
||||
val phrase: String = "",
|
||||
/** What was tried first: a [WakeWay]'s id. */
|
||||
val way: String = "",
|
||||
/** How that went: one of the `OUT_…` words. */
|
||||
val outcome: String = "",
|
||||
/** Android's own words when it refused: the exception's class and message. */
|
||||
val detail: String = "",
|
||||
/** What was done instead, when the first way did not open the sheet: `activity`, `notification` or nothing. */
|
||||
val fallback: String = "",
|
||||
/** Whether Android said LLeMbas holds the assistant role at that moment. */
|
||||
val assistant: Boolean = false,
|
||||
/** When Android last connected the assistant service in this run of the app, and last disconnected it; 0: never. */
|
||||
val readyAt: Long = 0,
|
||||
val shutdownAt: Long = 0,
|
||||
/** Set afterwards, when the service was not connected and Android connected it later. */
|
||||
val connectedLater: Long = 0,
|
||||
) {
|
||||
companion object {
|
||||
/** The sheet came up. */
|
||||
const val OUT_OPENED = "opened"
|
||||
|
||||
/** Android was asked and did not refuse, but no sheet came up in time. */
|
||||
const val OUT_NO_SHEET = "no_sheet"
|
||||
|
||||
/** The assistant service was not connected (`LembasAssistService.current` was null). */
|
||||
const val OUT_NOT_CONNECTED = "not_connected"
|
||||
|
||||
/** Android refused, with [detail]. */
|
||||
const val OUT_REFUSED = "refused"
|
||||
|
||||
/** A test in Settings took the word: nothing was to open. */
|
||||
const val OUT_TESTED = "tested"
|
||||
}
|
||||
}
|
||||
|
||||
const val WAKE_LOG_SIZE = 5
|
||||
|
||||
/** [log] with [attempt] put first, cut to the last [WAKE_LOG_SIZE]. */
|
||||
fun wakeLogAdd(log: List<WakeAttempt>, attempt: WakeAttempt): List<WakeAttempt> = (listOf(attempt) + log).take(WAKE_LOG_SIZE)
|
||||
|
||||
/**
|
||||
* Android connected the assistant service at [now]: the newest attempt that found it not
|
||||
* connected, and has not been answered yet, is told so. Anything else is left as it is.
|
||||
*/
|
||||
fun wakeLogConnected(log: List<WakeAttempt>, now: Long): List<WakeAttempt> {
|
||||
val newest = log.firstOrNull() ?: return log
|
||||
if (newest.outcome != WakeAttempt.OUT_NOT_CONNECTED || newest.connectedLater != 0L || now < newest.at) return log
|
||||
return listOf(newest.copy(connectedLater = now)) + log.drop(1)
|
||||
}
|
||||
|
||||
/** The ways the assistant may be opened when the word was heard, in the order they are worth trying. */
|
||||
enum class WakeWay(val id: String) {
|
||||
/** The assistant service is connected and the screen is on: it shows its sheet, from anywhere. */
|
||||
Session("session"),
|
||||
|
||||
/**
|
||||
* The assistant service is connected and the screen is off: a session's window turns no
|
||||
* screen on, so the sheet's activity is started through the service instead (Android lets an
|
||||
* app whose service the system has bound start one), and the activity turns the screen on.
|
||||
*/
|
||||
AssistantActivity("assistant_activity"),
|
||||
|
||||
/** No connected assistant service, but the app is on screen: the sheet's activity may start. */
|
||||
Activity("activity"),
|
||||
|
||||
/**
|
||||
* Neither: Android blocks an activity started from the background, and says nothing when it
|
||||
* does -- so it is not relied on, and a notification to tap is posted.
|
||||
*/
|
||||
Notification("notification"),
|
||||
|
||||
// A further way (answering by voice without a sheet) would be one more entry here, chosen in
|
||||
// [wakeWay] and carried out where the others are.
|
||||
}
|
||||
|
||||
/** The first way to try, from what is true at that moment. */
|
||||
fun wakeWay(connected: Boolean, screenOn: Boolean, appVisible: Boolean): WakeWay = when {
|
||||
connected && screenOn -> WakeWay.Session
|
||||
connected -> WakeWay.AssistantActivity
|
||||
appVisible -> WakeWay.Activity
|
||||
else -> WakeWay.Notification
|
||||
}
|
||||
|
||||
/** What is left when the assistant's own way did not open the sheet. */
|
||||
fun wakeFallback(appVisible: Boolean): WakeWay = if (appVisible) WakeWay.Activity else WakeWay.Notification
|
||||
|
||||
/**
|
||||
* The assistant service's life in this run of the app, as Android told it: when it was made,
|
||||
* connected (`onReady`), disconnected (`onShutdown`), and when a sheet last came up. Written by
|
||||
* the assistant service, the session and the sheet's activity; read when the word is heard.
|
||||
*/
|
||||
object AssistLink {
|
||||
@Volatile var readyAt = 0L
|
||||
private set
|
||||
|
||||
@Volatile var shutdownAt = 0L
|
||||
private set
|
||||
|
||||
private val _shown = MutableStateFlow(0L)
|
||||
|
||||
/** When a sheet last came up, on the phone's elapsed clock (ms); 0: not yet. */
|
||||
val shown: StateFlow<Long> = _shown.asStateFlow()
|
||||
|
||||
private val _connected = MutableStateFlow(false)
|
||||
|
||||
/** Whether Android has the assistant service connected right now. */
|
||||
val connected: StateFlow<Boolean> = _connected.asStateFlow()
|
||||
|
||||
fun ready(now: Long) {
|
||||
readyAt = now
|
||||
_connected.value = true
|
||||
}
|
||||
|
||||
fun shutdown(now: Long) {
|
||||
shutdownAt = now
|
||||
_connected.value = false
|
||||
}
|
||||
|
||||
fun sheetShown(elapsed: Long) {
|
||||
_shown.value = elapsed
|
||||
}
|
||||
}
|
||||
@@ -38,6 +38,7 @@ import kotlinx.coroutines.flow.filterNotNull
|
||||
import kotlinx.coroutines.flow.first
|
||||
import kotlinx.coroutines.flow.takeWhile
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withTimeoutOrNull
|
||||
|
||||
/**
|
||||
* Listening for the wake word: opt-in (Settings › Assistant › Wake word), off by default.
|
||||
@@ -169,7 +170,13 @@ class WakeWordService : LifecycleService() {
|
||||
engine = { keywords -> WakeEngine.create(this, keywords) },
|
||||
microphone = { PhoneMicrophone() },
|
||||
// A test in Settings takes the word; otherwise the assistant opens.
|
||||
heard = { if (!WakeStatus.heardInTrial(SystemClock.elapsedRealtime())) wake() },
|
||||
heard = { phrase ->
|
||||
if (WakeStatus.heardInTrial(SystemClock.elapsedRealtime())) {
|
||||
record(WakeAttempt(at = System.currentTimeMillis(), phrase = phrase.words, outcome = WakeAttempt.OUT_TESTED))
|
||||
} else {
|
||||
wake(phrase)
|
||||
}
|
||||
},
|
||||
log = { message, cause -> Log.w(TAG, message, cause) },
|
||||
)
|
||||
}
|
||||
@@ -197,25 +204,67 @@ class WakeWordService : LifecycleService() {
|
||||
}
|
||||
|
||||
/**
|
||||
* The word was heard: the assistant opens listening. Through the voice-interaction service
|
||||
* when LLeMbas is the phone's assistant (Android lets it open the sheet from the background);
|
||||
* as an activity while the app is on screen; and otherwise with a notification to tap,
|
||||
* because Android blocks an activity started from the background and says nothing when it
|
||||
* does ([wakeOpening]). The activity is still tried then -- where a phone allows it, it
|
||||
* opens and takes the notification away.
|
||||
* The word was heard: the assistant opens listening, by the first way Android allows
|
||||
* ([wakeWay]) -- and what was tried and how it went is written down ([WakeAttempt], kept in
|
||||
* the settings and shown in Settings › Wake word), because a silent "no" here looks to the
|
||||
* person like a wake word that does not work.
|
||||
*
|
||||
* A way that Android does not refuse is not yet a sheet on screen: the sheet says when it
|
||||
* is up ([AssistLink.shown]), and when it has not said so in time the fallback follows --
|
||||
* the activity while the app is on screen, else a notification to tap (the activity is
|
||||
* still tried then; where a phone allows it, it opens and takes the notification away).
|
||||
*/
|
||||
private fun wake() {
|
||||
private suspend fun wake(phrase: WakePhrase) {
|
||||
// The microphone is the sheet's from here: for a moment by this hold, then for as long as a sheet says it is up.
|
||||
AssistPresence.holdFor(SHEET_GRACE_MS)
|
||||
val session = LembasAssistService.current
|
||||
val shownBySystem = session != null &&
|
||||
runCatching { session.showSession(Bundle().apply { putBoolean(AssistActivity.EXTRA_LISTEN, true) }, 0) }.isSuccess
|
||||
val opening = wakeOpening(shownBySystem, AppVisibility.visible)
|
||||
if (opening == WakeOpening.Session) return
|
||||
val started = runCatching { startActivity(AssistActivity.listening(this).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)) }.isSuccess
|
||||
if (opening == WakeOpening.Notification || !started) {
|
||||
getSystemService(NotificationManager::class.java).notify(HEARD_ID, wakeHeardNotification(this))
|
||||
val asked = SystemClock.elapsedRealtime()
|
||||
val assistant = LembasAssistService.current
|
||||
val way = wakeWay(connected = assistant != null, screenOn = power().isInteractive, appVisible = AppVisibility.visible)
|
||||
var attempt = WakeAttempt(
|
||||
at = System.currentTimeMillis(),
|
||||
phrase = phrase.words,
|
||||
way = way.id,
|
||||
assistant = LembasAssistService.holdsRole(this),
|
||||
readyAt = AssistLink.readyAt,
|
||||
shutdownAt = AssistLink.shutdownAt,
|
||||
)
|
||||
// The assistant's own ways first, where it is connected.
|
||||
val refused: Throwable? = when (way) {
|
||||
WakeWay.Session -> runCatching { assistant?.showSession(Bundle().apply { putBoolean(AssistActivity.EXTRA_LISTEN, true) }, 0) }.exceptionOrNull()
|
||||
WakeWay.AssistantActivity -> runCatching { assistant?.startActivity(AssistActivity.woken(this)) }.exceptionOrNull()
|
||||
else -> null
|
||||
}
|
||||
if (way == WakeWay.Session || way == WakeWay.AssistantActivity) {
|
||||
if (refused == null && sheetCame(asked)) return record(attempt.copy(outcome = WakeAttempt.OUT_OPENED))
|
||||
attempt = if (refused != null) {
|
||||
attempt.copy(outcome = WakeAttempt.OUT_REFUSED, detail = WakeError(WakeFailure.Engine, refused).detail)
|
||||
} else {
|
||||
attempt.copy(outcome = WakeAttempt.OUT_NO_SHEET)
|
||||
}
|
||||
} else {
|
||||
attempt = attempt.copy(outcome = WakeAttempt.OUT_NOT_CONNECTED)
|
||||
}
|
||||
// Then what is left: the sheet's activity, relied on only while the app is on screen.
|
||||
val fallback = wakeFallback(AppVisibility.visible)
|
||||
val started = runCatching { startActivity(AssistActivity.woken(this)) }
|
||||
if (fallback == WakeWay.Activity && started.isSuccess && sheetCame(asked)) {
|
||||
return record(attempt.copy(fallback = WakeWay.Activity.id))
|
||||
}
|
||||
getSystemService(NotificationManager::class.java).notify(HEARD_ID, wakeHeardNotification(this, attempt.assistant))
|
||||
record(attempt.copy(fallback = WakeWay.Notification.id))
|
||||
}
|
||||
|
||||
/** Whether a sheet came up since [asked] (the phone's elapsed clock), waiting a moment for it. */
|
||||
private suspend fun sheetCame(asked: Long): Boolean = withTimeoutOrNull(SHEET_WAIT_MS) { AssistLink.shown.first { it >= asked } } != null
|
||||
|
||||
/** Write [attempt] down: in the log under a fixed tag, and first among the last few in the settings. */
|
||||
private suspend fun record(attempt: WakeAttempt) {
|
||||
Log.i(
|
||||
TAG,
|
||||
"wake word heard: way=${attempt.way} outcome=${attempt.outcome} fallback=${attempt.fallback} assistant=${attempt.assistant} " +
|
||||
"readyAt=${attempt.readyAt} shutdownAt=${attempt.shutdownAt} ${attempt.detail}",
|
||||
)
|
||||
runCatching { lembas.instances.savePrefs { it.copy(wakeLog = wakeLogAdd(it.wakeLog, attempt)) } }
|
||||
}
|
||||
|
||||
private fun power() = getSystemService(PowerManager::class.java)
|
||||
@@ -234,6 +283,9 @@ class WakeWordService : LifecycleService() {
|
||||
private const val NOTIFICATION_ID = 7001
|
||||
const val HEARD_ID = 7002
|
||||
private const val SHEET_GRACE_MS = 3_000L
|
||||
|
||||
/** How long a sheet has to say it is up before the way that was tried counts as not having opened it. */
|
||||
private const val SHEET_WAIT_MS = 2_500L
|
||||
private const val TAG = "LLeMbasWake"
|
||||
const val ACTION_STOP = "eu.llembas.android.action.WAKE_STOP"
|
||||
|
||||
@@ -280,12 +332,14 @@ class WakeWordService : LifecycleService() {
|
||||
* "Heard you. Tap to ask.": what the wake word posts when it cannot open the assistant itself.
|
||||
* A fixed sentence, nothing from the account; the tap opens the assistant listening.
|
||||
*/
|
||||
fun wakeHeardNotification(context: Context): Notification {
|
||||
fun wakeHeardNotification(context: Context, assistant: Boolean = false): Notification {
|
||||
val ask = PendingIntent.getActivity(context, 1, AssistActivity.listening(context), PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT)
|
||||
return NotificationCompat.Builder(context, WakeWordService.CHANNEL_HEARD)
|
||||
.setSmallIcon(R.drawable.ic_notification)
|
||||
.setContentTitle(context.getString(R.string.wake_heard))
|
||||
.setContentText(context.getString(R.string.wake_heard_line))
|
||||
// Why it is a notification and not the sheet, in fixed words: LLeMbas is not the phone's
|
||||
// assistant -- or it is, and could not open by itself this time (Settings says which step said no).
|
||||
.setContentText(context.getString(if (assistant) R.string.wake_heard_could_not else R.string.wake_heard_line))
|
||||
.setContentIntent(ask)
|
||||
.setAutoCancel(true)
|
||||
.setCategory(NotificationCompat.CATEGORY_RECOMMENDATION)
|
||||
|
||||
@@ -476,6 +476,24 @@
|
||||
<string name="wake_heard_line">LLeMbas se umí sám otevřít nad jinými aplikacemi jen jako aplikace digitálního asistenta v telefonu.</string>
|
||||
<string name="wake_not_assistant">LLeMbas není aplikací digitálního asistenta</string>
|
||||
<string name="wake_not_assistant_line">Budicí slovo proto nemůže otevřít asistenta nad jinými aplikacemi: dostanete oznámení, na které klepnete. Chcete-li otevírat hlasem kdekoli, klepněte sem a vyberte LLeMbas jako aplikaci digitálního asistenta.</string>
|
||||
<string name="wake_last">Poslední probuzení</string>
|
||||
<string name="wake_last_none">Frázi zatím neslyšel.</string>
|
||||
<string name="wake_out_opened">Otevřel asistenta.</string>
|
||||
<string name="wake_out_no_sheet">Požádal Android o otevření asistenta; neodmítl, ale panel se neobjevil.</string>
|
||||
<string name="wake_out_not_connected">Android neměl LLeMbas připojený jako asistenta, proto panel nemohl otevřít.</string>
|
||||
<string name="wake_out_refused">Android odmítl otevřít asistenta: %1$s</string>
|
||||
<string name="wake_out_activity">Místo toho ho otevřel jako obrazovku aplikace.</string>
|
||||
<string name="wake_out_notification">Místo toho poslal oznámení, na které je třeba klepnout.</string>
|
||||
<string name="wake_out_tested">Slyšeno při zkoušce: nebylo co otevírat.</string>
|
||||
<string name="wake_role_held">LLeMbas byl aplikací digitálního asistenta.</string>
|
||||
<string name="wake_role_not_held">LLeMbas nebyl aplikací digitálního asistenta.</string>
|
||||
<string name="wake_link_never">Android od spuštění aplikace asistenta nepřipojil.</string>
|
||||
<string name="wake_link_ready">Android připojil asistenta v %1$s.</string>
|
||||
<string name="wake_link_shutdown">Android ho odpojil v %1$s.</string>
|
||||
<string name="wake_link_later">Android ho znovu připojil v %1$s.</string>
|
||||
<string name="wake_assistant_unbound">LLeMbas je asistent, ale Android ho právě nemá připojeného</string>
|
||||
<string name="wake_assistant_unbound_line">Dokud ho nepřipojí, budicí slovo nemůže panel otevřít samo. Klepnutím otevřete systémové nastavení asistenta: vyberte jinou aplikaci a potom znovu LLeMbas, tím se připojí.</string>
|
||||
<string name="wake_heard_could_not">Nepodařilo se otevřít samo — klepněte a ptejte se</string>
|
||||
<string name="wake_resume">Znovu naslouchat budicímu slovu</string>
|
||||
<string name="wake_resume_line">Telefon se restartoval. Klepnutím znovu spustíte naslouchání.</string>
|
||||
<string name="assist_notifications">Shrnout má oznámení</string>
|
||||
|
||||
@@ -476,6 +476,24 @@
|
||||
<string name="wake_heard_line">LLeMbas kann sich nur als App für den digitalen Assistenten des Telefons selbst über anderen Apps öffnen.</string>
|
||||
<string name="wake_not_assistant">LLeMbas ist nicht die App für den digitalen Assistenten</string>
|
||||
<string name="wake_not_assistant_line">Deshalb kann das Aktivierungswort den Assistenten nicht über anderen Apps öffnen: Du bekommst eine Benachrichtigung zum Antippen. Um überall per Stimme zu öffnen, tippe hier und wähle LLeMbas als App für den digitalen Assistenten.</string>
|
||||
<string name="wake_last">Letztes Aufwecken</string>
|
||||
<string name="wake_last_none">Der Satz wurde noch nicht gehört.</string>
|
||||
<string name="wake_out_opened">Assistent geöffnet.</string>
|
||||
<string name="wake_out_no_sheet">Android wurde gebeten, den Assistenten zu öffnen; es hat nicht abgelehnt, aber es kam kein Blatt.</string>
|
||||
<string name="wake_out_not_connected">Android hatte LLeMbas nicht als Assistenten verbunden, daher ließ sich das Blatt nicht öffnen.</string>
|
||||
<string name="wake_out_refused">Android hat das Öffnen des Assistenten abgelehnt: %1$s</string>
|
||||
<string name="wake_out_activity">Stattdessen als Bildschirm der App geöffnet.</string>
|
||||
<string name="wake_out_notification">Stattdessen eine Benachrichtigung zum Antippen gesendet.</string>
|
||||
<string name="wake_out_tested">In einem Test gehört: Es war nichts zu öffnen.</string>
|
||||
<string name="wake_role_held">LLeMbas war die App für den digitalen Assistenten.</string>
|
||||
<string name="wake_role_not_held">LLeMbas war nicht die App für den digitalen Assistenten.</string>
|
||||
<string name="wake_link_never">Android hatte den Assistenten seit dem Start der App nicht verbunden.</string>
|
||||
<string name="wake_link_ready">Android hatte den Assistenten um %1$s verbunden.</string>
|
||||
<string name="wake_link_shutdown">Android hatte ihn um %1$s getrennt.</string>
|
||||
<string name="wake_link_later">Android hat ihn um %1$s wieder verbunden.</string>
|
||||
<string name="wake_assistant_unbound">LLeMbas ist der Assistent, aber Android hat ihn gerade nicht verbunden</string>
|
||||
<string name="wake_assistant_unbound_line">Solange das so ist, kann das Aktivierungswort das Blatt nicht selbst öffnen. Tippe für die Assistenten-Einstellung des Systems: Eine andere App und dann wieder LLeMbas zu wählen verbindet ihn.</string>
|
||||
<string name="wake_heard_could_not">Ließ sich nicht selbst öffnen — tippe, um zu fragen</string>
|
||||
<string name="wake_resume">Wieder auf das Aktivierungswort hören</string>
|
||||
<string name="wake_resume_line">Das Telefon wurde neu gestartet. Tippe, um wieder zuzuhören.</string>
|
||||
<string name="assist_notifications">Meine Benachrichtigungen zusammenfassen</string>
|
||||
|
||||
@@ -476,6 +476,24 @@
|
||||
<string name="wake_heard_line">LLeMbas solo puede abrirse por sí mismo sobre otras apps si es la app de asistente digital del teléfono.</string>
|
||||
<string name="wake_not_assistant">LLeMbas no es la app de asistente digital</string>
|
||||
<string name="wake_not_assistant_line">Por eso la palabra de activación no puede abrir el asistente sobre otras apps: recibes una notificación que tocar. Para abrir con la voz en cualquier parte, toca aquí y elige LLeMbas como app de asistente digital.</string>
|
||||
<string name="wake_last">Última activación</string>
|
||||
<string name="wake_last_none">Todavía no ha oído la frase.</string>
|
||||
<string name="wake_out_opened">Abrió el asistente.</string>
|
||||
<string name="wake_out_no_sheet">Pidió a Android que abriera el asistente; no se negó, pero no apareció el panel.</string>
|
||||
<string name="wake_out_not_connected">Android no tenía LLeMbas conectado como asistente, así que no pudo abrir el panel.</string>
|
||||
<string name="wake_out_refused">Android se negó a abrir el asistente: %1$s</string>
|
||||
<string name="wake_out_activity">En su lugar lo abrió como una pantalla de la app.</string>
|
||||
<string name="wake_out_notification">En su lugar envió una notificación para tocar.</string>
|
||||
<string name="wake_out_tested">Oída en una prueba: no había nada que abrir.</string>
|
||||
<string name="wake_role_held">LLeMbas era la app de asistente digital.</string>
|
||||
<string name="wake_role_not_held">LLeMbas no era la app de asistente digital.</string>
|
||||
<string name="wake_link_never">Android no había conectado el asistente desde que se inició la app.</string>
|
||||
<string name="wake_link_ready">Android había conectado el asistente a las %1$s.</string>
|
||||
<string name="wake_link_shutdown">Android lo había desconectado a las %1$s.</string>
|
||||
<string name="wake_link_later">Android volvió a conectarlo a las %1$s.</string>
|
||||
<string name="wake_assistant_unbound">LLeMbas es el asistente, pero Android no lo tiene conectado ahora mismo</string>
|
||||
<string name="wake_assistant_unbound_line">Hasta que lo conecte, la palabra de activación no puede abrir el panel por sí sola. Toca para ir al ajuste del asistente del sistema: elegir otra app y luego LLeMbas de nuevo lo conecta.</string>
|
||||
<string name="wake_heard_could_not">No pudo abrirse por sí solo: toca para preguntar</string>
|
||||
<string name="wake_resume">Volver a escuchar la palabra de activación</string>
|
||||
<string name="wake_resume_line">El teléfono se reinició. Toca para volver a escuchar.</string>
|
||||
<string name="assist_notifications">Resumir mis notificaciones</string>
|
||||
|
||||
@@ -476,6 +476,24 @@
|
||||
<string name="wake_heard_line">LLeMbas ne peut s’ouvrir de lui-même par-dessus d’autres apps que s’il est l’assistant numérique du téléphone.</string>
|
||||
<string name="wake_not_assistant">LLeMbas n’est pas l’application d’assistant numérique</string>
|
||||
<string name="wake_not_assistant_line">Le mot d’activation ne peut donc pas ouvrir l’assistant par-dessus d’autres apps : vous recevez une notification à toucher. Pour ouvrir à la voix partout, touchez ici et choisissez LLeMbas comme application d’assistant numérique.</string>
|
||||
<string name="wake_last">Dernier réveil</string>
|
||||
<string name="wake_last_none">Il n’a pas encore entendu la phrase.</string>
|
||||
<string name="wake_out_opened">A ouvert l’assistant.</string>
|
||||
<string name="wake_out_no_sheet">A demandé à Android d’ouvrir l’assistant ; il n’a pas refusé, mais aucun panneau n’est apparu.</string>
|
||||
<string name="wake_out_not_connected">Android n’avait pas connecté LLeMbas comme assistant, le panneau n’a donc pas pu s’ouvrir.</string>
|
||||
<string name="wake_out_refused">Android a refusé d’ouvrir l’assistant : %1$s</string>
|
||||
<string name="wake_out_activity">L’a ouvert à la place comme un écran de l’app.</string>
|
||||
<string name="wake_out_notification">A envoyé à la place une notification à toucher.</string>
|
||||
<string name="wake_out_tested">Entendu pendant un test : il n’y avait rien à ouvrir.</string>
|
||||
<string name="wake_role_held">LLeMbas était l’application d’assistant numérique.</string>
|
||||
<string name="wake_role_not_held">LLeMbas n’était pas l’application d’assistant numérique.</string>
|
||||
<string name="wake_link_never">Android n’avait pas connecté l’assistant depuis le démarrage de l’app.</string>
|
||||
<string name="wake_link_ready">Android avait connecté l’assistant à %1$s.</string>
|
||||
<string name="wake_link_shutdown">Android l’avait déconnecté à %1$s.</string>
|
||||
<string name="wake_link_later">Android l’a reconnecté à %1$s.</string>
|
||||
<string name="wake_assistant_unbound">LLeMbas est l’assistant, mais Android ne l’a pas connecté pour l’instant</string>
|
||||
<string name="wake_assistant_unbound_line">Tant que ce n’est pas fait, le mot d’activation ne peut pas ouvrir le panneau de lui-même. Touchez pour le réglage de l’assistant du système : choisir une autre app puis de nouveau LLeMbas le reconnecte.</string>
|
||||
<string name="wake_heard_could_not">N’a pas pu s’ouvrir de lui-même — touchez pour demander</string>
|
||||
<string name="wake_resume">Écouter à nouveau le mot d’activation</string>
|
||||
<string name="wake_resume_line">Le téléphone a redémarré. Touchez pour reprendre l’écoute.</string>
|
||||
<string name="assist_notifications">Résumer mes notifications</string>
|
||||
|
||||
@@ -476,6 +476,24 @@
|
||||
<string name="wake_heard_line">A LLeMbas csak a telefon digitális asszisztens alkalmazásaként tud magától megnyílni más alkalmazások fölött.</string>
|
||||
<string name="wake_not_assistant">A LLeMbas nem a digitális asszisztens alkalmazás</string>
|
||||
<string name="wake_not_assistant_line">Ezért az ébresztőszó nem tudja megnyitni az asszisztenst más alkalmazások fölött: értesítést kapsz, amelyre koppinthatsz. Ha bárhol hanggal szeretnéd megnyitni, koppints ide, és válaszd a LLeMbast digitális asszisztens alkalmazásnak.</string>
|
||||
<string name="wake_last">Utolsó ébresztés</string>
|
||||
<string name="wake_last_none">Még nem hallotta a kifejezést.</string>
|
||||
<string name="wake_out_opened">Megnyitotta az asszisztenst.</string>
|
||||
<string name="wake_out_no_sheet">Megkérte az Androidot az asszisztens megnyitására; nem utasította el, de a panel nem jelent meg.</string>
|
||||
<string name="wake_out_not_connected">Az Android nem csatlakoztatta a LLeMbast asszisztensként, ezért nem tudta megnyitni a panelt.</string>
|
||||
<string name="wake_out_refused">Az Android elutasította az asszisztens megnyitását: %1$s</string>
|
||||
<string name="wake_out_activity">Helyette az alkalmazás képernyőjeként nyitotta meg.</string>
|
||||
<string name="wake_out_notification">Helyette értesítést küldött, amelyre koppintani lehet.</string>
|
||||
<string name="wake_out_tested">Próba közben hallotta: nem volt mit megnyitni.</string>
|
||||
<string name="wake_role_held">A LLeMbas volt a digitális asszisztens alkalmazás.</string>
|
||||
<string name="wake_role_not_held">Nem a LLeMbas volt a digitális asszisztens alkalmazás.</string>
|
||||
<string name="wake_link_never">Az Android az alkalmazás indulása óta nem csatlakoztatta az asszisztenst.</string>
|
||||
<string name="wake_link_ready">Az Android ekkor csatlakoztatta az asszisztenst: %1$s.</string>
|
||||
<string name="wake_link_shutdown">Az Android ekkor választotta le: %1$s.</string>
|
||||
<string name="wake_link_later">Az Android ekkor csatlakoztatta újra: %1$s.</string>
|
||||
<string name="wake_assistant_unbound">A LLeMbas az asszisztens, de az Android most nem csatlakoztatta</string>
|
||||
<string name="wake_assistant_unbound_line">Amíg nem csatlakoztatja, az ébresztőszó nem tudja magától megnyitni a panelt. Koppints a rendszer asszisztensbeállításához: ha másik alkalmazást, majd újra a LLeMbast választod, csatlakozik.</string>
|
||||
<string name="wake_heard_could_not">Nem tudott magától megnyílni — koppints a kérdezéshez</string>
|
||||
<string name="wake_resume">Ébresztőszó figyelése újra</string>
|
||||
<string name="wake_resume_line">A telefon újraindult. Koppints a figyelés folytatásához.</string>
|
||||
<string name="assist_notifications">Értesítéseim összefoglalása</string>
|
||||
|
||||
@@ -476,6 +476,24 @@
|
||||
<string name="wake_heard_line">LLeMbas può aprirsi da solo sopra le altre app soltanto come app di assistente digitale del telefono.</string>
|
||||
<string name="wake_not_assistant">LLeMbas non è l’app di assistente digitale</string>
|
||||
<string name="wake_not_assistant_line">Per questo la parola di attivazione non può aprire l’assistente sopra le altre app: ricevi una notifica da toccare. Per aprire con la voce ovunque, tocca qui e scegli LLeMbas come app di assistente digitale.</string>
|
||||
<string name="wake_last">Ultima attivazione</string>
|
||||
<string name="wake_last_none">Non ha ancora sentito la frase.</string>
|
||||
<string name="wake_out_opened">Ha aperto l’assistente.</string>
|
||||
<string name="wake_out_no_sheet">Ha chiesto ad Android di aprire l’assistente; non ha rifiutato, ma il pannello non è comparso.</string>
|
||||
<string name="wake_out_not_connected">Android non aveva collegato LLeMbas come assistente, quindi non ha potuto aprire il pannello.</string>
|
||||
<string name="wake_out_refused">Android ha rifiutato di aprire l’assistente: %1$s</string>
|
||||
<string name="wake_out_activity">Al suo posto l’ha aperto come schermata dell’app.</string>
|
||||
<string name="wake_out_notification">Al suo posto ha inviato una notifica da toccare.</string>
|
||||
<string name="wake_out_tested">Sentita durante una prova: non c’era nulla da aprire.</string>
|
||||
<string name="wake_role_held">LLeMbas era l’app di assistente digitale.</string>
|
||||
<string name="wake_role_not_held">LLeMbas non era l’app di assistente digitale.</string>
|
||||
<string name="wake_link_never">Android non aveva collegato l’assistente dall’avvio dell’app.</string>
|
||||
<string name="wake_link_ready">Android aveva collegato l’assistente alle %1$s.</string>
|
||||
<string name="wake_link_shutdown">Android l’aveva scollegato alle %1$s.</string>
|
||||
<string name="wake_link_later">Android l’ha ricollegato alle %1$s.</string>
|
||||
<string name="wake_assistant_unbound">LLeMbas è l’assistente, ma Android non l’ha collegato in questo momento</string>
|
||||
<string name="wake_assistant_unbound_line">Finché non lo collega, la parola di attivazione non può aprire il pannello da sola. Tocca per l’impostazione dell’assistente di sistema: scegliere un’altra app e poi di nuovo LLeMbas lo collega.</string>
|
||||
<string name="wake_heard_could_not">Non è riuscito ad aprirsi da solo — tocca per chiedere</string>
|
||||
<string name="wake_resume">Ascolta di nuovo la parola di attivazione</string>
|
||||
<string name="wake_resume_line">Il telefono si è riavviato. Tocca per ricominciare ad ascoltare.</string>
|
||||
<string name="assist_notifications">Riassumi le mie notifiche</string>
|
||||
|
||||
@@ -476,6 +476,24 @@
|
||||
<string name="wake_heard_line">LLeMbas może sam otworzyć się nad innymi aplikacjami tylko jako aplikacja asystenta cyfrowego telefonu.</string>
|
||||
<string name="wake_not_assistant">LLeMbas nie jest aplikacją asystenta cyfrowego</string>
|
||||
<string name="wake_not_assistant_line">Dlatego słowo aktywujące nie może otworzyć asystenta nad innymi aplikacjami: dostajesz powiadomienie do dotknięcia. Aby otwierać głosem wszędzie, dotknij tutaj i wybierz LLeMbas jako aplikację asystenta cyfrowego.</string>
|
||||
<string name="wake_last">Ostatnie wybudzenie</string>
|
||||
<string name="wake_last_none">Jeszcze nie usłyszał frazy.</string>
|
||||
<string name="wake_out_opened">Otworzył asystenta.</string>
|
||||
<string name="wake_out_no_sheet">Poprosił Androida o otwarcie asystenta; nie odmówił, ale panel się nie pojawił.</string>
|
||||
<string name="wake_out_not_connected">Android nie miał połączonego LLeMbas jako asystenta, więc nie mógł otworzyć panelu.</string>
|
||||
<string name="wake_out_refused">Android odmówił otwarcia asystenta: %1$s</string>
|
||||
<string name="wake_out_activity">Zamiast tego otworzył go jako ekran aplikacji.</string>
|
||||
<string name="wake_out_notification">Zamiast tego wysłał powiadomienie do dotknięcia.</string>
|
||||
<string name="wake_out_tested">Usłyszano podczas próby: nie było czego otwierać.</string>
|
||||
<string name="wake_role_held">LLeMbas był aplikacją asystenta cyfrowego.</string>
|
||||
<string name="wake_role_not_held">LLeMbas nie był aplikacją asystenta cyfrowego.</string>
|
||||
<string name="wake_link_never">Android nie połączył asystenta od uruchomienia aplikacji.</string>
|
||||
<string name="wake_link_ready">Android połączył asystenta o %1$s.</string>
|
||||
<string name="wake_link_shutdown">Android rozłączył go o %1$s.</string>
|
||||
<string name="wake_link_later">Android połączył go ponownie o %1$s.</string>
|
||||
<string name="wake_assistant_unbound">LLeMbas jest asystentem, ale Android nie ma go teraz połączonego</string>
|
||||
<string name="wake_assistant_unbound_line">Dopóki go nie połączy, słowo aktywujące nie może samo otworzyć panelu. Dotknij, aby przejść do systemowego ustawienia asystenta: wybranie innej aplikacji, a potem znów LLeMbas, połączy go.</string>
|
||||
<string name="wake_heard_could_not">Nie udało się otworzyć samo — dotknij, aby zapytać</string>
|
||||
<string name="wake_resume">Znów nasłuchuj słowa aktywującego</string>
|
||||
<string name="wake_resume_line">Telefon uruchomił się ponownie. Dotknij, aby znów słuchać.</string>
|
||||
<string name="assist_notifications">Podsumuj moje powiadomienia</string>
|
||||
|
||||
@@ -476,6 +476,24 @@
|
||||
<string name="wake_heard_line">LLeMbas sa dokáže sám otvoriť nad inými aplikáciami len ako aplikácia digitálneho asistenta v telefóne.</string>
|
||||
<string name="wake_not_assistant">LLeMbas nie je aplikáciou digitálneho asistenta</string>
|
||||
<string name="wake_not_assistant_line">Budiace slovo preto nemôže otvoriť asistenta nad inými aplikáciami: dostanete oznámenie, na ktoré ťuknete. Ak chcete otvárať hlasom kdekoľvek, ťuknite sem a vyberte LLeMbas ako aplikáciu digitálneho asistenta.</string>
|
||||
<string name="wake_last">Posledné zobudenie</string>
|
||||
<string name="wake_last_none">Frázu zatiaľ nepočul.</string>
|
||||
<string name="wake_out_opened">Otvoril asistenta.</string>
|
||||
<string name="wake_out_no_sheet">Požiadal Android o otvorenie asistenta; neodmietol, no panel sa neobjavil.</string>
|
||||
<string name="wake_out_not_connected">Android nemal LLeMbas pripojený ako asistenta, preto panel nemohol otvoriť.</string>
|
||||
<string name="wake_out_refused">Android odmietol otvoriť asistenta: %1$s</string>
|
||||
<string name="wake_out_activity">Namiesto toho ho otvoril ako obrazovku aplikácie.</string>
|
||||
<string name="wake_out_notification">Namiesto toho poslal oznámenie, na ktoré treba ťuknúť.</string>
|
||||
<string name="wake_out_tested">Počuté pri skúške: nebolo čo otvárať.</string>
|
||||
<string name="wake_role_held">LLeMbas bol aplikáciou digitálneho asistenta.</string>
|
||||
<string name="wake_role_not_held">LLeMbas nebol aplikáciou digitálneho asistenta.</string>
|
||||
<string name="wake_link_never">Android od spustenia aplikácie asistenta nepripojil.</string>
|
||||
<string name="wake_link_ready">Android pripojil asistenta o %1$s.</string>
|
||||
<string name="wake_link_shutdown">Android ho odpojil o %1$s.</string>
|
||||
<string name="wake_link_later">Android ho znova pripojil o %1$s.</string>
|
||||
<string name="wake_assistant_unbound">LLeMbas je asistent, no Android ho práve nemá pripojeného</string>
|
||||
<string name="wake_assistant_unbound_line">Kým ho nepripojí, budiace slovo nemôže panel otvoriť samo. Ťuknutím otvoríte systémové nastavenie asistenta: vyberte inú aplikáciu a potom znova LLeMbas, tým sa pripojí.</string>
|
||||
<string name="wake_heard_could_not">Nepodarilo sa otvoriť samo — ťuknite a pýtajte sa</string>
|
||||
<string name="wake_resume">Znova počúvať budiace slovo</string>
|
||||
<string name="wake_resume_line">Telefón sa reštartoval. Ťuknutím znova spustíte počúvanie.</string>
|
||||
<string name="assist_notifications">Zhrnúť moje oznámenia</string>
|
||||
|
||||
@@ -478,6 +478,24 @@
|
||||
<string name="wake_heard_line">LLeMbas can open by itself over other apps only as the phone\'s digital assistant app.</string>
|
||||
<string name="wake_not_assistant">LLeMbas is not the digital assistant app</string>
|
||||
<string name="wake_not_assistant_line">So the wake word cannot open the assistant over other apps: you get a notification to tap. To open by voice anywhere, tap here and choose LLeMbas as the digital assistant app.</string>
|
||||
<string name="wake_last">Last wake</string>
|
||||
<string name="wake_last_none">It has not heard the phrase yet.</string>
|
||||
<string name="wake_out_opened">Opened the assistant.</string>
|
||||
<string name="wake_out_no_sheet">Asked Android to open the assistant; it did not refuse, but no sheet came.</string>
|
||||
<string name="wake_out_not_connected">Android had not connected LLeMbas as the assistant, so it could not open the sheet.</string>
|
||||
<string name="wake_out_refused">Android refused to open the assistant: %1$s</string>
|
||||
<string name="wake_out_activity">Opened it as a screen of the app instead.</string>
|
||||
<string name="wake_out_notification">Posted a notification to tap instead.</string>
|
||||
<string name="wake_out_tested">Heard in a test: nothing was to open.</string>
|
||||
<string name="wake_role_held">LLeMbas was the digital assistant app.</string>
|
||||
<string name="wake_role_not_held">LLeMbas was not the digital assistant app.</string>
|
||||
<string name="wake_link_never">Android had not connected the assistant since the app started.</string>
|
||||
<string name="wake_link_ready">Android had connected the assistant at %1$s.</string>
|
||||
<string name="wake_link_shutdown">Android had disconnected it at %1$s.</string>
|
||||
<string name="wake_link_later">Android connected it again at %1$s.</string>
|
||||
<string name="wake_assistant_unbound">LLeMbas is the assistant, but Android has not connected it right now</string>
|
||||
<string name="wake_assistant_unbound_line">Until it does, the wake word cannot open the sheet by itself. Tap for the system\'s assistant setting: choosing another app and then LLeMbas again connects it.</string>
|
||||
<string name="wake_heard_could_not">Could not open by itself — tap to ask</string>
|
||||
<string name="wake_resume">Listen for the wake word again</string>
|
||||
<string name="wake_resume_line">The phone restarted. Tap to start listening again.</string>
|
||||
<string name="assist_notifications">Summarise my notifications</string>
|
||||
|
||||
@@ -3,10 +3,12 @@ package eu.llembas.android
|
||||
import android.app.Application
|
||||
import android.app.Notification
|
||||
import android.app.NotificationManager
|
||||
import eu.llembas.android.wake.WakeAttempt
|
||||
import eu.llembas.android.wake.WakeFailure
|
||||
import eu.llembas.android.wake.WakePause
|
||||
import eu.llembas.android.wake.WakeState
|
||||
import eu.llembas.android.wake.WakeWordService
|
||||
import eu.llembas.android.wake.wakeAttemptWords
|
||||
import eu.llembas.android.wake.wakeHeardNotification
|
||||
import eu.llembas.android.wake.wakeNotification
|
||||
import eu.llembas.android.wake.wakeTitle
|
||||
@@ -19,6 +21,8 @@ import org.junit.runner.RunWith
|
||||
import org.robolectric.RobolectricTestRunner
|
||||
import org.robolectric.RuntimeEnvironment
|
||||
import org.robolectric.annotation.Config
|
||||
import java.time.ZoneOffset
|
||||
import java.util.Locale
|
||||
|
||||
/**
|
||||
* What the wake word's notification says, from its state alone: the phrase only while it really
|
||||
@@ -95,4 +99,70 @@ class WakeNotificationTest {
|
||||
assertEquals(Notification.FLAG_AUTO_CANCEL, heard.flags and Notification.FLAG_AUTO_CANCEL)
|
||||
assertNotNull(heard.contentIntent)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun theFallbackSaysWhyInFixedWords() {
|
||||
fun line(assistant: Boolean) = wakeHeardNotification(app, assistant).extras.getCharSequence(Notification.EXTRA_TEXT).toString()
|
||||
// The assistant, and still it could not open by itself this time.
|
||||
assertEquals("Could not open by itself — tap to ask", line(assistant = true))
|
||||
// Not the assistant: that is the reason.
|
||||
assertEquals("LLeMbas can open by itself over other apps only as the phone's digital assistant app.", line(assistant = false))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun theLastWakeInPlainWords() {
|
||||
val zone = ZoneOffset.UTC
|
||||
val at = 1_773_129_600_000 // Tue 10 Mar 2026, 08:00:00 UTC
|
||||
fun words(attempt: WakeAttempt) = wakeAttemptWords(app, attempt, zone, Locale.ENGLISH)
|
||||
assertEquals(
|
||||
listOf("Tue 10 Mar, 08:00:00 · “Hey Assistant”", "Opened the assistant."),
|
||||
words(WakeAttempt(at = at, phrase = "Hey Assistant", way = "session", outcome = WakeAttempt.OUT_OPENED, assistant = true, readyAt = at - 60_000)),
|
||||
)
|
||||
// The assistant in name, never connected in this run of the app: said step by step.
|
||||
assertEquals(
|
||||
listOf(
|
||||
"Tue 10 Mar, 08:00:00 · “Hey Assistant”",
|
||||
"Android had not connected LLeMbas as the assistant, so it could not open the sheet.",
|
||||
"Posted a notification to tap instead.",
|
||||
"LLeMbas was the digital assistant app.",
|
||||
"Android had not connected the assistant since the app started.",
|
||||
"Android connected it again at Tue 10 Mar, 08:00:30.",
|
||||
),
|
||||
words(
|
||||
WakeAttempt(
|
||||
at = at,
|
||||
phrase = "Hey Assistant",
|
||||
way = "notification",
|
||||
outcome = WakeAttempt.OUT_NOT_CONNECTED,
|
||||
fallback = "notification",
|
||||
assistant = true,
|
||||
connectedLater =
|
||||
at + 30_000,
|
||||
),
|
||||
),
|
||||
)
|
||||
// Android's own words where it refused, and when it had connected and dropped the service.
|
||||
val refused = words(
|
||||
WakeAttempt(
|
||||
at = at,
|
||||
phrase = "OK Computer",
|
||||
way = "session",
|
||||
outcome = WakeAttempt.OUT_REFUSED,
|
||||
detail = "SecurityException: not the current voice interaction service",
|
||||
fallback = "activity",
|
||||
readyAt = at - 3_600_000,
|
||||
shutdownAt = at - 60_000,
|
||||
),
|
||||
)
|
||||
assertEquals("Android refused to open the assistant: SecurityException: not the current voice interaction service", refused[1])
|
||||
assertEquals("Opened it as a screen of the app instead.", refused[2])
|
||||
assertEquals("LLeMbas was not the digital assistant app.", refused[3])
|
||||
assertEquals("Android had connected the assistant at Tue 10 Mar, 07:00:00.", refused[4])
|
||||
assertEquals("Android had disconnected it at Tue 10 Mar, 07:59:00.", refused[5])
|
||||
assertEquals("Heard in a test: nothing was to open.", words(WakeAttempt(at = at, phrase = "Hey Assistant", outcome = WakeAttempt.OUT_TESTED))[1])
|
||||
assertEquals(
|
||||
"Asked Android to open the assistant; it did not refuse, but no sheet came.",
|
||||
words(WakeAttempt(at = at, phrase = "Hey Assistant", way = "session", outcome = WakeAttempt.OUT_NO_SHEET, fallback = "notification"))[1],
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -3,23 +3,28 @@ package eu.llembas.android
|
||||
import eu.llembas.android.api.LembasJson
|
||||
import eu.llembas.android.auth.Prefs
|
||||
import eu.llembas.android.wake.AppVisibility
|
||||
import eu.llembas.android.wake.AssistLink
|
||||
import eu.llembas.android.wake.AssistPresence
|
||||
import eu.llembas.android.wake.WakeAttempt
|
||||
import eu.llembas.android.wake.WakeError
|
||||
import eu.llembas.android.wake.WakeFailure
|
||||
import eu.llembas.android.wake.WakeOpening
|
||||
import eu.llembas.android.wake.WakePause
|
||||
import eu.llembas.android.wake.WakePhrases
|
||||
import eu.llembas.android.wake.WakeSensitivity
|
||||
import eu.llembas.android.wake.WakeState
|
||||
import eu.llembas.android.wake.WakeStatus
|
||||
import eu.llembas.android.wake.WakeWay
|
||||
import eu.llembas.android.wake.WakeWords
|
||||
import eu.llembas.android.wake.checkKeywords
|
||||
import eu.llembas.android.wake.unpackWakeModel
|
||||
import eu.llembas.android.wake.wakeBackoff
|
||||
import eu.llembas.android.wake.wakeFallback
|
||||
import eu.llembas.android.wake.wakeKeywords
|
||||
import eu.llembas.android.wake.wakeOpening
|
||||
import eu.llembas.android.wake.wakeLogAdd
|
||||
import eu.llembas.android.wake.wakeLogConnected
|
||||
import eu.llembas.android.wake.wakePause
|
||||
import eu.llembas.android.wake.wakeStateAtStart
|
||||
import eu.llembas.android.wake.wakeWay
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||
import kotlinx.coroutines.Job
|
||||
@@ -160,13 +165,18 @@ class WakeTest {
|
||||
|
||||
@Test
|
||||
fun theAssistantIsOpenedOnlyTheWayAndroidAllows() {
|
||||
// The phone's assistant: its own service shows the sheet, on screen or not.
|
||||
assertEquals(WakeOpening.Session, wakeOpening(isAssistant = true, appVisible = false))
|
||||
assertEquals(WakeOpening.Session, wakeOpening(isAssistant = true, appVisible = true))
|
||||
// Not the assistant, but on screen: the sheet's activity may start.
|
||||
assertEquals(WakeOpening.Activity, wakeOpening(isAssistant = false, appVisible = true))
|
||||
// Neither: an activity start is blocked without a word, so the notification is what is relied on.
|
||||
assertEquals(WakeOpening.Notification, wakeOpening(isAssistant = false, appVisible = false))
|
||||
// The assistant service connected and the screen on: it shows its sheet, on screen or not.
|
||||
assertEquals(WakeWay.Session, wakeWay(connected = true, screenOn = true, appVisible = false))
|
||||
assertEquals(WakeWay.Session, wakeWay(connected = true, screenOn = true, appVisible = true))
|
||||
// Connected, the screen off: the sheet's activity through the service, which turns the screen on.
|
||||
assertEquals(WakeWay.AssistantActivity, wakeWay(connected = true, screenOn = false, appVisible = false))
|
||||
// Not connected -- whether or not LLeMbas is the assistant in name: only what the app itself may do.
|
||||
assertEquals(WakeWay.Activity, wakeWay(connected = false, screenOn = true, appVisible = true))
|
||||
assertEquals(WakeWay.Notification, wakeWay(connected = false, screenOn = true, appVisible = false))
|
||||
assertEquals(WakeWay.Notification, wakeWay(connected = false, screenOn = false, appVisible = false))
|
||||
// And when the assistant's own way did not open the sheet.
|
||||
assertEquals(WakeWay.Activity, wakeFallback(appVisible = true))
|
||||
assertEquals(WakeWay.Notification, wakeFallback(appVisible = false))
|
||||
repeat(3) { AppVisibility.activityStopped() }
|
||||
assertFalse(AppVisibility.visible)
|
||||
AppVisibility.activityStarted()
|
||||
@@ -220,6 +230,45 @@ class WakeTest {
|
||||
assertEquals(WakeState.Starting, wakeStateAtStart(running = true, current = WakeState.Off))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun theLastFiveWakesAreKeptNewestFirst() {
|
||||
var log = emptyList<WakeAttempt>()
|
||||
for (i in 1..7) log = wakeLogAdd(log, WakeAttempt(at = i * 1_000L, phrase = "Hey Assistant", way = "session", outcome = WakeAttempt.OUT_OPENED))
|
||||
assertEquals(listOf(7_000L, 6_000L, 5_000L, 4_000L, 3_000L), log.map { it.at })
|
||||
// They live in the phone's settings, and read back as they were written.
|
||||
val saved = LembasJson.encodeToString(Prefs.serializer(), Prefs(wakeLog = log))
|
||||
assertEquals(log, LembasJson.decodeFromString(Prefs.serializer(), saved).wakeLog)
|
||||
assertTrue(Prefs().wakeLog.isEmpty())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun anAttemptThatFoundTheAssistantNotConnectedLearnsThatItCameLater() {
|
||||
val missed = WakeAttempt(at = 5_000, outcome = WakeAttempt.OUT_NOT_CONNECTED, fallback = "notification", assistant = true)
|
||||
val earlier = WakeAttempt(at = 1_000, outcome = WakeAttempt.OUT_NOT_CONNECTED)
|
||||
val told = wakeLogConnected(listOf(missed, earlier), now = 9_000)
|
||||
assertEquals(9_000L, told[0].connectedLater)
|
||||
// Only the newest, only once, and never by a connection from before it.
|
||||
assertEquals(0L, told[1].connectedLater)
|
||||
assertEquals(told, wakeLogConnected(told, now = 12_000))
|
||||
assertEquals(listOf(missed), wakeLogConnected(listOf(missed), now = 4_000))
|
||||
// An attempt that opened, or an empty record, has nothing to learn.
|
||||
val opened = listOf(WakeAttempt(at = 5_000, outcome = WakeAttempt.OUT_OPENED))
|
||||
assertEquals(opened, wakeLogConnected(opened, now = 9_000))
|
||||
assertTrue(wakeLogConnected(emptyList(), now = 9_000).isEmpty())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun theAssistantsLinkIsWhatAndroidLastSaid() {
|
||||
AssistLink.ready(now = 1_000)
|
||||
assertTrue(AssistLink.connected.value)
|
||||
assertEquals(1_000L, AssistLink.readyAt)
|
||||
AssistLink.shutdown(now = 2_000)
|
||||
assertFalse(AssistLink.connected.value)
|
||||
assertEquals(2_000L, AssistLink.shutdownAt)
|
||||
AssistLink.sheetShown(elapsed = 77)
|
||||
assertEquals(77L, AssistLink.shown.value)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun onlyTheNewestServiceWritesTheState() {
|
||||
val old = WakeStatus.begin()
|
||||
|
||||
@@ -61,6 +61,7 @@ import eu.llembas.android.ui.scheduled.ScheduleState
|
||||
import eu.llembas.android.ui.scheduled.ScheduledState
|
||||
import eu.llembas.android.ui.settings.SettingsState
|
||||
import eu.llembas.android.ui.settings.WakeTestShown
|
||||
import eu.llembas.android.wake.WakeAttempt
|
||||
import eu.llembas.android.wake.WakeFailure
|
||||
import eu.llembas.android.wake.WakeState
|
||||
import kotlinx.serialization.json.JsonPrimitive
|
||||
@@ -383,6 +384,24 @@ object Fakes {
|
||||
wakeTest = WakeTestShown(done = true),
|
||||
)
|
||||
|
||||
/** The assistant in name but not connected, and a last wake that says so step by step. */
|
||||
val settingsWakeUnbound = settings.copy(
|
||||
assistantConnected = false,
|
||||
prefs = settings.prefs.copy(
|
||||
wakeLog = listOf(
|
||||
WakeAttempt(
|
||||
at = 1_773_129_600_000,
|
||||
phrase = "OK Google",
|
||||
way = "notification",
|
||||
outcome = WakeAttempt.OUT_NOT_CONNECTED,
|
||||
fallback = "notification",
|
||||
assistant = true,
|
||||
),
|
||||
WakeAttempt(at = 1_773_126_000_000, phrase = "OK Google", way = "session", outcome = WakeAttempt.OUT_OPENED, assistant = true),
|
||||
),
|
||||
),
|
||||
)
|
||||
|
||||
/** A standard build: the test heard the phrase twice, and notification summaries are in the other build. */
|
||||
val settingsWakeTested = settings.copy(wakeTest = WakeTestShown(running = true, heard = 2), notificationsBuild = false, isAssistant = false)
|
||||
|
||||
|
||||
@@ -217,6 +217,9 @@ class ScreenShots {
|
||||
shoot("08-wake-listening", Phone.Scroll) { groups(Fakes.settings) }
|
||||
shoot("08-wake-failed", Phone.Scroll) { groups(Fakes.settingsWakeFailed) }
|
||||
shoot("08-wake-failed", Phone.SmallScroll, fontScale = 1.5f) { groups(Fakes.settingsWakeFailed) }
|
||||
// The assistant not connected right now, and the last wake that found it so.
|
||||
shoot("08-wake-unbound", Phone.Scroll) { groups(Fakes.settingsWakeUnbound) }
|
||||
shoot("08-wake-unbound", Phone.SmallScroll, fontScale = 1.5f) { groups(Fakes.settingsWakeUnbound) }
|
||||
shoot("08-wake-tested", Phone.Scroll) { groups(Fakes.settingsWakeTested) }
|
||||
shoot("08-wake-tested", Phone.SmallScroll, fontScale = 1.5f) { groups(Fakes.settingsWakeTested) }
|
||||
}
|
||||
|
||||
@@ -503,6 +503,24 @@ STRINGS: dict[str, str] = {
|
||||
"wake_heard_line": "LLeMbas can open by itself over other apps only as the phone's digital assistant app.",
|
||||
"wake_not_assistant": "LLeMbas is not the digital assistant app",
|
||||
"wake_not_assistant_line": "So the wake word cannot open the assistant over other apps: you get a notification to tap. To open by voice anywhere, tap here and choose LLeMbas as the digital assistant app.",
|
||||
"wake_last": "Last wake",
|
||||
"wake_last_none": "It has not heard the phrase yet.",
|
||||
"wake_out_opened": "Opened the assistant.",
|
||||
"wake_out_no_sheet": "Asked Android to open the assistant; it did not refuse, but no sheet came.",
|
||||
"wake_out_not_connected": "Android had not connected LLeMbas as the assistant, so it could not open the sheet.",
|
||||
"wake_out_refused": "Android refused to open the assistant: %1$s",
|
||||
"wake_out_activity": "Opened it as a screen of the app instead.",
|
||||
"wake_out_notification": "Posted a notification to tap instead.",
|
||||
"wake_out_tested": "Heard in a test: nothing was to open.",
|
||||
"wake_role_held": "LLeMbas was the digital assistant app.",
|
||||
"wake_role_not_held": "LLeMbas was not the digital assistant app.",
|
||||
"wake_link_never": "Android had not connected the assistant since the app started.",
|
||||
"wake_link_ready": "Android had connected the assistant at %1$s.",
|
||||
"wake_link_shutdown": "Android had disconnected it at %1$s.",
|
||||
"wake_link_later": "Android connected it again at %1$s.",
|
||||
"wake_assistant_unbound": "LLeMbas is the assistant, but Android has not connected it right now",
|
||||
"wake_assistant_unbound_line": "Until it does, the wake word cannot open the sheet by itself. Tap for the system's assistant setting: choosing another app and then LLeMbas again connects it.",
|
||||
"wake_heard_could_not": "Could not open by itself — tap to ask",
|
||||
"wake_resume": "Listen for the wake word again",
|
||||
"wake_resume_line": "The phone restarted. Tap to start listening again.",
|
||||
"assist_notifications": "Summarise my notifications",
|
||||
|
||||
@@ -302,6 +302,8 @@
|
||||
"voice_input_phone": "Telefon (Google nebo systémový)",
|
||||
"voice_input_phone_line": "Vlastní rozpoznávání řeči v telefonu. Slova se objevují, jak mluvíte; nahrávka jde tam, kam ji to rozpoznávání pošle.",
|
||||
"voice_input_phone_none": "Tento telefon nemá vlastní rozpoznávání řeči.",
|
||||
"wake_assistant_unbound": "LLeMbas je asistent, ale Android ho právě nemá připojeného",
|
||||
"wake_assistant_unbound_line": "Dokud ho nepřipojí, budicí slovo nemůže panel otevřít samo. Klepnutím otevřete systémové nastavení asistenta: vyberte jinou aplikaci a potom znovu LLeMbas, tím se připojí.",
|
||||
"wake_battery": "Nechat běžet na pozadí",
|
||||
"wake_battery_line": "Některé telefony (Samsung, Xiaomi, Huawei, OnePlus a další) kvůli baterii zastavují aplikace na pozadí, a s nimi i budicí slovo. Zde vyjměte LLeMbas z optimalizace baterie; dontkillmyapp.com vysvětluje nastavení vašeho telefonu.",
|
||||
"wake_failed_engine": "Budicí slovo nefunguje: modul se nespustil",
|
||||
@@ -311,7 +313,14 @@
|
||||
"wake_failed_no_engine": "Budicí slovo nefunguje: toto sestavení nemá modul",
|
||||
"wake_greeting": "Oslovení",
|
||||
"wake_heard": "Slyšel jsem vás. Klepněte a ptejte se.",
|
||||
"wake_heard_could_not": "Nepodařilo se otevřít samo — klepněte a ptejte se",
|
||||
"wake_heard_line": "LLeMbas se umí sám otevřít nad jinými aplikacemi jen jako aplikace digitálního asistenta v telefonu.",
|
||||
"wake_last": "Poslední probuzení",
|
||||
"wake_last_none": "Frázi zatím neslyšel.",
|
||||
"wake_link_later": "Android ho znovu připojil v %1$s.",
|
||||
"wake_link_never": "Android od spuštění aplikace asistenta nepřipojil.",
|
||||
"wake_link_ready": "Android připojil asistenta v %1$s.",
|
||||
"wake_link_shutdown": "Android ho odpojil v %1$s.",
|
||||
"wake_listening_for": "Naslouchám frázi „%1$s“",
|
||||
"wake_name": "Jméno",
|
||||
"wake_name_google_line": "Ozve se i telefon nebo reproduktor Google poblíž.",
|
||||
@@ -319,6 +328,13 @@
|
||||
"wake_not_assistant_line": "Budicí slovo proto nemůže otevřít asistenta nad jinými aplikacemi: dostanete oznámení, na které klepnete. Chcete-li otevírat hlasem kdekoli, klepněte sem a vyberte LLeMbas jako aplikaci digitálního asistenta.",
|
||||
"wake_notification_line": "Dokud ji neřeknete, nic neopustí telefon.",
|
||||
"wake_off": "Budicí slovo neposlouchá",
|
||||
"wake_out_activity": "Místo toho ho otevřel jako obrazovku aplikace.",
|
||||
"wake_out_no_sheet": "Požádal Android o otevření asistenta; neodmítl, ale panel se neobjevil.",
|
||||
"wake_out_not_connected": "Android neměl LLeMbas připojený jako asistenta, proto panel nemohl otevřít.",
|
||||
"wake_out_notification": "Místo toho poslal oznámení, na které je třeba klepnout.",
|
||||
"wake_out_opened": "Otevřel asistenta.",
|
||||
"wake_out_refused": "Android odmítl otevřít asistenta: %1$s",
|
||||
"wake_out_tested": "Slyšeno při zkoušce: nebylo co otevírat.",
|
||||
"wake_paused_assistant": "Budicí slovo je pozastaveno, dokud je asistent otevřený",
|
||||
"wake_paused_battery": "Budicí slovo pozastaveno: je zapnutý úsporný režim",
|
||||
"wake_paused_microphone": "Budicí slovo pozastaveno: LLeMbas nemá povolený mikrofon",
|
||||
@@ -327,6 +343,8 @@
|
||||
"wake_phrase_line": "Tohle říkáte, potom krátká pauza: platí, až když zmlknete. Anglicky, ať je aplikace v jakémkoli jazyce: modul zná jen anglickou řeč.",
|
||||
"wake_resume": "Znovu naslouchat budicímu slovu",
|
||||
"wake_resume_line": "Telefon se restartoval. Klepnutím znovu spustíte naslouchání.",
|
||||
"wake_role_held": "LLeMbas byl aplikací digitálního asistenta.",
|
||||
"wake_role_not_held": "LLeMbas nebyl aplikací digitálního asistenta.",
|
||||
"wake_screen_only": "Jen při zapnuté obrazovce",
|
||||
"wake_screen_only_line": "Vypnuto: poslouchá i při zhasnuté obrazovce, za cenu vyšší spotřeby baterie.",
|
||||
"wake_sensitivity": "Citlivost",
|
||||
@@ -659,6 +677,8 @@
|
||||
"voice_input_phone": "Telefon (Google oder das System)",
|
||||
"voice_input_phone_line": "Die eigene Spracherkennung des Telefons. Die Wörter erscheinen beim Sprechen; die Aufnahme geht dorthin, wohin diese Erkennung sie schickt.",
|
||||
"voice_input_phone_none": "Dieses Telefon hat keine eigene Spracherkennung.",
|
||||
"wake_assistant_unbound": "LLeMbas ist der Assistent, aber Android hat ihn gerade nicht verbunden",
|
||||
"wake_assistant_unbound_line": "Solange das so ist, kann das Aktivierungswort das Blatt nicht selbst öffnen. Tippe für die Assistenten-Einstellung des Systems: Eine andere App und dann wieder LLeMbas zu wählen verbindet ihn.",
|
||||
"wake_battery": "Im Hintergrund laufen lassen",
|
||||
"wake_battery_line": "Manche Telefone (Samsung, Xiaomi, Huawei, OnePlus und andere) beenden Hintergrund-Apps, um Akku zu sparen, und damit auch das Aktivierungswort. Nimm LLeMbas hier von der Akku-Optimierung aus; dontkillmyapp.com erklärt die Einstellungen deines Telefons.",
|
||||
"wake_failed_engine": "Aktivierungswort funktioniert nicht: Die Engine ist nicht gestartet",
|
||||
@@ -668,7 +688,14 @@
|
||||
"wake_failed_no_engine": "Aktivierungswort funktioniert nicht: Dieser Build hat keine Engine",
|
||||
"wake_greeting": "Anrede",
|
||||
"wake_heard": "Gehört. Tippe, um zu fragen.",
|
||||
"wake_heard_could_not": "Ließ sich nicht selbst öffnen — tippe, um zu fragen",
|
||||
"wake_heard_line": "LLeMbas kann sich nur als App für den digitalen Assistenten des Telefons selbst über anderen Apps öffnen.",
|
||||
"wake_last": "Letztes Aufwecken",
|
||||
"wake_last_none": "Der Satz wurde noch nicht gehört.",
|
||||
"wake_link_later": "Android hat ihn um %1$s wieder verbunden.",
|
||||
"wake_link_never": "Android hatte den Assistenten seit dem Start der App nicht verbunden.",
|
||||
"wake_link_ready": "Android hatte den Assistenten um %1$s verbunden.",
|
||||
"wake_link_shutdown": "Android hatte ihn um %1$s getrennt.",
|
||||
"wake_listening_for": "Hört auf „%1$s“",
|
||||
"wake_name": "Name",
|
||||
"wake_name_google_line": "Ein Google-Telefon oder -Lautsprecher in der Nähe antwortet ebenfalls.",
|
||||
@@ -676,6 +703,13 @@
|
||||
"wake_not_assistant_line": "Deshalb kann das Aktivierungswort den Assistenten nicht über anderen Apps öffnen: Du bekommst eine Benachrichtigung zum Antippen. Um überall per Stimme zu öffnen, tippe hier und wähle LLeMbas als App für den digitalen Assistenten.",
|
||||
"wake_notification_line": "Bis du es sagst, verlässt nichts das Telefon.",
|
||||
"wake_off": "Das Aktivierungswort hört nicht zu",
|
||||
"wake_out_activity": "Stattdessen als Bildschirm der App geöffnet.",
|
||||
"wake_out_no_sheet": "Android wurde gebeten, den Assistenten zu öffnen; es hat nicht abgelehnt, aber es kam kein Blatt.",
|
||||
"wake_out_not_connected": "Android hatte LLeMbas nicht als Assistenten verbunden, daher ließ sich das Blatt nicht öffnen.",
|
||||
"wake_out_notification": "Stattdessen eine Benachrichtigung zum Antippen gesendet.",
|
||||
"wake_out_opened": "Assistent geöffnet.",
|
||||
"wake_out_refused": "Android hat das Öffnen des Assistenten abgelehnt: %1$s",
|
||||
"wake_out_tested": "In einem Test gehört: Es war nichts zu öffnen.",
|
||||
"wake_paused_assistant": "Aktivierungswort pausiert, solange der Assistent offen ist",
|
||||
"wake_paused_battery": "Aktivierungswort pausiert: Energiesparmodus ist an",
|
||||
"wake_paused_microphone": "Aktivierungswort pausiert: LLeMbas darf das Mikrofon nicht verwenden",
|
||||
@@ -684,6 +718,8 @@
|
||||
"wake_phrase_line": "Das sagst du, dann eine kurze Pause: Es zählt, sobald du aufhörst. Auf Englisch, egal in welcher Sprache die App ist: Die Engine kennt nur englische Sprache.",
|
||||
"wake_resume": "Wieder auf das Aktivierungswort hören",
|
||||
"wake_resume_line": "Das Telefon wurde neu gestartet. Tippe, um wieder zuzuhören.",
|
||||
"wake_role_held": "LLeMbas war die App für den digitalen Assistenten.",
|
||||
"wake_role_not_held": "LLeMbas war nicht die App für den digitalen Assistenten.",
|
||||
"wake_screen_only": "Nur bei eingeschaltetem Bildschirm",
|
||||
"wake_screen_only_line": "Aus: Es hört auch bei ausgeschaltetem Bildschirm zu, was mehr Akku kostet.",
|
||||
"wake_sensitivity": "Empfindlichkeit",
|
||||
@@ -1015,6 +1051,8 @@
|
||||
"voice_input_phone": "Teléfono (Google o el del sistema)",
|
||||
"voice_input_phone_line": "El reconocimiento de voz del propio teléfono. Las palabras aparecen mientras habla; la grabación va adonde ese reconocimiento la envíe.",
|
||||
"voice_input_phone_none": "Este teléfono no tiene reconocimiento de voz propio.",
|
||||
"wake_assistant_unbound": "LLeMbas es el asistente, pero Android no lo tiene conectado ahora mismo",
|
||||
"wake_assistant_unbound_line": "Hasta que lo conecte, la palabra de activación no puede abrir el panel por sí sola. Toca para ir al ajuste del asistente del sistema: elegir otra app y luego LLeMbas de nuevo lo conecta.",
|
||||
"wake_battery": "Dejar que funcione en segundo plano",
|
||||
"wake_battery_line": "Algunos teléfonos (Samsung, Xiaomi, Huawei, OnePlus y otros) detienen las apps en segundo plano para ahorrar batería, y con ellas la palabra de activación. Excluye aquí a LLeMbas de la optimización de batería; dontkillmyapp.com explica los ajustes de tu teléfono.",
|
||||
"wake_failed_engine": "La palabra de activación no funciona: el motor no se inició",
|
||||
@@ -1024,7 +1062,14 @@
|
||||
"wake_failed_no_engine": "La palabra de activación no funciona: esta versión no tiene motor",
|
||||
"wake_greeting": "Saludo",
|
||||
"wake_heard": "Te he oído. Toca para preguntar.",
|
||||
"wake_heard_could_not": "No pudo abrirse por sí solo: toca para preguntar",
|
||||
"wake_heard_line": "LLeMbas solo puede abrirse por sí mismo sobre otras apps si es la app de asistente digital del teléfono.",
|
||||
"wake_last": "Última activación",
|
||||
"wake_last_none": "Todavía no ha oído la frase.",
|
||||
"wake_link_later": "Android volvió a conectarlo a las %1$s.",
|
||||
"wake_link_never": "Android no había conectado el asistente desde que se inició la app.",
|
||||
"wake_link_ready": "Android había conectado el asistente a las %1$s.",
|
||||
"wake_link_shutdown": "Android lo había desconectado a las %1$s.",
|
||||
"wake_listening_for": "Escuchando «%1$s»",
|
||||
"wake_name": "Nombre",
|
||||
"wake_name_google_line": "Un teléfono o altavoz de Google cercano también responderá.",
|
||||
@@ -1032,6 +1077,13 @@
|
||||
"wake_not_assistant_line": "Por eso la palabra de activación no puede abrir el asistente sobre otras apps: recibes una notificación que tocar. Para abrir con la voz en cualquier parte, toca aquí y elige LLeMbas como app de asistente digital.",
|
||||
"wake_notification_line": "Nada sale del teléfono hasta que lo digas.",
|
||||
"wake_off": "La palabra de activación no está escuchando",
|
||||
"wake_out_activity": "En su lugar lo abrió como una pantalla de la app.",
|
||||
"wake_out_no_sheet": "Pidió a Android que abriera el asistente; no se negó, pero no apareció el panel.",
|
||||
"wake_out_not_connected": "Android no tenía LLeMbas conectado como asistente, así que no pudo abrir el panel.",
|
||||
"wake_out_notification": "En su lugar envió una notificación para tocar.",
|
||||
"wake_out_opened": "Abrió el asistente.",
|
||||
"wake_out_refused": "Android se negó a abrir el asistente: %1$s",
|
||||
"wake_out_tested": "Oída en una prueba: no había nada que abrir.",
|
||||
"wake_paused_assistant": "Palabra de activación en pausa mientras el asistente está abierto",
|
||||
"wake_paused_battery": "Palabra de activación en pausa: ahorro de batería activado",
|
||||
"wake_paused_microphone": "Palabra de activación en pausa: LLeMbas no tiene permiso para usar el micrófono",
|
||||
@@ -1040,6 +1092,8 @@
|
||||
"wake_phrase_line": "Lo que dices, y después una pausa breve: cuenta cuando te callas. En inglés, sea cual sea el idioma de la app: el motor solo conoce el habla inglesa.",
|
||||
"wake_resume": "Volver a escuchar la palabra de activación",
|
||||
"wake_resume_line": "El teléfono se reinició. Toca para volver a escuchar.",
|
||||
"wake_role_held": "LLeMbas era la app de asistente digital.",
|
||||
"wake_role_not_held": "LLeMbas no era la app de asistente digital.",
|
||||
"wake_screen_only": "Solo con la pantalla encendida",
|
||||
"wake_screen_only_line": "Desactivado: también escucha con la pantalla apagada, con más gasto de batería.",
|
||||
"wake_sensitivity": "Sensibilidad",
|
||||
@@ -1372,6 +1426,8 @@
|
||||
"voice_input_phone": "Téléphone (Google ou celui du système)",
|
||||
"voice_input_phone_line": "La reconnaissance vocale du téléphone. Les mots apparaissent pendant que vous parlez ; l’enregistrement va là où cette reconnaissance l’envoie.",
|
||||
"voice_input_phone_none": "Ce téléphone n’a pas de reconnaissance vocale propre.",
|
||||
"wake_assistant_unbound": "LLeMbas est l’assistant, mais Android ne l’a pas connecté pour l’instant",
|
||||
"wake_assistant_unbound_line": "Tant que ce n’est pas fait, le mot d’activation ne peut pas ouvrir le panneau de lui-même. Touchez pour le réglage de l’assistant du système : choisir une autre app puis de nouveau LLeMbas le reconnecte.",
|
||||
"wake_battery": "Le laisser tourner en arrière-plan",
|
||||
"wake_battery_line": "Certains téléphones (Samsung, Xiaomi, Huawei, OnePlus et d’autres) arrêtent les apps en arrière-plan pour économiser la batterie, et le mot d’activation avec. Exemptez ici LLeMbas de l’optimisation de la batterie ; dontkillmyapp.com explique les réglages de votre téléphone.",
|
||||
"wake_failed_engine": "Le mot d’activation ne fonctionne pas : le moteur n’a pas démarré",
|
||||
@@ -1381,7 +1437,14 @@
|
||||
"wake_failed_no_engine": "Le mot d’activation ne fonctionne pas : cette version n’a pas de moteur",
|
||||
"wake_greeting": "Salutation",
|
||||
"wake_heard": "Entendu. Touchez pour demander.",
|
||||
"wake_heard_could_not": "N’a pas pu s’ouvrir de lui-même — touchez pour demander",
|
||||
"wake_heard_line": "LLeMbas ne peut s’ouvrir de lui-même par-dessus d’autres apps que s’il est l’assistant numérique du téléphone.",
|
||||
"wake_last": "Dernier réveil",
|
||||
"wake_last_none": "Il n’a pas encore entendu la phrase.",
|
||||
"wake_link_later": "Android l’a reconnecté à %1$s.",
|
||||
"wake_link_never": "Android n’avait pas connecté l’assistant depuis le démarrage de l’app.",
|
||||
"wake_link_ready": "Android avait connecté l’assistant à %1$s.",
|
||||
"wake_link_shutdown": "Android l’avait déconnecté à %1$s.",
|
||||
"wake_listening_for": "À l’écoute de « %1$s »",
|
||||
"wake_name": "Nom",
|
||||
"wake_name_google_line": "Un téléphone ou une enceinte Google à proximité répondra aussi.",
|
||||
@@ -1389,6 +1452,13 @@
|
||||
"wake_not_assistant_line": "Le mot d’activation ne peut donc pas ouvrir l’assistant par-dessus d’autres apps : vous recevez une notification à toucher. Pour ouvrir à la voix partout, touchez ici et choisissez LLeMbas comme application d’assistant numérique.",
|
||||
"wake_notification_line": "Rien ne quitte le téléphone avant que vous le disiez.",
|
||||
"wake_off": "Le mot d’activation n’écoute pas",
|
||||
"wake_out_activity": "L’a ouvert à la place comme un écran de l’app.",
|
||||
"wake_out_no_sheet": "A demandé à Android d’ouvrir l’assistant ; il n’a pas refusé, mais aucun panneau n’est apparu.",
|
||||
"wake_out_not_connected": "Android n’avait pas connecté LLeMbas comme assistant, le panneau n’a donc pas pu s’ouvrir.",
|
||||
"wake_out_notification": "A envoyé à la place une notification à toucher.",
|
||||
"wake_out_opened": "A ouvert l’assistant.",
|
||||
"wake_out_refused": "Android a refusé d’ouvrir l’assistant : %1$s",
|
||||
"wake_out_tested": "Entendu pendant un test : il n’y avait rien à ouvrir.",
|
||||
"wake_paused_assistant": "Mot d’activation en pause pendant que l’assistant est ouvert",
|
||||
"wake_paused_battery": "Mot d’activation en pause : économiseur de batterie activé",
|
||||
"wake_paused_microphone": "Mot d’activation en pause : LLeMbas n’est pas autorisé à utiliser le micro",
|
||||
@@ -1397,6 +1467,8 @@
|
||||
"wake_phrase_line": "Ce que vous dites, puis une courte pause : cela compte dès que vous vous taisez. En anglais, quelle que soit la langue de l’app : le moteur ne connaît que la parole anglaise.",
|
||||
"wake_resume": "Écouter à nouveau le mot d’activation",
|
||||
"wake_resume_line": "Le téléphone a redémarré. Touchez pour reprendre l’écoute.",
|
||||
"wake_role_held": "LLeMbas était l’application d’assistant numérique.",
|
||||
"wake_role_not_held": "LLeMbas n’était pas l’application d’assistant numérique.",
|
||||
"wake_screen_only": "Seulement écran allumé",
|
||||
"wake_screen_only_line": "Désactivé : il écoute aussi écran éteint, au prix de plus de batterie.",
|
||||
"wake_sensitivity": "Sensibilité",
|
||||
@@ -1729,6 +1801,8 @@
|
||||
"voice_input_phone": "Telefon (Google vagy a rendszeré)",
|
||||
"voice_input_phone_line": "A telefon saját beszédfelismerője. A szavak beszéd közben jelennek meg; a felvétel oda megy, ahová az a felismerő küldi.",
|
||||
"voice_input_phone_none": "Ennek a telefonnak nincs saját beszédfelismerője.",
|
||||
"wake_assistant_unbound": "A LLeMbas az asszisztens, de az Android most nem csatlakoztatta",
|
||||
"wake_assistant_unbound_line": "Amíg nem csatlakoztatja, az ébresztőszó nem tudja magától megnyitni a panelt. Koppints a rendszer asszisztensbeállításához: ha másik alkalmazást, majd újra a LLeMbast választod, csatlakozik.",
|
||||
"wake_battery": "Futhasson a háttérben",
|
||||
"wake_battery_line": "Egyes telefonok (Samsung, Xiaomi, Huawei, OnePlus és mások) az akkumulátor kímélése miatt leállítják a háttéralkalmazásokat, és velük az ébresztőszót is. Itt vedd ki a LLeMbast az akkumulátor-optimalizálásból; a dontkillmyapp.com elmagyarázza a telefonod beállításait.",
|
||||
"wake_failed_engine": "Az ébresztőszó nem működik: a motor nem indult el",
|
||||
@@ -1738,7 +1812,14 @@
|
||||
"wake_failed_no_engine": "Az ébresztőszó nem működik: ebben a változatban nincs motor",
|
||||
"wake_greeting": "Megszólítás",
|
||||
"wake_heard": "Hallottalak. Koppints a kérdezéshez.",
|
||||
"wake_heard_could_not": "Nem tudott magától megnyílni — koppints a kérdezéshez",
|
||||
"wake_heard_line": "A LLeMbas csak a telefon digitális asszisztens alkalmazásaként tud magától megnyílni más alkalmazások fölött.",
|
||||
"wake_last": "Utolsó ébresztés",
|
||||
"wake_last_none": "Még nem hallotta a kifejezést.",
|
||||
"wake_link_later": "Az Android ekkor csatlakoztatta újra: %1$s.",
|
||||
"wake_link_never": "Az Android az alkalmazás indulása óta nem csatlakoztatta az asszisztenst.",
|
||||
"wake_link_ready": "Az Android ekkor csatlakoztatta az asszisztenst: %1$s.",
|
||||
"wake_link_shutdown": "Az Android ekkor választotta le: %1$s.",
|
||||
"wake_listening_for": "Figyeli: „%1$s”",
|
||||
"wake_name": "Név",
|
||||
"wake_name_google_line": "A közelben lévő Google-telefon vagy -hangszóró is válaszolni fog.",
|
||||
@@ -1746,6 +1827,13 @@
|
||||
"wake_not_assistant_line": "Ezért az ébresztőszó nem tudja megnyitni az asszisztenst más alkalmazások fölött: értesítést kapsz, amelyre koppinthatsz. Ha bárhol hanggal szeretnéd megnyitni, koppints ide, és válaszd a LLeMbast digitális asszisztens alkalmazásnak.",
|
||||
"wake_notification_line": "Amíg ki nem mondod, semmi nem hagyja el a telefont.",
|
||||
"wake_off": "Az ébresztőszó nem figyel",
|
||||
"wake_out_activity": "Helyette az alkalmazás képernyőjeként nyitotta meg.",
|
||||
"wake_out_no_sheet": "Megkérte az Androidot az asszisztens megnyitására; nem utasította el, de a panel nem jelent meg.",
|
||||
"wake_out_not_connected": "Az Android nem csatlakoztatta a LLeMbast asszisztensként, ezért nem tudta megnyitni a panelt.",
|
||||
"wake_out_notification": "Helyette értesítést küldött, amelyre koppintani lehet.",
|
||||
"wake_out_opened": "Megnyitotta az asszisztenst.",
|
||||
"wake_out_refused": "Az Android elutasította az asszisztens megnyitását: %1$s",
|
||||
"wake_out_tested": "Próba közben hallotta: nem volt mit megnyitni.",
|
||||
"wake_paused_assistant": "Az ébresztőszó szünetel, amíg az asszisztens nyitva van",
|
||||
"wake_paused_battery": "Ébresztőszó szünetel: be van kapcsolva az energiatakarékos mód",
|
||||
"wake_paused_microphone": "Ébresztőszó szünetel: a LLeMbas nem használhatja a mikrofont",
|
||||
@@ -1754,6 +1842,8 @@
|
||||
"wake_phrase_line": "Ezt mondod, utána rövid szünet: akkor számít, amikor elhallgatsz. Angolul, bármilyen nyelvű is az alkalmazás: a motor csak az angol beszédet ismeri.",
|
||||
"wake_resume": "Ébresztőszó figyelése újra",
|
||||
"wake_resume_line": "A telefon újraindult. Koppints a figyelés folytatásához.",
|
||||
"wake_role_held": "A LLeMbas volt a digitális asszisztens alkalmazás.",
|
||||
"wake_role_not_held": "Nem a LLeMbas volt a digitális asszisztens alkalmazás.",
|
||||
"wake_screen_only": "Csak bekapcsolt képernyőnél",
|
||||
"wake_screen_only_line": "Kikapcsolva kikapcsolt képernyőnél is figyel, ami több akkumulátort fogyaszt.",
|
||||
"wake_sensitivity": "Érzékenység",
|
||||
@@ -2085,6 +2175,8 @@
|
||||
"voice_input_phone": "Telefono (Google o quello di sistema)",
|
||||
"voice_input_phone_line": "Il riconoscimento vocale del telefono. Le parole appaiono mentre parla; la registrazione va dove la manda quel riconoscimento.",
|
||||
"voice_input_phone_none": "Questo telefono non ha un riconoscimento vocale proprio.",
|
||||
"wake_assistant_unbound": "LLeMbas è l’assistente, ma Android non l’ha collegato in questo momento",
|
||||
"wake_assistant_unbound_line": "Finché non lo collega, la parola di attivazione non può aprire il pannello da sola. Tocca per l’impostazione dell’assistente di sistema: scegliere un’altra app e poi di nuovo LLeMbas lo collega.",
|
||||
"wake_battery": "Lascialo funzionare in background",
|
||||
"wake_battery_line": "Alcuni telefoni (Samsung, Xiaomi, Huawei, OnePlus e altri) fermano le app in background per risparmiare batteria, e con loro la parola di attivazione. Escludi qui LLeMbas dall’ottimizzazione della batteria; dontkillmyapp.com spiega le impostazioni del tuo telefono.",
|
||||
"wake_failed_engine": "La parola di attivazione non funziona: il motore non si è avviato",
|
||||
@@ -2094,7 +2186,14 @@
|
||||
"wake_failed_no_engine": "La parola di attivazione non funziona: questa build non ha un motore",
|
||||
"wake_greeting": "Saluto",
|
||||
"wake_heard": "Ti ho sentito. Tocca per chiedere.",
|
||||
"wake_heard_could_not": "Non è riuscito ad aprirsi da solo — tocca per chiedere",
|
||||
"wake_heard_line": "LLeMbas può aprirsi da solo sopra le altre app soltanto come app di assistente digitale del telefono.",
|
||||
"wake_last": "Ultima attivazione",
|
||||
"wake_last_none": "Non ha ancora sentito la frase.",
|
||||
"wake_link_later": "Android l’ha ricollegato alle %1$s.",
|
||||
"wake_link_never": "Android non aveva collegato l’assistente dall’avvio dell’app.",
|
||||
"wake_link_ready": "Android aveva collegato l’assistente alle %1$s.",
|
||||
"wake_link_shutdown": "Android l’aveva scollegato alle %1$s.",
|
||||
"wake_listening_for": "In ascolto di «%1$s»",
|
||||
"wake_name": "Nome",
|
||||
"wake_name_google_line": "Risponderà anche un telefono o un altoparlante Google nelle vicinanze.",
|
||||
@@ -2102,6 +2201,13 @@
|
||||
"wake_not_assistant_line": "Per questo la parola di attivazione non può aprire l’assistente sopra le altre app: ricevi una notifica da toccare. Per aprire con la voce ovunque, tocca qui e scegli LLeMbas come app di assistente digitale.",
|
||||
"wake_notification_line": "Niente lascia il telefono finché non lo dici.",
|
||||
"wake_off": "La parola di attivazione non è in ascolto",
|
||||
"wake_out_activity": "Al suo posto l’ha aperto come schermata dell’app.",
|
||||
"wake_out_no_sheet": "Ha chiesto ad Android di aprire l’assistente; non ha rifiutato, ma il pannello non è comparso.",
|
||||
"wake_out_not_connected": "Android non aveva collegato LLeMbas come assistente, quindi non ha potuto aprire il pannello.",
|
||||
"wake_out_notification": "Al suo posto ha inviato una notifica da toccare.",
|
||||
"wake_out_opened": "Ha aperto l’assistente.",
|
||||
"wake_out_refused": "Android ha rifiutato di aprire l’assistente: %1$s",
|
||||
"wake_out_tested": "Sentita durante una prova: non c’era nulla da aprire.",
|
||||
"wake_paused_assistant": "Parola di attivazione in pausa mentre l’assistente è aperto",
|
||||
"wake_paused_battery": "Parola di attivazione in pausa: risparmio energetico attivo",
|
||||
"wake_paused_microphone": "Parola di attivazione in pausa: LLeMbas non ha il permesso di usare il microfono",
|
||||
@@ -2110,6 +2216,8 @@
|
||||
"wake_phrase_line": "Quello che dici, poi una breve pausa: conta quando smetti di parlare. In inglese, qualunque sia la lingua dell’app: il motore conosce solo il parlato inglese.",
|
||||
"wake_resume": "Ascolta di nuovo la parola di attivazione",
|
||||
"wake_resume_line": "Il telefono si è riavviato. Tocca per ricominciare ad ascoltare.",
|
||||
"wake_role_held": "LLeMbas era l’app di assistente digitale.",
|
||||
"wake_role_not_held": "LLeMbas non era l’app di assistente digitale.",
|
||||
"wake_screen_only": "Solo a schermo acceso",
|
||||
"wake_screen_only_line": "Disattivato: ascolta anche a schermo spento, con più consumo di batteria.",
|
||||
"wake_sensitivity": "Sensibilità",
|
||||
@@ -2441,6 +2549,8 @@
|
||||
"voice_input_phone": "Telefon (Google lub systemowy)",
|
||||
"voice_input_phone_line": "Własne rozpoznawanie mowy telefonu. Słowa pojawiają się w trakcie mówienia; nagranie trafia tam, dokąd wyśle je to rozpoznawanie.",
|
||||
"voice_input_phone_none": "Ten telefon nie ma własnego rozpoznawania mowy.",
|
||||
"wake_assistant_unbound": "LLeMbas jest asystentem, ale Android nie ma go teraz połączonego",
|
||||
"wake_assistant_unbound_line": "Dopóki go nie połączy, słowo aktywujące nie może samo otworzyć panelu. Dotknij, aby przejść do systemowego ustawienia asystenta: wybranie innej aplikacji, a potem znów LLeMbas, połączy go.",
|
||||
"wake_battery": "Pozwól działać w tle",
|
||||
"wake_battery_line": "Niektóre telefony (Samsung, Xiaomi, Huawei, OnePlus i inne) zatrzymują aplikacje w tle, by oszczędzać baterię, a z nimi słowo aktywujące. Wyłącz tu LLeMbas z optymalizacji baterii; dontkillmyapp.com wyjaśnia ustawienia Twojego telefonu.",
|
||||
"wake_failed_engine": "Słowo aktywujące nie działa: silnik się nie uruchomił",
|
||||
@@ -2450,7 +2560,14 @@
|
||||
"wake_failed_no_engine": "Słowo aktywujące nie działa: ta wersja nie ma silnika",
|
||||
"wake_greeting": "Powitanie",
|
||||
"wake_heard": "Słyszę. Dotknij, aby zapytać.",
|
||||
"wake_heard_could_not": "Nie udało się otworzyć samo — dotknij, aby zapytać",
|
||||
"wake_heard_line": "LLeMbas może sam otworzyć się nad innymi aplikacjami tylko jako aplikacja asystenta cyfrowego telefonu.",
|
||||
"wake_last": "Ostatnie wybudzenie",
|
||||
"wake_last_none": "Jeszcze nie usłyszał frazy.",
|
||||
"wake_link_later": "Android połączył go ponownie o %1$s.",
|
||||
"wake_link_never": "Android nie połączył asystenta od uruchomienia aplikacji.",
|
||||
"wake_link_ready": "Android połączył asystenta o %1$s.",
|
||||
"wake_link_shutdown": "Android rozłączył go o %1$s.",
|
||||
"wake_listening_for": "Nasłuchuje „%1$s”",
|
||||
"wake_name": "Imię",
|
||||
"wake_name_google_line": "Odpowie też telefon lub głośnik Google w pobliżu.",
|
||||
@@ -2458,6 +2575,13 @@
|
||||
"wake_not_assistant_line": "Dlatego słowo aktywujące nie może otworzyć asystenta nad innymi aplikacjami: dostajesz powiadomienie do dotknięcia. Aby otwierać głosem wszędzie, dotknij tutaj i wybierz LLeMbas jako aplikację asystenta cyfrowego.",
|
||||
"wake_notification_line": "Nic nie opuszcza telefonu, dopóki tego nie powiesz.",
|
||||
"wake_off": "Słowo aktywujące nie nasłuchuje",
|
||||
"wake_out_activity": "Zamiast tego otworzył go jako ekran aplikacji.",
|
||||
"wake_out_no_sheet": "Poprosił Androida o otwarcie asystenta; nie odmówił, ale panel się nie pojawił.",
|
||||
"wake_out_not_connected": "Android nie miał połączonego LLeMbas jako asystenta, więc nie mógł otworzyć panelu.",
|
||||
"wake_out_notification": "Zamiast tego wysłał powiadomienie do dotknięcia.",
|
||||
"wake_out_opened": "Otworzył asystenta.",
|
||||
"wake_out_refused": "Android odmówił otwarcia asystenta: %1$s",
|
||||
"wake_out_tested": "Usłyszano podczas próby: nie było czego otwierać.",
|
||||
"wake_paused_assistant": "Słowo aktywujące wstrzymane, gdy asystent jest otwarty",
|
||||
"wake_paused_battery": "Słowo aktywujące wstrzymane: oszczędzanie baterii jest włączone",
|
||||
"wake_paused_microphone": "Słowo aktywujące wstrzymane: LLeMbas nie ma zgody na używanie mikrofonu",
|
||||
@@ -2466,6 +2590,8 @@
|
||||
"wake_phrase_line": "To, co mówisz, a potem krótka pauza: liczy się, gdy zamilkniesz. Po angielsku, niezależnie od języka aplikacji: silnik zna tylko mowę angielską.",
|
||||
"wake_resume": "Znów nasłuchuj słowa aktywującego",
|
||||
"wake_resume_line": "Telefon uruchomił się ponownie. Dotknij, aby znów słuchać.",
|
||||
"wake_role_held": "LLeMbas był aplikacją asystenta cyfrowego.",
|
||||
"wake_role_not_held": "LLeMbas nie był aplikacją asystenta cyfrowego.",
|
||||
"wake_screen_only": "Tylko przy włączonym ekranie",
|
||||
"wake_screen_only_line": "Wyłączone: słucha także przy wyłączonym ekranie, kosztem baterii.",
|
||||
"wake_sensitivity": "Czułość",
|
||||
@@ -2797,6 +2923,8 @@
|
||||
"voice_input_phone": "Telefón (Google alebo systémový)",
|
||||
"voice_input_phone_line": "Vlastné rozpoznávanie reči v telefóne. Slová sa objavujú, ako hovoríte; nahrávka ide tam, kam ju to rozpoznávanie pošle.",
|
||||
"voice_input_phone_none": "Tento telefón nemá vlastné rozpoznávanie reči.",
|
||||
"wake_assistant_unbound": "LLeMbas je asistent, no Android ho práve nemá pripojeného",
|
||||
"wake_assistant_unbound_line": "Kým ho nepripojí, budiace slovo nemôže panel otvoriť samo. Ťuknutím otvoríte systémové nastavenie asistenta: vyberte inú aplikáciu a potom znova LLeMbas, tým sa pripojí.",
|
||||
"wake_battery": "Nechať bežať na pozadí",
|
||||
"wake_battery_line": "Niektoré telefóny (Samsung, Xiaomi, Huawei, OnePlus a ďalšie) kvôli batérii zastavujú aplikácie na pozadí, a s nimi aj budiace slovo. Tu vyjmite LLeMbas z optimalizácie batérie; dontkillmyapp.com vysvetľuje nastavenia vášho telefónu.",
|
||||
"wake_failed_engine": "Budiace slovo nefunguje: modul sa nespustil",
|
||||
@@ -2806,7 +2934,14 @@
|
||||
"wake_failed_no_engine": "Budiace slovo nefunguje: toto zostavenie nemá modul",
|
||||
"wake_greeting": "Oslovenie",
|
||||
"wake_heard": "Počul som vás. Ťuknite a pýtajte sa.",
|
||||
"wake_heard_could_not": "Nepodarilo sa otvoriť samo — ťuknite a pýtajte sa",
|
||||
"wake_heard_line": "LLeMbas sa dokáže sám otvoriť nad inými aplikáciami len ako aplikácia digitálneho asistenta v telefóne.",
|
||||
"wake_last": "Posledné zobudenie",
|
||||
"wake_last_none": "Frázu zatiaľ nepočul.",
|
||||
"wake_link_later": "Android ho znova pripojil o %1$s.",
|
||||
"wake_link_never": "Android od spustenia aplikácie asistenta nepripojil.",
|
||||
"wake_link_ready": "Android pripojil asistenta o %1$s.",
|
||||
"wake_link_shutdown": "Android ho odpojil o %1$s.",
|
||||
"wake_listening_for": "Počúvam frázu „%1$s“",
|
||||
"wake_name": "Meno",
|
||||
"wake_name_google_line": "Ozve sa aj telefón alebo reproduktor Google nablízku.",
|
||||
@@ -2814,6 +2949,13 @@
|
||||
"wake_not_assistant_line": "Budiace slovo preto nemôže otvoriť asistenta nad inými aplikáciami: dostanete oznámenie, na ktoré ťuknete. Ak chcete otvárať hlasom kdekoľvek, ťuknite sem a vyberte LLeMbas ako aplikáciu digitálneho asistenta.",
|
||||
"wake_notification_line": "Kým ju nepoviete, nič neopustí telefón.",
|
||||
"wake_off": "Budiace slovo nepočúva",
|
||||
"wake_out_activity": "Namiesto toho ho otvoril ako obrazovku aplikácie.",
|
||||
"wake_out_no_sheet": "Požiadal Android o otvorenie asistenta; neodmietol, no panel sa neobjavil.",
|
||||
"wake_out_not_connected": "Android nemal LLeMbas pripojený ako asistenta, preto panel nemohol otvoriť.",
|
||||
"wake_out_notification": "Namiesto toho poslal oznámenie, na ktoré treba ťuknúť.",
|
||||
"wake_out_opened": "Otvoril asistenta.",
|
||||
"wake_out_refused": "Android odmietol otvoriť asistenta: %1$s",
|
||||
"wake_out_tested": "Počuté pri skúške: nebolo čo otvárať.",
|
||||
"wake_paused_assistant": "Budiace slovo je pozastavené, kým je asistent otvorený",
|
||||
"wake_paused_battery": "Budiace slovo pozastavené: je zapnutý úsporný režim",
|
||||
"wake_paused_microphone": "Budiace slovo pozastavené: LLeMbas nemá povolený mikrofón",
|
||||
@@ -2822,6 +2964,8 @@
|
||||
"wake_phrase_line": "Toto hovoríte, potom krátka pauza: platí, až keď zmĺknete. Po anglicky, nech je aplikácia v akomkoľvek jazyku: modul pozná len anglickú reč.",
|
||||
"wake_resume": "Znova počúvať budiace slovo",
|
||||
"wake_resume_line": "Telefón sa reštartoval. Ťuknutím znova spustíte počúvanie.",
|
||||
"wake_role_held": "LLeMbas bol aplikáciou digitálneho asistenta.",
|
||||
"wake_role_not_held": "LLeMbas nebol aplikáciou digitálneho asistenta.",
|
||||
"wake_screen_only": "Len pri zapnutej obrazovke",
|
||||
"wake_screen_only_line": "Vypnuté: počúva aj pri zhasnutej obrazovke, za cenu vyššej spotreby batérie.",
|
||||
"wake_sensitivity": "Citlivosť",
|
||||
|
||||
Reference in new issue
Block a user