Update the feature condtions

Checking for feature t=before the permission
This commit is contained in:
deeppandya
2023-01-23 13:51:15 -05:00
parent 5e43ee24da
commit 80da5d012d
2 changed files with 5 additions and 5 deletions
@@ -91,13 +91,13 @@ public class BraveNotificationWarningDialog extends BraveDialogFragment {
}
public static boolean shouldShowRewardWarningDialog(Context context) {
return BravePermissionUtils.isBraveAdsNotificationPermissionBlocked(context)
&& isBraveRewardsEnabled();
return isBraveRewardsEnabled()
&& BravePermissionUtils.isBraveAdsNotificationPermissionBlocked(context);
}
public static boolean shouldShowPrivacyWarningDialog(Context context) {
return BravePermissionUtils.isGeneralNotificationPermissionBlocked(context)
&& isPrivacyReportsEnabled();
return isPrivacyReportsEnabled()
&& BravePermissionUtils.isGeneralNotificationPermissionBlocked(context);
}
private static boolean shouldShowBothWarningDialog(Context context) {
@@ -62,7 +62,7 @@ public class BravePermissionUtils {
(NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
NotificationChannelGroup notificationChannelGroup =
notificationManager.getNotificationChannelGroup(channelGroupName);
return notificationChannelGroup.isBlocked();
return notificationChannelGroup != null ? notificationChannelGroup.isBlocked() : false;
} else {
return NotificationManagerCompat.from(context).areNotificationsEnabled();
}