bug fixes for android auto

This commit is contained in:
2026-05-16 21:05:34 -07:00
parent 5ea7442c7c
commit 85740b399b
3 changed files with 59 additions and 14 deletions
+10 -6
View File
@@ -13,13 +13,16 @@ import 'streaming_audio_business_object.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
tz.initializeTimeZones();
unawaited(StreamingAudioBusinessObject.initializeBackgroundAudio());
await SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitUp,
DeviceOrientation.portraitDown,
]);
runApp(const MyApp());
// Keep startup non-blocking so UI can render even if background media
// services are initializing after an Android Auto cold start.
unawaited(
SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitUp,
DeviceOrientation.portraitDown,
]),
);
}
class MyApp extends StatefulWidget {
@@ -36,6 +39,7 @@ class _MyAppState extends State<MyApp> {
@override
void initState() {
super.initState();
unawaited(_audio.ensureInitialized());
_casting.initialize();
}