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

Commit c73bbdcb authored by Thomas Stuart's avatar Thomas Stuart
Browse files

Ensure immediate delivery of WFC notification action

The 'Do Not Ask Again' button on the Emergency Network Notification
(Wi-Fi Calling) was observed to be non-responsive immediately upon click. Log analysis revealed that while the `notification_action_clicked` event was registered, the associated broadcast `SILENCE_WIFI_CALLING_NOTIFICATION` was experiencing significant delivery delays by the Activity Manager,
sometimes up to 14 minutes.

This delay prevented the `NotificationActionReceiver` from processing the action in a timely manner, resulting in the notification not being
silenced or dismissed as expected by the user.

To resolve this, `Intent.FLAG_RECEIVER_FOREGROUND` has been added to the
`Intent` carried by the `PendingIntent` for the 'Do Not Ask Again'
action within the `EmergencyNetworkNotification`. This flag instructs the system to prioritize the delivery of this broadcast, ensuring the user's interaction is processed immediately.

This change restores the intended functionality of the notification action, allowing users to effectively silence the Emergency Network Notification and improving overall user experience.

Flag: com.android.internal.telephony.flags.immediately_process_do_not_show_again_broadcast
Fixes: 368690328
Test: manual - use adb command to trigger the notification
Change-Id: Ibd68f1fc6b74fcd25b4a7a2b53bdc1401dc18b97
parent ebb43b43
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -169,3 +169,13 @@ flag {
    }
}

# OWNER=tjstuart TARGET=25Q3
flag {
    name: "immediately_process_do_not_show_again_broadcast"
    namespace: "telephony"
    description: "Ensure the Do Not Show Again broadcast is immediately processed by receiver"
    bug:"368690328"
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}
+6 −1
Original line number Diff line number Diff line
@@ -715,10 +715,15 @@ public class CarrierServiceStateTracker extends Handler {
         * notification
         */
        private Notification.Action createDoNotShowAgainAction(Context c) {
            Intent broadcastIntent = new Intent(ACTION_NEVER_ASK_AGAIN);
            if (mFeatureFlags.immediatelyProcessDoNotShowAgainBroadcast()) {
                // Ensure immediate delivery of the broadcast to the receiver!
                broadcastIntent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
            }
            final PendingIntent pendingIntent = PendingIntent.getBroadcast(
                    c,
                    0,
                    new Intent(ACTION_NEVER_ASK_AGAIN),
                    broadcastIntent,
                    PendingIntent.FLAG_IMMUTABLE);
            CharSequence text = "Do Not Ask Again";
            if (c != null && mFeatureFlags.dynamicDoNotAskAgainText()) {