smartdevicelink/manticore

Alert sent when the HMI level is background is rejected

NicoleYarroch opened this issue · 4 comments

Bug Report

Manticore’s permissions allow an Alert to be sent when the hmiLevel is BACKGROUND , however when an alert is sent while the app is backgrounded the request is rejected.

Reproduction Steps

  1. Connect the SDL app to the module.
  2. Launch the app so the hmiLevel is FULL. Put the SDL app in the background (the hmiLevel changes to BACKGROUND) and send an alert request.

Expected Result

The alert is shown.

Actual Result

The alert is rejected.

2020-11-18 14:37:28.836692-0500 SDL Example Swift[5576:126712] [Lifecycle] Sending callback for RPC message: OnPermissionsChange (notification)
{
    permissionItem =     (
            ...
            hmiPermissions =             {
                allowed =                 (
                    BACKGROUND,
                    FULL,
                    LIMITED
                );
                userDisallowed =                 (
                );
            };
            parameterPermissions =             {
                allowed =                 (
                );
                userDisallowed =                 (
                );
            };
            rpcName = Alert;
        },
Request failed: Alert (request), id: 73
{
    alertText1 = "You pressed the button!";
    cancelID = 0;
    duration = 5000;
    playTone = 0;
    progressIndicator = 0;
    softButtons =     (
        "{\n    isHighlighted = 0;\n    softButtonID = 1;\n    systemAction = \"DEFAULT_ACTION\";\n    text = \"Button 1\";\n    type = TEXT;\n}",
        "{\n    isHighlighted = 0;\n    softButtonID = 101;\n    systemAction = \"DEFAULT_ACTION\";\n    text = \"Button 2\";\n    type = TEXT;\n}"
    );
}, response: Alert (response), id: 73
{
    resultCode = REJECTED;
    success = 0;
}, error: Error Domain=com.sdl.lifecyclemanager.error Code=-1 "REJECTED" UserInfo={NSLocalizedDescription=REJECTED, NSLocalizedFailureReason=}

@NicoleYarroch What is your app's priority value?

Alerts in background are limited by notifications_per_minute_by_priority in the policy table:

"notifications_per_minute_by_priority": {
                 "EMERGENCY": 60,
                 "NAVIGATION": 15,
                 "PROJECTION": 15,
                 "VOICECOM": 20,
                 "COMMUNICATION": 6,
                 "NORMAL": 4,
                 "NONE": 0
             },

Which means if priority is NONE for the app in the policy table it will not be allowed to send Alerts in HMI Level Background, and if priority is EMERGENCY it can send 60 Alerts per minute.

@crokita Can you provide the notifications_per_minute_by_priority set in the default policy table for Manticore? I was using the default policy table and there is no way for the SDL app to find out what notifications_per_minute_by_priority was set to in the policy table.

@NicoleYarroch This is the current value in the Manticore PT:

"notifications_per_minute_by_priority": {
                "EMERGENCY": 60,
                "NAVIGATION": 15,
                "PROJECTION": 15,
                "VOICECOM": 20,
                "COMMUNICATION": 6,
                "NORMAL": 4,
                "NONE": 0
            },

We are modifying the default policy table to allow all connected apps to have priority EMERGENCY which will be the most permissible option for the alerts in the upcoming release on Dec 8th

Resolved in the 2.7 release