diff --git a/app/src/main/java/org/thoughtcrime/securesms/MainActivity.kt b/app/src/main/java/org/thoughtcrime/securesms/MainActivity.kt index 64244e32b5..814a2d010b 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/MainActivity.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/MainActivity.kt @@ -1031,7 +1031,7 @@ class MainActivity : PassphraseRequiredActivity(), VoiceNoteMediaControllerOwner } private fun updateNotificationProfileStatus(notificationProfiles: List) { - val activeProfile = NotificationProfiles.getActiveProfile(notificationProfiles) + val activeProfile = NotificationProfiles.getActiveProfile(profiles = notificationProfiles, shouldSync = true) if (activeProfile != null) { if (activeProfile.id != SignalStore.notificationProfile.lastProfilePopup) { val view = findViewById(android.R.id.content) diff --git a/app/src/main/java/org/thoughtcrime/securesms/notifications/profiles/NotificationProfiles.kt b/app/src/main/java/org/thoughtcrime/securesms/notifications/profiles/NotificationProfiles.kt index e6d782bd4f..81d9e9c7d3 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/notifications/profiles/NotificationProfiles.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/notifications/profiles/NotificationProfiles.kt @@ -27,7 +27,7 @@ object NotificationProfiles { @JvmStatic @JvmOverloads - fun getActiveProfile(profiles: List, now: Long = System.currentTimeMillis(), zoneId: ZoneId = ZoneId.systemDefault()): NotificationProfile? { + fun getActiveProfile(profiles: List, now: Long = System.currentTimeMillis(), zoneId: ZoneId = ZoneId.systemDefault(), shouldSync: Boolean = false): NotificationProfile? { val storeValues: NotificationProfileValues = SignalStore.notificationProfile val localNow: LocalDateTime = now.toLocalDateTime(zoneId) @@ -41,7 +41,7 @@ object NotificationProfiles { profile.schedule.startDateTime(localNow).toMillis(zoneId.toOffset()) > storeValues.manuallyDisabledAt } - if (shouldClearManualOverride(manualProfile, scheduledProfile)) { + if (shouldSync && shouldClearManualOverride(manualProfile, scheduledProfile)) { SignalExecutors.UNBOUNDED.execute { SignalDatabase.recipients.markNeedsSync(Recipient.self().id) StorageSyncHelper.scheduleSyncForDataChange()