def playSound(self):
self.dbg('playSound started')
- if self.sound:
+ profiled = dbus.Interface(dbus.SessionBus().get_object("com.nokia.profiled", "/com/nokia/profiled"), "com.nokia.profiled")
+ mce = dbus.Interface(dbus.SystemBus().get_object("com.nokia.mce", "/com/nokia/mce/request"), "com.nokia.mce.request")
+ if self.sound and profiled.get_value("", "ringing.alert.type") != "silent":
# Create the player_name sink
- if self.msgType == "Call":
+ if self.msgType == "Call" and profiled.get_value("", "ringing.alert.volume") != "0":
self.dbg('play soundCall:' + self.soundCall)
Playbin2().play(self.soundCall, self.volume)
- elif self.msgType == "SMS":
+ elif self.msgType == "SMS" and profiled.get_value("", "sms.alert.volume") != "0":
self.dbg('play soundSMS:' + self.soundSMS)
Playbin2().play(self.soundSMS, self.volume)
elif self.msgType == "Both":
else:
Playbin2().play(self.soundFile, self.volume)
- if self.vibration:
- bb = 'run-standalone.sh dbus-send --print-reply --system --dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.req_vibrator_pattern_activate string:' + "\'PatternIncomingCall\'"
- bb = str(bb)
- b = os.popen(bb)
- b.close()
- bb = 'run-standalone.sh dbus-send --print-reply --system --dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.req_vibrator_pattern_deactivate string:' + "\'PatternIncomingCall\'"
- b = os.popen(bb)
- b.close()
+ if self.vibration and profiled.get_value("", "vibrating.alert.enabled") == "On":
+ mce.req_vibrator_pattern_activate("PatternIncomingCall")
+ mce.req_vibrator_pattern_deactivate("PatternIncomingCall")
return True
def loadImages(self):