-
Notifications
You must be signed in to change notification settings - Fork 131
Open
Description
Bug Report
Alerts stop working if the previous notification was not dismissed by the User.
Reproduction Steps
- Connect the phone to the TDK
- The app must have Alert and background permissions (SYNC)
- The app does not need to be open on the HMI, the state of the app is
HMI_BACKGROUND
- Send an alert with buttons, and do not dismiss it.
- Send another Alert (2nd). (this alert is not displayed)
- Dismiss the first Alert
- Send the 3rd Alert.
- 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
Labels
No labels