59 #include "../PubSub/securityuisprivatepskeys.h" |
59 #include "../PubSub/securityuisprivatepskeys.h" |
60 #include <avkondomainpskeys.h> |
60 #include <avkondomainpskeys.h> |
61 #include <hwrmdomainpskeys.h> |
61 #include <hwrmdomainpskeys.h> |
62 #include <ctsydomainpskeys.h> |
62 #include <ctsydomainpskeys.h> |
63 |
63 |
|
64 #include <startupdomainpskeys.h> |
|
65 |
64 #include <hbdevicedialog.h> |
66 #include <hbdevicedialog.h> |
65 // handled now directly but screensaver |
67 // handled now directly but screensaver |
66 // #include <power_save_display_mode.h> |
68 // #include <power_save_display_mode.h> |
67 |
69 |
68 const TInt KPhoneIndex(0); |
70 const TInt KPhoneIndex(0); |
69 const TInt KTriesToConnectServer(2); |
71 const TInt KTriesToConnectServer(2); |
70 const TInt KTimeBeforeRetryingServerConnection(50000); |
72 const TInt KTimeBeforeRetryingServerConnection(50000); |
71 #define ESecUiTypeLock 0x00100000 |
73 #define ESecUiTypeDeviceLock 0x00100000 |
|
74 #define ESecUiTypeKeyguard 0x00200000 |
72 _LIT( KMmTsyModuleName, "PhoneTsy"); |
75 _LIT( KMmTsyModuleName, "PhoneTsy"); |
73 |
76 |
74 // Constant definitions to control screensaver view types |
77 // Constant definitions to control screensaver view types |
75 static const char *KSnsrViewTypeKey = "view_type"; |
78 static const char *KSnsrViewTypeKey = "view_type"; |
76 enum TSnsrViewType |
79 enum TSnsrViewType |
83 static const char *KSnsrCmdUnlock = "unlock"; |
86 static const char *KSnsrCmdUnlock = "unlock"; |
84 static const char *KSnsrCmdSwitchLights = "switch_lights"; |
87 static const char *KSnsrCmdSwitchLights = "switch_lights"; |
85 static const char *KSnsrCmdSwitchLowPower = "switch_low_power"; |
88 static const char *KSnsrCmdSwitchLowPower = "switch_low_power"; |
86 |
89 |
87 Autolock::Autolock(QWidget *parent, Qt::WFlags f) : |
90 Autolock::Autolock(QWidget *parent, Qt::WFlags f) : |
88 QWidget(parent, f), mService(NULL) |
91 QWidget(parent, f), |
|
92 mService(NULL), |
|
93 mPowerKeyCaptureHandle(0), |
|
94 mApplicationKeyCaptureHandle(0), |
|
95 mApplicationLongKeyCaptureHandle(0), |
|
96 mEKeyDeviceFCaptureHandle(0), |
|
97 mEKeyBellCaptureHandle(0), |
|
98 mEKeyYesCaptureHandle(0), |
|
99 mEKeyNoCaptureHandle(0), |
|
100 iLockCodeQueryInDisplay(false), |
|
101 mScreensaverModeTimer(0) |
|
102 |
89 { |
103 { |
90 RDEBUG("start autolock", 0); |
104 RDEBUG("start autolock", 0); |
91 |
105 |
92 // The very first thing is to define the properties, so that others can use them. |
106 // The very first thing is to define the properties, so that others can use them. |
93 TSecurityPolicy readPolicy(ECapabilityReadDeviceData); |
107 TSecurityPolicy readPolicy(ECapabilityReadDeviceData); |
196 // this value is not used for now |
211 // this value is not used for now |
197 delete repository; |
212 delete repository; |
198 |
213 |
199 // subscribe to settings changes |
214 // subscribe to settings changes |
200 subscriberKSettingsAutolockStatus = new QValueSpaceSubscriber("/KCRUidSecuritySettings/KSettingsAutolockStatus", this); |
215 subscriberKSettingsAutolockStatus = new QValueSpaceSubscriber("/KCRUidSecuritySettings/KSettingsAutolockStatus", this); |
201 connect(subscriberKSettingsAutolockStatus, SIGNAL(contentsChanged()), this, SLOT(subscriberKSettingsAutolockStatusChanged())); |
216 err = connect(subscriberKSettingsAutolockStatus, SIGNAL(contentsChanged()), this, SLOT(subscriberKSettingsAutolockStatusChanged())); |
|
217 RDEBUG("err", err); |
202 subscriberKSettingsAutoLockTime = new QValueSpaceSubscriber("/KCRUidSecuritySettings/KSettingsAutoLockTime", this); |
218 subscriberKSettingsAutoLockTime = new QValueSpaceSubscriber("/KCRUidSecuritySettings/KSettingsAutoLockTime", this); |
203 connect(subscriberKSettingsAutoLockTime, SIGNAL(contentsChanged()), this, SLOT(subscriberKSettingsAutoLockTimeChanged())); |
219 err = connect(subscriberKSettingsAutoLockTime, SIGNAL(contentsChanged()), this, SLOT(subscriberKSettingsAutoLockTimeChanged())); |
|
220 RDEBUG("err", err); |
204 subscriberKSettingsAutomaticKeyguardTime = new QValueSpaceSubscriber("/KCRUidSecuritySettings/KSettingsAutomaticKeyguardTime", this); |
221 subscriberKSettingsAutomaticKeyguardTime = new QValueSpaceSubscriber("/KCRUidSecuritySettings/KSettingsAutomaticKeyguardTime", this); |
205 connect(subscriberKSettingsAutomaticKeyguardTime, SIGNAL(contentsChanged()), this, SLOT(subscriberKSettingsAutomaticKeyguardTimeChanged())); |
222 err = connect(subscriberKSettingsAutomaticKeyguardTime, SIGNAL(contentsChanged()), this, SLOT(subscriberKSettingsAutomaticKeyguardTimeChanged())); |
|
223 RDEBUG("err", err); |
206 subscriberKDisplayLightsTimeout = new QValueSpaceSubscriber("/KCRUidLightSettings/KDisplayLightsTimeout", this); |
224 subscriberKDisplayLightsTimeout = new QValueSpaceSubscriber("/KCRUidLightSettings/KDisplayLightsTimeout", this); |
207 connect(subscriberKDisplayLightsTimeout, SIGNAL(contentsChanged()), this, SLOT(subscriberKDisplayLightsTimeoutChanged())); |
225 err = connect(subscriberKDisplayLightsTimeout, SIGNAL(contentsChanged()), this, SLOT(subscriberKDisplayLightsTimeoutChanged())); |
|
226 RDEBUG("err", err); |
208 subscriberKProEngActiveProfile = new QValueSpaceSubscriber("/KCRUidProfileEngine/KProEngActiveProfile", this); |
227 subscriberKProEngActiveProfile = new QValueSpaceSubscriber("/KCRUidProfileEngine/KProEngActiveProfile", this); |
209 connect(subscriberKProEngActiveProfile, SIGNAL(contentsChanged()), this, SLOT(subscriberKProEngActiveProfileChanged())); |
228 err = connect(subscriberKProEngActiveProfile, SIGNAL(contentsChanged()), this, SLOT(subscriberKProEngActiveProfileChanged())); |
|
229 RDEBUG("err", err); |
210 |
230 |
211 subscriberKSecurityUIsDismissDialog = new QValueSpaceSubscriber("/KPSUidSecurityUIs/KSecurityUIsDismissDialog", this); |
231 subscriberKSecurityUIsDismissDialog = new QValueSpaceSubscriber("/KPSUidSecurityUIs/KSecurityUIsDismissDialog", this); |
212 connect(subscriberKSecurityUIsDismissDialog, SIGNAL(contentsChanged()), this, SLOT(subscriberKSecurityUIsDismissDialogChanged())); |
232 err = connect(subscriberKSecurityUIsDismissDialog, SIGNAL(contentsChanged()), this, SLOT(subscriberKSecurityUIsDismissDialogChanged())); |
|
233 RDEBUG("err", err); |
213 |
234 |
214 // subscribe to environment changes |
235 // subscribe to environment changes |
215 subscriberKHWRMGripStatus = new QValueSpaceSubscriber("/KPSUidHWRM/KHWRMGripStatus"); |
236 subscriberKHWRMGripStatus = new QValueSpaceSubscriber("/KPSUidHWRM/KHWRMGripStatus", this); |
216 connect(subscriberKHWRMGripStatus, SIGNAL(contentsChanged()), this, SLOT(subscriberKHWRMGripStatusChanged())); |
237 err = connect(subscriberKHWRMGripStatus, SIGNAL(contentsChanged()), this, SLOT(subscriberKHWRMGripStatusChanged())); |
217 |
238 RDEBUG("err", err); |
218 subscriberKAknKeyguardStatus = new QValueSpaceSubscriber("/KPSUidAvkonDomain/KAknKeyguardStatus"); |
239 |
219 connect(subscriberKAknKeyguardStatus, SIGNAL(contentsChanged()), this, SLOT(subscriberKAknKeyguardStatusChanged())); |
240 subscriberKAknKeyguardStatus = new QValueSpaceSubscriber("/KPSUidAvkonDomain/KAknKeyguardStatus", this); |
220 |
241 err = connect(subscriberKAknKeyguardStatus, SIGNAL(contentsChanged()), this, SLOT(subscriberKAknKeyguardStatusChanged())); |
221 subscriberKCoreAppUIsAutolockStatus = new QValueSpaceSubscriber("/KPSUidCoreApplicationUIs/KCoreAppUIsAutolockStatus"); |
242 RDEBUG("err", err); |
222 connect(subscriberKCoreAppUIsAutolockStatus, SIGNAL(contentsChanged()), this, SLOT(subscriberKCoreAppUIsAutolockStatusChanged())); |
243 |
223 |
244 subscriberKCoreAppUIsAutolockStatus = new QValueSpaceSubscriber("/KPSUidCoreApplicationUIs/KCoreAppUIsAutolockStatus", this); |
224 subscriberKCTsyCallState = new QValueSpaceSubscriber("/KPSUidCtsyCallInformation/KCTsyCallState"); |
245 err = connect(subscriberKCoreAppUIsAutolockStatus, SIGNAL(contentsChanged()), this, SLOT(subscriberKCoreAppUIsAutolockStatusChanged())); |
225 connect(subscriberKCTsyCallState, SIGNAL(contentsChanged()), this, SLOT(subscriberKCTsyCallStateChanged())); |
246 RDEBUG("err", err); |
|
247 |
|
248 subscriberKCTsyCallState = new QValueSpaceSubscriber("/KPSUidCtsyCallInformation/KCTsyCallState", this); |
|
249 err = connect(subscriberKCTsyCallState, SIGNAL(contentsChanged()), this, SLOT(subscriberKCTsyCallStateChanged())); |
|
250 RDEBUG("err", err); |
|
251 |
|
252 subscriberKSecurityUIsTestCode = new QValueSpaceSubscriber("/KPSUidSecurityUIs/KSecurityUIsTestCode", this); |
|
253 err = connect(subscriberKSecurityUIsTestCode, SIGNAL(contentsChanged()), this, SLOT(subscriberKSecurityUIsTestCodeChanged())); |
|
254 RDEBUG("err", err); |
226 |
255 |
227 // inactivity |
256 // inactivity |
228 connect(serviceKeyguard, SIGNAL(active()), this, SLOT(activeKeyguard())); |
257 connect(serviceKeyguard, SIGNAL(active()), this, SLOT(activeKeyguard())); |
229 connect(serviceKeyguard, SIGNAL(notActive()), this, SLOT(notActiveKeyguard())); |
258 connect(serviceKeyguard, SIGNAL(notActive()), this, SLOT(notActiveKeyguard())); |
230 connect(serviceDevicelock, SIGNAL(active()), this, SLOT(activeDevicelock())); |
259 connect(serviceDevicelock, SIGNAL(active()), this, SLOT(activeDevicelock())); |
335 int Autolock::TurnLights(int aMode, int aReason, int aCaller) |
366 int Autolock::TurnLights(int aMode, int aReason, int aCaller) |
336 { |
367 { |
337 RDEBUG("aMode", aMode); |
368 RDEBUG("aMode", aMode); |
338 RDEBUG("aReason", aReason); |
369 RDEBUG("aReason", aReason); |
339 RDEBUG("aCaller", aCaller); |
370 RDEBUG("aCaller", aCaller); |
340 TInt err = RProperty::Set(KPSUidSecurityUIs, KSecurityUIsLights, aMode); |
371 TInt err = 0; |
|
372 if(aMode!=ESecurityUIsLightsLockOffRequest) |
|
373 { |
|
374 RDEBUG("KLightsSSForcedLightsOn", KLightsSSForcedLightsOn); |
|
375 err = RProperty::Set(KPSUidCoreApplicationUIs, KLightsSSForcedLightsOn, 30); |
|
376 } |
|
377 RDEBUG("err", err); |
|
378 err = RProperty::Set(KPSUidSecurityUIs, KSecurityUIsLights, aMode); |
341 RDEBUG("KSecurityUIsLights err", err); |
379 RDEBUG("KSecurityUIsLights err", err); |
342 return err; |
380 return err; |
343 } |
381 } |
|
382 |
344 int Autolock::AskValidSecCode(int aReason) |
383 int Autolock::AskValidSecCode(int aReason) |
345 { |
384 { |
346 RDEBUG("aReason", aReason); |
385 RDEBUG("aReason", aReason); |
347 RMobilePhone iPhone; // NULL in emulator |
386 RMobilePhone iPhone; // NULL in emulator |
348 |
387 |
596 // check whether a dialog is already displayed. This is to prevent timeout-lock and timeout-keyguard activated on top of a PIN query, in particular at boot-up (TODO check for Starter) |
639 // check whether a dialog is already displayed. This is to prevent timeout-lock and timeout-keyguard activated on top of a PIN query, in particular at boot-up (TODO check for Starter) |
597 TInt secUiOriginatedQuery(ESecurityUIsSecUIOriginatedUninitialized); |
640 TInt secUiOriginatedQuery(ESecurityUIsSecUIOriginatedUninitialized); |
598 TInt err = RProperty::Get(KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, secUiOriginatedQuery); |
641 TInt err = RProperty::Get(KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, secUiOriginatedQuery); |
599 RDEBUG("err", err); |
642 RDEBUG("err", err); |
600 RDEBUG("secUiOriginatedQuery", secUiOriginatedQuery); |
643 RDEBUG("secUiOriginatedQuery", secUiOriginatedQuery); |
|
644 |
|
645 TInt startupValue(EStartupUiPhaseUninitialized); |
|
646 err = RProperty::Get(KPSUidStartup, KPSStartupUiPhase, startupValue); |
|
647 RDEBUG("err", err); |
|
648 RDEBUG("startupValue", startupValue); |
|
649 |
|
650 TInt simStatusValue(0); |
|
651 err = RProperty::Get(KPSUidStartup, KPSSimStatus, simStatusValue); |
|
652 RDEBUG("err", err); |
|
653 RDEBUG("simStatusValue", simStatusValue); |
|
654 if(startupValue<EStartupUiPhaseAllDone && aReason!=ELockAppDisableKeyguard && aReason!=ELockAppDisableDevicelock ) |
|
655 { |
|
656 // before bootup, it can't be manually nor automatically keyguarded/locked |
|
657 RDEBUG("before bootup, it can't be manually nor automatically keyguarded/locked KErrInUse", KErrInUse); |
|
658 return KErrInUse; |
|
659 } |
|
660 |
601 switch (aReason) |
661 switch (aReason) |
602 { |
662 { |
603 case ELockAppEnableKeyguard: |
663 case ELockAppEnableKeyguard: |
604 { |
664 { |
605 RDEBUG("ELockAppEnableKeyguard iLockStatus", iLockStatus); |
665 RDEBUG("ELockAppEnableKeyguard iLockStatus", iLockStatus); |
745 CRepository* repositoryKeyguard = NULL; |
805 CRepository* repositoryKeyguard = NULL; |
746 QT_TRAP_THROWING(repositoryDevicelock = CRepository::NewL(KCRUidSecuritySettings)); |
806 QT_TRAP_THROWING(repositoryDevicelock = CRepository::NewL(KCRUidSecuritySettings)); |
747 QT_TRAP_THROWING(repositoryKeyguard = CRepository::NewL(KCRUidCoreApplicationUIsSysAp)); |
807 QT_TRAP_THROWING(repositoryKeyguard = CRepository::NewL(KCRUidCoreApplicationUIsSysAp)); |
748 TInt cRresult = KErrNone; |
808 TInt cRresult = KErrNone; |
749 Q_UNUSED(cRresult); |
809 Q_UNUSED(cRresult); |
|
810 |
|
811 TInt autolockState; |
|
812 err = RProperty::Get(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, autolockState); |
|
813 RDEBUG("Get KCoreAppUIsAutolockStatus", err); |
|
814 RDEBUG("autolockState", autolockState); |
|
815 |
750 if (1 == 1) // this is a quick way to disable this functionality, for testing |
816 if (1 == 1) // this is a quick way to disable this functionality, for testing |
751 { |
817 { |
752 RDEBUG("publishing", aReason); |
818 RDEBUG("publishing", aReason); |
753 if (aReason == ELockNotActive) |
819 if (aReason == ELockNotActive) |
754 { |
820 { |
755 err = RProperty::Set(KPSUidAvkonDomain, KAknKeyguardStatus, EKeyguardNotActive); |
821 err = RProperty::Set(KPSUidAvkonDomain, KAknKeyguardStatus, EKeyguardNotActive); |
756 RDEBUG("err", err); |
822 RDEBUG("err", err); |
757 err = RProperty::Set(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, EAutolockOff); |
823 if(autolockState!=EAutolockOff) |
758 RDEBUG("err", err); |
824 { |
|
825 err = RProperty::Set(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, EAutolockOff); |
|
826 RDEBUG("err", err); |
|
827 } |
|
828 else |
|
829 { |
|
830 RDEBUG("not set KCoreAppUIsAutolockStatus because already ", EAutolockOff); |
|
831 } |
759 TurnLights(ESecurityUIsLightsLockOnRequest, aReason, 0x14); |
832 TurnLights(ESecurityUIsLightsLockOnRequest, aReason, 0x14); |
760 |
833 |
761 // cRresult = repositoryDevicelock->Set(KSettingsAutolockStatus, 0); // the settings remains. Only ISA changes, as well as the P&S |
834 // cRresult = repositoryDevicelock->Set(KSettingsAutolockStatus, 0); // the settings remains. Only ISA changes, as well as the P&S |
762 cRresult = repositoryKeyguard->Set(KSysApKeyguardActive, 0); |
835 cRresult = repositoryKeyguard->Set(KSysApKeyguardActive, 0); |
763 RDEBUG("cRresult", cRresult); |
836 RDEBUG("cRresult", cRresult); |
766 { |
839 { |
767 if (aReason == EKeyguardActive) |
840 if (aReason == EKeyguardActive) |
768 { |
841 { |
769 err = RProperty::Set(KPSUidAvkonDomain, KAknKeyguardStatus, EKeyguardLocked); |
842 err = RProperty::Set(KPSUidAvkonDomain, KAknKeyguardStatus, EKeyguardLocked); |
770 RDEBUG("KAknKeyguardStatus err", err); |
843 RDEBUG("KAknKeyguardStatus err", err); |
771 err = RProperty::Set(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, EAutolockOff); |
844 if(autolockState!=EAutolockOff) |
772 RDEBUG("KCoreAppUIsAutolockStatus err", err); |
845 { |
|
846 err = RProperty::Set(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, EAutolockOff); |
|
847 RDEBUG("KCoreAppUIsAutolockStatus err", err); |
|
848 } |
|
849 else |
|
850 { |
|
851 RDEBUG("not set KCoreAppUIsAutolockStatus because already ", EAutolockOff); |
|
852 } |
773 TurnLights(ESecurityUIsLightsLockOffRequest, aReason, 0x16); // same for keyguard and devicelock |
853 TurnLights(ESecurityUIsLightsLockOffRequest, aReason, 0x16); // same for keyguard and devicelock |
774 // cRresult = repositoryDevicelock->Set(KSettingsAutolockStatus, 0); |
854 // cRresult = repositoryDevicelock->Set(KSettingsAutolockStatus, 0); |
775 cRresult = repositoryKeyguard->Set(KSysApKeyguardActive, 1); |
855 cRresult = repositoryKeyguard->Set(KSysApKeyguardActive, 1); |
776 RDEBUG("cRresult", cRresult); |
856 RDEBUG("cRresult", cRresult); |
777 } |
857 } |
778 else if (aReason >= EDevicelockActive) |
858 else if (aReason >= EDevicelockActive) |
779 { |
859 { |
780 err = RProperty::Set(KPSUidAvkonDomain, KAknKeyguardStatus, EKeyguardLocked); // previously EKeyguardAutolockEmulation, but then Telephone doesn't understand that it's keyguarded. Other candidates might be: EKeyguardLocked and EKeyguardNotActive |
860 err = RProperty::Set(KPSUidAvkonDomain, KAknKeyguardStatus, EKeyguardLocked); // previously EKeyguardAutolockEmulation, but then Telephone doesn't understand that it's keyguarded. Other candidates might be: EKeyguardLocked and EKeyguardNotActive |
781 RDEBUG("KAknKeyguardStatus err", err); |
861 RDEBUG("KAknKeyguardStatus err", err); |
782 err = RProperty::Set(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, EManualLocked); |
862 if(autolockState!=EManualLocked) |
783 RDEBUG("KCoreAppUIsAutolockStatus err", err); |
863 { |
|
864 err = RProperty::Set(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, EManualLocked); |
|
865 RDEBUG("KCoreAppUIsAutolockStatus err", err); |
|
866 } |
|
867 else |
|
868 { |
|
869 RDEBUG("not set KCoreAppUIsAutolockStatus because already ", EManualLocked); |
|
870 } |
784 TurnLights(ESecurityUIsLightsQueryOnRequest, aReason, 0x18); |
871 TurnLights(ESecurityUIsLightsQueryOnRequest, aReason, 0x18); |
785 // cRresult = repositoryDevicelock->Set(KSettingsAutolockStatus, 1); |
872 // cRresult = repositoryDevicelock->Set(KSettingsAutolockStatus, 1); |
786 cRresult = repositoryKeyguard->Set(KSysApKeyguardActive, 0); // keyguard disabled, so that user can type and DeviceF can be captured |
873 cRresult = repositoryKeyguard->Set(KSysApKeyguardActive, 0); // keyguard disabled, so that user can type and DeviceF can be captured |
787 RDEBUG("cRresult", cRresult); |
874 RDEBUG("cRresult", cRresult); |
788 } |
875 } |
855 { |
942 { |
856 showNoteIfRequested( EKeyguardActive); |
943 showNoteIfRequested( EKeyguardActive); |
857 setLabelIcon(EKeyguardActive); |
944 setLabelIcon(EKeyguardActive); |
858 updateIndicator(EKeyguardActive); |
945 updateIndicator(EKeyguardActive); |
859 publishStatus(EKeyguardActive); |
946 publishStatus(EKeyguardActive); |
860 setLockDialog(aReason, 1); |
947 setLockDialog(aReason, EDeviceDialogCreated); |
861 } |
948 } |
862 // Telephone might want to re-enable only-keyguard after the call ends. Allow it. This means re-showing the screensaver, not more. |
949 // Telephone might want to re-enable only-keyguard after the call ends. Allow it. This means re-showing the screensaver, not more. |
863 if (errorInProcess == KErrPermissionDenied && iTempDisableOnlyKeyguardBecauseIncomingCall==1) |
950 // Note: this is already done in CallStateChanged, so it's useless. Therefore it expects KErrLocked, which never happens |
|
951 if (errorInProcess == KErrLocked && iTempDisableOnlyKeyguardBecauseIncomingCall==1) |
864 { |
952 { |
865 setLockDialog(aReason, 1); |
953 RDEBUG("allowing telephone to re-enable keyguard . Call setLockDialog EDeviceDialogScreenSaverReDisplay", EDeviceDialogScreenSaverReDisplay); |
|
954 setLockDialog(aReason, EDeviceDialogScreenSaverReDisplay); |
866 iTempDisableOnlyKeyguardBecauseIncomingCall=0; |
955 iTempDisableOnlyKeyguardBecauseIncomingCall=0; |
867 } |
956 } |
868 } |
957 } |
869 break; |
958 break; |
870 case ELockAppDisableKeyguard: // 2 |
959 case ELockAppDisableKeyguard: // 2 |
875 { |
964 { |
876 showNoteIfRequested( ELockNotActive); |
965 showNoteIfRequested( ELockNotActive); |
877 setLabelIcon(ELockNotActive); |
966 setLabelIcon(ELockNotActive); |
878 updateIndicator(ELockNotActive); |
967 updateIndicator(ELockNotActive); |
879 publishStatus(ELockNotActive); |
968 publishStatus(ELockNotActive); |
880 setLockDialog(aReason, 0); |
969 setLockDialog(aReason, EDeviceDialogDestroyed); |
881 } |
970 } |
882 } |
971 } |
883 RDEBUG("errorInProcess", errorInProcess); |
972 RDEBUG("errorInProcess", errorInProcess); |
884 // Telephone might want to disnable only-keyguard during a call. Allow it. This means hiding the screensaver, not more. |
973 // Telephone might want to disable only-keyguard during a call. Allow it. This means hiding the screensaver, not more. |
885 if(errorInProcess==KErrPermissionDenied) |
974 // Note: this is already done in CallStateChanged, so it's useless. Therefore it expects KErrLocked, which never happens |
|
975 if(errorInProcess==KErrLocked) |
886 { |
976 { |
887 TInt aCallStatus; |
977 TInt aCallStatus=-1; |
888 TInt err = RProperty::Get(KPSUidCtsyCallInformation, KCTsyCallState, aCallStatus); |
978 TInt err = RProperty::Get(KPSUidCtsyCallInformation, KCTsyCallState, aCallStatus); |
889 RDEBUG("err", err); |
979 RDEBUG("err", err); |
890 RDEBUG("aCallStatus", aCallStatus); |
980 RDEBUG("aCallStatus", aCallStatus); |
891 if (aCallStatus != EPSCTsyCallStateUninitialized && aCallStatus != EPSCTsyCallStateNone) |
981 if (aCallStatus != EPSCTsyCallStateUninitialized && aCallStatus != EPSCTsyCallStateNone) |
892 { |
982 { |
893 RDEBUG("allowing telephone to disable keyguard . Call setLockDialog 0", 0); |
983 RDEBUG("allowing telephone to disable keyguard . Call setLockDialog EDeviceDialogScreenSaverHidden", EDeviceDialogScreenSaverHidden); |
894 setLockDialog(aReason, 0); |
984 setLockDialog(aReason, EDeviceDialogScreenSaverHidden); |
895 iTempDisableOnlyKeyguardBecauseIncomingCall=1; |
985 iTempDisableOnlyKeyguardBecauseIncomingCall=1; |
896 errorInProcess=KErrNone; |
986 errorInProcess=KErrNone; |
897 } |
987 } |
898 } |
988 } |
899 break; |
989 break; |
930 } |
1020 } |
931 if (errorInProcess == KErrNone) |
1021 if (errorInProcess == KErrNone) |
932 { |
1022 { |
933 RDEBUG("skip setLockDialog", 0); |
1023 RDEBUG("skip setLockDialog", 0); |
934 // No need to disable screensaver. Notes now can get on top. Also, this avoids the transition Screensaver->unlockQuery, which produces flicker on HomeScreen. |
1024 // No need to disable screensaver. Notes now can get on top. Also, this avoids the transition Screensaver->unlockQuery, which produces flicker on HomeScreen. |
935 // setLockDialog(aReason, 0); // hide temporarilly because HbDeviceMessageBox doesn't get in top of the Lock-icon. Thus, dismiss it. |
1025 setLockDialog(aReason, EDeviceDialogScreenSaverHidden); // hide temporarilly because HbDeviceMessageBox doesn't get in top of the Lock-icon. Thus, dismiss it. |
936 // do I need to enable touch? it seems to work without it |
1026 // do I need to enable touch? it seems to work without it |
937 // in any case, lights are needed |
1027 // in any case, lights are needed |
938 TurnLights(ESecurityUIsLightsQueryOnRequest, aReason, 0x20); |
1028 TurnLights(ESecurityUIsLightsQueryOnRequest, aReason, 0x20); |
939 RDEBUG("calling HbDeviceMessageBox::question", 0); |
|
940 bool value = true; |
1029 bool value = true; |
941 // not sure whether this question is really needed. The UI doesn't say anything, so I remove it for now. |
1030 // not sure whether this question is really needed. The UI doesn't say anything, so I remove it for now. |
942 // HbDeviceMessageBox::question("Disable Lock?"); // this doesn't block other events, so after return everything might be messed up. |
1031 RDEBUG("not calling HbDeviceMessageBox::question", 0); |
|
1032 // value = HbDeviceMessageBox::question("Disable Lock?"); // this doesn't block other events, so after return everything might be messed up. |
943 RDEBUG("value", value); |
1033 RDEBUG("value", value); |
944 if (!value) |
1034 if (!value) |
945 errorInProcess = KErrCancel; |
1035 errorInProcess = KErrCancel; |
946 } |
1036 } |
947 if (errorInProcess == KErrNone) |
1037 if (errorInProcess == KErrNone) |
948 { |
1038 { |
949 RDEBUG("skip setLockDialog", 1); |
1039 RDEBUG("skip setLockDialog", 0); |
950 // No need to disable screensaver. Notes now can get on top. Also, this avoids the transition Screensaver->unlockQuery, which produces flicker on HomeScreen. |
1040 // No need to disable screensaver. Notes now can get on top. Also, this avoids the transition Screensaver->unlockQuery, which produces flicker on HomeScreen. |
951 // setLockDialog(aReason, 0); // hide temporarilly because AskValidSecCode doesn't get in top of the Lock-icon. Thus, dismiss it. |
1041 setLockDialog(aReason, EDeviceDialogScreenSaverHidden); // hide temporarilly because AskValidSecCode doesn't get in top of the Lock-icon. Thus, dismiss it. |
952 RDEBUG("calling AskValidSecCode", 0); |
1042 RDEBUG("calling AskValidSecCode", 0); |
953 errorInProcess = AskValidSecCode(ELockAppDisableDevicelock); |
1043 errorInProcess = AskValidSecCode(ELockAppDisableDevicelock); |
954 RDEBUG("errorInProcess", errorInProcess); |
1044 RDEBUG("errorInProcess", errorInProcess); |
955 } |
1045 } |
956 if (errorInProcess == KErrNone) |
1046 if (errorInProcess == KErrNone) |
957 { |
1047 { |
|
1048 // code is correct. Time to destroy the lock-icon |
958 setLabelIcon( ELockNotActive); |
1049 setLabelIcon( ELockNotActive); |
959 updateIndicator(ELockNotActive); |
1050 updateIndicator(ELockNotActive); |
960 setLockDialog(aReason, 0); |
1051 setLockDialog(aReason, EDeviceDialogDestroyed); |
961 publishStatus(ELockNotActive); |
1052 publishStatus(ELockNotActive); |
962 } |
1053 } |
963 if (errorInProcess != KErrNone) |
1054 if (errorInProcess != KErrNone) |
964 { // re-lock. For example, if password is cancelled |
1055 { // re-lock. For example, if password is cancelled |
|
1056 TInt aCallStatus=-1; |
|
1057 TInt skipScreenSaver=0; |
|
1058 TInt err = RProperty::Get(KPSUidCtsyCallInformation, KCTsyCallState, aCallStatus); |
|
1059 RDEBUG("err", err); |
|
1060 RDEBUG("aCallStatus", aCallStatus); |
|
1061 if (aCallStatus != EPSCTsyCallStateUninitialized && aCallStatus != EPSCTsyCallStateNone) |
|
1062 { |
|
1063 // if there's an active call and the query is cancelled, screensaver should not show. |
|
1064 skipScreenSaver=1; // if it's skipped, it will be set at CallStateChanged |
|
1065 RDEBUG("new skipScreenSaver", skipScreenSaver); |
|
1066 } |
|
1067 RDEBUG("skipScreenSaver", skipScreenSaver); |
965 if (iLockStatus >= EDevicelockActive) // this skips the case "unlocking although it wasn't locked" |
1068 if (iLockStatus >= EDevicelockActive) // this skips the case "unlocking although it wasn't locked" |
966 setLockDialog(ELockAppEnableDevicelock, 1); |
1069 if(!skipScreenSaver) |
|
1070 setLockDialog(ELockAppEnableDevicelock, EDeviceDialogScreenSaverReDisplay); |
967 } |
1071 } |
968 // this never shows a note |
1072 // this never shows a note |
969 } |
1073 } |
970 break; |
1074 break; |
971 case ELockAppOfferKeyguard: // 5 |
1075 case ELockAppOfferKeyguard: // 5 |
1038 RDEBUG("err", err); |
1145 RDEBUG("err", err); |
1039 RDEBUG("secUiOriginatedQuery", secUiOriginatedQuery); |
1146 RDEBUG("secUiOriginatedQuery", secUiOriginatedQuery); |
1040 |
1147 |
1041 RWindowGroup& groupWin = CEikonEnv::Static()->RootWin(); |
1148 RWindowGroup& groupWin = CEikonEnv::Static()->RootWin(); |
1042 |
1149 |
1043 if (status == 0) // hide |
1150 if (status == EDeviceDialogDestroyed || status == EDeviceDialogScreenSaverHidden) // hide |
1044 { |
1151 { |
1045 // aReason is not important here, but let's check nevertheless |
1152 // aReason is not important here, but let's check nevertheless |
1046 RDEBUG("ReleaseContext", R_AVKON_DEFAULT_SKEY_LIST); |
1153 RDEBUG("ReleaseContext", R_AVKON_DEFAULT_SKEY_LIST); |
1047 static_cast<CAknAppUi*>(CEikonEnv::Static()->EikAppUi())->KeySounds()->ReleaseContext(); |
1154 static_cast<CAknAppUi*>(CEikonEnv::Static()->EikAppUi())->KeySounds()->ReleaseContext(); |
1048 RDEBUG("PopContext", 0x90); |
1155 RDEBUG("PopContext", 0x90); |
1049 static_cast<CAknAppUi*>(CEikonEnv::Static()->EikAppUi())->KeySounds()->PopContext(); |
1156 static_cast<CAknAppUi*>(CEikonEnv::Static()->EikAppUi())->KeySounds()->PopContext(); |
1050 RDEBUG("ReleaseContext done", 0x92); |
1157 RDEBUG("ReleaseContext done", 0x92); |
1051 |
1158 |
1052 if (aReason != ELockAppDisableKeyguard && aReason != ELockAppDisableDevicelock) |
1159 if (aReason != ELockAppDisableKeyguard && aReason != ELockAppDisableDevicelock && aReason != ELockAppOfferDevicelock) |
1053 { |
1160 { |
1054 RDEBUG("!!!!****!!!!! error. status=0 but aReason", aReason); |
1161 RDEBUG("!!!!****!!!!! error. status=0 but aReason", aReason); |
1055 } |
1162 } |
1056 // secUiOriginatedQuery should be ESecurityUIsSystemLockOriginated . If not, this is not correctly setting it |
1163 // secUiOriginatedQuery should be ESecurityUIsSystemLockOriginated . If not, this is not correctly setting it |
1057 if (iDeviceDialogCreated >= EDeviceDialogCreated) |
1164 if (iDeviceDialogCreated >= EDeviceDialogCreated) |
1058 { |
1165 { |
1059 iDeviceDialogCreated = EDeviceDialogDestroyed; |
1166 if(status == EDeviceDialogDestroyed) |
1060 RDEBUG("new iDeviceDialogCreated", iDeviceDialogCreated); |
1167 { |
1061 |
1168 disconnect(iDeviceDialog, SIGNAL(dataReceived(QVariantMap)), this, SLOT(handleMessageFromScreensaver(QVariantMap))); |
1062 RDEBUG("calling switchScreensaverMode", ESnsrViewTypeDisabled); |
1169 disconnect(iDeviceDialog, SIGNAL(deviceDialogClosed()), this, SLOT(handleScreensaverClosed())); |
1063 switchScreensaverMode( ESnsrViewTypeDisabled); |
1170 RDEBUG("signal disconnected", err); |
1064 |
1171 // TODO this crashes for EDeviceDialogScreenSaver |
1065 disconnect(iDeviceDialog, SIGNAL(dataReceived(QVariantMap)), this, SLOT(handleMessageFromScreensaver(QVariantMap))); |
1172 err = iDeviceDialog->cancel(); |
1066 disconnect(iDeviceDialog, SIGNAL(deviceDialogClosed()), this, SLOT(handleScreensaverClosed())); |
1173 RDEBUG("cancel (bool: 1= wellCancelled) err", err); |
1067 RDEBUG("signal disconnected", err); |
1174 err = iDeviceDialog->error(); |
1068 // TODO this crashes for EDeviceDialogScreenSaver |
1175 RDEBUG("err", err); |
1069 err = iDeviceDialog->cancel(); |
1176 RDEBUG("calling iDeviceDialog->waitForClosed()", 0); |
1070 RDEBUG("cancel (bool: 1= wellCancelled) err", err); |
1177 err = iDeviceDialog->waitForClosed(); |
1071 err = iDeviceDialog->error(); |
1178 RDEBUG("cancel (bool: 1= well waitForClosed) err", err); |
1072 RDEBUG("err", err); |
1179 err = iDeviceDialog->error(); |
1073 RDEBUG("calling iDeviceDialog->waitForClosed()", 0); |
1180 RDEBUG("err", err); |
1074 err = iDeviceDialog->waitForClosed(); |
1181 handleScreensaverClosed(); |
1075 RDEBUG("cancel (bool: 1= well waitForClosed) err", err); |
1182 RDEBUG("deleting iDeviceDialog", 0); |
1076 err = iDeviceDialog->error(); |
1183 delete iDeviceDialog; |
1077 RDEBUG("err", err); |
1184 RDEBUG("deleted iDeviceDialog", 1); |
|
1185 iDeviceDialog = NULL; |
|
1186 } |
|
1187 else if(status == EDeviceDialogScreenSaverHidden) |
|
1188 { |
|
1189 RDEBUG("calling switchScreensaverMode", ESnsrViewTypeDisabled); |
|
1190 switchScreensaverMode( ESnsrViewTypeDisabled); |
|
1191 } |
1078 |
1192 |
1079 TInt err = RProperty::Set(KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, ESecurityUIsSecUIOriginatedUninitialized); |
1193 TInt err = RProperty::Set(KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, ESecurityUIsSecUIOriginatedUninitialized); |
1080 RDEBUG("reset KSecurityUIsSecUIOriginatedQuery. err", err); |
1194 RDEBUG("reset KSecurityUIsSecUIOriginatedQuery. err", err); |
1081 handleScreensaverClosed(); |
1195 |
1082 TurnLights(ESecurityUIsLightsQueryOnRequest, aReason, 0x22); |
1196 TurnLights(ESecurityUIsLightsQueryOnRequest, aReason, 0x22); |
1083 // Cancel power key and application key capturing |
1197 // Cancel power key and application key capturing |
1084 groupWin.CancelCaptureKey(mPowerKeyCaptureHandle); |
1198 groupWin.CancelCaptureKey(mPowerKeyCaptureHandle); |
1085 groupWin.CancelCaptureKey(mApplicationKeyCaptureHandle); |
1199 groupWin.CancelCaptureKey(mApplicationKeyCaptureHandle); |
1086 groupWin.CancelCaptureLongKey(mApplicationLongKeyCaptureHandle); |
1200 groupWin.CancelCaptureLongKey(mApplicationLongKeyCaptureHandle); |
1095 { |
1209 { |
1096 RDEBUG("mEKeyNoCaptureHandle", mEKeyNoCaptureHandle); |
1210 RDEBUG("mEKeyNoCaptureHandle", mEKeyNoCaptureHandle); |
1097 groupWin.CancelCaptureKey(mEKeyNoCaptureHandle); |
1211 groupWin.CancelCaptureKey(mEKeyNoCaptureHandle); |
1098 mEKeyNoCaptureHandle = NULL; |
1212 mEKeyNoCaptureHandle = NULL; |
1099 } |
1213 } |
1100 |
1214 iDeviceDialogCreated = status; |
1101 RDEBUG("deleting iDeviceDialog", 0); |
1215 RDEBUG("new iDeviceDialogCreated", iDeviceDialogCreated); |
1102 delete iDeviceDialog; |
1216 } |
1103 RDEBUG("deleted iDeviceDialog", 1); |
1217 } |
1104 iDeviceDialog = NULL; |
1218 else if (status == EDeviceDialogCreated || status == EDeviceDialogScreenSaverReDisplay) // show |
1105 } |
|
1106 } |
|
1107 else if (status == 1) // show |
|
1108 { |
1219 { |
1109 RDEBUG("PushContextL", R_AVKON_DEFAULT_SKEY_LIST); |
1220 RDEBUG("PushContextL", R_AVKON_DEFAULT_SKEY_LIST); |
1110 static_cast<CAknAppUi*>(CEikonEnv::Static()->EikAppUi())->KeySounds()->PushContextL(R_AVKON_SILENT_SKEY_LIST); |
1221 static_cast<CAknAppUi*>(CEikonEnv::Static()->EikAppUi())->KeySounds()->PushContextL(R_AVKON_SILENT_SKEY_LIST); |
1111 RDEBUG("BringToForeground", 0x90); |
1222 RDEBUG("BringToForeground", 0x90); |
1112 static_cast<CAknAppUi*>(CEikonEnv::Static()->EikAppUi())->KeySounds()->BringToForeground(); |
1223 static_cast<CAknAppUi*>(CEikonEnv::Static()->EikAppUi())->KeySounds()->BringToForeground(); |
1115 RDEBUG("PushContextL Done", 0x92); |
1226 RDEBUG("PushContextL Done", 0x92); |
1116 |
1227 |
1117 // secUiOriginatedQuery should be ESecurityUIsSecUIOriginatedUninitialized . If not, the validation is not correctly filtering it |
1228 // secUiOriginatedQuery should be ESecurityUIsSecUIOriginatedUninitialized . If not, the validation is not correctly filtering it |
1118 QVariantMap params; |
1229 QVariantMap params; |
1119 TBool err=EFalse; |
1230 TBool err=EFalse; |
1120 #define ESecUiTypeDeviceLock 0x00100000 |
|
1121 #define ESecUiTypeKeyguard 0x00200000 |
|
1122 |
1231 |
1123 if (aReason == ELockAppEnableKeyguard) |
1232 if (aReason == ELockAppEnableKeyguard) |
1124 params.insert("type", ESecUiTypeKeyguard); |
1233 params.insert("type", ESecUiTypeKeyguard); |
1125 else if (aReason == ELockAppEnableDevicelock) |
1234 else if (aReason == ELockAppEnableDevicelock) |
1126 params.insert("type", ESecUiTypeDeviceLock); |
1235 params.insert("type", ESecUiTypeDeviceLock); |
1127 else |
1236 else |
1128 { |
1237 { |
1129 RDEBUG("error. status=1 but aReason", aReason); |
1238 RDEBUG("!!!!****!!!!! error. status=1 but aReason", aReason); |
1130 } |
1239 } |
1131 // no need for title. Icon should be explicit enough |
1240 // no need for title. Icon should be explicit enough |
1132 // params.insert("title", "Locked"); |
1241 // params.insert("title", "Locked"); |
1133 if (iDeviceDialogCreated < EDeviceDialogCreated) |
1242 if (iDeviceDialogCreated < EDeviceDialogCreated) |
1134 { |
1243 { |
1153 iDeviceDialogCreated = EDeviceDialogRaised; |
1262 iDeviceDialogCreated = EDeviceDialogRaised; |
1154 RDEBUG("new iDeviceDialogCreated", iDeviceDialogCreated); |
1263 RDEBUG("new iDeviceDialogCreated", iDeviceDialogCreated); |
1155 } |
1264 } |
1156 const QString KScreensaverDeviceDialog("com.nokia.screensaver.snsrdevicedialogplugin/1.0"); |
1265 const QString KScreensaverDeviceDialog("com.nokia.screensaver.snsrdevicedialogplugin/1.0"); |
1157 RDEBUG("pre show", aReason); |
1266 RDEBUG("pre show", aReason); |
1158 bool launchSuccesful = iDeviceDialog->show(KScreensaverDeviceDialog, params); // and continue processing |
1267 TInt skipScreenSaver=0; |
1159 RDEBUG("post show. bool launchSuccesful", launchSuccesful); |
1268 bool launchSuccesful = EFalse; |
|
1269 |
|
1270 TInt aCallStatus=-1; |
|
1271 err = RProperty::Get(KPSUidCtsyCallInformation, KCTsyCallState, aCallStatus); |
|
1272 RDEBUG("aCallStatus", aCallStatus); |
|
1273 // never create screensaver if active call. |
|
1274 if (aCallStatus != EPSCTsyCallStateUninitialized && aCallStatus != EPSCTsyCallStateNone && iLockStatus >= EDevicelockActive ) |
|
1275 { |
|
1276 skipScreenSaver=1; |
|
1277 RDEBUG("new skipScreenSaver", skipScreenSaver); |
|
1278 } |
|
1279 RDEBUG("skipScreenSaver", skipScreenSaver); |
|
1280 if(!skipScreenSaver) |
|
1281 { |
|
1282 if(iDeviceDialogCreated == EDeviceDialogCreated) |
|
1283 { |
|
1284 launchSuccesful = iDeviceDialog->show(KScreensaverDeviceDialog, params); // and continue processing |
|
1285 RDEBUG("post show. bool launchSuccesful", launchSuccesful); |
|
1286 } |
|
1287 else if(iDeviceDialogCreated == EDeviceDialogScreenSaverHidden || iDeviceDialogCreated == EDeviceDialogRaised) |
|
1288 { |
|
1289 RDEBUG("calling switchScreensaverMode ESnsrViewTypeActive", ESnsrViewTypeActive); |
|
1290 switchScreensaverMode( ESnsrViewTypeActive); |
|
1291 launchSuccesful = ETrue; |
|
1292 } |
|
1293 } |
|
1294 RDEBUG("bool launchSuccesful", launchSuccesful); |
1160 err = iDeviceDialog->error(); |
1295 err = iDeviceDialog->error(); |
1161 RDEBUG("iDeviceDialog->error", err); |
1296 RDEBUG("iDeviceDialog->error", err); |
1162 if (launchSuccesful) // TODO && !error ??? |
1297 if (launchSuccesful) // TODO && !error ??? |
1163 { |
1298 { |
1164 iDeviceDialogCreated = EDeviceDialogScreenSaver; |
1299 iDeviceDialogCreated = EDeviceDialogScreenSaver; |
1523 DebugStatus( iLockStatus); |
1661 DebugStatus( iLockStatus); |
1524 if (iLockStatus == ELockNotActive) |
1662 if (iLockStatus == ELockNotActive) |
1525 { |
1663 { |
1526 iShowKeyguardNote = 0; // no note on enable keyguard |
1664 iShowKeyguardNote = 0; // no note on enable keyguard |
1527 callerHasECapabilityWriteDeviceData = 1; |
1665 callerHasECapabilityWriteDeviceData = 1; |
1528 ret = TryChangeStatus(ELockAppEnableKeyguard); // this should not ask confirmation |
1666 // TODO ELockAppEnableDevicelock |
|
1667 CRepository *repository = 0; |
|
1668 int deviceLock = 0; |
|
1669 QT_TRAP_THROWING(repository = CRepository::NewL(KCRUidSecuritySettings)); |
|
1670 repository->Get(KSettingsAutoLockTime, deviceLock); |
|
1671 delete repository; |
|
1672 if (65535 == deviceLock) { |
|
1673 // Setting says "When keys& screen locked". Therefore device is also locked when screen is manually locked. |
|
1674 // TODO what about the API for screen lock? |
|
1675 ret = TryChangeStatus(ELockAppEnableDevicelock); // this should not ask confirmation |
|
1676 } else { |
|
1677 ret = TryChangeStatus(ELockAppEnableKeyguard); // this should not ask confirmation |
|
1678 } |
|
1679 |
1529 } |
1680 } |
1530 else if (iLockStatus == EKeyguardActive) |
1681 else if (iLockStatus == EKeyguardActive) |
1531 { |
1682 { |
1532 iShowKeyguardNote = 0; // no note on disable keyguard |
1683 iShowKeyguardNote = 0; // no note on disable keyguard |
1533 callerHasECapabilityWriteDeviceData = 1; |
1684 callerHasECapabilityWriteDeviceData = 1; |
1646 RDEBUG("aCallStatus", aCallStatus); |
1800 RDEBUG("aCallStatus", aCallStatus); |
1647 RWindowGroup& groupWin = CEikonEnv::Static()->RootWin(); |
1801 RWindowGroup& groupWin = CEikonEnv::Static()->RootWin(); |
1648 RDEBUG("iLockStatus", iLockStatus); |
1802 RDEBUG("iLockStatus", iLockStatus); |
1649 if (aCallStatus == EPSCTsyCallStateUninitialized || aCallStatus == EPSCTsyCallStateNone) |
1803 if (aCallStatus == EPSCTsyCallStateUninitialized || aCallStatus == EPSCTsyCallStateNone) |
1650 { |
1804 { |
|
1805 // Telephone might want to re-enable only-keyguard after the call ends. Allow it. This means re-showing the screensaver, not more. |
1651 RDEBUG("call is inactive", aCallStatus); |
1806 RDEBUG("call is inactive", aCallStatus); |
|
1807 if(iLockStatus == EDevicelockActive) |
|
1808 setLockDialog(ELockAppEnableKeyguard, 1); |
|
1809 |
1652 if (iLockStatus == EKeyguardActive || iLockStatus == EDevicelockActive) |
1810 if (iLockStatus == EKeyguardActive || iLockStatus == EDevicelockActive) |
1653 { |
1811 { |
1654 if (!mEKeyYesCaptureHandle) |
1812 if (!mEKeyYesCaptureHandle) |
1655 mEKeyYesCaptureHandle = groupWin.CaptureKey(EKeyYes, 0, 0); |
1813 mEKeyYesCaptureHandle = groupWin.CaptureKey(EKeyYes, 0, 0); |
1656 if (!mEKeyNoCaptureHandle) |
1814 if (!mEKeyNoCaptureHandle) |
1688 RDEBUG("0", 0); |
1851 RDEBUG("0", 0); |
1689 TInt aDismissDialog = ESecurityUIsDismissDialogUninitialized; |
1852 TInt aDismissDialog = ESecurityUIsDismissDialogUninitialized; |
1690 TInt err = RProperty::Get(KPSUidSecurityUIs, KSecurityUIsDismissDialog, aDismissDialog); |
1853 TInt err = RProperty::Get(KPSUidSecurityUIs, KSecurityUIsDismissDialog, aDismissDialog); |
1691 RDEBUG("err", err); |
1854 RDEBUG("err", err); |
1692 RDEBUG("aDismissDialog", aDismissDialog); |
1855 RDEBUG("aDismissDialog", aDismissDialog); |
|
1856 } |
|
1857 |
|
1858 void Autolock::subscriberKSecurityUIsTestCodeChanged() |
|
1859 { |
|
1860 RDEBUG("0", 0); |
|
1861 TInt aTestCode = -1; |
|
1862 TInt err = RProperty::Get(KPSUidSecurityUIs, KSecurityUIsTestCode, aTestCode); |
|
1863 RDEBUG("err", err); |
|
1864 RDEBUG("aTestCode", aTestCode); |
1693 } |
1865 } |
1694 // ----------AutolockService--------------- |
1866 // ----------AutolockService--------------- |
1695 |
1867 |
1696 AutolockService::AutolockService(Autolock* parent) : |
1868 AutolockService::AutolockService(Autolock* parent) : |
1697 XQServiceProvider(QLatin1String("com.nokia.services.Autolock.Autolock"), parent), mAutolock(parent), mAsyncReqId(-1), mAsyncAnswer(false) |
1869 XQServiceProvider(QLatin1String("com.nokia.services.Autolock.Autolock"), parent), mAutolock(parent), mAsyncReqId(-1), mAsyncAnswer(false) |