Skip to content

Commit f94d0d3

Browse files
committed
Merge branch 'jan-milovanovic-minor' into minor
2 parents e3abd9b + c62d77d commit f94d0d3

File tree

8 files changed

+45
-13
lines changed

8 files changed

+45
-13
lines changed

audio_service/CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 0.18.15
2+
3+
* Add deep link support for FlutterFragmentActivity (@jan-milovanovic).
4+
* Fix JDK 21 compile error.
5+
16
## 0.18.14
27

38
* Support rxdart 0.28.x.

audio_service/android/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
group 'com.ryanheise.audioservice'
22
version '1.0-SNAPSHOT'
3-
def args = ["-Xlint:deprecation","-Xlint:unchecked","-Werror"]
3+
def args = ["-Xlint:deprecation","-Xlint:unchecked"]
44

55
buildscript {
66
repositories {

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

+12
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,16 @@ protected String getCachedEngineId() {
3333
public boolean shouldDestroyEngineWithHost() {
3434
return false;
3535
}
36+
37+
// Make this protected method public
38+
@Override
39+
public String getInitialRoute() {
40+
return super.getInitialRoute();
41+
}
42+
43+
// Make this protected method public
44+
@Override
45+
public boolean shouldHandleDeeplinking() {
46+
return super.shouldHandleDeeplinking();
47+
}
3648
}

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

+15
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import java.util.concurrent.Executors;
3838

3939
import io.flutter.embedding.android.FlutterActivity;
40+
import io.flutter.embedding.android.FlutterFragmentActivity;
4041
import io.flutter.embedding.engine.plugins.FlutterPlugin;
4142
import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding;
4243
import io.flutter.embedding.engine.plugins.activity.ActivityAware;
@@ -87,6 +88,20 @@ public static synchronized FlutterEngine getFlutterEngine(Context context) {
8788
}
8889
}
8990
}
91+
} else if (context instanceof AudioServiceFragmentActivity) {
92+
final AudioServiceFragmentActivity activity = (AudioServiceFragmentActivity)context;
93+
initialRoute = activity.getInitialRoute();
94+
if (initialRoute == null) {
95+
if (activity.shouldHandleDeeplinking()) {
96+
Uri data = activity.getIntent().getData();
97+
if (data != null) {
98+
initialRoute = data.getPath();
99+
if (data.getQuery() != null && !data.getQuery().isEmpty()) {
100+
initialRoute += "?" + data.getQuery();
101+
}
102+
}
103+
}
104+
}
90105
}
91106
if (initialRoute == null) {
92107
initialRoute = "/";

audio_service/example/android/app/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
2626

2727
android {
2828
namespace 'com.ryanheise.audioserviceexample'
29-
compileSdkVersion 33
29+
compileSdkVersion 34
3030

3131
lintOptions {
3232
disable 'InvalidPackage'
@@ -35,7 +35,7 @@ android {
3535
defaultConfig {
3636
applicationId "com.ryanheise.audioserviceexample"
3737
minSdkVersion 21
38-
targetSdkVersion 33
38+
targetSdkVersion 34
3939
versionCode flutterVersionCode.toInteger()
4040
versionName flutterVersionName
4141
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
<uses-permission android:name="android.permission.INTERNET"/>
66
<uses-permission android:name="android.permission.WAKE_LOCK"/>
77
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
8-
<!-- If targeting SDK 34 -->
9-
<!-- <uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK"/> -->
8+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK"/>
109

1110
<!-- For example_android_songs example -->
1211
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

audio_service/example/android/build.gradle

+8-7
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,6 @@ allprojects {
1414
google()
1515
mavenCentral()
1616
}
17-
18-
gradle.projectsEvaluated {
19-
tasks.withType(JavaCompile) {
20-
options.compilerArgs << "-Xlint:deprecation"
21-
options.compilerArgs << "-Xlint:unchecked"
22-
}
23-
}
2417
}
2518

2619
rootProject.buildDir = '../build'
@@ -34,3 +27,11 @@ subprojects {
3427
tasks.register("clean", Delete) {
3528
delete rootProject.buildDir
3629
}
30+
31+
gradle.projectsEvaluated {
32+
project(":audio_service") {
33+
tasks.withType(JavaCompile) {
34+
options.compilerArgs << "-Werror"
35+
}
36+
}
37+
}

audio_service/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: audio_service
22
description: Flutter plugin to play audio in the background while the screen is off.
3-
version: 0.18.14
3+
version: 0.18.15
44
repository: https://github.com/ryanheise/audio_service/tree/minor/audio_service
55
issue_tracker: https://github.com/ryanheise/audio_service/issues
66
topics:

0 commit comments

Comments
 (0)