car: Waze gets the cards taken out of its stable area too, and the areas each app is given go in the log

This commit is contained in:
Seb3thehacker committed 2026-10-26 23:44:53 -07:00
1 parent bcde51ad56
commit 57803988d4
2 files changed
+4 -1

No files matched your search

@@ -134,7 +134,9 @@ private fun AppSurface(
LaunchedEffect(template, size, measured, measuredStable, cardsAtEnd) {
if (width > 0 && height > 0) {
val visible = visibleAreaFor(template, width, height, measured, cardsAtEnd)
val stable = if (!isContentTemplate(template)) {
// Waze seems to centre its car in the stable area rather than the visible one, so it
// gets the cards taken out of that too. Test: see whether its car moves out from under them.
val stable = if (!isContentTemplate(template) && connection.appPackage != "com.waze") {
visibleAreaFor(template, width, height, measuredStable, cardsAtEnd)
} else {
visible
@@ -600,6 +600,7 @@ class CarAppConnection(private val context: Context) {
fun reportAreas(visible: Rect, stable: Rect) {
areas = visible to stable
val callback = surfaceCallback ?: return
GearslipLog.i("host: areas for $appPackage: visible=${visible.toShortString()} stable=${stable.toShortString()}")
runCatching { callback.onStableAreaChanged(stable, noop("onStableAreaChanged")) }
runCatching { callback.onVisibleAreaChanged(visible, noop("onVisibleAreaChanged")) }
}