There is a lot of duplicated code in showPersistentMessage and showTransientMessage.  Can you just handle the two cases in showNotification()?