Skip to content

Commit d73c37a

Browse files
committed
Fix cache bug in AudioServiceFragmentActivity (@Mordtimer).
1 parent 670c94f commit d73c37a

4 files changed

Lines changed: 31 additions & 3 deletions

File tree

audio_service/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
## 0.18.9
22

3+
* Fix cache bug in AudioServiceFragmentActivity (@Mordtimer).
34
* Add Android Auto manifest entry for example app (@ColinSchmale).
45

56
## 0.18.8

audio_service/android/src/main/java/com/ryanheise/audioservice/AudioServiceFragmentActivity.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22

33
import android.content.Context;
44

5+
import android.os.Bundle;
56
import androidx.annotation.NonNull;
67

8+
import androidx.annotation.Nullable;
79
import io.flutter.embedding.android.FlutterFragmentActivity;
810
import io.flutter.embedding.engine.FlutterEngine;
911

@@ -13,6 +15,12 @@ public FlutterEngine provideFlutterEngine(@NonNull Context context) {
1315
return AudioServicePlugin.getFlutterEngine(context);
1416
}
1517

18+
@Override
19+
protected void onCreate(@Nullable Bundle savedInstanceState) {
20+
AudioServicePlugin.getFlutterEngine(this);
21+
super.onCreate(savedInstanceState);
22+
}
23+
1624
@Override
1725
protected String getCachedEngineId() {
1826
AudioServicePlugin.getFlutterEngine(this);

audio_service/example/android/app/src/main/AndroidManifest.xml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,25 @@
1111

1212
<application
1313
android:label="Audio Service Demo"
14+
android:name="${applicationName}"
1415
android:icon="@mipmap/ic_launcher">
1516
<activity
1617
android:name="com.ryanheise.audioservice.AudioServiceActivity"
18+
android:exported="true"
1719
android:launchMode="singleTop"
1820
android:theme="@style/LaunchTheme"
1921
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density"
2022
android:hardwareAccelerated="true"
2123
android:windowSoftInputMode="adjustResize"
22-
android:exported="true"
2324
tools:ignore="Instantiatable">
25+
<!-- Specifies an Android theme to apply to this Activity as soon as
26+
the Android process has started. This theme is visible to the user
27+
while the Flutter UI initializes. After that, this theme continues
28+
to determine the Window background behind the Flutter UI. -->
29+
<meta-data
30+
android:name="io.flutter.embedding.android.NormalTheme"
31+
android:resource="@style/NormalTheme"
32+
/>
2433
<intent-filter>
2534
<action android:name="android.intent.action.MAIN"/>
2635
<category android:name="android.intent.category.LAUNCHER"/>
Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<resources>
3-
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
3+
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
4+
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
45
<!-- Show a splash screen on the activity. Automatically removed when
5-
Flutter draws its first frame -->
6+
the Flutter engine draws its first frame -->
67
<item name="android:windowBackground">@drawable/launch_background</item>
78
</style>
9+
<!-- Theme applied to the Android Window as soon as the process has started.
10+
This theme determines the color of the Android Window while your
11+
Flutter UI initializes, as well as behind your Flutter UI while its
12+
running.
13+
14+
This Theme is only used starting with V2 of Flutter's Android embedding. -->
15+
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
16+
<item name="android:windowBackground">?android:colorBackground</item>
17+
</style>
818
</resources>

0 commit comments

Comments
 (0)