summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorByteHamster <ByteHamster@users.noreply.github.com>2024-04-09 22:33:52 +0200
committerGitHub <noreply@github.com>2024-04-09 22:33:52 +0200
commitd9e84f8c38d9f867074713618d90a765ef6db995 (patch)
tree2bd7673309f49c8b032869b1e91e4e13338def51
parentbd4e9e19d732de045260fcd7fd2870421f0a4d19 (diff)
downloadAntennaPod-d9e84f8c38d9f867074713618d90a765ef6db995.zip
Target SDK 34 (#7075)
-rw-r--r--app/src/main/AndroidManifest.xml3
-rw-r--r--build.gradle4
-rw-r--r--common.gradle4
-rw-r--r--playback/service/src/main/AndroidManifest.xml1
-rw-r--r--playback/service/src/main/java/de/danoeh/antennapod/playback/service/PlaybackController.java9
-rw-r--r--playback/service/src/main/java/de/danoeh/antennapod/playback/service/PlaybackService.java11
-rw-r--r--ui/echo/build.gradle2
7 files changed, 19 insertions, 15 deletions
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 81b809c89..9b0415a5e 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -28,9 +28,6 @@
android:name="android.hardware.touchscreen"
android:required="false"/>
- <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
- <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
-
<application
android:name="de.danoeh.antennapod.PodcastApp"
android:icon="@mipmap/ic_launcher"
diff --git a/build.gradle b/build.gradle
index 52e53093c..1e9c6e946 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,5 +1,5 @@
buildscript {
- ext.agpVersion = "8.0.2"
+ ext.agpVersion = "8.1.1"
}
plugins {
id 'com.android.application' version "$agpVersion" apply false
@@ -36,7 +36,7 @@ project.ext {
//Tests
awaitilityVersion = "3.1.6"
junitVersion = "4.13"
- robolectricVersion = "4.9"
+ robolectricVersion = "4.11"
espressoVersion = "3.5.0"
runnerVersion = "1.5.0"
rulesVersion = "1.5.0"
diff --git a/common.gradle b/common.gradle
index 3018807c8..512527bcf 100644
--- a/common.gradle
+++ b/common.gradle
@@ -1,9 +1,9 @@
android {
- compileSdk 33
+ compileSdk 34
defaultConfig {
minSdk 21
- targetSdk 33
+ targetSdk 34
vectorDrawables.useSupportLibrary true
vectorDrawables.generatedDensities = []
diff --git a/playback/service/src/main/AndroidManifest.xml b/playback/service/src/main/AndroidManifest.xml
index 62ab1094e..d5aa49978 100644
--- a/playback/service/src/main/AndroidManifest.xml
+++ b/playback/service/src/main/AndroidManifest.xml
@@ -11,6 +11,7 @@
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
+ <uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK" />
<application
android:allowBackup="true"
diff --git a/playback/service/src/main/java/de/danoeh/antennapod/playback/service/PlaybackController.java b/playback/service/src/main/java/de/danoeh/antennapod/playback/service/PlaybackController.java
index cfd494ba2..4a6ebbad2 100644
--- a/playback/service/src/main/java/de/danoeh/antennapod/playback/service/PlaybackController.java
+++ b/playback/service/src/main/java/de/danoeh/antennapod/playback/service/PlaybackController.java
@@ -12,6 +12,7 @@ import android.util.Log;
import android.util.Pair;
import android.view.SurfaceHolder;
import androidx.annotation.NonNull;
+import androidx.core.content.ContextCompat;
import de.danoeh.antennapod.storage.database.DBReader;
import de.danoeh.antennapod.storage.database.DBWriter;
import de.danoeh.antennapod.event.playback.PlaybackPositionEvent;
@@ -83,10 +84,10 @@ public abstract class PlaybackController {
}
initialized = true;
- activity.registerReceiver(statusUpdate, new IntentFilter(
- PlaybackService.ACTION_PLAYER_STATUS_CHANGED));
- activity.registerReceiver(notificationReceiver, new IntentFilter(
- PlaybackServiceInterface.ACTION_PLAYER_NOTIFICATION));
+ ContextCompat.registerReceiver(activity, statusUpdate, new IntentFilter(
+ PlaybackService.ACTION_PLAYER_STATUS_CHANGED), ContextCompat.RECEIVER_NOT_EXPORTED);
+ ContextCompat.registerReceiver(activity, notificationReceiver, new IntentFilter(
+ PlaybackServiceInterface.ACTION_PLAYER_NOTIFICATION), ContextCompat.RECEIVER_NOT_EXPORTED);
if (!released) {
bindToService();
diff --git a/playback/service/src/main/java/de/danoeh/antennapod/playback/service/PlaybackService.java b/playback/service/src/main/java/de/danoeh/antennapod/playback/service/PlaybackService.java
index 0f3d06b00..7f213a598 100644
--- a/playback/service/src/main/java/de/danoeh/antennapod/playback/service/PlaybackService.java
+++ b/playback/service/src/main/java/de/danoeh/antennapod/playback/service/PlaybackService.java
@@ -228,9 +228,12 @@ public class PlaybackService extends MediaBrowserServiceCompat {
stateManager = new PlaybackServiceStateManager(this);
notificationBuilder = new PlaybackServiceNotificationBuilder(this);
- registerReceiver(autoStateUpdated, new IntentFilter("com.google.android.gms.car.media.STATUS"));
+ ContextCompat.registerReceiver(this, autoStateUpdated,
+ new IntentFilter("com.google.android.gms.car.media.STATUS"), ContextCompat.RECEIVER_EXPORTED);
+ ContextCompat.registerReceiver(this, shutdownReceiver,
+ new IntentFilter(PlaybackServiceInterface.ACTION_SHUTDOWN_PLAYBACK_SERVICE),
+ ContextCompat.RECEIVER_NOT_EXPORTED);
registerReceiver(headsetDisconnected, new IntentFilter(Intent.ACTION_HEADSET_PLUG));
- registerReceiver(shutdownReceiver, new IntentFilter(PlaybackServiceInterface.ACTION_SHUTDOWN_PLAYBACK_SERVICE));
registerReceiver(bluetoothStateUpdated, new IntentFilter(BluetoothA2dp.ACTION_CONNECTION_STATE_CHANGED));
registerReceiver(audioBecomingNoisy, new IntentFilter(AudioManager.ACTION_AUDIO_BECOMING_NOISY));
EventBus.getDefault().register(this);
@@ -1609,8 +1612,10 @@ public class PlaybackService extends MediaBrowserServiceCompat {
@Override
public void onReceive(Context context, Intent intent) {
if (TextUtils.equals(intent.getAction(), PlaybackServiceInterface.ACTION_SHUTDOWN_PLAYBACK_SERVICE)) {
- EventBus.getDefault().post(new PlaybackServiceEvent(PlaybackServiceEvent.Action.SERVICE_SHUT_DOWN));
stateManager.stopService();
+ PlaybackPreferences.writeNoMediaPlaying();
+ EventBus.getDefault().post(new PlaybackServiceEvent(PlaybackServiceEvent.Action.SERVICE_SHUT_DOWN));
+ EventBus.getDefault().post(new PlayerStatusEvent());
}
}
diff --git a/ui/echo/build.gradle b/ui/echo/build.gradle
index e5626a380..847164448 100644
--- a/ui/echo/build.gradle
+++ b/ui/echo/build.gradle
@@ -8,7 +8,7 @@ android {
namespace "de.danoeh.antennapod.ui.echo"
lint {
- disable "AppBundleLocaleChanges"
+ disable "AppBundleLocaleChanges", "MissingQuantity"
}
}