shorter code

This commit is contained in:
Benoit Marty 2022-06-02 15:25:54 +02:00 committed by Benoit Marty
parent 639c570150
commit 87087197e5

View File

@ -236,14 +236,11 @@ class UnifiedPushHelper @Inject constructor(
} }
fun getCurrentDistributorName(): String { fun getCurrentDistributorName(): String {
if (isEmbeddedDistributor()) { return when {
return stringProvider.getString(R.string.unifiedpush_distributor_fcm_fallback) isEmbeddedDistributor() -> stringProvider.getString(R.string.unifiedpush_distributor_fcm_fallback)
isBackgroundSync() -> stringProvider.getString(R.string.unifiedpush_distributor_background_sync)
else -> context.getApplicationLabel(up.getDistributor(context))
} }
if (isBackgroundSync()) {
return stringProvider.getString(R.string.unifiedpush_distributor_background_sync)
}
val distributor = up.getDistributor(context)
return context.getApplicationLabel(distributor)
} }
fun isEmbeddedDistributor(): Boolean { fun isEmbeddedDistributor(): Boolean {