Close projection-launched app on exit#89
Conversation
|
Hi @ptuchik — thanks for a genuinely well-crafted PR. The daemon protocol extension, the marshalling tests and the restore fallback all follow the codebase conventions closely, and the problem you describe is real. After walking through how the steering-wheel star is actually used on this head unit, we've decided not to take the change — let me explain the workflow it would break. The cluster is not touchable. Building or changing a route can only be done on the tablet (main display). So the star works as a display toggle, not an "exit":
Why the origin heuristic misfires here: cluster projection is typically started by an automation right when the car starts, when nothing else is running yet — so the Navigator task is virtually always classified as If auto-close is valuable for your use case (map-only driving where a route is never built), we think the meaningful close signal is not who launched the task but whether route guidance is active: a task with live guidance must never be removed, while a map-only session is disposable. It would also need to be opt-in behind a setting, since the default star semantics must stay "move between displays". If that matches how you drive, feel free to open an issue and we can design it on that basis. Thanks again — the |
|
Thanks for detailed and explanatory answer, but it would kill the task only if it was launched via button, so if the user wants to play with routes or navigation, he can open from tablet and then the full behavior will be as previously. Anyways if he wants to set some destination and route a navigation he must do multiple touches on tablet and so just one more touch to open app on tablet would not be a problem, but in case he wants just see the map on cluster then close, with this PR he could start with button and stop with button. Anyways, thanks for review! |
What changed
Why
launchAndForce()automatically launches a missing projection target, but the projection manager previously retained only the package name. On exit it therefore always moved the task to display 0, even when BYDMate had launched the app solely for projection.The manager now records the task origin before projection and applies the matching exit behavior without force-stopping the package.
User impact
Validation
./gradlew :app:testDebugUnitTest :app:lintDebug --stacktracegit diff --checkPhysical validation on a DiLink 5.0 head unit is still recommended because
ActivityTaskManager.removeTask()is a private/vendor-dependent path. The implementation safely restores the task to the tablet if removal is unavailable.