From 92d7940f56ee233e6eda33d1d5cec2408b689dde Mon Sep 17 00:00:00 2001 From: Seb3thehacker Date: Fri, 9 Oct 2026 13:50:40 -0700 Subject: [PATCH] car apps: let hosted apps start their own location service, fixing MapQuest Since Android 14, an app bound by a visible host may start a foreground service only if the host binds it with BIND_ALLOW_ACTIVITY_STARTS. Without it, MapQuest crashed as navigation began, and Flitsmeister and Vela ran their services without location. MapQuest now gets the working check. --- .../app/seb3thehacker/gearslip/host/CarAppConnection.kt | 7 ++++++- .../main/java/app/seb3thehacker/gearslip/host/KnownApps.kt | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gearslip/src/main/java/app/seb3thehacker/gearslip/host/CarAppConnection.kt b/gearslip/src/main/java/app/seb3thehacker/gearslip/host/CarAppConnection.kt index d13c3e8..1521f64 100644 --- a/gearslip/src/main/java/app/seb3thehacker/gearslip/host/CarAppConnection.kt +++ b/gearslip/src/main/java/app/seb3thehacker/gearslip/host/CarAppConnection.kt @@ -9,6 +9,7 @@ import android.content.res.Configuration import android.graphics.Rect import android.location.Location import android.net.Uri +import android.os.Build import android.os.Handler import android.os.IBinder import android.os.Looper @@ -139,7 +140,11 @@ class CarAppConnection(private val context: Context) { // Replaced by another connect (or a disconnect) while waiting on the location service. if (binding !== connection) return@bind var bindError: Throwable? = null - val flags = Context.BIND_AUTO_CREATE or LocationKeepAlive.BIND_INCLUDE_CAPABILITIES + // BIND_ALLOW_ACTIVITY_STARTS lets the app start its own location service while + // Gearslip's car window is showing. Since Android 14 a bound app only inherits that + // from a visible host that opts in, and MapQuest crashes as navigation starts without it. + val flags = Context.BIND_AUTO_CREATE or LocationKeepAlive.BIND_INCLUDE_CAPABILITIES or + (if (Build.VERSION.SDK_INT >= 34) Context.BIND_ALLOW_ACTIVITY_STARTS else 0) val bound = runCatching { // Without BIND_FOREGROUND_SERVICE, an app bound by a foreground service (which is // all Gearslip is once the phone screen leaves it) only reaches "important diff --git a/gearslip/src/main/java/app/seb3thehacker/gearslip/host/KnownApps.kt b/gearslip/src/main/java/app/seb3thehacker/gearslip/host/KnownApps.kt index 79caa60..7e03a49 100644 --- a/gearslip/src/main/java/app/seb3thehacker/gearslip/host/KnownApps.kt +++ b/gearslip/src/main/java/app/seb3thehacker/gearslip/host/KnownApps.kt @@ -18,6 +18,7 @@ object KnownApps { "com.vivi.vivimusic", // Vivi Music: browse, play, seek, works well "com.metrolist.music", // Metrolist: browse, play, works "nl.flitsmeister", // Flitsmeister: map, routing, alerts - works well + "com.mapquest.android.ace", // MapQuest: map, routing, navigation ) fun works(packageName: String): Boolean = packageName in working