Skip to content

Commit

Permalink
Merge branch 'jb37378' into 'master'
Browse files Browse the repository at this point in the history
[devicelock] Abort non-emergency calls during device lockout. Contributes to JB#37378

See merge request !14
  • Loading branch information
adenexter committed Mar 20, 2017
2 parents aefea4f + ea9d81e commit 9541332
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions rpm/voicecall-qt5.spec
Expand Up @@ -17,6 +17,7 @@ BuildRequires: pkgconfig(libresourceqt5)
BuildRequires: pkgconfig(libpulse-mainloop-glib)
BuildRequires: pkgconfig(ngf-qt5)
BuildRequires: pkgconfig(qt5-boostable)
BuildRequires: pkgconfig(nemodevicelock)

Provides: voicecall-core >= 0.4.9
Provides: voicecall-libs >= 0.4.9
Expand Down
2 changes: 1 addition & 1 deletion src/src.pro
Expand Up @@ -7,7 +7,7 @@ CONFIG += link_pkgconfig

INCLUDEPATH += ../lib/src

PKGCONFIG += libresourceqt5
PKGCONFIG += libresourceqt5 nemodevicelock

packagesExist(qt5-boostable) {
DEFINES += HAS_BOOSTER
Expand Down
9 changes: 9 additions & 0 deletions src/voicecallmanager.cpp
Expand Up @@ -23,6 +23,7 @@

#include <QHash>
#include <QUuid>
#include <nemo-devicelock/devicelock.h>

#include "audiocallpolicyproxy.h"

Expand All @@ -44,6 +45,7 @@ class VoiceCallManagerPrivate

AbstractVoiceCallHandler *activeVoiceCall;

NemoDeviceLock::DeviceLock deviceLock;
QString audioMode;
bool isAudioRouted;
bool isMicrophoneMuted;
Expand Down Expand Up @@ -325,6 +327,13 @@ void VoiceCallManager::onVoiceCallAdded(AbstractVoiceCallHandler *handler)
TRACE
Q_D(VoiceCallManager);

if (!handler->isEmergency()
&& d->deviceLock.state() == NemoDeviceLock::DeviceLock::ManagerLockout) {
handler->hangup();
return;

}

//AudioCallPolicyProxy *pHandler = new AudioCallPolicyProxy(handler, this);
d->voiceCalls.insert(handler->handlerId(), handler);

Expand Down

0 comments on commit 9541332

Please sign in to comment.