Skip to content

Commit

Permalink
Merge pull request #16106 from brave/pr16090_26988_crash_notification…
Browse files Browse the repository at this point in the history
…s_is_null_on_Android_6_1.47.x

crash notifications is null on Android 6 (uplift to 1.47.x)
  • Loading branch information
kjozwiak authored Nov 29, 2022
2 parents a97d36c + 8f003fe commit ca5fb24
Showing 1 changed file with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,17 +144,19 @@ private void showNotificationWarningDialog() {

private void notificationClick() {
Preference notifications = findPreference(PREF_NOTIFICATIONS);
notifications.setOnPreferenceClickListener(preference -> {
mNotificationClicked = true;

Intent intent = new Intent();
intent.setAction(Settings.ACTION_APP_NOTIFICATION_SETTINGS);
intent.putExtra(Settings.EXTRA_APP_PACKAGE,
ContextUtils.getApplicationContext().getPackageName());
startActivity(intent);
// We handle the click so the default action isn't triggered.
return true;
});
if (notifications != null) {
notifications.setOnPreferenceClickListener(preference -> {
mNotificationClicked = true;

Intent intent = new Intent();
intent.setAction(Settings.ACTION_APP_NOTIFICATION_SETTINGS);
intent.putExtra(Settings.EXTRA_APP_PACKAGE,
ContextUtils.getApplicationContext().getPackageName());
startActivity(intent);
// We handle the click so the default action isn't triggered.
return true;
});
}
}

private void updateBravePreferences() {
Expand Down

0 comments on commit ca5fb24

Please sign in to comment.