Re-enables sound notification during on-going call by default. This behavior can be overridden by the net.java.sip.communicator.impl.notification.disableNotificationDuringCall property.

cusax-fix
Vincent Lucas 13 years ago
parent 0bea2e337d
commit e1b4deac80

@ -12,6 +12,7 @@
import net.java.sip.communicator.util.*;
import org.jitsi.service.audionotifier.*;
import org.jitsi.service.configuration.*;
import org.osgi.framework.*;
/**
@ -42,6 +43,13 @@ public class NotificationActivator
private PopupMessageNotificationHandler popupMessageHandler;
private SoundNotificationHandler soundHandler;
/**
* The <tt>ConfigurationService</tt> registered in {@link #bundleContext}
* and used by the <tt>NotificationActivator</tt> instance to read and write
* configuration properties.
*/
private static ConfigurationService configurationService;
public void start(BundleContext bc) throws Exception
{
bundleContext = bc;
@ -145,4 +153,23 @@ public static UIService getUIService()
uiService = ServiceUtils.getService(bundleContext, UIService.class);
return uiService;
}
/**
* Returns a reference to a ConfigurationService implementation currently
* registered in the bundle context or null if no such implementation was
* found.
*
* @return a currently valid implementation of the ConfigurationService.
*/
public static ConfigurationService getConfigurationService()
{
if (configurationService == null)
{
configurationService
= ServiceUtils.getService(
bundleContext,
ConfigurationService.class);
}
return configurationService;
}
}

@ -13,6 +13,7 @@
import net.java.sip.communicator.service.notification.*;
import org.jitsi.service.audionotifier.*;
import org.jitsi.service.configuration.*;
import org.jitsi.util.*;
/**
@ -39,6 +40,12 @@ public class SoundNotificationHandlerImpl
private Map<SCAudioClip, NotificationData> playedClips
= new WeakHashMap<SCAudioClip, NotificationData>();
/**
* Property to disable sound notification during an on-going call.
*/
private static final String PROP_DISABLE_NOTIFICATION_DURING_CALL =
"net.java.sip.communicator.impl.notification.disableNotificationDuringCall";
/**
* {@inheritDoc}
*/
@ -81,7 +88,13 @@ private void play(
// when playing notification in the call, can break the call and
// no further communicating can be done after the notification.
// So we skip playing notification if we have a call running
if(SCAudioClipDevice.PLAYBACK.equals(device))
ConfigurationService cfg
= NotificationActivator.getConfigurationService();
if(cfg != null
&& cfg.getBoolean(
PROP_DISABLE_NOTIFICATION_DURING_CALL,
false)
&& SCAudioClipDevice.PLAYBACK.equals(device))
{
UIService uiService = NotificationActivator.getUIService();

Loading…
Cancel
Save