Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4325c61c authored by Julia Reynolds's avatar Julia Reynolds
Browse files

Scale back channel toast

Only show the toast if enabled by the user.

Test: Turn off setting and post a notification to an invalid channel
Fixes: 231150048
Change-Id: I83a66c60ff4638392814233dfa15c2e0fd0cf9c8
parent cdae841b
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -6758,9 +6758,8 @@ public class NotificationManagerService extends SystemService {
    protected void doChannelWarningToast(int forUid, CharSequence toastText) {
        Binder.withCleanCallingIdentity(() -> {
            final int defaultWarningEnabled = Build.IS_DEBUGGABLE ? 1 : 0;
            final boolean warningEnabled = Settings.Global.getInt(getContext().getContentResolver(),
                    Settings.Global.SHOW_NOTIFICATION_CHANNEL_WARNINGS, defaultWarningEnabled) != 0;
                    Settings.Global.SHOW_NOTIFICATION_CHANNEL_WARNINGS, 0) != 0;
            if (warningEnabled) {
                Toast toast = Toast.makeText(getContext(), mHandler.getLooper(), toastText,
                        Toast.LENGTH_SHORT);