Lazily initialize NotificationChannels.

This commit is contained in:
Greyson Parrelli
2022-11-16 19:08:50 -05:00
committed by Cody Henthorne
parent 3e8b5ca91d
commit 81c10a1eae
24 changed files with 251 additions and 227 deletions

View File

@@ -705,7 +705,7 @@ public class ConversationParentFragment extends Fragment
onRecipientChanged(recipientSnapshot);
titleView.setTitle(glideRequests, recipientSnapshot);
NotificationChannels.updateContactChannelName(requireContext(), recipientSnapshot);
NotificationChannels.getInstance().updateContactChannelName(recipientSnapshot);
setBlockedUserState(recipientSnapshot, viewModel.getConversationStateSnapshot().getSecurityInfo());
invalidateOptionsMenu();
break;

View File

@@ -184,7 +184,7 @@ public final class EnableCallNotificationSettingsDialog extends DialogFragment {
}
private void showNotificationChannelSettings() {
NotificationChannels.openChannelSettings(requireContext(), NotificationChannels.CALLS, null);
NotificationChannels.getInstance().openChannelSettings(NotificationChannels.CALLS, null);
}
private void showAppSettings() {
@@ -194,7 +194,7 @@ public final class EnableCallNotificationSettingsDialog extends DialogFragment {
}
private static boolean areNotificationsDisabled(@NonNull Context context) {
return !NotificationChannels.areNotificationsEnabled(context);
return !NotificationChannels.getInstance().areNotificationsEnabled();
}
private static boolean areCallNotificationsDisabled(Context context) {
@@ -202,7 +202,7 @@ public final class EnableCallNotificationSettingsDialog extends DialogFragment {
}
private static boolean isCallChannelInvalid(Context context) {
return !NotificationChannels.isCallsChannelValid(context);
return !NotificationChannels.getInstance().isCallsChannelValid();
}
private static boolean isBackgroundRestricted(Context context) {