Package 

Class MessageManager


  • 
    public class MessageManager
    
                        

    Manager for adding and removing Volvo specific notifications.

    The manager abstracts away the platform differences when running on different Volvo HW.

    • Constructor Detail

      • MessageManager

        MessageManager(Context appContext)
    • Method Detail

      • addMessage

         void addMessage(@NonNull() Message message)

        Adds message, see Message.

        The manager holds a local list of already active messages. If the message toadd is already present the call to the underlying service is omitted. This is to avoidunnecessary IPC.

        Parameters:
        message - The message to add, see Message.
      • updateMessage

         void updateMessage(@NonNull() Message message)

        Updates a message, see Message.

        Updates an already active message. If the message is not active the call to the underlyingservice is omitted. This is to avoid unnecessary IPC. Updating a message allows for changingthe message content while keeping the message active, for example changing the messagesummary.

        Parameters:
        message - The message to update, see Message.
      • forceAddMessage

         void forceAddMessage(@NonNull() Message message)

        Force Adds message, see Message.

        The manager holds a local list of already active messages. If the message already exists itis removed first then added again to trigger the message to the user again.

        Parameters:
        message - The message to add, see Message.
      • removeMessage

         void removeMessage(int id)

        Removes message.

        The manager holds a local list of already active messages.If the message to remove is NOT present the call to the underlying service is omitted.This is to avoid unnecessary IPC.

        Parameters:
        id - The id of the message to remove.
      • removeMessage

         void removeMessage(@NonNull() Message message)

        Removes message.

        The manager holds a local list of already active messages.If the message to remove is NOT present the call to the underlying service is omitted.This is to avoid unnecessary IPC.

        Parameters:
        message - the message to remove.
      • removeAllMessages

         void removeAllMessages()

        Removes all message from the calling package. The calling package is retrieved fromthe calling context ( context.getPackageName() )

      • setPassFilterLevel

         void setPassFilterLevel(int level)

        There is a possibility to enable what level of messages that shall be passed through to theunderlying service from this instance.

        If never set all messages are enabled/passed through by default.

        NOTE! For SID only NONE, INFO and WARNING are applicable

        if NONE no messages enabledif CRITICAL only critical messages enabledif WARNING critical and warning messages enabledif INFO critical, warning and information messages enabledif SYSTEM critical, warning information and system messages enabled

        Parameters:
        level - The level of messages to enable
      • isMessageActive

         boolean isMessageActive(int id)

        Checks if message id present in the active messages list.