Phone actions, groundwork: the executor and its settings, before the server's phone_action
CI / check (push) Canceled after 0s
CI / check (push) Canceled after 0s
- actions/PhoneActions: standard intents for alarm, timer, calendar insert, SMS and email drafts, dial (the dialler, never a call), open URL (http/https only), open app (package or launcher label), settings panels, automation broadcasts (never android.* / com.android.*); torch via CameraManager; media keys via AudioManager. - actions/Navigation: Google Maps (google.navigation:, the dir URL with waypoints, geo:0,0?q=; no adding to a running route, no stop) and OsmAnd through its intent API only (osmand.api:// navigate, navigate_gpx with route points as GPX data, navigate_search, stop_navigation; no OsmAnd code, which is GPLv3). add_stop re-plans here -> stop -> destination. - Optional OsmAnd get_info (Settings switch, after allowing LLeMbas inside OsmAnd): position and the running route's destination, through a see-through ResultActivity. - Settings › Navigation app: whichever is installed (both: ask), Google Maps, OsmAnd, ask. - Not wired yet: the confirm card and the capability wait for the server's spec 3.6.0 fixtures. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
19 files changed
+900
No files matched your search
@@ -12,6 +12,8 @@
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MICROPHONE" />
|
||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
||||
<!-- Phone actions: an alarm or a timer, set through the clock app once the person confirms. -->
|
||||
<uses-permission android:name="com.android.alarm.permission.SET_ALARM" />
|
||||
|
||||
<queries>
|
||||
<!-- UnifiedPush distributors (ntfy and others) are found by this action. -->
|
||||
@@ -22,6 +24,15 @@
|
||||
<intent>
|
||||
<action android:name="android.speech.RecognitionService" />
|
||||
</intent>
|
||||
<!-- Phone actions: "open an app" by its name, and the navigation apps a route goes to. -->
|
||||
<intent>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent>
|
||||
<package android:name="com.google.android.apps.maps" />
|
||||
<package android:name="net.osmand.plus" />
|
||||
<package android:name="net.osmand" />
|
||||
<package android:name="net.osmand.dev" />
|
||||
</queries>
|
||||
|
||||
<application
|
||||
@@ -96,6 +107,14 @@
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<!-- Phone actions: asks another app for a result (OsmAnd's get_info) and goes. -->
|
||||
<activity
|
||||
android:name=".actions.ActionRunner$ResultActivity"
|
||||
android:excludeFromRecents="true"
|
||||
android:exported="false"
|
||||
android:taskAffinity=""
|
||||
android:theme="@style/Theme.Lembas.Sheet" />
|
||||
|
||||
<!-- The home-screen widget: Ask, the microphone, the last assistant chat. -->
|
||||
<receiver
|
||||
android:name=".widget.AskWidget"
|
||||
|
||||
@@ -0,0 +1,135 @@
|
||||
package eu.llembas.android.actions
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.ActivityNotFoundException
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import androidx.activity.ComponentActivity
|
||||
import androidx.activity.result.contract.ActivityResultContracts
|
||||
import kotlinx.coroutines.CompletableDeferred
|
||||
import kotlinx.coroutines.withTimeoutOrNull
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
import java.util.concurrent.atomic.AtomicInteger
|
||||
|
||||
/**
|
||||
* Carries out a phone action the person confirmed: [run] picks the way -- one intent, the torch, a
|
||||
* media key, or a navigation app -- and answers with done, failed (and why), never silence.
|
||||
*/
|
||||
object ActionRunner {
|
||||
// The reasons go back to the model as the tool's result, so they are written for it, in English.
|
||||
private const val NOT_POSSIBLE = "the phone cannot do this action with these arguments"
|
||||
private const val NO_NAV_APP = "no navigation app chosen or installed (Google Maps or OsmAnd)"
|
||||
private const val NO_DESTINATION =
|
||||
"a stop can only be added with the route's destination: name it (destination), or the person lets LLeMbas ask OsmAnd for it"
|
||||
private const val GOOGLE_CANNOT_STOP = "Google Maps cannot be told to stop navigating; the person stops it there"
|
||||
private const val OSMAND_NEEDS_COORDINATES = "OsmAnd takes a route through stops only with every point's lat and lon"
|
||||
|
||||
/**
|
||||
* [askOsmAnd]: Settings › Phone actions says the person allowed LLeMbas inside OsmAnd, so its
|
||||
* position and the running route's destination may be asked for (`get_info`).
|
||||
*/
|
||||
suspend fun run(context: Context, action: String, args: Args, nav: NavApp?, askOsmAnd: Boolean = false): ActionOutcome {
|
||||
when (action) {
|
||||
"torch" -> return PhoneActions.torch(context, args.bool("on"))
|
||||
"media" -> return PhoneActions.media(context, args.str("key").ifBlank { "play_pause" })
|
||||
"navigate", "add_stop", "search_nearby", "stop_navigation" -> return navigate(context, action, args, nav, askOsmAnd)
|
||||
}
|
||||
val intent = PhoneActions.intentFor(context, action, args)
|
||||
?: return ActionOutcome(ActionStatus.Failed, NOT_POSSIBLE)
|
||||
return PhoneActions.launch(context, intent, broadcast = action == "automation")
|
||||
}
|
||||
|
||||
private suspend fun navigate(context: Context, action: String, args: Args, nav: NavApp?, askOsmAnd: Boolean): ActionOutcome {
|
||||
val app = nav ?: return ActionOutcome(ActionStatus.Failed, NO_NAV_APP)
|
||||
val pkg = app.installed(context) ?: return ActionOutcome(ActionStatus.Failed, NO_NAV_APP)
|
||||
val travel = Travel.of(args.str("mode").ifBlank { null })
|
||||
// OsmAnd's own position and destination, if the person allowed LLeMbas to ask it.
|
||||
val info = if (app == NavApp.OsmAnd && askOsmAnd && action != "stop_navigation") osmandInfo(context, pkg) else null
|
||||
val step = when (action) {
|
||||
"navigate" -> args.place("destination")?.let { NavIntents.navigate(app, pkg, it, args.places("stops"), travel, info) }
|
||||
|
||||
"add_stop" -> args.place("stop")?.let {
|
||||
NavIntents.addStop(app, pkg, it, args.place("destination"), travel, info, NO_DESTINATION)
|
||||
}
|
||||
|
||||
"search_nearby" -> args.str("query").takeIf { it.isNotBlank() }?.let { NavIntents.searchNearby(app, pkg, it, info) }
|
||||
|
||||
else -> NavIntents.stop(app, pkg, GOOGLE_CANNOT_STOP)
|
||||
} ?: return ActionOutcome(ActionStatus.Failed, NOT_POSSIBLE)
|
||||
return when (step) {
|
||||
is NavStep.Unsupported -> ActionOutcome(ActionStatus.Failed, step.reason.ifBlank { OSMAND_NEEDS_COORDINATES })
|
||||
|
||||
// The map app comes to the front and stays: it answers nothing more until the person
|
||||
// leaves it, so its having taken the intent is "done".
|
||||
is NavStep.Launch -> PhoneActions.launch(context, step.intent)
|
||||
}
|
||||
}
|
||||
|
||||
/** OsmAnd's `get_info`, when the person allowed it inside OsmAnd; null otherwise, quietly. */
|
||||
private suspend fun osmandInfo(context: Context, pkg: String): OsmAndInfo? {
|
||||
val (code, extras) = forResult(context, NavIntents.osmandInfo(pkg), timeoutMs = 4_000) ?: return null
|
||||
return if (code == Activity.RESULT_OK) OsmAndInfo.of(extras) else null
|
||||
}
|
||||
|
||||
private val waiting = ConcurrentHashMap<Int, CompletableDeferred<Pair<Int, Bundle?>>>()
|
||||
private val ids = AtomicInteger()
|
||||
|
||||
/**
|
||||
* Start [intent] for its result through [ResultActivity] -- a see-through activity of the
|
||||
* app's own, so this works from the assistant's sheet (a voice-interaction session) as well.
|
||||
*/
|
||||
suspend fun forResult(context: Context, intent: Intent, timeoutMs: Long = 60_000): Pair<Int, Bundle?>? {
|
||||
val id = ids.incrementAndGet()
|
||||
val answer = CompletableDeferred<Pair<Int, Bundle?>>()
|
||||
waiting[id] = answer
|
||||
return try {
|
||||
context.startActivity(
|
||||
Intent(context, ResultActivity::class.java)
|
||||
.putExtra(ResultActivity.EXTRA_ID, id)
|
||||
.putExtra(ResultActivity.EXTRA_INTENT, intent)
|
||||
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK),
|
||||
)
|
||||
withTimeoutOrNull(timeoutMs) { answer.await() }
|
||||
} finally {
|
||||
waiting.remove(id)
|
||||
}
|
||||
}
|
||||
|
||||
internal fun answered(id: Int, code: Int, extras: Bundle?) {
|
||||
waiting[id]?.complete(code to extras)
|
||||
}
|
||||
|
||||
/** Asks another app for a result on [ActionRunner]'s behalf, then goes. Shows nothing of its own. */
|
||||
class ResultActivity : ComponentActivity() {
|
||||
private var id = 0
|
||||
private val launcher = registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { result ->
|
||||
answered(id, result.resultCode, result.data?.extras)
|
||||
finish()
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
id = intent.getIntExtra(EXTRA_ID, 0)
|
||||
if (savedInstanceState != null) return
|
||||
@Suppress("DEPRECATION")
|
||||
val target = intent.getParcelableExtra<Intent>(EXTRA_INTENT)
|
||||
if (target == null) {
|
||||
answered(id, Activity.RESULT_CANCELED, null)
|
||||
finish()
|
||||
return
|
||||
}
|
||||
try {
|
||||
launcher.launch(target)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
answered(id, Activity.RESULT_FIRST_USER, null)
|
||||
finish()
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val EXTRA_ID = "eu.llembas.android.RESULT_ID"
|
||||
const val EXTRA_INTENT = "eu.llembas.android.RESULT_INTENT"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,211 @@
|
||||
package eu.llembas.android.actions
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.pm.PackageManager
|
||||
import android.net.Uri
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
|
||||
/** A place for a navigation app: coordinates when the model knows them, else words to search for. */
|
||||
data class Place(val name: String = "", val lat: Double? = null, val lon: Double? = null, val query: String = "") {
|
||||
val hasCoordinates: Boolean get() = lat != null && lon != null
|
||||
val label: String get() = name.ifBlank { query.ifBlank { if (hasCoordinates) "$lat, $lon" else "" } }
|
||||
|
||||
/** What a map app searches for: the words, else the name. */
|
||||
val searchText: String get() = query.ifBlank { name }
|
||||
}
|
||||
|
||||
/** The navigation apps the phone actions drive. */
|
||||
enum class NavApp(val id: String, val packages: List<String>) {
|
||||
GoogleMaps("google", listOf("com.google.android.apps.maps")),
|
||||
|
||||
// OsmAnd: `net.osmand.plus` is OsmAnd+ and the F-Droid build (OsmAnd~); `net.osmand` the free one.
|
||||
OsmAnd("osmand", listOf("net.osmand.plus", "net.osmand", "net.osmand.dev")),
|
||||
;
|
||||
|
||||
/** The package of this app on the phone, if it is installed. */
|
||||
fun installed(context: Context): String? = packages.firstOrNull { isInstalled(context, it) }
|
||||
|
||||
companion object {
|
||||
/**
|
||||
* Settings' choice among [installed]: the one named; by default whichever is installed, and
|
||||
* with both installed (or "ask"), null -- the card then offers each.
|
||||
*/
|
||||
fun chosen(pref: String, installed: List<NavApp>): NavApp? = when (pref) {
|
||||
PREF_ASK -> null
|
||||
"" -> installed.singleOrNull()
|
||||
else -> installed.firstOrNull { it.id == pref } ?: installed.singleOrNull()
|
||||
}
|
||||
|
||||
fun installedApps(context: Context): List<NavApp> = entries.filter { it.installed(context) != null }
|
||||
|
||||
const val PREF_ASK = "ask"
|
||||
|
||||
private fun isInstalled(context: Context, pkg: String): Boolean = runCatching {
|
||||
if (Build.VERSION.SDK_INT >= 33) {
|
||||
context.packageManager.getPackageInfo(pkg, PackageManager.PackageInfoFlags.of(0))
|
||||
} else {
|
||||
@Suppress("DEPRECATION")
|
||||
context.packageManager.getPackageInfo(pkg, 0)
|
||||
}
|
||||
}.isSuccess
|
||||
}
|
||||
}
|
||||
|
||||
/** How a person travels, as the action names it. */
|
||||
enum class Travel(val id: String, val google: String, val googleNav: String, val osmand: String) {
|
||||
Drive("drive", "driving", "d", "car"),
|
||||
Walk("walk", "walking", "w", "pedestrian"),
|
||||
Bike("bike", "bicycling", "b", "bicycle"),
|
||||
Transit("transit", "transit", "d", "public_transport"),
|
||||
;
|
||||
|
||||
companion object {
|
||||
fun of(id: String?): Travel = entries.firstOrNull { it.id == id } ?: Drive
|
||||
}
|
||||
}
|
||||
|
||||
/** One request to a navigation app: an [Intent], or why it cannot be done in that app. */
|
||||
sealed interface NavStep {
|
||||
data class Launch(val intent: Intent) : NavStep
|
||||
|
||||
data class Unsupported(val reason: String) : NavStep
|
||||
}
|
||||
|
||||
/**
|
||||
* What OsmAnd itself says about the route, when the person allowed LLeMbas to ask
|
||||
* (OsmAnd › Plugins › … › the app's "Location" access for its API): the phone's position and the
|
||||
* route's destination. Null when not allowed -- the actions then use what the model gave.
|
||||
*/
|
||||
data class OsmAndInfo(val lat: Double?, val lon: Double?, val destination: Place?) {
|
||||
companion object {
|
||||
fun of(extras: Bundle?): OsmAndInfo? {
|
||||
extras ?: return null
|
||||
fun d(key: String) = if (extras.containsKey(key)) extras.getDouble(key) else null
|
||||
val dLat = d("destination_lat")
|
||||
val dLon = d("destination_lon")
|
||||
return OsmAndInfo(d("lat"), d("lon"), if (dLat != null && dLon != null) Place(lat = dLat, lon = dLon) else null)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The intents, per app. Google Maps: a route to a place with up to a few stops (its `dir` URL),
|
||||
* a search near here (`geo:0,0?q=`); it cannot take a stop into a route already running, nor be
|
||||
* told to stop -- adding a stop there starts the route again through the stop. OsmAnd: its intent
|
||||
* API (`osmand.api://`, a URI protocol; no OsmAnd code in this app): navigate, a route through
|
||||
* stops as a GPX passed as data, a search near a position, stop navigation.
|
||||
*/
|
||||
object NavIntents {
|
||||
private const val GOOGLE_STOPS = 9
|
||||
|
||||
fun navigate(app: NavApp, pkg: String, destination: Place, stops: List<Place>, travel: Travel, info: OsmAndInfo?): NavStep = when (app) {
|
||||
NavApp.GoogleMaps -> google(pkg, destination, stops, travel)
|
||||
NavApp.OsmAnd -> osmand(pkg, destination, stops, travel, info)
|
||||
}
|
||||
|
||||
/** A stop on the way to the route's destination ([destination] from the model, else OsmAnd's own). */
|
||||
fun addStop(app: NavApp, pkg: String, stop: Place, destination: Place?, travel: Travel, info: OsmAndInfo?, noDestination: String): NavStep {
|
||||
val to = destination?.takeIf { it.hasCoordinates || it.searchText.isNotBlank() } ?: info?.destination ?: return NavStep.Unsupported(noDestination)
|
||||
return navigate(app, pkg, to, listOf(stop), travel, info)
|
||||
}
|
||||
|
||||
fun searchNearby(app: NavApp, pkg: String, query: String, info: OsmAndInfo?): NavStep = when {
|
||||
app == NavApp.OsmAnd && info?.lat != null && info.lon != null -> NavStep.Launch(
|
||||
osmandUri(
|
||||
pkg,
|
||||
"navigate_search",
|
||||
"dest_search_query" to query,
|
||||
"search_lat" to info.lat.toString(),
|
||||
"search_lon" to info.lon.toString(),
|
||||
"show_search_results" to "true",
|
||||
"force" to "true",
|
||||
),
|
||||
)
|
||||
|
||||
else -> NavStep.Launch(Intent(Intent.ACTION_VIEW, Uri.parse("geo:0,0?q=" + Uri.encode(query))).setPackage(pkg))
|
||||
}
|
||||
|
||||
fun stop(app: NavApp, pkg: String, unsupported: String): NavStep = when (app) {
|
||||
NavApp.OsmAnd -> NavStep.Launch(osmandUri(pkg, "stop_navigation"))
|
||||
NavApp.GoogleMaps -> NavStep.Unsupported(unsupported)
|
||||
}
|
||||
|
||||
/** OsmAnd's own account of the route (needs the person's grant inside OsmAnd). */
|
||||
fun osmandInfo(pkg: String): Intent = osmandUri(pkg, "get_info")
|
||||
|
||||
private fun google(pkg: String, destination: Place, stops: List<Place>, travel: Travel): NavStep {
|
||||
if (stops.isEmpty()) {
|
||||
val q = if (destination.hasCoordinates) "${destination.lat},${destination.lon}" else destination.searchText
|
||||
return NavStep.Launch(Intent(Intent.ACTION_VIEW, Uri.parse("google.navigation:q=${Uri.encode(q)}&mode=${travel.googleNav}")).setPackage(pkg))
|
||||
}
|
||||
val url = Uri.parse("https://www.google.com/maps/dir/").buildUpon()
|
||||
.appendQueryParameter("api", "1")
|
||||
.appendQueryParameter("destination", googlePlace(destination))
|
||||
.appendQueryParameter("waypoints", stops.take(GOOGLE_STOPS).joinToString("|") { googlePlace(it) })
|
||||
.appendQueryParameter("travelmode", travel.google)
|
||||
.appendQueryParameter("dir_action", "navigate")
|
||||
.build()
|
||||
return NavStep.Launch(Intent(Intent.ACTION_VIEW, url).setPackage(pkg))
|
||||
}
|
||||
|
||||
private fun googlePlace(p: Place) = if (p.hasCoordinates) "${p.lat},${p.lon}" else p.searchText
|
||||
|
||||
private fun osmand(pkg: String, destination: Place, stops: List<Place>, travel: Travel, info: OsmAndInfo?): NavStep {
|
||||
val route = stops + destination
|
||||
return when {
|
||||
// Through stops: OsmAnd follows a route given as GPX, which needs every point's coordinates.
|
||||
stops.isNotEmpty() && route.all { it.hasCoordinates } -> NavStep.Launch(
|
||||
osmandUri(pkg, "navigate_gpx", "force" to "true").putExtra("data", gpx(route)),
|
||||
)
|
||||
|
||||
stops.isNotEmpty() -> NavStep.Unsupported("")
|
||||
|
||||
destination.hasCoordinates -> NavStep.Launch(
|
||||
osmandUri(
|
||||
pkg,
|
||||
"navigate",
|
||||
"dest_lat" to destination.lat.toString(),
|
||||
"dest_lon" to destination.lon.toString(),
|
||||
"dest_name" to destination.label,
|
||||
"profile" to travel.osmand,
|
||||
"force" to "true",
|
||||
),
|
||||
)
|
||||
|
||||
// Words only: OsmAnd searches them near the phone when it says where the phone is,
|
||||
// else its own search opens with them (geo:0,0?q=).
|
||||
info?.lat != null && info.lon != null -> NavStep.Launch(
|
||||
osmandUri(
|
||||
pkg,
|
||||
"navigate_search",
|
||||
"dest_search_query" to destination.searchText,
|
||||
"search_lat" to info.lat.toString(),
|
||||
"search_lon" to info.lon.toString(),
|
||||
"profile" to travel.osmand,
|
||||
"force" to "true",
|
||||
),
|
||||
)
|
||||
|
||||
else -> NavStep.Launch(Intent(Intent.ACTION_VIEW, Uri.parse("geo:0,0?q=" + Uri.encode(destination.searchText))).setPackage(pkg))
|
||||
}
|
||||
}
|
||||
|
||||
private fun osmandUri(pkg: String, command: String, vararg params: Pair<String, String>): Intent {
|
||||
val uri = Uri.Builder().scheme("osmand.api").authority(command).apply { params.forEach { (k, v) -> appendQueryParameter(k, v) } }.build()
|
||||
return Intent(Intent.ACTION_VIEW, uri).setPackage(pkg)
|
||||
}
|
||||
|
||||
/** A route as GPX 1.1: its points in order, named. */
|
||||
fun gpx(points: List<Place>): String = buildString {
|
||||
append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n")
|
||||
append("<gpx version=\"1.1\" creator=\"LLeMbas\" xmlns=\"http://www.topografix.com/GPX/1/1\"><rte>")
|
||||
for (p in points) {
|
||||
append("<rtept lat=\"${p.lat}\" lon=\"${p.lon}\"><name>")
|
||||
append(p.label.replace("&", "&").replace("<", "<").replace(">", ">"))
|
||||
append("</name></rtept>")
|
||||
}
|
||||
append("</rte></gpx>\n")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,250 @@
|
||||
package eu.llembas.android.actions
|
||||
|
||||
import android.content.ActivityNotFoundException
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.pm.PackageManager
|
||||
import android.hardware.camera2.CameraCharacteristics
|
||||
import android.hardware.camera2.CameraManager
|
||||
import android.media.AudioManager
|
||||
import android.net.Uri
|
||||
import android.provider.AlarmClock
|
||||
import android.provider.CalendarContract
|
||||
import android.provider.Settings
|
||||
import android.view.KeyEvent
|
||||
import kotlinx.serialization.json.JsonArray
|
||||
import kotlinx.serialization.json.JsonElement
|
||||
import kotlinx.serialization.json.JsonObject
|
||||
import kotlinx.serialization.json.JsonPrimitive
|
||||
import kotlinx.serialization.json.booleanOrNull
|
||||
import kotlinx.serialization.json.doubleOrNull
|
||||
import kotlinx.serialization.json.intOrNull
|
||||
import kotlinx.serialization.json.longOrNull
|
||||
import java.time.LocalDateTime
|
||||
import java.time.OffsetDateTime
|
||||
import java.time.ZoneId
|
||||
|
||||
/** How a phone action ended, as the tool's result says it. */
|
||||
enum class ActionStatus(val wire: String) { Done("done"), Declined("declined"), Failed("failed") }
|
||||
|
||||
data class ActionOutcome(val status: ActionStatus, val message: String = "")
|
||||
|
||||
/** The arguments of an action, read leniently: a model writes numbers as strings now and then. */
|
||||
class Args(val json: JsonObject) {
|
||||
private val o get() = json
|
||||
|
||||
fun str(key: String): String = (o[key] as? JsonPrimitive)?.takeIf { it.isString || it.booleanOrNull == null }?.content.orEmpty()
|
||||
|
||||
fun int(key: String): Int? = (o[key] as? JsonPrimitive)?.let { it.intOrNull ?: it.content.toIntOrNull() }
|
||||
|
||||
fun long(key: String): Long? = (o[key] as? JsonPrimitive)?.let { it.longOrNull ?: it.content.toLongOrNull() }
|
||||
|
||||
fun bool(key: String): Boolean? = (o[key] as? JsonPrimitive)?.let { it.booleanOrNull ?: it.content.toBooleanStrictOrNull() }
|
||||
|
||||
fun obj(key: String): Args? = (o[key] as? JsonObject)?.let(::Args)
|
||||
|
||||
fun list(key: String): List<JsonElement> = (o[key] as? JsonArray).orEmpty()
|
||||
|
||||
fun place(key: String): Place? = when (val v = o[key]) {
|
||||
is JsonObject -> placeOf(v)
|
||||
is JsonPrimitive -> v.content.takeIf { it.isNotBlank() }?.let { Place(query = it) }
|
||||
else -> null
|
||||
}
|
||||
|
||||
fun places(key: String): List<Place> = list(key).mapNotNull { e ->
|
||||
when (e) {
|
||||
is JsonObject -> placeOf(e)
|
||||
is JsonPrimitive -> e.content.takeIf { it.isNotBlank() }?.let { Place(query = it) }
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
|
||||
private fun placeOf(v: JsonObject): Place {
|
||||
fun d(k: String) = (v[k] as? JsonPrimitive)?.let { it.doubleOrNull ?: it.content.toDoubleOrNull() }
|
||||
return Place(
|
||||
name = (v["name"] as? JsonPrimitive)?.content.orEmpty(),
|
||||
lat = d("lat"),
|
||||
lon = d("lon"),
|
||||
query = (v["query"] as? JsonPrimitive)?.content.orEmpty(),
|
||||
)
|
||||
}
|
||||
|
||||
/** A time the model wrote: ISO 8601 with an offset, or local (the phone's zone). */
|
||||
fun time(key: String): Long? {
|
||||
val raw = str(key).ifBlank { return null }
|
||||
return runCatching { OffsetDateTime.parse(raw).toInstant().toEpochMilli() }.getOrNull()
|
||||
?: runCatching { LocalDateTime.parse(raw).atZone(ZoneId.systemDefault()).toInstant().toEpochMilli() }.getOrNull()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The phone actions a model may propose (`phone_action`), carried out with Android's standard
|
||||
* intents once the person tapped Do it on the card. Each one either opens the app that does it,
|
||||
* with everything filled in (an alarm, an event, a draft -- the person sends a message or saves
|
||||
* an event there themselves), or does a small thing at once (the torch, play/pause).
|
||||
*
|
||||
* Nothing here runs without the card's Do it, and none of it from the lock screen. A model's
|
||||
* words are data: a URL opens only for http and https, a broadcast never names a system action,
|
||||
* a phone number goes to the dialler and is never called.
|
||||
*/
|
||||
object PhoneActions {
|
||||
/** Media keys the `media` action sends. */
|
||||
private val MEDIA = mapOf(
|
||||
"play_pause" to KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE,
|
||||
"play" to KeyEvent.KEYCODE_MEDIA_PLAY,
|
||||
"pause" to KeyEvent.KEYCODE_MEDIA_PAUSE,
|
||||
"next" to KeyEvent.KEYCODE_MEDIA_NEXT,
|
||||
"previous" to KeyEvent.KEYCODE_MEDIA_PREVIOUS,
|
||||
"stop" to KeyEvent.KEYCODE_MEDIA_STOP,
|
||||
)
|
||||
|
||||
/** Settings panels, by the action's name. Panels (Android 10+) float over the app; the rest are pages. */
|
||||
private val PANELS = mapOf(
|
||||
"wifi" to Settings.Panel.ACTION_WIFI,
|
||||
"internet" to Settings.Panel.ACTION_INTERNET_CONNECTIVITY,
|
||||
"nfc" to Settings.Panel.ACTION_NFC,
|
||||
"volume" to Settings.Panel.ACTION_VOLUME,
|
||||
"bluetooth" to Settings.ACTION_BLUETOOTH_SETTINGS,
|
||||
"location" to Settings.ACTION_LOCATION_SOURCE_SETTINGS,
|
||||
"display" to Settings.ACTION_DISPLAY_SETTINGS,
|
||||
"battery" to Intent.ACTION_POWER_USAGE_SUMMARY,
|
||||
"airplane" to Settings.ACTION_AIRPLANE_MODE_SETTINGS,
|
||||
"do_not_disturb" to Settings.ACTION_ZEN_MODE_PRIORITY_SETTINGS,
|
||||
)
|
||||
|
||||
/** A broadcast an automation app (Tasker, Automate, MacroDroid) listens for: never a system one. */
|
||||
fun broadcastAllowed(action: String): Boolean =
|
||||
action.isNotBlank() && action.length <= 200 && !action.startsWith("android.") && !action.startsWith("com.android.") &&
|
||||
Regex("^[A-Za-z0-9_.]+$").matches(action)
|
||||
|
||||
/** A URL the phone may open for a model: web pages only. */
|
||||
fun urlAllowed(url: String): Boolean = Uri.parse(url.trim()).scheme?.lowercase() in setOf("http", "https")
|
||||
|
||||
/**
|
||||
* The intent for an action that is one intent (everything but navigation, the torch and media
|
||||
* keys), or null when [action] is not one of these.
|
||||
*/
|
||||
fun intentFor(context: Context, action: String, a: Args): Intent? = when (action) {
|
||||
"alarm" -> Intent(AlarmClock.ACTION_SET_ALARM)
|
||||
.putExtra(AlarmClock.EXTRA_HOUR, a.int("hour") ?: 7)
|
||||
.putExtra(AlarmClock.EXTRA_MINUTES, a.int("minute") ?: 0)
|
||||
.apply { a.str("label").takeIf { it.isNotBlank() }?.let { putExtra(AlarmClock.EXTRA_MESSAGE, it) } }
|
||||
.apply {
|
||||
val days = a.list("days").mapNotNull { (it as? JsonPrimitive)?.content?.let(::calendarDay) }
|
||||
if (days.isNotEmpty()) putIntegerArrayListExtra(AlarmClock.EXTRA_DAYS, ArrayList(days))
|
||||
}
|
||||
|
||||
"timer" -> Intent(AlarmClock.ACTION_SET_TIMER)
|
||||
.putExtra(AlarmClock.EXTRA_LENGTH, (a.int("seconds") ?: 60).coerceIn(1, 86_400))
|
||||
.putExtra(AlarmClock.EXTRA_SKIP_UI, false)
|
||||
.apply { a.str("label").takeIf { it.isNotBlank() }?.let { putExtra(AlarmClock.EXTRA_MESSAGE, it) } }
|
||||
|
||||
"calendar_event" -> Intent(Intent.ACTION_INSERT, CalendarContract.Events.CONTENT_URI)
|
||||
.putExtra(CalendarContract.Events.TITLE, a.str("title"))
|
||||
.apply {
|
||||
a.time("start")?.let { putExtra(CalendarContract.EXTRA_EVENT_BEGIN_TIME, it) }
|
||||
a.time("end")?.let { putExtra(CalendarContract.EXTRA_EVENT_END_TIME, it) }
|
||||
if (a.bool("all_day") == true) putExtra(CalendarContract.EXTRA_EVENT_ALL_DAY, true)
|
||||
a.str("location").takeIf { it.isNotBlank() }?.let { putExtra(CalendarContract.Events.EVENT_LOCATION, it) }
|
||||
a.str("description").takeIf { it.isNotBlank() }?.let { putExtra(CalendarContract.Events.DESCRIPTION, it) }
|
||||
}
|
||||
|
||||
"sms_draft" -> Intent(Intent.ACTION_SENDTO, Uri.parse("smsto:" + Uri.encode(a.str("to"))))
|
||||
.putExtra("sms_body", a.str("body"))
|
||||
|
||||
"email_draft" -> Intent(Intent.ACTION_SENDTO, Uri.parse("mailto:"))
|
||||
.putExtra(
|
||||
Intent.EXTRA_EMAIL,
|
||||
a.list("to").mapNotNull {
|
||||
(it as? JsonPrimitive)?.content
|
||||
}.ifEmpty { listOf(a.str("to")) }.filter { it.isNotBlank() }.toTypedArray(),
|
||||
)
|
||||
.putExtra(Intent.EXTRA_SUBJECT, a.str("subject"))
|
||||
.putExtra(Intent.EXTRA_TEXT, a.str("body"))
|
||||
|
||||
// The dialler with the number in it: the person presses call.
|
||||
"dial" -> Intent(Intent.ACTION_DIAL, Uri.parse("tel:" + Uri.encode(a.str("number"))))
|
||||
|
||||
"open_url" -> a.str("url").trim().takeIf(::urlAllowed)?.let { Intent(Intent.ACTION_VIEW, Uri.parse(it)) }
|
||||
|
||||
"open_app" -> appIntent(context, a.str("package"), a.str("name"))
|
||||
|
||||
"settings_panel" -> PANELS[a.str("panel")]?.let { Intent(it) }
|
||||
|
||||
"automation" -> a.str("action").takeIf(::broadcastAllowed)?.let { name ->
|
||||
Intent(name).apply {
|
||||
a.str("package").takeIf { it.isNotBlank() }?.let { setPackage(it) }
|
||||
a.obj("extras")?.let { extras ->
|
||||
// Strings only: an automation app reads its variables as text.
|
||||
extras.json.forEach { (k, v) -> (v as? JsonPrimitive)?.let { putExtra(k, it.content) } }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else -> null
|
||||
}
|
||||
|
||||
/** An app by its package, else by the name the launcher shows (the first app whose label matches). */
|
||||
fun appIntent(context: Context, pkg: String, name: String): Intent? {
|
||||
val pm = context.packageManager
|
||||
pkg.takeIf { it.isNotBlank() }?.let { p -> pm.getLaunchIntentForPackage(p)?.let { return it } }
|
||||
if (name.isBlank()) return null
|
||||
val launcher = Intent(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_LAUNCHER)
|
||||
val apps = runCatching { pm.queryIntentActivities(launcher, PackageManager.MATCH_ALL) }.getOrDefault(emptyList())
|
||||
val wanted = name.trim().lowercase()
|
||||
val found = apps.firstOrNull { it.loadLabel(pm).toString().lowercase() == wanted }
|
||||
?: apps.firstOrNull { it.loadLabel(pm).toString().lowercase().contains(wanted) }
|
||||
?: return null
|
||||
return pm.getLaunchIntentForPackage(found.activityInfo.packageName)
|
||||
}
|
||||
|
||||
/** The torch on or off (or the other way round), through the camera service; no permission needed. */
|
||||
fun torch(context: Context, on: Boolean?): ActionOutcome {
|
||||
val cameras = context.getSystemService(CameraManager::class.java) ?: return ActionOutcome(ActionStatus.Failed, "no camera")
|
||||
val id = cameras.cameraIdList.firstOrNull { cameras.getCameraCharacteristics(it).get(CameraCharacteristics.FLASH_INFO_AVAILABLE) == true }
|
||||
?: return ActionOutcome(ActionStatus.Failed, "this phone has no torch")
|
||||
val target = on ?: !torchOn
|
||||
return runCatching {
|
||||
cameras.setTorchMode(id, target)
|
||||
torchOn = target
|
||||
ActionOutcome(ActionStatus.Done, if (target) "torch on" else "torch off")
|
||||
}.getOrElse { ActionOutcome(ActionStatus.Failed, it.message.orEmpty()) }
|
||||
}
|
||||
|
||||
@Volatile
|
||||
private var torchOn = false
|
||||
|
||||
/** A media key to whatever is playing. */
|
||||
fun media(context: Context, key: String): ActionOutcome {
|
||||
val code = MEDIA[key] ?: return ActionOutcome(ActionStatus.Failed, "unknown media key: $key")
|
||||
val audio = context.getSystemService(AudioManager::class.java) ?: return ActionOutcome(ActionStatus.Failed, "no audio")
|
||||
audio.dispatchMediaKeyEvent(KeyEvent(KeyEvent.ACTION_DOWN, code))
|
||||
audio.dispatchMediaKeyEvent(KeyEvent(KeyEvent.ACTION_UP, code))
|
||||
return ActionOutcome(ActionStatus.Done, key)
|
||||
}
|
||||
|
||||
/** Start [intent] as a new task; whether an app took it. */
|
||||
fun launch(context: Context, intent: Intent, broadcast: Boolean = false): ActionOutcome = try {
|
||||
if (broadcast) {
|
||||
context.sendBroadcast(intent)
|
||||
} else {
|
||||
context.startActivity(intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK))
|
||||
}
|
||||
ActionOutcome(ActionStatus.Done)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
ActionOutcome(ActionStatus.Failed, "no app on this phone does that")
|
||||
} catch (e: SecurityException) {
|
||||
ActionOutcome(ActionStatus.Failed, e.message.orEmpty())
|
||||
}
|
||||
|
||||
private fun calendarDay(day: String): Int? = when (day.lowercase().take(3)) {
|
||||
"sun" -> java.util.Calendar.SUNDAY
|
||||
"mon" -> java.util.Calendar.MONDAY
|
||||
"tue" -> java.util.Calendar.TUESDAY
|
||||
"wed" -> java.util.Calendar.WEDNESDAY
|
||||
"thu" -> java.util.Calendar.THURSDAY
|
||||
"fri" -> java.util.Calendar.FRIDAY
|
||||
"sat" -> java.util.Calendar.SATURDAY
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
@@ -95,6 +95,10 @@ data class Prefs(
|
||||
val wakeScreenOnly: Boolean = true,
|
||||
/** The assistant may read the notifications when asked (with Android's notification access). */
|
||||
val notificationSummaries: Boolean = false,
|
||||
/** Phone actions' navigation app: "" whichever is installed, "google", "osmand", or "ask". */
|
||||
val navApp: String = "",
|
||||
/** Ask OsmAnd for the phone's position and the route's destination (allowed inside OsmAnd first). */
|
||||
val osmandInfo: Boolean = false,
|
||||
val assistantModel: String = "",
|
||||
val lastAssistChat: String = "",
|
||||
val lastAssistTitle: String = "",
|
||||
|
||||
@@ -38,6 +38,8 @@ import androidx.compose.material.icons.filled.Forum
|
||||
import androidx.compose.material.icons.filled.Hearing
|
||||
import androidx.compose.material.icons.filled.Info
|
||||
import androidx.compose.material.icons.filled.Mic
|
||||
import androidx.compose.material.icons.filled.MyLocation
|
||||
import androidx.compose.material.icons.filled.Navigation
|
||||
import androidx.compose.material.icons.filled.Notifications
|
||||
import androidx.compose.material.icons.filled.NotificationsActive
|
||||
import androidx.compose.material.icons.filled.Palette
|
||||
@@ -84,6 +86,7 @@ import androidx.core.content.ContextCompat
|
||||
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.PhoneRecognizer
|
||||
import eu.llembas.android.auth.Instance
|
||||
import eu.llembas.android.auth.Prefs
|
||||
@@ -123,6 +126,8 @@ interface SettingsActions {
|
||||
fun batterySettings() {}
|
||||
fun notificationSummaries(on: Boolean) {}
|
||||
fun notificationAccess() {}
|
||||
fun navApp(id: String) {}
|
||||
fun osmandInfo(on: Boolean) {}
|
||||
fun readAloud(on: Boolean) {}
|
||||
fun checkUpdate() {}
|
||||
fun openRelease() {}
|
||||
@@ -151,6 +156,8 @@ data class SettingsState(
|
||||
val wakeAvailable: Boolean = false,
|
||||
/** Whether Android's notification access is given to LLeMbas. */
|
||||
val notificationAccess: Boolean = false,
|
||||
/** The navigation apps installed: NavApp ids. */
|
||||
val navApps: List<String> = emptyList(),
|
||||
)
|
||||
|
||||
@Composable
|
||||
@@ -274,6 +281,14 @@ fun SettingsScreen(onBack: () -> Unit, onAddInstance: () -> Unit) {
|
||||
runCatching { context.startActivity(NotificationReader.settingsIntent(context)) }
|
||||
}
|
||||
|
||||
override fun navApp(id: String) {
|
||||
scope.launch { store.savePrefs { it.copy(navApp = id) } }
|
||||
}
|
||||
|
||||
override fun osmandInfo(on: Boolean) {
|
||||
scope.launch { store.savePrefs { it.copy(osmandInfo = on) } }
|
||||
}
|
||||
|
||||
override fun readAloud(on: Boolean) {
|
||||
scope.launch { store.savePrefs { it.copy(readAloudSpoken = on) } }
|
||||
}
|
||||
@@ -331,6 +346,7 @@ fun SettingsScreen(onBack: () -> Unit, onAddInstance: () -> Unit) {
|
||||
wakeAvailable = WakeEngine.AVAILABLE,
|
||||
// Read again each time Settings is composed: the person comes back from the system's page.
|
||||
notificationAccess = NotificationReader.granted(context),
|
||||
navApps = remember { NavApp.installedApps(context).map { it.id } },
|
||||
),
|
||||
actions,
|
||||
onBack,
|
||||
@@ -514,6 +530,7 @@ fun SettingsContent(state: SettingsState, actions: SettingsActions, onBack: () -
|
||||
}
|
||||
item { WakeWordGroup(state, actions) }
|
||||
item { NotificationSummaryGroup(state, actions) }
|
||||
item { PhoneActionsGroup(state, actions) }
|
||||
item {
|
||||
// Which recogniser turns speech into words: the instance's or the phone's -- what
|
||||
// each one is, and where the recording goes, said in the row itself.
|
||||
@@ -648,6 +665,53 @@ private fun WakeWordGroup(state: SettingsState, actions: SettingsActions) {
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Phone actions: which navigation app a route goes to (whichever is installed by default; with
|
||||
* both, the card asks), and whether OsmAnd may be asked where the phone is and where the running
|
||||
* route goes -- which the person allows inside OsmAnd first.
|
||||
*/
|
||||
@Composable
|
||||
private fun PhoneActionsGroup(state: SettingsState, actions: SettingsActions) {
|
||||
val palette = LocalPalette.current
|
||||
val choices = listOf(
|
||||
"" to stringResource(R.string.nav_app_auto),
|
||||
NavApp.GoogleMaps.id to stringResource(R.string.nav_app_google),
|
||||
NavApp.OsmAnd.id to stringResource(R.string.nav_app_osmand),
|
||||
NavApp.PREF_ASK to stringResource(R.string.nav_app_ask),
|
||||
)
|
||||
Group(stringResource(R.string.nav_app)) {
|
||||
choices.forEachIndexed { i, (id, label) ->
|
||||
if (i > 0) Rule()
|
||||
val installed = id == "" || id == NavApp.PREF_ASK || id in state.navApps
|
||||
SettingRow(
|
||||
Icons.Filled.Navigation,
|
||||
label,
|
||||
subtitle = if (installed) null else stringResource(R.string.nav_app_not_installed),
|
||||
showIcon = i == 0,
|
||||
enabled = installed,
|
||||
onClick = { actions.navApp(id) },
|
||||
trailing = { RadioButton(selected = state.prefs.navApp == id, enabled = installed, onClick = { actions.navApp(id) }) },
|
||||
)
|
||||
}
|
||||
if (NavApp.OsmAnd.id in state.navApps) {
|
||||
Rule()
|
||||
SettingRow(
|
||||
Icons.Filled.MyLocation,
|
||||
stringResource(R.string.osmand_info),
|
||||
subtitle = stringResource(R.string.osmand_info_line),
|
||||
onClick = { actions.osmandInfo(!state.prefs.osmandInfo) },
|
||||
trailing = { Switch(checked = state.prefs.osmandInfo, onCheckedChange = actions::osmandInfo) },
|
||||
)
|
||||
}
|
||||
}
|
||||
Text(
|
||||
stringResource(R.string.phone_actions_line),
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
color = palette.inkFaint,
|
||||
modifier = Modifier.padding(horizontal = 16.dp, vertical = 8.dp),
|
||||
)
|
||||
}
|
||||
|
||||
/** Notification summaries: off by default; on needs Android's notification access too, which this explains. */
|
||||
@Composable
|
||||
private fun NotificationSummaryGroup(state: SettingsState, actions: SettingsActions) {
|
||||
|
||||
@@ -427,6 +427,15 @@
|
||||
<string name="notification_access_on">Uděleno. Přepínač Androidu je v systémovém nastavení.</string>
|
||||
<string name="notification_access_off">Zatím neuděleno. Klepnutím otevřete přepínač Androidu pro LLeMbas.</string>
|
||||
<string name="notification_summaries_privacy">Ve výchozím stavu vypnuto. Když požádáte, text oznámení, která jsou v telefonu právě teď (aplikace, název, text), půjde s touto jedinou otázkou na vaši instanci a její model. Dřív se nic nečte, aplikace si nic neponechá a při zamčeném telefonu se nečte nic. Přístup k oznámením v Androidu dovolí aplikaci vidět každé oznámení, proto je na vás, zda ho dáte a zase vezmete.</string>
|
||||
<string name="nav_app">Navigační aplikace</string>
|
||||
<string name="nav_app_auto">Ta, která je nainstalovaná</string>
|
||||
<string name="nav_app_google">Mapy Google</string>
|
||||
<string name="nav_app_osmand">OsmAnd</string>
|
||||
<string name="nav_app_ask">Pokaždé se zeptat</string>
|
||||
<string name="nav_app_not_installed">Není nainstalovaná</string>
|
||||
<string name="osmand_info">Ptát se OsmAnd na trasu</string>
|
||||
<string name="osmand_info_line">Umožní „přidat zastávku“ a hledání v okolí i u trasy nastavené přímo v OsmAnd: LLeMbas se OsmAnd zeptá, kde jste a kam trasa vede. Nejdřív LLeMbas povolte v OsmAnd (připojené aplikace, s polohou); OsmAnd dá vědět, pokud povoleno není.</string>
|
||||
<string name="phone_actions_line">Model může nabídnout, že v telefonu něco udělá — nastaví budík, přidá událost, připraví zprávu, spustí trasu. Nic se nestane, dokud neklepnete na Provést na jeho kartě, a nikdy při zamčeném telefonu. Mapy Google spustí trasu s několika zastávkami, ale do běžící trasy zastávku nepřidají ani je nelze zastavit; OsmAnd to umí.</string>
|
||||
<string name="assist_recogniser_failed">Rozpoznávání řeči v telefonu se zastavilo. Zkuste to znovu nebo zvolte LLeMbas v Nastavení › Hlasový vstup.</string>
|
||||
<string name="assistant_listens">Začít poslouchat, když se asistent otevře</string>
|
||||
<string name="voice_input">Hlasový vstup</string>
|
||||
|
||||
@@ -427,6 +427,15 @@
|
||||
<string name="notification_access_on">Erteilt. Der Schalter dafür ist in den Android-Einstellungen.</string>
|
||||
<string name="notification_access_off">Noch nicht erteilt. Tippe, um den Android-Schalter für LLeMbas zu öffnen.</string>
|
||||
<string name="notification_summaries_privacy">Standardmäßig aus. Wenn du fragst, geht der Text der Benachrichtigungen, die gerade auf deinem Telefon sind (App, Titel, Text), mit dieser einen Frage an deine Instanz und ihr Modell. Vorher wird nichts gelesen, die App behält nichts davon, und bei gesperrtem Telefon wird nichts gelesen. Der Benachrichtigungszugriff von Android lässt eine App jede Benachrichtigung sehen; ihn zu erteilen und zu entziehen liegt bei dir.</string>
|
||||
<string name="nav_app">Navigations-App</string>
|
||||
<string name="nav_app_auto">Die installierte</string>
|
||||
<string name="nav_app_google">Google Maps</string>
|
||||
<string name="nav_app_osmand">OsmAnd</string>
|
||||
<string name="nav_app_ask">Jedes Mal fragen</string>
|
||||
<string name="nav_app_not_installed">Nicht installiert</string>
|
||||
<string name="osmand_info">OsmAnd nach der Route fragen</string>
|
||||
<string name="osmand_info_line">Damit „Zwischenstopp hinzufügen“ und die Suche in der Nähe auch mit einer in OsmAnd geplanten Route gehen: LLeMbas fragt OsmAnd, wo du bist und wohin die Route führt. Erlaube LLeMbas zuerst in OsmAnd (verbundene Apps, mit Standort); OsmAnd sagt Bescheid, wenn es nicht erlaubt ist.</string>
|
||||
<string name="phone_actions_line">Ein Modell kann anbieten, etwas auf diesem Telefon zu tun — einen Wecker stellen, einen Termin eintragen, eine Nachricht entwerfen, eine Route starten. Nichts passiert, bevor du auf seiner Karte auf Ausführen tippst, und nie bei gesperrtem Telefon. Google Maps startet eine Route mit ein paar Stopps, kann aber keinen in eine laufende Route einfügen und nicht angehalten werden; OsmAnd kann das.</string>
|
||||
<string name="assist_recogniser_failed">Die Spracherkennung des Telefons hat angehalten. Versuchen Sie es erneut oder wählen Sie LLeMbas unter Einstellungen › Spracheingabe.</string>
|
||||
<string name="assistant_listens">Beim Öffnen des Assistenten zuhören</string>
|
||||
<string name="voice_input">Spracheingabe</string>
|
||||
|
||||
@@ -427,6 +427,15 @@
|
||||
<string name="notification_access_on">Concedido. El interruptor de Android está en los ajustes del sistema.</string>
|
||||
<string name="notification_access_off">Aún no concedido. Toca para abrir el interruptor de Android para LLeMbas.</string>
|
||||
<string name="notification_summaries_privacy">Desactivado por defecto. Cuando lo pides, el texto de las notificaciones que hay ahora en tu teléfono (app, título, texto) va con esa única pregunta a tu instancia y su modelo. No se lee nada antes, la app no guarda nada y no se lee nada con el teléfono bloqueado. El acceso a notificaciones de Android permite a una app ver todas las notificaciones; darlo y retirarlo es cosa tuya.</string>
|
||||
<string name="nav_app">App de navegación</string>
|
||||
<string name="nav_app_auto">La que esté instalada</string>
|
||||
<string name="nav_app_google">Google Maps</string>
|
||||
<string name="nav_app_osmand">OsmAnd</string>
|
||||
<string name="nav_app_ask">Preguntar cada vez</string>
|
||||
<string name="nav_app_not_installed">No instalada</string>
|
||||
<string name="osmand_info">Preguntar a OsmAnd por la ruta</string>
|
||||
<string name="osmand_info_line">Permite «añadir una parada» y buscar cerca de ti con una ruta creada en el propio OsmAnd: LLeMbas pregunta a OsmAnd dónde estás y adónde va la ruta. Primero permite LLeMbas en OsmAnd (apps conectadas, con ubicación); OsmAnd te avisa si no está permitido.</string>
|
||||
<string name="phone_actions_line">Un modelo puede ofrecer hacer cosas en este teléfono: poner una alarma, añadir un evento, redactar un mensaje, iniciar una ruta. No pasa nada hasta que tocas Hacerlo en su tarjeta, y nunca con el teléfono bloqueado. Google Maps inicia una ruta con unas pocas paradas, pero no puede añadir una a una ruta en curso ni detenerse a petición; OsmAnd sí.</string>
|
||||
<string name="assist_recogniser_failed">El reconocimiento de voz del teléfono se detuvo. Inténtelo de nuevo o elija LLeMbas en Ajustes › Entrada de voz.</string>
|
||||
<string name="assistant_listens">Empezar a escuchar al abrir el asistente</string>
|
||||
<string name="voice_input">Entrada de voz</string>
|
||||
|
||||
@@ -427,6 +427,15 @@
|
||||
<string name="notification_access_on">Accordé. L’interrupteur d’Android est dans les paramètres du système.</string>
|
||||
<string name="notification_access_off">Pas encore accordé. Touchez pour ouvrir l’interrupteur d’Android pour LLeMbas.</string>
|
||||
<string name="notification_summaries_privacy">Désactivé par défaut. Quand vous le demandez, le texte des notifications présentes sur votre téléphone (app, titre, texte) part avec cette seule question vers votre instance et son modèle. Rien n’est lu avant, l’app n’en garde rien, et rien n’est lu téléphone verrouillé. L’accès aux notifications d’Android permet à une app de voir toutes les notifications : c’est à vous de l’accorder et de le retirer.</string>
|
||||
<string name="nav_app">App de navigation</string>
|
||||
<string name="nav_app_auto">Celle qui est installée</string>
|
||||
<string name="nav_app_google">Google Maps</string>
|
||||
<string name="nav_app_osmand">OsmAnd</string>
|
||||
<string name="nav_app_ask">Demander à chaque fois</string>
|
||||
<string name="nav_app_not_installed">Non installée</string>
|
||||
<string name="osmand_info">Demander l’itinéraire à OsmAnd</string>
|
||||
<string name="osmand_info_line">Permet « ajouter un arrêt » et la recherche à proximité avec un itinéraire créé dans OsmAnd même : LLeMbas demande à OsmAnd où vous êtes et où va l’itinéraire. Autorisez d’abord LLeMbas dans OsmAnd (apps connectées, avec la position) ; OsmAnd vous prévient sinon.</string>
|
||||
<string name="phone_actions_line">Un modèle peut proposer de faire des choses sur ce téléphone : régler une alarme, ajouter un événement, rédiger un message, lancer un itinéraire. Rien ne se passe tant que vous ne touchez pas Le faire sur sa carte, et jamais téléphone verrouillé. Google Maps lance un itinéraire avec quelques arrêts mais ne peut ni en ajouter à un itinéraire en cours ni être arrêté ; OsmAnd le peut.</string>
|
||||
<string name="assist_recogniser_failed">La reconnaissance vocale du téléphone s’est arrêtée. Réessayez, ou choisissez LLeMbas dans Réglages › Saisie vocale.</string>
|
||||
<string name="assistant_listens">Écouter dès l’ouverture de l’assistant</string>
|
||||
<string name="voice_input">Saisie vocale</string>
|
||||
|
||||
@@ -427,6 +427,15 @@
|
||||
<string name="notification_access_on">Megadva. Az Android kapcsolója a rendszerbeállításokban van.</string>
|
||||
<string name="notification_access_off">Még nincs megadva. Koppints az Android LLeMbas-kapcsolójának megnyitásához.</string>
|
||||
<string name="notification_summaries_privacy">Alapból ki van kapcsolva. Ha kéred, a telefonon éppen látható értesítések szövege (alkalmazás, cím, szöveg) ezzel az egy kérdéssel együtt a példányodhoz és a modelljéhez kerül. Előtte semmit nem olvas, az alkalmazás semmit nem tart meg, és zárolt telefonnál semmit nem olvas. Az Android értesítés-hozzáférése minden értesítést láthatóvá tesz egy alkalmazásnak, ezért rajtad múlik, megadod-e, és visszavonod-e.</string>
|
||||
<string name="nav_app">Navigációs alkalmazás</string>
|
||||
<string name="nav_app_auto">Amelyik telepítve van</string>
|
||||
<string name="nav_app_google">Google Térkép</string>
|
||||
<string name="nav_app_osmand">OsmAnd</string>
|
||||
<string name="nav_app_ask">Mindig kérdezzen</string>
|
||||
<string name="nav_app_not_installed">Nincs telepítve</string>
|
||||
<string name="osmand_info">Útvonal lekérdezése az OsmAndtól</string>
|
||||
<string name="osmand_info_line">Így a „megálló hozzáadása” és a közeli keresés az OsmAndban beállított útvonallal is működik: a LLeMbas megkérdezi az OsmAndot, hol vagy és hová tart az útvonal. Előbb engedélyezd a LLeMbast az OsmAndban (csatlakoztatott alkalmazások, helyadattal); az OsmAnd szól, ha nincs engedélyezve.</string>
|
||||
<string name="phone_actions_line">Egy modell felajánlhatja, hogy tesz valamit ezen a telefonon — ébresztőt állít, eseményt vesz fel, üzenetet fogalmaz, útvonalat indít. Semmi sem történik, amíg a kártyáján nem koppintasz a Mehet gombra, és zárolt telefonnál soha. A Google Térkép néhány megállós útvonalat indít, de futó útvonalhoz nem ad megállót és nem állítható le; az OsmAnd igen.</string>
|
||||
<string name="assist_recogniser_failed">A telefon beszédfelismerője leállt. Próbálja újra, vagy válassza a LLeMbast a Beállítások › Hangbevitel alatt.</string>
|
||||
<string name="assistant_listens">Hallgatás indítása az asszisztens megnyitásakor</string>
|
||||
<string name="voice_input">Hangbevitel</string>
|
||||
|
||||
@@ -427,6 +427,15 @@
|
||||
<string name="notification_access_on">Concesso. L’interruttore di Android è nelle impostazioni di sistema.</string>
|
||||
<string name="notification_access_off">Non ancora concesso. Tocca per aprire l’interruttore di Android per LLeMbas.</string>
|
||||
<string name="notification_summaries_privacy">Disattivato per impostazione predefinita. Quando lo chiedi, il testo delle notifiche presenti ora sul telefono (app, titolo, testo) va con quella sola domanda alla tua istanza e al suo modello. Prima non si legge nulla, l’app non conserva nulla e a telefono bloccato non si legge nulla. L’accesso alle notifiche di Android permette a un’app di vedere ogni notifica: concederlo e revocarlo spetta a te.</string>
|
||||
<string name="nav_app">App di navigazione</string>
|
||||
<string name="nav_app_auto">Quella installata</string>
|
||||
<string name="nav_app_google">Google Maps</string>
|
||||
<string name="nav_app_osmand">OsmAnd</string>
|
||||
<string name="nav_app_ask">Chiedi ogni volta</string>
|
||||
<string name="nav_app_not_installed">Non installata</string>
|
||||
<string name="osmand_info">Chiedi il percorso a OsmAnd</string>
|
||||
<string name="osmand_info_line">Permette «aggiungi una tappa» e la ricerca nelle vicinanze anche con un percorso impostato in OsmAnd: LLeMbas chiede a OsmAnd dove sei e dove va il percorso. Prima consenti LLeMbas in OsmAnd (app collegate, con posizione); OsmAnd ti avvisa se non è consentito.</string>
|
||||
<string name="phone_actions_line">Un modello può offrirsi di fare cose su questo telefono: impostare una sveglia, aggiungere un evento, preparare un messaggio, avviare un percorso. Non succede nulla finché non tocchi Fallo sulla sua scheda, e mai a telefono bloccato. Google Maps avvia un percorso con alcune tappe ma non può aggiungerne a un percorso in corso né essere fermato; OsmAnd sì.</string>
|
||||
<string name="assist_recogniser_failed">Il riconoscimento vocale del telefono si è fermato. Riprovi, oppure scelga LLeMbas in Impostazioni › Input vocale.</string>
|
||||
<string name="assistant_listens">Inizia ad ascoltare all’apertura dell’assistente</string>
|
||||
<string name="voice_input">Input vocale</string>
|
||||
|
||||
@@ -427,6 +427,15 @@
|
||||
<string name="notification_access_on">Przyznany. Przełącznik Androida jest w ustawieniach systemu.</string>
|
||||
<string name="notification_access_off">Jeszcze nie przyznany. Dotknij, aby otworzyć przełącznik Androida dla LLeMbas.</string>
|
||||
<string name="notification_summaries_privacy">Domyślnie wyłączone. Gdy poprosisz, tekst powiadomień, które są teraz na telefonie (aplikacja, tytuł, treść), trafi z tym jednym pytaniem do Twojej instancji i jej modelu. Wcześniej nic nie jest czytane, aplikacja niczego nie zachowuje i nic nie jest czytane przy zablokowanym telefonie. Dostęp do powiadomień w Androidzie pozwala aplikacji widzieć każde powiadomienie, więc to Ty decydujesz, czy go dać i odebrać.</string>
|
||||
<string name="nav_app">Aplikacja nawigacyjna</string>
|
||||
<string name="nav_app_auto">Ta, która jest zainstalowana</string>
|
||||
<string name="nav_app_google">Mapy Google</string>
|
||||
<string name="nav_app_osmand">OsmAnd</string>
|
||||
<string name="nav_app_ask">Pytaj za każdym razem</string>
|
||||
<string name="nav_app_not_installed">Nie zainstalowano</string>
|
||||
<string name="osmand_info">Pytaj OsmAnd o trasę</string>
|
||||
<string name="osmand_info_line">Pozwala „dodać przystanek” i szukać w pobliżu także przy trasie ustawionej w samym OsmAnd: LLeMbas pyta OsmAnd, gdzie jesteś i dokąd prowadzi trasa. Najpierw zezwól LLeMbas w OsmAnd (połączone aplikacje, z lokalizacją); OsmAnd poinformuje, jeśli nie ma zgody.</string>
|
||||
<string name="phone_actions_line">Model może zaproponować zrobienie czegoś na tym telefonie — ustawienie budzika, dodanie wydarzenia, szkic wiadomości, start trasy. Nic się nie dzieje, dopóki nie dotkniesz Zrób to na jego karcie, i nigdy przy zablokowanym telefonie. Mapy Google uruchomią trasę z kilkoma przystankami, ale nie dodadzą przystanku do trwającej trasy ani nie dadzą się zatrzymać; OsmAnd potrafi.</string>
|
||||
<string name="assist_recogniser_failed">Rozpoznawanie mowy w telefonie przestało działać. Spróbuj ponownie albo wybierz LLeMbas w Ustawienia › Wprowadzanie głosowe.</string>
|
||||
<string name="assistant_listens">Zacznij słuchać po otwarciu asystenta</string>
|
||||
<string name="voice_input">Wprowadzanie głosowe</string>
|
||||
|
||||
@@ -427,6 +427,15 @@
|
||||
<string name="notification_access_on">Udelený. Prepínač Androidu je v systémových nastaveniach.</string>
|
||||
<string name="notification_access_off">Zatiaľ neudelený. Ťuknutím otvoríte prepínač Androidu pre LLeMbas.</string>
|
||||
<string name="notification_summaries_privacy">Predvolene vypnuté. Keď požiadate, text oznámení, ktoré sú v telefóne práve teraz (aplikácia, názov, text), pôjde s touto jedinou otázkou na vašu inštanciu a jej model. Predtým sa nič nečíta, aplikácia si nič neponechá a pri zamknutom telefóne sa nečíta nič. Prístup k oznámeniam v Androide dovolí aplikácii vidieť každé oznámenie, preto je na vás, či ho dáte a znova vezmete.</string>
|
||||
<string name="nav_app">Navigačná aplikácia</string>
|
||||
<string name="nav_app_auto">Tá, ktorá je nainštalovaná</string>
|
||||
<string name="nav_app_google">Mapy Google</string>
|
||||
<string name="nav_app_osmand">OsmAnd</string>
|
||||
<string name="nav_app_ask">Zakaždým sa opýtať</string>
|
||||
<string name="nav_app_not_installed">Nie je nainštalovaná</string>
|
||||
<string name="osmand_info">Pýtať sa OsmAnd na trasu</string>
|
||||
<string name="osmand_info_line">Umožní „pridať zastávku“ a hľadanie v okolí aj pri trase nastavenej priamo v OsmAnd: LLeMbas sa OsmAnd opýta, kde ste a kam trasa vedie. Najprv LLeMbas povoľte v OsmAnd (pripojené aplikácie, s polohou); OsmAnd dá vedieť, ak povolené nie je.</string>
|
||||
<string name="phone_actions_line">Model môže ponúknuť, že v telefóne niečo urobí — nastaví budík, pridá udalosť, pripraví správu, spustí trasu. Nič sa nestane, kým neťuknete na Urobiť na jeho karte, a nikdy pri zamknutom telefóne. Mapy Google spustia trasu s niekoľkými zastávkami, ale do bežiacej trasy zastávku nepridajú ani sa nedajú zastaviť; OsmAnd to vie.</string>
|
||||
<string name="assist_recogniser_failed">Rozpoznávanie reči v telefóne sa zastavilo. Skúste to znova alebo zvoľte LLeMbas v Nastaveniach › Hlasový vstup.</string>
|
||||
<string name="assistant_listens">Začať počúvať, keď sa asistent otvorí</string>
|
||||
<string name="voice_input">Hlasový vstup</string>
|
||||
|
||||
@@ -429,6 +429,15 @@
|
||||
<string name="notification_access_on">Given. Android\'s switch for it is in the system\'s settings.</string>
|
||||
<string name="notification_access_off">Not given yet. Tap to open Android\'s switch for LLeMbas.</string>
|
||||
<string name="notification_summaries_privacy">Off by default. When you ask, the text of the notifications on your phone right now (app, title, text) goes with that one question to your instance and its model. Nothing is read before you ask, the app keeps none of it, and none is read while the phone is locked. Android\'s notification access lets an app see every notification, so it is yours to give and to take back.</string>
|
||||
<string name="nav_app">Navigation app</string>
|
||||
<string name="nav_app_auto">Whichever is installed</string>
|
||||
<string name="nav_app_google">Google Maps</string>
|
||||
<string name="nav_app_osmand">OsmAnd</string>
|
||||
<string name="nav_app_ask">Ask each time</string>
|
||||
<string name="nav_app_not_installed">Not installed</string>
|
||||
<string name="osmand_info">Ask OsmAnd about the route</string>
|
||||
<string name="osmand_info_line">Lets “add a stop” and searches near you work with a route you set up in OsmAnd itself: LLeMbas asks OsmAnd where you are and where the route goes. Allow LLeMbas in OsmAnd first (its connected apps, with Location); OsmAnd tells you if it is not allowed.</string>
|
||||
<string name="phone_actions_line">A model may offer to do things on this phone — set an alarm, add an event, draft a message, start a route. Nothing happens until you tap Do it on its card, and never while the phone is locked. Google Maps starts a route with a few stops but cannot add one to a route already running or be told to stop; OsmAnd can.</string>
|
||||
<string name="assist_recogniser_failed">The phone\'s speech recogniser stopped. Try again, or choose LLeMbas under Settings › Voice input.</string>
|
||||
<string name="assistant_listens">Start listening when the assistant opens</string>
|
||||
<string name="voice_input">Voice input</string>
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
package eu.llembas.android
|
||||
|
||||
import eu.llembas.android.actions.Args
|
||||
import eu.llembas.android.actions.NavApp
|
||||
import eu.llembas.android.actions.NavIntents
|
||||
import eu.llembas.android.actions.PhoneActions
|
||||
import eu.llembas.android.actions.Place
|
||||
import eu.llembas.android.api.LembasJson
|
||||
import kotlinx.serialization.json.jsonObject
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertFalse
|
||||
import org.junit.Assert.assertNull
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
|
||||
class PhoneActionsTest {
|
||||
private fun args(json: String) = Args(LembasJson.parseToJsonElement(json).jsonObject)
|
||||
|
||||
@Test
|
||||
fun placesAreReadLeniently() {
|
||||
val a = args("""{"destination": {"name": "Rivendell", "lat": "47.1", "lon": 8.5}, "stops": ["Bree", {"query": "inn"}], "hour": "7"}""")
|
||||
assertEquals(Place("Rivendell", 47.1, 8.5), a.place("destination"))
|
||||
assertEquals(listOf(Place(query = "Bree"), Place(query = "inn")), a.places("stops"))
|
||||
assertEquals(7, a.int("hour"))
|
||||
assertNull(a.place("missing"))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun theNavigationAppIsTheOneInstalledOrAsked() {
|
||||
val both = listOf(NavApp.GoogleMaps, NavApp.OsmAnd)
|
||||
assertEquals(NavApp.OsmAnd, NavApp.chosen("", listOf(NavApp.OsmAnd)))
|
||||
// Both installed and nothing chosen: the card asks.
|
||||
assertNull(NavApp.chosen("", both))
|
||||
assertEquals(NavApp.GoogleMaps, NavApp.chosen("google", both))
|
||||
assertNull(NavApp.chosen(NavApp.PREF_ASK, both))
|
||||
// Chosen but since uninstalled: the one there is.
|
||||
assertEquals(NavApp.GoogleMaps, NavApp.chosen("osmand", listOf(NavApp.GoogleMaps)))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun aRouteForOsmAndIsGpxWithItsPointsInOrder() {
|
||||
val gpx = NavIntents.gpx(listOf(Place("Bree & Co", 1.0, 2.0), Place("Rivendell", 3.0, 4.0)))
|
||||
assertTrue(gpx.contains("<rtept lat=\"1.0\" lon=\"2.0\"><name>Bree & Co</name></rtept><rtept lat=\"3.0\" lon=\"4.0\">"))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun aBroadcastNeverNamesASystemAction() {
|
||||
assertTrue(PhoneActions.broadcastAllowed("net.dinglisch.android.tasker.ACTION_TASK"))
|
||||
assertTrue(PhoneActions.broadcastAllowed("lembas.lights_off"))
|
||||
assertFalse(PhoneActions.broadcastAllowed("android.intent.action.BOOT_COMPLETED"))
|
||||
assertFalse(PhoneActions.broadcastAllowed("com.android.something"))
|
||||
assertFalse(PhoneActions.broadcastAllowed("has spaces"))
|
||||
}
|
||||
}
|
||||
@@ -363,6 +363,7 @@ object Fakes {
|
||||
selfUpdate = true,
|
||||
phoneRecognizer = true,
|
||||
wakeAvailable = true,
|
||||
navApps = listOf("google", "osmand"),
|
||||
)
|
||||
|
||||
// The assistant's sheet, as it opens and as it answers.
|
||||
|
||||
@@ -454,6 +454,15 @@ STRINGS: dict[str, str] = {
|
||||
"notification_access_on": "Given. Android's switch for it is in the system's settings.",
|
||||
"notification_access_off": "Not given yet. Tap to open Android's switch for LLeMbas.",
|
||||
"notification_summaries_privacy": "Off by default. When you ask, the text of the notifications on your phone right now (app, title, text) goes with that one question to your instance and its model. Nothing is read before you ask, the app keeps none of it, and none is read while the phone is locked. Android's notification access lets an app see every notification, so it is yours to give and to take back.",
|
||||
"nav_app": "Navigation app",
|
||||
"nav_app_auto": "Whichever is installed",
|
||||
"nav_app_google": "Google Maps",
|
||||
"nav_app_osmand": "OsmAnd",
|
||||
"nav_app_ask": "Ask each time",
|
||||
"nav_app_not_installed": "Not installed",
|
||||
"osmand_info": "Ask OsmAnd about the route",
|
||||
"osmand_info_line": "Lets “add a stop” and searches near you work with a route you set up in OsmAnd itself: LLeMbas asks OsmAnd where you are and where the route goes. Allow LLeMbas in OsmAnd first (its connected apps, with Location); OsmAnd tells you if it is not allowed.",
|
||||
"phone_actions_line": "A model may offer to do things on this phone — set an alarm, add an event, draft a message, start a route. Nothing happens until you tap Do it on its card, and never while the phone is locked. Google Maps starts a route with a few stops but cannot add one to a route already running or be told to stop; OsmAnd can.",
|
||||
"assist_recogniser_failed": "The phone's speech recogniser stopped. Try again, or choose LLeMbas under Settings › Voice input.",
|
||||
"assistant_listens": "Start listening when the assistant opens",
|
||||
"voice_input": "Voice input",
|
||||
|
||||
@@ -110,6 +110,12 @@
|
||||
"model_thinking_switchable": "Přemýšlení zapnout či vypnout",
|
||||
"model_uses_tools": "Používá nástroje",
|
||||
"more": "Více",
|
||||
"nav_app": "Navigační aplikace",
|
||||
"nav_app_ask": "Pokaždé se zeptat",
|
||||
"nav_app_auto": "Ta, která je nainstalovaná",
|
||||
"nav_app_google": "Mapy Google",
|
||||
"nav_app_not_installed": "Není nainstalovaná",
|
||||
"nav_app_osmand": "OsmAnd",
|
||||
"new_agent_chat": "Nová konverzace s agentem",
|
||||
"notification_access": "Přístup k oznámením",
|
||||
"notification_access_off": "Zatím neuděleno. Klepnutím otevřete přepínač Androidu pro LLeMbas.",
|
||||
@@ -125,7 +131,10 @@
|
||||
"notify_never": "Nedá vědět nikdy",
|
||||
"offline": "Instance není dostupná. Zkontrolujte připojení telefonu a to, zda se dostane na adresu instance.",
|
||||
"older": "Starší zprávy",
|
||||
"osmand_info": "Ptát se OsmAnd na trasu",
|
||||
"osmand_info_line": "Umožní „přidat zastávku“ a hledání v okolí i u trasy nastavené přímo v OsmAnd: LLeMbas se OsmAnd zeptá, kde jste a kam trasa vede. Nejdřív LLeMbas povolte v OsmAnd (připojené aplikace, s polohou); OsmAnd dá vědět, pokud povoleno není.",
|
||||
"output_cut": "Výstup je zde zkrácen. Celý ho najdete na webové stránce.",
|
||||
"phone_actions_line": "Model může nabídnout, že v telefonu něco udělá — nastaví budík, přidá událost, připraví zprávu, spustí trasu. Nic se nestane, dokud neklepnete na Provést na jeho kartě, a nikdy při zamčeném telefonu. Mapy Google spustí trasu s několika zastávkami, ale do běžící trasy zastávku nepřidají ani je nelze zastavit; OsmAnd to umí.",
|
||||
"plan_approve": "Schválit plán",
|
||||
"plan_carry_out": "Provést plán",
|
||||
"plan_first": "Nejdřív plán",
|
||||
@@ -377,6 +386,12 @@
|
||||
"model_thinking_switchable": "Nachdenken an oder aus",
|
||||
"model_uses_tools": "Nutzt Werkzeuge",
|
||||
"more": "Mehr",
|
||||
"nav_app": "Navigations-App",
|
||||
"nav_app_ask": "Jedes Mal fragen",
|
||||
"nav_app_auto": "Die installierte",
|
||||
"nav_app_google": "Google Maps",
|
||||
"nav_app_not_installed": "Nicht installiert",
|
||||
"nav_app_osmand": "OsmAnd",
|
||||
"new_agent_chat": "Neuer Agent-Chat",
|
||||
"notification_access": "Zugriff auf Benachrichtigungen",
|
||||
"notification_access_off": "Noch nicht erteilt. Tippe, um den Android-Schalter für LLeMbas zu öffnen.",
|
||||
@@ -392,7 +407,10 @@
|
||||
"notify_never": "Meldet sich nie",
|
||||
"offline": "Die Instanz ist nicht erreichbar. Prüfen Sie die Verbindung des Telefons und ob es die Adresse der Instanz erreicht.",
|
||||
"older": "Frühere Nachrichten",
|
||||
"osmand_info": "OsmAnd nach der Route fragen",
|
||||
"osmand_info_line": "Damit „Zwischenstopp hinzufügen“ und die Suche in der Nähe auch mit einer in OsmAnd geplanten Route gehen: LLeMbas fragt OsmAnd, wo du bist und wohin die Route führt. Erlaube LLeMbas zuerst in OsmAnd (verbundene Apps, mit Standort); OsmAnd sagt Bescheid, wenn es nicht erlaubt ist.",
|
||||
"output_cut": "Die Ausgabe ist hier verkürzt. Vollständig finden Sie sie auf der Webseite.",
|
||||
"phone_actions_line": "Ein Modell kann anbieten, etwas auf diesem Telefon zu tun — einen Wecker stellen, einen Termin eintragen, eine Nachricht entwerfen, eine Route starten. Nichts passiert, bevor du auf seiner Karte auf Ausführen tippst, und nie bei gesperrtem Telefon. Google Maps startet eine Route mit ein paar Stopps, kann aber keinen in eine laufende Route einfügen und nicht angehalten werden; OsmAnd kann das.",
|
||||
"plan_approve": "Plan bestätigen",
|
||||
"plan_carry_out": "Plan ausführen",
|
||||
"plan_first": "Erst planen",
|
||||
@@ -643,6 +661,12 @@
|
||||
"model_thinking_switchable": "Razonamiento sí o no",
|
||||
"model_uses_tools": "Usa herramientas",
|
||||
"more": "Más",
|
||||
"nav_app": "App de navegación",
|
||||
"nav_app_ask": "Preguntar cada vez",
|
||||
"nav_app_auto": "La que esté instalada",
|
||||
"nav_app_google": "Google Maps",
|
||||
"nav_app_not_installed": "No instalada",
|
||||
"nav_app_osmand": "OsmAnd",
|
||||
"new_agent_chat": "Nuevo chat de agente",
|
||||
"notification_access": "Acceso a notificaciones",
|
||||
"notification_access_off": "Aún no concedido. Toca para abrir el interruptor de Android para LLeMbas.",
|
||||
@@ -658,7 +682,10 @@
|
||||
"notify_never": "No avisa nunca",
|
||||
"offline": "No se puede acceder a la instancia. Compruebe la conexión del teléfono y que llegue a la dirección de la instancia.",
|
||||
"older": "Mensajes anteriores",
|
||||
"osmand_info": "Preguntar a OsmAnd por la ruta",
|
||||
"osmand_info_line": "Permite «añadir una parada» y buscar cerca de ti con una ruta creada en el propio OsmAnd: LLeMbas pregunta a OsmAnd dónde estás y adónde va la ruta. Primero permite LLeMbas en OsmAnd (apps conectadas, con ubicación); OsmAnd te avisa si no está permitido.",
|
||||
"output_cut": "La salida está acortada aquí. La tiene completa en la página web.",
|
||||
"phone_actions_line": "Un modelo puede ofrecer hacer cosas en este teléfono: poner una alarma, añadir un evento, redactar un mensaje, iniciar una ruta. No pasa nada hasta que tocas Hacerlo en su tarjeta, y nunca con el teléfono bloqueado. Google Maps inicia una ruta con unas pocas paradas, pero no puede añadir una a una ruta en curso ni detenerse a petición; OsmAnd sí.",
|
||||
"plan_approve": "Aprobar el plan",
|
||||
"plan_carry_out": "Llevar a cabo el plan",
|
||||
"plan_first": "Primero un plan",
|
||||
@@ -910,6 +937,12 @@
|
||||
"model_thinking_switchable": "Réflexion activable",
|
||||
"model_uses_tools": "Utilise des outils",
|
||||
"more": "Plus",
|
||||
"nav_app": "App de navigation",
|
||||
"nav_app_ask": "Demander à chaque fois",
|
||||
"nav_app_auto": "Celle qui est installée",
|
||||
"nav_app_google": "Google Maps",
|
||||
"nav_app_not_installed": "Non installée",
|
||||
"nav_app_osmand": "OsmAnd",
|
||||
"new_agent_chat": "Nouvelle conversation d'agent",
|
||||
"notification_access": "Accès aux notifications",
|
||||
"notification_access_off": "Pas encore accordé. Touchez pour ouvrir l’interrupteur d’Android pour LLeMbas.",
|
||||
@@ -925,7 +958,10 @@
|
||||
"notify_never": "Ne prévient jamais",
|
||||
"offline": "L'instance est injoignable. Vérifiez la connexion du téléphone et qu'il atteint bien l'adresse de l'instance.",
|
||||
"older": "Messages précédents",
|
||||
"osmand_info": "Demander l’itinéraire à OsmAnd",
|
||||
"osmand_info_line": "Permet « ajouter un arrêt » et la recherche à proximité avec un itinéraire créé dans OsmAnd même : LLeMbas demande à OsmAnd où vous êtes et où va l’itinéraire. Autorisez d’abord LLeMbas dans OsmAnd (apps connectées, avec la position) ; OsmAnd vous prévient sinon.",
|
||||
"output_cut": "La sortie est raccourcie ici. Vous la trouverez en entier sur la page web.",
|
||||
"phone_actions_line": "Un modèle peut proposer de faire des choses sur ce téléphone : régler une alarme, ajouter un événement, rédiger un message, lancer un itinéraire. Rien ne se passe tant que vous ne touchez pas Le faire sur sa carte, et jamais téléphone verrouillé. Google Maps lance un itinéraire avec quelques arrêts mais ne peut ni en ajouter à un itinéraire en cours ni être arrêté ; OsmAnd le peut.",
|
||||
"plan_approve": "Approuver le plan",
|
||||
"plan_carry_out": "Exécuter le plan",
|
||||
"plan_first": "D’abord un plan",
|
||||
@@ -1177,6 +1213,12 @@
|
||||
"model_thinking_switchable": "Gondolkodás be- vagy kikapcsolva",
|
||||
"model_uses_tools": "Eszközöket használ",
|
||||
"more": "Továbbiak",
|
||||
"nav_app": "Navigációs alkalmazás",
|
||||
"nav_app_ask": "Mindig kérdezzen",
|
||||
"nav_app_auto": "Amelyik telepítve van",
|
||||
"nav_app_google": "Google Térkép",
|
||||
"nav_app_not_installed": "Nincs telepítve",
|
||||
"nav_app_osmand": "OsmAnd",
|
||||
"new_agent_chat": "Új ügynök-csevegés",
|
||||
"notification_access": "Hozzáférés az értesítésekhez",
|
||||
"notification_access_off": "Még nincs megadva. Koppints az Android LLeMbas-kapcsolójának megnyitásához.",
|
||||
@@ -1192,7 +1234,10 @@
|
||||
"notify_never": "Soha nem szól",
|
||||
"offline": "A példány nem érhető el. Ellenőrizze a telefon kapcsolatát, és hogy eléri-e a példány címét.",
|
||||
"older": "Korábbi üzenetek",
|
||||
"osmand_info": "Útvonal lekérdezése az OsmAndtól",
|
||||
"osmand_info_line": "Így a „megálló hozzáadása” és a közeli keresés az OsmAndban beállított útvonallal is működik: a LLeMbas megkérdezi az OsmAndot, hol vagy és hová tart az útvonal. Előbb engedélyezd a LLeMbast az OsmAndban (csatlakoztatott alkalmazások, helyadattal); az OsmAnd szól, ha nincs engedélyezve.",
|
||||
"output_cut": "A kimenet itt lerövidítve jelenik meg. A teljes szöveg a weblapon található.",
|
||||
"phone_actions_line": "Egy modell felajánlhatja, hogy tesz valamit ezen a telefonon — ébresztőt állít, eseményt vesz fel, üzenetet fogalmaz, útvonalat indít. Semmi sem történik, amíg a kártyáján nem koppintasz a Mehet gombra, és zárolt telefonnál soha. A Google Térkép néhány megállós útvonalat indít, de futó útvonalhoz nem ad megállót és nem állítható le; az OsmAnd igen.",
|
||||
"plan_approve": "Terv jóváhagyása",
|
||||
"plan_carry_out": "Terv végrehajtása",
|
||||
"plan_first": "Előbb terv",
|
||||
@@ -1443,6 +1488,12 @@
|
||||
"model_thinking_switchable": "Ragionamento attivabile",
|
||||
"model_uses_tools": "Usa strumenti",
|
||||
"more": "Altro",
|
||||
"nav_app": "App di navigazione",
|
||||
"nav_app_ask": "Chiedi ogni volta",
|
||||
"nav_app_auto": "Quella installata",
|
||||
"nav_app_google": "Google Maps",
|
||||
"nav_app_not_installed": "Non installata",
|
||||
"nav_app_osmand": "OsmAnd",
|
||||
"new_agent_chat": "Nuova chat agente",
|
||||
"notification_access": "Accesso alle notifiche",
|
||||
"notification_access_off": "Non ancora concesso. Tocca per aprire l’interruttore di Android per LLeMbas.",
|
||||
@@ -1458,7 +1509,10 @@
|
||||
"notify_never": "Non avvisa mai",
|
||||
"offline": "L'istanza non è raggiungibile. Controlla la connessione del telefono e che raggiunga l'indirizzo dell'istanza.",
|
||||
"older": "Messaggi precedenti",
|
||||
"osmand_info": "Chiedi il percorso a OsmAnd",
|
||||
"osmand_info_line": "Permette «aggiungi una tappa» e la ricerca nelle vicinanze anche con un percorso impostato in OsmAnd: LLeMbas chiede a OsmAnd dove sei e dove va il percorso. Prima consenti LLeMbas in OsmAnd (app collegate, con posizione); OsmAnd ti avvisa se non è consentito.",
|
||||
"output_cut": "L'output qui è abbreviato. Lo trovi per intero sulla pagina web.",
|
||||
"phone_actions_line": "Un modello può offrirsi di fare cose su questo telefono: impostare una sveglia, aggiungere un evento, preparare un messaggio, avviare un percorso. Non succede nulla finché non tocchi Fallo sulla sua scheda, e mai a telefono bloccato. Google Maps avvia un percorso con alcune tappe ma non può aggiungerne a un percorso in corso né essere fermato; OsmAnd sì.",
|
||||
"plan_approve": "Approva il piano",
|
||||
"plan_carry_out": "Esegui il piano",
|
||||
"plan_first": "Prima un piano",
|
||||
@@ -1709,6 +1763,12 @@
|
||||
"model_thinking_switchable": "Myślenie włączane lub wyłączane",
|
||||
"model_uses_tools": "Używa narzędzi",
|
||||
"more": "Więcej",
|
||||
"nav_app": "Aplikacja nawigacyjna",
|
||||
"nav_app_ask": "Pytaj za każdym razem",
|
||||
"nav_app_auto": "Ta, która jest zainstalowana",
|
||||
"nav_app_google": "Mapy Google",
|
||||
"nav_app_not_installed": "Nie zainstalowano",
|
||||
"nav_app_osmand": "OsmAnd",
|
||||
"new_agent_chat": "Nowy czat agenta",
|
||||
"notification_access": "Dostęp do powiadomień",
|
||||
"notification_access_off": "Jeszcze nie przyznany. Dotknij, aby otworzyć przełącznik Androida dla LLeMbas.",
|
||||
@@ -1724,7 +1784,10 @@
|
||||
"notify_never": "Nigdy nie powiadamia",
|
||||
"offline": "Instancja jest nieosiągalna. Sprawdź połączenie telefonu i czy dociera on do adresu instancji.",
|
||||
"older": "Wcześniejsze wiadomości",
|
||||
"osmand_info": "Pytaj OsmAnd o trasę",
|
||||
"osmand_info_line": "Pozwala „dodać przystanek” i szukać w pobliżu także przy trasie ustawionej w samym OsmAnd: LLeMbas pyta OsmAnd, gdzie jesteś i dokąd prowadzi trasa. Najpierw zezwól LLeMbas w OsmAnd (połączone aplikacje, z lokalizacją); OsmAnd poinformuje, jeśli nie ma zgody.",
|
||||
"output_cut": "Wynik jest tu skrócony. Cały znajduje się na stronie internetowej.",
|
||||
"phone_actions_line": "Model może zaproponować zrobienie czegoś na tym telefonie — ustawienie budzika, dodanie wydarzenia, szkic wiadomości, start trasy. Nic się nie dzieje, dopóki nie dotkniesz Zrób to na jego karcie, i nigdy przy zablokowanym telefonie. Mapy Google uruchomią trasę z kilkoma przystankami, ale nie dodadzą przystanku do trwającej trasy ani nie dadzą się zatrzymać; OsmAnd potrafi.",
|
||||
"plan_approve": "Zatwierdź plan",
|
||||
"plan_carry_out": "Wykonaj plan",
|
||||
"plan_first": "Najpierw plan",
|
||||
@@ -1975,6 +2038,12 @@
|
||||
"model_thinking_switchable": "Premýšľanie zapnúť alebo vypnúť",
|
||||
"model_uses_tools": "Používa nástroje",
|
||||
"more": "Viac",
|
||||
"nav_app": "Navigačná aplikácia",
|
||||
"nav_app_ask": "Zakaždým sa opýtať",
|
||||
"nav_app_auto": "Tá, ktorá je nainštalovaná",
|
||||
"nav_app_google": "Mapy Google",
|
||||
"nav_app_not_installed": "Nie je nainštalovaná",
|
||||
"nav_app_osmand": "OsmAnd",
|
||||
"new_agent_chat": "Nová konverzácia s agentom",
|
||||
"notification_access": "Prístup k oznámeniam",
|
||||
"notification_access_off": "Zatiaľ neudelený. Ťuknutím otvoríte prepínač Androidu pre LLeMbas.",
|
||||
@@ -1990,7 +2059,10 @@
|
||||
"notify_never": "Nedá vedieť nikdy",
|
||||
"offline": "Inštancia nie je dostupná. Skontrolujte pripojenie telefónu a či sa dostane na adresu inštancie.",
|
||||
"older": "Staršie správy",
|
||||
"osmand_info": "Pýtať sa OsmAnd na trasu",
|
||||
"osmand_info_line": "Umožní „pridať zastávku“ a hľadanie v okolí aj pri trase nastavenej priamo v OsmAnd: LLeMbas sa OsmAnd opýta, kde ste a kam trasa vedie. Najprv LLeMbas povoľte v OsmAnd (pripojené aplikácie, s polohou); OsmAnd dá vedieť, ak povolené nie je.",
|
||||
"output_cut": "Výstup je tu skrátený. Celý nájdete na webovej stránke.",
|
||||
"phone_actions_line": "Model môže ponúknuť, že v telefóne niečo urobí — nastaví budík, pridá udalosť, pripraví správu, spustí trasu. Nič sa nestane, kým neťuknete na Urobiť na jeho karte, a nikdy pri zamknutom telefóne. Mapy Google spustia trasu s niekoľkými zastávkami, ale do bežiacej trasy zastávku nepridajú ani sa nedajú zastaviť; OsmAnd to vie.",
|
||||
"plan_approve": "Schváliť plán",
|
||||
"plan_carry_out": "Vykonať plán",
|
||||
"plan_first": "Najprv plán",
|
||||
|
||||
Reference in new issue
Block a user