/** {@inheritDoc} */ public void start(BundleContext bc) throws Exception { bundleContext = bc; try { logger.logEntry(); logger.info("Android notification handler Service...[ STARTED ]"); // Get the notification service implementation ServiceReference notifReference = bundleContext.getServiceReference(NotificationService.class.getName()); notificationService = (NotificationService) bundleContext.getService(notifReference); vibrateHandler = new VibrateHandlerImpl(); notificationService.addActionHandler(vibrateHandler); logger.info("Android notification handler Service...[REGISTERED]"); } finally { logger.logExit(); } }
/** * Returns the <tt>NotificationService</tt> obtained from the bundle context. * * @return The <tt>NotificationService</tt> obtained from the bundle context. */ public static NotificationService getNotificationService() { if (notificationService == null) { // Get the notification service implementation ServiceReference notifReference = bundleContext.getServiceReference(NotificationService.class.getName()); notificationService = (NotificationService) bundleContext.getService(notifReference); if (notificationService != null) { // Register a popup message for a device configuration changed // notification. notificationService.registerDefaultNotificationForEvent( DEVICE_CONFIGURATION_HAS_CHANGED, net.java.sip.communicator.service.notification.NotificationAction.ACTION_POPUP_MESSAGE, "Device onfiguration has changed", null); } } return notificationService; }