Loading app/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/AccountSettingsFragment.kt +10 −1 Original line number Diff line number Diff line Loading @@ -101,8 +101,17 @@ class AccountSettingsFragment : PreferenceFragmentCompat(), ConfirmationDialogFr val account = getAccount() initializeCryptoSettings(account) // Don't update the notification preferences when resuming after the user has selected a new notification sound // via NotificationSoundPreference. Otherwise we race the background thread and might read data from the old // NotificationChannel, overwriting the notification sound with the previous value. notificationSoundPreference?.let { notificationSoundPreference -> if (notificationSoundPreference.receivedActivityResultJustNow) { notificationSoundPreference.receivedActivityResultJustNow = false } else { maybeUpdateNotificationPreferences(account) } } } override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) { super.onCreateOptionsMenu(menu, inflater) Loading app/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/NotificationSoundPreference.kt +2 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ constructor( ), defStyleRes: Int = 0 ) : Preference(context, attrs, defStyleAttr, defStyleRes), PreferenceActivityResultListener { var receivedActivityResultJustNow = false fun setNotificationSound(sound: Uri?) { persistRingtone(sound) Loading @@ -42,6 +43,7 @@ constructor( val uri = data?.getParcelableExtra<Uri>(RingtoneManager.EXTRA_RINGTONE_PICKED_URI) if (callChangeListener(uri?.toString().orEmpty())) { receivedActivityResultJustNow = true persistRingtone(uri) } } Loading Loading
app/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/AccountSettingsFragment.kt +10 −1 Original line number Diff line number Diff line Loading @@ -101,8 +101,17 @@ class AccountSettingsFragment : PreferenceFragmentCompat(), ConfirmationDialogFr val account = getAccount() initializeCryptoSettings(account) // Don't update the notification preferences when resuming after the user has selected a new notification sound // via NotificationSoundPreference. Otherwise we race the background thread and might read data from the old // NotificationChannel, overwriting the notification sound with the previous value. notificationSoundPreference?.let { notificationSoundPreference -> if (notificationSoundPreference.receivedActivityResultJustNow) { notificationSoundPreference.receivedActivityResultJustNow = false } else { maybeUpdateNotificationPreferences(account) } } } override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) { super.onCreateOptionsMenu(menu, inflater) Loading
app/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/NotificationSoundPreference.kt +2 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ constructor( ), defStyleRes: Int = 0 ) : Preference(context, attrs, defStyleAttr, defStyleRes), PreferenceActivityResultListener { var receivedActivityResultJustNow = false fun setNotificationSound(sound: Uri?) { persistRingtone(sound) Loading @@ -42,6 +43,7 @@ constructor( val uri = data?.getParcelableExtra<Uri>(RingtoneManager.EXTRA_RINGTONE_PICKED_URI) if (callChangeListener(uri?.toString().orEmpty())) { receivedActivityResultJustNow = true persistRingtone(uri) } } Loading