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 e18c9ca16..a47019c02 100644 --- a/app/src/androidTest/java/de/test/antennapod/ui/PreferencesTest.java +++ b/app/src/androidTest/java/de/test/antennapod/ui/PreferencesTest.java @@ -110,8 +110,8 @@ public class PreferencesTest extends ActivityInstrumentationTestCase2 UserPreferences.showRewindOnCompactNotification(), Timeout.getLargeTimeout())); - assertTrue(solo.waitForCondition(() -> UserPreferences.showFastForwardOnCompactNotification(), Timeout.getLargeTimeout())); + assertTrue(solo.waitForCondition(UserPreferences::showRewindOnCompactNotification, Timeout.getLargeTimeout())); + assertTrue(solo.waitForCondition(UserPreferences::showFastForwardOnCompactNotification, Timeout.getLargeTimeout())); assertTrue(solo.waitForCondition(() -> !UserPreferences.showSkipOnCompactNotification(), Timeout.getLargeTimeout())); } @@ -134,7 +134,7 @@ public class PreferencesTest extends ActivityInstrumentationTestCase2 UserPreferences.isPauseOnHeadsetDisconnect(), Timeout.getLargeTimeout())); + assertTrue(solo.waitForCondition(UserPreferences::isPauseOnHeadsetDisconnect, Timeout.getLargeTimeout())); } final boolean unpauseOnHeadsetReconnect = UserPreferences.isUnpauseOnHeadsetReconnect(); solo.clickOnText(solo.getString(R.string.pref_unpauseOnHeadsetReconnect_title)); @@ -146,7 +146,7 @@ public class PreferencesTest extends ActivityInstrumentationTestCase2 UserPreferences.isPauseOnHeadsetDisconnect(), Timeout.getLargeTimeout())); + assertTrue(solo.waitForCondition(UserPreferences::isPauseOnHeadsetDisconnect, Timeout.getLargeTimeout())); } final boolean unpauseOnBluetoothReconnect = UserPreferences.isUnpauseOnBluetoothReconnect(); solo.clickOnText(solo.getString(R.string.pref_unpauseOnBluetoothReconnect_title)); diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java index c600501c0..5fd6600bf 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java @@ -910,7 +910,7 @@ public class PlaybackService extends MediaBrowserServiceCompat { taskManager.setSleepTimer(waitingTime, shakeToReset, vibrate); sendNotificationBroadcast(NOTIFICATION_TYPE_SLEEPTIMER_UPDATE, 0); EventBus.getDefault().post(new MessageEvent(getString(R.string.sleep_timer_enabled_label), - () -> disableSleepTimer())); + this::disableSleepTimer)); } public void disableSleepTimer() {