mirror of
https://gitlab.com/xynngh/YetAnotherCallBlocker.git
synced 2025-02-11 01:00:48 +01:00
Init notification channels before opening notification settings
This commit is contained in:
parent
fb1029ee71
commit
f816f2637d
@ -297,7 +297,7 @@ public class NotificationHelper {
|
|||||||
ReviewsActivity.getNumberIntent(context, numberInfo.number)));
|
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 (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) return;
|
||||||
|
|
||||||
if (notificationChannelsInitialized) return;
|
if (notificationChannelsInitialized) return;
|
||||||
|
@ -172,6 +172,8 @@ public class RootSettingsFragment extends BaseSettingsFragment {
|
|||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
requirePreference(PREF_NOTIFICATION_CHANNEL_SETTINGS)
|
requirePreference(PREF_NOTIFICATION_CHANNEL_SETTINGS)
|
||||||
.setOnPreferenceClickListener(preference -> {
|
.setOnPreferenceClickListener(preference -> {
|
||||||
|
NotificationHelper.initNotificationChannels(requireContext());
|
||||||
|
|
||||||
Intent intent = new Intent(
|
Intent intent = new Intent(
|
||||||
android.provider.Settings.ACTION_APP_NOTIFICATION_SETTINGS);
|
android.provider.Settings.ACTION_APP_NOTIFICATION_SETTINGS);
|
||||||
intent.putExtra(android.provider.Settings.EXTRA_APP_PACKAGE,
|
intent.putExtra(android.provider.Settings.EXTRA_APP_PACKAGE,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user