mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-19 08:09:12 +01:00
Fix notification profile overrides.
This commit is contained in:
committed by
jeffrey-signal
parent
df6d446e83
commit
e1454cfc6a
@@ -1031,7 +1031,7 @@ class MainActivity : PassphraseRequiredActivity(), VoiceNoteMediaControllerOwner
|
||||
}
|
||||
|
||||
private fun updateNotificationProfileStatus(notificationProfiles: List<NotificationProfile>) {
|
||||
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<ViewGroup>(android.R.id.content)
|
||||
|
||||
@@ -27,7 +27,7 @@ object NotificationProfiles {
|
||||
|
||||
@JvmStatic
|
||||
@JvmOverloads
|
||||
fun getActiveProfile(profiles: List<NotificationProfile>, now: Long = System.currentTimeMillis(), zoneId: ZoneId = ZoneId.systemDefault()): NotificationProfile? {
|
||||
fun getActiveProfile(profiles: List<NotificationProfile>, 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()
|
||||
|
||||
Reference in New Issue
Block a user