Skip to content

Alert RPCs through Alert Manager stop working if the first was not dismissed.  #1779

@mjuarez-ford

Description

@mjuarez-ford

Bug Report

Alerts stop working if the previous notification was not dismissed by the User.

Reproduction Steps
  1. Connect the phone to the TDK
  2. The app must have Alert and background permissions (SYNC)
  3. The app does not need to be open on the HMI, the state of the app is HMI_BACKGROUND
  4. Send an alert with buttons, and do not dismiss it.
  5. Send another Alert (2nd). (this alert is not displayed)
  6. Dismiss the first Alert
  7. Send the 3rd Alert.
  8. The 3rd and consecutive Alert are not sent to the HMI.
Expected Behavior

The user should keep receiving notifications.

Observed Behavior

On the SYNC logs, I verify that on the HMI the Alert RPC is not received. And on the PresentAlertOperation the start() is not executed.

When everything is executing correctly on the Queue class the properties head and tail are always null. But after it breaks it always adds them to the queue.

public void add(Task task, boolean placeAtHead) {
....
  else {
      Queue.Node<Task> taskNode = new Queue.Node(task, this.head, this.tail);
      this.head = taskNode;
      this.tail = taskNode;
  }
...

If we follow the steps on the Reproduction Steps on the step **5** it could be that the TaskMaster in charge of the alert queue is no longer running or is waiting for a response.

OS & Version Information
  • Android Version: 9
  • SDL Android Version: 5.3.0
  • Testing Against: SDL Hello World with the same code
Test Case, Sample Code, and / or Example App
int i = 0;
Timer timer = new Timer();
timer.schedule(new TimerTask() {
    @Override
    public void run() {
        sendAlert();
    }
},0,50000);


public void sendAlert() {
  AlertView.Builder builder = new AlertView.Builder();
  builder.setText("text 1");
  builder.setSecondaryText("text 2");
  builder.setSoftButtons(getButtons());
  AlertView alert = builder.build();
  sdlManager.getScreenManager().presentAlert(alert, (success, tryAgainTime) -> {
      DebugTool.logInfo(TAG,"Success: "+ success);
  });
}

private ArrayList<SoftButtonObject> getButtons() {
    SoftButtonState okButtonState = new SoftButtonState("okButtonAlertState","okButtonAlertState",null);
    SoftButtonObject okSoftButtonObj = new SoftButtonObject("okButtonAlert", okButtonState, new 
    SoftButtonObject.OnEventListener() {
        @Override
        public void onPress(SoftButtonObject softButtonObject, OnButtonPress onButtonPress) {
            DebugTool.logInfo(TAG, "OK BUTTON PRESSED");
        }

        @Override
        public void onEvent(SoftButtonObject softButtonObject, OnButtonEvent onButtonEvent) {
            DebugTool.logInfo(TAG, "OK BUTTON "+ onButtonEvent.toString());
        }
    });
    SoftButtonState cancelButtonState = new SoftButtonState("cancelButtonAlertState","cancelButtonState",null);
    SoftButtonObject cancelButtonObj = new SoftButtonObject("cancelButtonAlertState", cancelButtonState, new SoftButtonObject.OnEventListener() {
        @Override
        public void onPress(SoftButtonObject softButtonObject, OnButtonPress onButtonPress) {
            DebugTool.logInfo(TAG, "CANCEL BUTTON PRESSED");
        }

        @Override
        public void onEvent(SoftButtonObject softButtonObject, OnButtonEvent onButtonEvent) {
            DebugTool.logInfo(TAG, "CANCEL BUTTON "+onButtonEvent.toString());
        }
    });
    return new ArrayList<SoftButtonObject>(Arrays.asList(okSoftButtonObj,cancelButtonObj));
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions