mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
fix(auto): clean up imports and simplify CarAppService
Agent-Logs-Url: https://github.com/meshtastic/Meshtastic-Android/sessions/571f7a66-0c36-43f2-890e-c8ed87ec7164 Co-authored-by: garthvh <1795163+garthvh@users.noreply.github.com>
This commit is contained in:
parent
c018ca6066
commit
e2700b26aa
3 changed files with 9 additions and 23 deletions
|
|
@ -16,8 +16,6 @@
|
|||
*/
|
||||
package org.meshtastic.app.auto
|
||||
|
||||
import android.content.Intent
|
||||
import android.content.pm.ApplicationInfo
|
||||
import androidx.car.app.CarAppService
|
||||
import androidx.car.app.Session
|
||||
import androidx.car.app.SessionInfo
|
||||
|
|
@ -31,24 +29,13 @@ import androidx.car.app.validation.HostValidator
|
|||
*/
|
||||
class MeshtasticCarAppService : CarAppService() {
|
||||
|
||||
override fun createHostValidator(): HostValidator {
|
||||
return if (applicationInfo.flags and ApplicationInfo.FLAG_DEBUGGABLE != 0) {
|
||||
HostValidator.ALLOW_ALL_HOSTS_VALIDATOR
|
||||
} else {
|
||||
HostValidator.ALLOW_ALL_HOSTS_VALIDATOR
|
||||
}
|
||||
}
|
||||
override fun createHostValidator(): HostValidator =
|
||||
HostValidator.ALLOW_ALL_HOSTS_VALIDATOR
|
||||
|
||||
override fun onCreateSession(sessionInfo: SessionInfo): Session {
|
||||
return MeshtasticCarSession()
|
||||
}
|
||||
override fun onCreateSession(sessionInfo: SessionInfo): Session =
|
||||
MeshtasticCarSession()
|
||||
|
||||
@Suppress("DEPRECATION", "OVERRIDE_DEPRECATION")
|
||||
override fun onCreateSession(): Session {
|
||||
return MeshtasticCarSession()
|
||||
}
|
||||
|
||||
override fun onNewIntent(intent: Intent) {
|
||||
super.onNewIntent(intent)
|
||||
}
|
||||
override fun onCreateSession(): Session =
|
||||
MeshtasticCarSession()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ package org.meshtastic.app.auto
|
|||
import androidx.car.app.CarContext
|
||||
import androidx.car.app.Screen
|
||||
import androidx.car.app.model.Action
|
||||
import androidx.car.app.model.CarIcon
|
||||
import androidx.car.app.model.ItemList
|
||||
import androidx.car.app.model.ListTemplate
|
||||
import androidx.car.app.model.Row
|
||||
|
|
@ -172,7 +171,7 @@ class MeshtasticCarScreen(carContext: CarContext) :
|
|||
}
|
||||
|
||||
private fun buildStatusSection(): ItemList {
|
||||
val statusText = when (val state = connectionState) {
|
||||
val statusText = when (connectionState) {
|
||||
is ConnectionState.Connected -> "Connected"
|
||||
is ConnectionState.Disconnected -> "Disconnected"
|
||||
is ConnectionState.DeviceSleep -> "Device Sleeping"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue