Init notification channels before opening notification settings

This commit is contained in:
xynngh 2020-11-03 00:09:20 +04:00
parent fb1029ee71
commit f816f2637d
2 changed files with 3 additions and 1 deletions

View File

@ -297,7 +297,7 @@ public class NotificationHelper {
ReviewsActivity.getNumberIntent(context, numberInfo.number)));
}
private static void initNotificationChannels(Context context) {
public static void initNotificationChannels(Context context) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) return;
if (notificationChannelsInitialized) return;

View File

@ -172,6 +172,8 @@ public class RootSettingsFragment extends BaseSettingsFragment {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
requirePreference(PREF_NOTIFICATION_CHANNEL_SETTINGS)
.setOnPreferenceClickListener(preference -> {
NotificationHelper.initNotificationChannels(requireContext());
Intent intent = new Intent(
android.provider.Settings.ACTION_APP_NOTIFICATION_SETTINGS);
intent.putExtra(android.provider.Settings.EXTRA_APP_PACKAGE,