mirror of
https://github.com/ProtonMail/android-mail.git
synced 2026-05-15 09:50:40 +00:00
Address 'getCurrentIconData returns enabled icon' flakiness
NOJIRA
This commit is contained in:
committed by
MargeBot
parent
120c56f578
commit
1e854fe0c3
+2
-2
@@ -38,7 +38,7 @@ internal class AppIconManager @Inject constructor(
|
||||
private val notificationManagerCompatProxy: NotificationManagerCompatProxy
|
||||
) {
|
||||
|
||||
val currentIconData by lazy { MutableStateFlow(getCurrentIconData()) }
|
||||
private val currentIconState by lazy { MutableStateFlow(getCurrentIconData()) }
|
||||
|
||||
fun setNewAppIcon(desiredAppIcon: AppIconData) {
|
||||
// Dismiss all notifications
|
||||
@@ -62,7 +62,7 @@ internal class AppIconManager @Inject constructor(
|
||||
PackageManager.DONT_KILL_APP
|
||||
)
|
||||
|
||||
currentIconData.value = desiredAppIcon
|
||||
currentIconState.value = desiredAppIcon
|
||||
createLaunchIntent.invalidateCache()
|
||||
}
|
||||
|
||||
|
||||
+1
-2
@@ -29,7 +29,6 @@ import io.mockk.just
|
||||
import io.mockk.mockk
|
||||
import io.mockk.runs
|
||||
import io.mockk.verify
|
||||
import kotlinx.coroutines.flow.first
|
||||
import kotlinx.coroutines.test.runTest
|
||||
import org.junit.runner.RunWith
|
||||
import org.robolectric.RobolectricTestRunner
|
||||
@@ -88,7 +87,7 @@ internal class AppIconManagerTest {
|
||||
appIconManager.setNewAppIcon(NEW_ICON)
|
||||
|
||||
// Then
|
||||
val updatedIcon = appIconManager.currentIconData.first()
|
||||
val updatedIcon = appIconManager.getCurrentIconData()
|
||||
assert(updatedIcon == NEW_ICON)
|
||||
verify { mockNotificationManager.dismissAllNotifications() }
|
||||
verify { mockCreateLaunchIntent.invalidateCache() }
|
||||
|
||||
Reference in New Issue
Block a user