Merge lp:~phablet-team/telephony-service/sms-notif-lp1544477 into lp:telephony-service

Proposed by Alfonso Sanchez-Beato on 2016-08-23
Status: Merged
Approved by: Gustavo Pichorim Boiko on 2016-08-23
Approved revision: 1201
Merged at revision: 1202
Proposed branch: lp:~phablet-team/telephony-service/sms-notif-lp1544477
Merge into: lp:telephony-service
Diff against target: 20 lines (+10/-0)
1 file modified
libtelephonyservice/ringtone.cpp (+10/-0)
To merge this branch: bzr merge lp:~phablet-team/telephony-service/sms-notif-lp1544477
Reviewer Review Type Date Requested Status
Jim Hodapp (community) code Approve on 2016-08-23
Gustavo Pichorim Boiko (community) 2016-08-23 Approve on 2016-08-23
Review via email: mp+303680@code.launchpad.net

Commit message

Make sure we play notification sounds if media-hub re-starts
(LP: #1544477).

Description of the change

Make sure we play notification sounds if media-hub re-starts
(LP: #1544477).

To post a comment you must log in.
Gustavo Pichorim Boiko (boiko) wrote :

Looks good!

review: Approve
Jim Hodapp (jhodapp) :
review: Needs Fixing (code)
1202. By Alfonso Sanchez-Beato on 2016-08-23

Fix style issue

Jim Hodapp (jhodapp) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libtelephonyservice/ringtone.cpp'
2--- libtelephonyservice/ringtone.cpp 2016-03-21 19:05:02 +0000
3+++ libtelephonyservice/ringtone.cpp 2016-08-23 14:43:38 +0000
4@@ -72,6 +72,16 @@
5 return;
6 }
7
8+ // Re-create if in error state. A typical case is when media-hub-server has
9+ // crashed and we need to start from a clean slate.
10+ if (mMessageAudioPlayer && mMessageAudioPlayer->error()) {
11+ qDebug() << "mMessageAudioPlayer in error state ("
12+ << mMessageAudioPlayer->error() << "), recreating";
13+
14+ mMessageAudioPlayer->deleteLater();
15+ mMessageAudioPlayer = NULL;
16+ }
17+
18 if (!mMessageAudioPlayer) {
19 mMessageAudioPlayer = new QMediaPlayer(this);
20 mMessageAudioPlayer->setAudioRole(QAudio::NotificationRole);

Subscribers

People subscribed via source and target branches

to all changes: