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

Commit 90b05814 authored by William Escande's avatar William Escande
Browse files

Apm notif: replace hardcode with ressource

Bug: 290403852
Bug: 262605980
Bug: 303552318
Test: atest ServiceBluetoothTest
Test: atest xxx.BluetoothAirplaneModeListenerTest
Test: Manual: change airplane mode and observe the notification
Change-Id: I2be8e28696a2c51ea2b564f2b4d6ca98077dd996
parent 1e6fe49f
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -191,4 +191,9 @@

    <!-- Boolean indicating if current platform supports HFP inband ringing -->
    <bool name="config_bluetooth_hfp_inband_ringing_support">true</bool>

     <!-- Link used in airplane mode notification. -->
    <string name="config_apmLearnMoreLink" translatable="false">
            https://support.google.com/pixelphone/answer/12639358
    </string>
</resources>
+2 −3
Original line number Diff line number Diff line
@@ -49,8 +49,6 @@ public class NotificationHelperService extends Service {
    private static final String NOTIFICATION_TAG = "com.android.bluetooth";
    private static final String APM_NOTIFICATION_CHANNEL = "apm_notification_channel";
    private static final String APM_NOTIFICATION_GROUP = "apm_notification_group";
    private static final String HELP_PAGE_URL =
            "https://support.google.com/pixelphone/answer/12639358";

    private static final Map<String, Pair<Integer /* titleId */, Integer /* messageId */>>
            NOTIFICATION_MAP =
@@ -112,6 +110,7 @@ public class NotificationHelperService extends Service {

        String title = getString(notificationContent.first);
        String message = getString(notificationContent.second);
        String helpLinkUrl = getString(R.string.config_apmLearnMoreLink);

        notificationManager.notify(
                NOTIFICATION_TAG,
@@ -126,7 +125,7 @@ public class NotificationHelperService extends Service {
                                        this,
                                        PendingIntent.FLAG_UPDATE_CURRENT,
                                        new Intent(Intent.ACTION_VIEW)
                                                .setData(Uri.parse(HELP_PAGE_URL))
                                                .setData(Uri.parse(helpLinkUrl))
                                                .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK),
                                        PendingIntent.FLAG_IMMUTABLE))
                        .setVisibility(Notification.VISIBILITY_PUBLIC)