Commit f140bb2
committed
Sync with risin42/NagramX@ec956e3: align Android Auto with androidx.car.app:1.7.0
Aligns the Android Auto code path with the androidx.car.app:app:1.7.0
contract that the rest of the codebase already assumes. Combines the
transitive dependency and manifest pieces from DrKLO/Telegram#2008 with
the MediaPlayerService/MediaSession integration that risin42 added in
ec956e3 ("fix: Android Auto support", co-authored by rainman74).
The AndroidX media-compat artifact androidx.media:media:1.7.0 keeps its
classes under the legacy android.support.v4.media.* package for binary
compatibility reasons - the import migration to androidx.media.* is
NOT applied here (it would reference non-existent classes). Only the
new transitive dependency is added; existing android.support.v4.media.*
imports are left as-is.
Build
- add androidx.media:media:1.7.0 (AndroidX media session)
- add androidx.lifecycle:lifecycle-runtime:2.7.0 (DefaultLifecycleObserver)
Manifest / config
- uncomment the CarAppService <meta-data> + <service> block in
AndroidManifest.xml; bump minCarApiLevel 5 -> 7 (required by
ConversationItem @RequiresCarApi(7))
- automotive_app_desc.xml: add <uses name="media"/> for the new
CarAppService media category; keep notification and template
Code
- HomeScreen: ensure Person always carries a key, which the 1.7.x
ConversationItem.validateSender() requires. Applied locally to the
senderBuilder.setName("") branch in buildCarMessage, matching the
upstream intent without touching the surrounding code (NagramX has
a richer DefaultLifecycleObserver + NotificationCenter pipeline
than the upstream).
- MusicPlayerService: after every mediaSession.setPlaybackState() and
mediaSession.setMetadata(), also publish the same state / metadata
to TelegramMediaSession so the MediaBrowserService is in sync with
the phone player. On onDestroy, publish STATE_STOPPED if nothing is
playing. Without this, the Android Auto media surface had no view of
what the phone player was doing.
- TelegramMediaSession.publishPlaybackState: merge getAvailableActions()
(skip next/prev, set shuffle, etc.) into the state before publishing,
so Android Auto renders the full action set.
NagramX-specific context
- NagramX already ships androidx.car.app:app:1.7.0 and
app-projected:1.7.0; the dependency swap itself is a no-op in this
repo - only the two missing transitive dependencies are added.
- Final diff against dev: 6 files, 26 insertions(+), 13 deletions(-).
Refs: DrKLO/Telegram#2008
risin42@ec956e391 parent ee899ef commit f140bb2
6 files changed
Lines changed: 25 additions & 11 deletions
File tree
- TMessagesProj
- src/main
- java/org/telegram/messenger
- car
- res/xml
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
| 212 | + | |
| 213 | + | |
212 | 214 | | |
213 | 215 | | |
214 | 216 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
879 | 879 | | |
880 | 880 | | |
881 | 881 | | |
882 | | - | |
883 | 882 | | |
884 | 883 | | |
885 | 884 | | |
| |||
895 | 894 | | |
896 | 895 | | |
897 | 896 | | |
898 | | - | |
899 | | - | |
| 897 | + | |
900 | 898 | | |
901 | 899 | | |
902 | 900 | | |
| |||
Lines changed: 14 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
527 | 527 | | |
528 | 528 | | |
529 | 529 | | |
530 | | - | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
531 | 533 | | |
532 | 534 | | |
533 | 535 | | |
| |||
541 | 543 | | |
542 | 544 | | |
543 | 545 | | |
| 546 | + | |
544 | 547 | | |
545 | 548 | | |
546 | 549 | | |
| |||
750 | 753 | | |
751 | 754 | | |
752 | 755 | | |
753 | | - | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
754 | 759 | | |
755 | 760 | | |
756 | 761 | | |
| |||
823 | 828 | | |
824 | 829 | | |
825 | 830 | | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
826 | 837 | | |
827 | 838 | | |
828 | 839 | | |
| |||
873 | 884 | | |
874 | 885 | | |
875 | 886 | | |
876 | | - | |
| 887 | + | |
Lines changed: 6 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
402 | 402 | | |
403 | 403 | | |
404 | 404 | | |
405 | | - | |
| 405 | + | |
406 | 406 | | |
407 | 407 | | |
408 | 408 | | |
| |||
436 | 436 | | |
437 | 437 | | |
438 | 438 | | |
439 | | - | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
440 | 442 | | |
441 | 443 | | |
442 | 444 | | |
| |||
618 | 620 | | |
619 | 621 | | |
620 | 622 | | |
621 | | - | |
| 623 | + | |
622 | 624 | | |
623 | 625 | | |
624 | 626 | | |
625 | 627 | | |
626 | | - | |
| 628 | + | |
627 | 629 | | |
628 | 630 | | |
629 | 631 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
268 | 268 | | |
269 | 269 | | |
270 | 270 | | |
271 | | - | |
| 271 | + | |
272 | 272 | | |
273 | 273 | | |
274 | 274 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
0 commit comments