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

Commit 8ad8fa64 authored by George Chan's avatar George Chan Committed by Android Build Coastguard Worker
Browse files

Fix notification silence action for data and charge_data notification types.

Currently only power notifications would get silenced, we do not do a conditional check for the notification type and then add the correct intent extra.

Bug: 445461293
Flag: android.security.aapm_feature_usb_data_protection
Test: manual
Cherrypick-From: https://googleplex-android-review.googlesource.com/q/commit:b64ca7b34745e695e14dddd2133ef1a19a581ae0
Merged-In: If46274c98e42eac863299b18c2ad92a20ea72064
Change-Id: If46274c98e42eac863299b18c2ad92a20ea72064
parent b7ca87d5
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -552,7 +552,14 @@ public class UsbDataAdvancedProtectionHook extends AdvancedProtectionHook {
        }

        Intent silenceIntent = new Intent(ACTION_SILENCE_NOTIFICATION);
        if(notificationType == NOTIFICATION_CHARGE_DATA) {
            silenceIntent.putExtra(EXTRA_SILENCE_DATA_NOTIFICATION, true);
            silenceIntent.putExtra(EXTRA_SILENCE_POWER_NOTIFICATION, true);
        } else if (notificationType == NOTIFICATION_CHARGE) {
            silenceIntent.putExtra(EXTRA_SILENCE_POWER_NOTIFICATION, true);
        } else if (notificationType == NOTIFICATION_DATA) {
            silenceIntent.putExtra(EXTRA_SILENCE_DATA_NOTIFICATION, true);
        }
        sendNotification(
                notificationTitle,
                notificationBody,