diff options
4 files changed, 14 insertions, 9 deletions
diff --git a/app/src/androidTest/java/de/test/antennapod/playback/PlaybackTest.java b/app/src/androidTest/java/de/test/antennapod/playback/PlaybackTest.java index 2ab2361d7..67a660ae1 100644 --- a/app/src/androidTest/java/de/test/antennapod/playback/PlaybackTest.java +++ b/app/src/androidTest/java/de/test/antennapod/playback/PlaybackTest.java @@ -223,10 +223,6 @@ public class PlaybackTest { startLocalPlayback(); } - protected MainActivity getActivity() { - return activityTestRule.getActivity(); - } - protected void setContinuousPlaybackPreference(boolean value) { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); prefs.edit().putBoolean(UserPreferences.PREF_FOLLOW_QUEUE, value).commit(); diff --git a/app/src/androidTest/java/de/test/antennapod/ui/PreferencesTest.java b/app/src/androidTest/java/de/test/antennapod/ui/PreferencesTest.java index 74414240f..902cad98c 100644 --- a/app/src/androidTest/java/de/test/antennapod/ui/PreferencesTest.java +++ b/app/src/androidTest/java/de/test/antennapod/ui/PreferencesTest.java @@ -35,7 +35,9 @@ import de.test.antennapod.EspressoTestUtils; import static androidx.test.espresso.Espresso.onData; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.action.ViewActions.closeSoftKeyboard; import static androidx.test.espresso.action.ViewActions.replaceText; +import static androidx.test.espresso.action.ViewActions.scrollTo; import static androidx.test.espresso.action.ViewActions.swipeDown; import static androidx.test.espresso.action.ViewActions.swipeUp; import static androidx.test.espresso.assertion.ViewAssertions.doesNotExist; @@ -302,6 +304,7 @@ public class PreferencesTest { clickPreference(R.string.pref_parallel_downloads_title); onView(isRoot()).perform(waitForView(withClassName(endsWith("EditText")), 1000)); onView(withClassName(endsWith("EditText"))).perform(replaceText("10")); + onView(withClassName(endsWith("EditText"))).perform(closeSoftKeyboard()); onView(withText(android.R.string.ok)).perform(click()); Awaitility.await().atMost(1000, MILLISECONDS) .until(() -> UserPreferences.getParallelDownloads() == 10); @@ -391,7 +394,7 @@ public class PreferencesTest { clickPreference(R.string.network_pref); onView(withText(R.string.pref_automatic_download_title)).perform(click()); onView(withText(R.string.pref_episode_cleanup_title)).perform(click()); - onView(isRoot()).perform(waitForView(withText(R.string.episode_cleanup_except_favorite_removal), 1000)); + onView(withId(R.id.select_dialog_listview)).perform(swipeDown()); onView(withText(R.string.episode_cleanup_except_favorite_removal)).perform(click()); Awaitility.await().atMost(1000, MILLISECONDS) .until(() -> UserPreferences.getEpisodeCleanupAlgorithm() instanceof ExceptFavoriteCleanupAlgorithm); @@ -402,7 +405,7 @@ public class PreferencesTest { clickPreference(R.string.network_pref); onView(withText(R.string.pref_automatic_download_title)).perform(click()); onView(withText(R.string.pref_episode_cleanup_title)).perform(click()); - onView(isRoot()).perform(waitForView(withText(R.string.episode_cleanup_queue_removal), 1000)); + onView(withId(R.id.select_dialog_listview)).perform(swipeDown()); onView(withText(R.string.episode_cleanup_queue_removal)).perform(click()); Awaitility.await().atMost(1000, MILLISECONDS) .until(() -> UserPreferences.getEpisodeCleanupAlgorithm() instanceof APQueueCleanupAlgorithm); @@ -424,7 +427,7 @@ public class PreferencesTest { clickPreference(R.string.network_pref); onView(withText(R.string.pref_automatic_download_title)).perform(click()); onView(withText(R.string.pref_episode_cleanup_title)).perform(click()); - onView(isRoot()).perform(waitForView(withText(R.string.episode_cleanup_after_listening), 1000)); + onView(withId(R.id.select_dialog_listview)).perform(swipeUp()); onView(withText(R.string.episode_cleanup_after_listening)).perform(click()); Awaitility.await().atMost(1000, MILLISECONDS) .until(() -> { @@ -443,7 +446,7 @@ public class PreferencesTest { clickPreference(R.string.pref_automatic_download_title); clickPreference(R.string.pref_episode_cleanup_title); String search = res.getQuantityString(R.plurals.episode_cleanup_days_after_listening, 3, 3); - onView(isRoot()).perform(waitForView(withText(search), 1000)); + onView(withText(search)).perform(scrollTo()); onView(withText(search)).perform(click()); Awaitility.await().atMost(1000, MILLISECONDS) .until(() -> { diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java index 0daa6b483..db6088d8d 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java @@ -730,6 +730,7 @@ public class LocalPSMP extends PlaybackServiceMediaPlayer { } mediaPlayer.release(); mediaPlayer = null; + playerStatus = PlayerStatus.STOPPED; } isShutDown = true; executor.shutdown(); @@ -836,6 +837,7 @@ public class LocalPSMP extends PlaybackServiceMediaPlayer { } if (media == null) { mediaPlayer = null; + playerStatus = PlayerStatus.STOPPED; return; } diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/playback/AudioPlayer.java b/core/src/main/java/de/danoeh/antennapod/core/util/playback/AudioPlayer.java index c948d98a3..d9f5811e2 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/playback/AudioPlayer.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/playback/AudioPlayer.java @@ -38,7 +38,11 @@ public class AudioPlayer extends MediaPlayer implements IPlayer { @Override public void setPlaybackParams(float speed, boolean skipSilence) { if (canSetSpeed()) { - setPlaybackSpeed(speed); + try { + setPlaybackSpeed(speed); + } catch (Exception e) { + e.printStackTrace(); + } } //Default player does not support silence skipping } |