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

Commit ef53f427 authored by Sarah Chin's avatar Sarah Chin
Browse files

Allow user to disable network boost notification

CarrierDefaultApp notification channels are not able to be disabled by
default. Allow the network boost channel notifications to be blockable
so user can disable them without affecting other notificatons in
CarrierDefaultApp.

Test: manual test
Bug: 258266536
Change-Id: I8907205e905b9fbdab3193f1816074b9ed62e785
parent 80c69055
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@
    <string name="ssl_error_continue">Continue anyway via browser</string>

    <!-- Telephony notification channel name for network boost notifications. -->
    <string name="network_boost_notification_channel">Network Boost</string>
    <string name="network_boost_notification_channel">Network boost</string>
    <!-- Notification title text for the network boost notification. -->
    <string name="network_boost_notification_title">%s recommends a data boost</string>
    <!-- Notification detail text for the network boost notification. -->
+9 −5
Original line number Diff line number Diff line
@@ -240,11 +240,15 @@ public class SlicePurchaseBroadcastReceiver extends BroadcastReceiver{
            return;
        }

        context.getSystemService(NotificationManager.class).createNotificationChannel(
                new NotificationChannel(NETWORK_BOOST_NOTIFICATION_CHANNEL_ID,
                        context.getResources().getString(
                                R.string.network_boost_notification_channel),
                        NotificationManager.IMPORTANCE_DEFAULT));
        NotificationChannel channel = new NotificationChannel(
                NETWORK_BOOST_NOTIFICATION_CHANNEL_ID,
                context.getResources().getString(R.string.network_boost_notification_channel),
                NotificationManager.IMPORTANCE_DEFAULT);
        // CarrierDefaultApp notifications are unblockable by default. Make this channel blockable
        //  to allow users to disable notifications posted to this channel without affecting other
        //  notifications in this application.
        channel.setBlockable(true);
        context.getSystemService(NotificationManager.class).createNotificationChannel(channel);

        Notification notification =
                new Notification.Builder(context, NETWORK_BOOST_NOTIFICATION_CHANNEL_ID)