Target SDK 34 (#7075)

This commit is contained in:
ByteHamster 2024-04-09 22:33:52 +02:00 committed by GitHub
parent bd4e9e19d7
commit d9e84f8c38
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 19 additions and 15 deletions

View File

@ -28,9 +28,6 @@
android:name="android.hardware.touchscreen" android:name="android.hardware.touchscreen"
android:required="false"/> android:required="false"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<application <application
android:name="de.danoeh.antennapod.PodcastApp" android:name="de.danoeh.antennapod.PodcastApp"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher"

View File

@ -1,5 +1,5 @@
buildscript { buildscript {
ext.agpVersion = "8.0.2" ext.agpVersion = "8.1.1"
} }
plugins { plugins {
id 'com.android.application' version "$agpVersion" apply false id 'com.android.application' version "$agpVersion" apply false
@ -36,7 +36,7 @@ project.ext {
//Tests //Tests
awaitilityVersion = "3.1.6" awaitilityVersion = "3.1.6"
junitVersion = "4.13" junitVersion = "4.13"
robolectricVersion = "4.9" robolectricVersion = "4.11"
espressoVersion = "3.5.0" espressoVersion = "3.5.0"
runnerVersion = "1.5.0" runnerVersion = "1.5.0"
rulesVersion = "1.5.0" rulesVersion = "1.5.0"

View File

@ -1,9 +1,9 @@
android { android {
compileSdk 33 compileSdk 34
defaultConfig { defaultConfig {
minSdk 21 minSdk 21
targetSdk 33 targetSdk 34
vectorDrawables.useSupportLibrary true vectorDrawables.useSupportLibrary true
vectorDrawables.generatedDensities = [] vectorDrawables.generatedDensities = []

View File

@ -11,6 +11,7 @@
<uses-permission android:name="android.permission.BLUETOOTH" /> <uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.VIBRATE" /> <uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" /> <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK" />
<application <application
android:allowBackup="true" android:allowBackup="true"

View File

@ -12,6 +12,7 @@ import android.util.Log;
import android.util.Pair; import android.util.Pair;
import android.view.SurfaceHolder; import android.view.SurfaceHolder;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.core.content.ContextCompat;
import de.danoeh.antennapod.storage.database.DBReader; import de.danoeh.antennapod.storage.database.DBReader;
import de.danoeh.antennapod.storage.database.DBWriter; import de.danoeh.antennapod.storage.database.DBWriter;
import de.danoeh.antennapod.event.playback.PlaybackPositionEvent; import de.danoeh.antennapod.event.playback.PlaybackPositionEvent;
@ -83,10 +84,10 @@ public abstract class PlaybackController {
} }
initialized = true; initialized = true;
activity.registerReceiver(statusUpdate, new IntentFilter( ContextCompat.registerReceiver(activity, statusUpdate, new IntentFilter(
PlaybackService.ACTION_PLAYER_STATUS_CHANGED)); PlaybackService.ACTION_PLAYER_STATUS_CHANGED), ContextCompat.RECEIVER_NOT_EXPORTED);
activity.registerReceiver(notificationReceiver, new IntentFilter( ContextCompat.registerReceiver(activity, notificationReceiver, new IntentFilter(
PlaybackServiceInterface.ACTION_PLAYER_NOTIFICATION)); PlaybackServiceInterface.ACTION_PLAYER_NOTIFICATION), ContextCompat.RECEIVER_NOT_EXPORTED);
if (!released) { if (!released) {
bindToService(); bindToService();

View File

@ -228,9 +228,12 @@ public class PlaybackService extends MediaBrowserServiceCompat {
stateManager = new PlaybackServiceStateManager(this); stateManager = new PlaybackServiceStateManager(this);
notificationBuilder = new PlaybackServiceNotificationBuilder(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(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(bluetoothStateUpdated, new IntentFilter(BluetoothA2dp.ACTION_CONNECTION_STATE_CHANGED));
registerReceiver(audioBecomingNoisy, new IntentFilter(AudioManager.ACTION_AUDIO_BECOMING_NOISY)); registerReceiver(audioBecomingNoisy, new IntentFilter(AudioManager.ACTION_AUDIO_BECOMING_NOISY));
EventBus.getDefault().register(this); EventBus.getDefault().register(this);
@ -1609,8 +1612,10 @@ public class PlaybackService extends MediaBrowserServiceCompat {
@Override @Override
public void onReceive(Context context, Intent intent) { public void onReceive(Context context, Intent intent) {
if (TextUtils.equals(intent.getAction(), PlaybackServiceInterface.ACTION_SHUTDOWN_PLAYBACK_SERVICE)) { if (TextUtils.equals(intent.getAction(), PlaybackServiceInterface.ACTION_SHUTDOWN_PLAYBACK_SERVICE)) {
EventBus.getDefault().post(new PlaybackServiceEvent(PlaybackServiceEvent.Action.SERVICE_SHUT_DOWN));
stateManager.stopService(); stateManager.stopService();
PlaybackPreferences.writeNoMediaPlaying();
EventBus.getDefault().post(new PlaybackServiceEvent(PlaybackServiceEvent.Action.SERVICE_SHUT_DOWN));
EventBus.getDefault().post(new PlayerStatusEvent());
} }
} }

View File

@ -8,7 +8,7 @@ android {
namespace "de.danoeh.antennapod.ui.echo" namespace "de.danoeh.antennapod.ui.echo"
lint { lint {
disable "AppBundleLocaleChanges" disable "AppBundleLocaleChanges", "MissingQuantity"
} }
} }