author | hgs |
Wed, 22 Sep 2010 18:06:15 +0300 | |
changeset 72 | 56a7be608841 |
parent 71 | 9352913932ef |
child 74 | 1505405bc645 |
permissions | -rw-r--r-- |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1 |
/* |
21
c4cbaa4fb734
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2 |
* Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies). |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3 |
* All rights reserved. |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5 |
* under the terms of "Eclipse Public License v1.0" |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
8 |
* |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
11 |
* |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
12 |
* Contributors: |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
13 |
* |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
14 |
* Description: CSysApAppUi implementation. |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
15 |
* |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
16 |
*/ |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
17 |
// INCLUDES |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
18 |
|
46 | 19 |
#include <startupdomainpskeys.h> |
20 |
#include "sysapappui.h" |
|
21 |
#include "coreapplicationuisprivatepskeys.h" |
|
22 |
#include <HbDeviceMessageBoxSymbian.h> |
|
23 |
//#include <hbdevicepowermenusymbian.h> |
|
24 |
#include <sacls.h> |
|
25 |
#include <featmgr.h> |
|
26 |
#include <DevEncProtectedPSKey.h> |
|
27 |
#include <ctsydomainpskeys.h> |
|
28 |
#include <secuisystemlock.h> |
|
29 |
#include <apgtask.h> |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
30 |
#include <hwrmpowerstatesdkpskeys.h> |
46 | 31 |
#include <wlaninternalpskeys.h> |
32 |
#include <HbDeviceNotificationDialogSymbian.h> |
|
33 |
#include <hbsymbianvariant.h> |
|
51 | 34 |
#include <hbtextresolversymbian.h> |
46 | 35 |
#include <UikonInternalPSKeys.h> |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
36 |
|
46 | 37 |
//#include "SysApWsClient.h" |
38 |
#include "SysApFeatureManager.h" |
|
39 |
#include "SysApNspsHandler.h" |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
40 |
#include "SysApPubSubObserver.h" |
46 | 41 |
#include "sysapdefaultkeyhandler.h" |
42 |
#include "SysApStartupController.h" |
|
43 |
#include "MSysApOfflineModeController.h" |
|
44 |
#include "SysApCenRepController.h" |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
45 |
#include "sysapcenreplightsettingsobserver.h" |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
46 |
#include "SysApCenRepLogsObserver.h" |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
47 |
#include "SysApCenRepBTObserver.h" |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
48 |
#include "SysApCenRepHacSettingObserver.h" |
46 | 49 |
#include "sysapaudioroutingobserver.h" |
50 |
#include "sysapbatteryinfocontroller.h" |
|
51 |
#include "SysApSimChanged.h" |
|
52 |
#include "MSysApBtSapController.h" |
|
53 |
#include "MSysApBtController.h" |
|
54 |
#include "MSysApUsbIndicator.h" |
|
55 |
#include "sysapkeymanagement.h" |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
56 |
#include "SysApShutdownImage.h" |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
57 |
#include "SysApKeySndHandler.h" |
72 | 58 |
#include "SysApCenRepSilentModeObserver.h" |
51 | 59 |
#include "SysApShutdownAnimation.h" |
60 |
#include "SysApEtelConnector.h" |
|
61 |
||
61 | 62 |
#ifdef RD_MULTIPLE_DRIVE |
63 |
#include "sysapdrivelist.h" |
|
64 |
#include "sysapdriveunlockhandler.h" |
|
65 |
#include "sysapdriveejecthandler.h" |
|
66 |
#include "hbdeviceinputdialogsymbian.h" |
|
67 |
#endif // RD_MULTIPLE_DRIVE |
|
51 | 68 |
|
46 | 69 |
#include <settingsinternalcrkeys.h> |
70 |
#include <keyguardaccessapi.h> |
|
71 |
#include <eikdef.h> |
|
72 |
#include <eikenv.h> |
|
51 | 73 |
#include <UsbWatcherInternalPSKeys.h> // USB transfer modes |
74 |
#include <usbpersonalityids.h> |
|
75 |
#include "sysap.rsg" |
|
76 |
#include <hbindicatorsymbian.h> |
|
72 | 77 |
//Qt Highway |
78 |
#include <xqappmgr.h> |
|
79 |
#include <xqaiwdecl.h> |
|
80 |
#include <xqaiwrequest.h> |
|
81 |
#include <QString.h> |
|
82 |
#include <QVariant.h> |
|
83 |
#include <QMap.h> |
|
84 |
#include <QList.h> |
|
85 |
//For End Key |
|
86 |
#include <APGWGNAM.H> |
|
87 |
//For HS RPropertyKey |
|
88 |
#include <homescreendomainpskeys.h> |
|
89 |
//For Hs Changes |
|
90 |
#include <afactivitylauncher.h> |
|
91 |
#include <apgcli.h> |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
92 |
|
46 | 93 |
class CHbSymbianVariant; |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
94 |
const TInt KModifierMask( 0 ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
95 |
_LIT_SECURITY_POLICY_PASS(KAlwaysPassPolicy); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
96 |
_LIT_SECURITY_POLICY_C1(KWriteDeviceDataPolicy, ECapabilityWriteDeviceData); |
46 | 97 |
const TInt KDelayBeforeNextScanningRound( 1000000 ); |
51 | 98 |
|
99 |
/* ENABLE ANIMATION: Add id of background image. |
|
100 |
Example: const TInt KBackgroundImageID = EMbmSysapQgn_graf_startup_bg; |
|
101 |
If there is no image defined, clear screen is used.*/ |
|
102 |
const TInt KBackgroundImageID = 0; |
|
103 |
||
104 |
||
105 |
_LIT(KAccesoryPlugin,"com.nokia.accessory.indicatorplugin/1.0"); |
|
106 |
_LIT(KAccMode, "AccMode"); |
|
107 |
_LIT(KAccPhyConType, "AccType"); |
|
108 |
||
46 | 109 |
_LIT(KPsmPlugin,"com.nokia.hb.powersavemodeplugin/1.0"); |
110 |
_LIT(KPsm,"PSM"); |
|
111 |
_LIT(KCharging,"Charging"); |
|
112 |
_LIT(KPsmlocalisationfile, "powermanagement_"); |
|
113 |
_LIT(KtsfilePath, "z:/resource/qt/translations/"); |
|
114 |
_LIT(KlowbatteryIcon,"qtg_small_bt_low_battery.svg"); |
|
115 |
_LIT(KbatteryFullIcon,"qtg_status_battery.svg"); |
|
116 |
||
51 | 117 |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
118 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
119 |
// ============================ MEMBER FUNCTIONS ============================== |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
120 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
121 |
// ---------------------------------------------------------------------------- |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
122 |
// CSysApAppUi::CSysApAppUi() |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
123 |
// ---------------------------------------------------------------------------- |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
124 |
|
46 | 125 |
CSysApAppUi::CSysApAppUi() |
126 |
:iSysApShutdownImage(NULL), |
|
127 |
iPowerMenuDialog(NULL), |
|
128 |
iDeviceLockEnabled(EFalse), |
|
129 |
iKeyLockEnabled(EFalse), |
|
130 |
iPowerKeyPopupMenuActive(EFalse), |
|
131 |
iResourcesFreed (EFalse), |
|
132 |
iShutdownStarted (EFalse), |
|
133 |
iSysApAudioRoutingObserver (NULL), |
|
134 |
iSysApBatteryInfoController (NULL), |
|
135 |
iSysApPsmController(NULL), |
|
136 |
iSapTimer (NULL), |
|
137 |
iSysApCenRepLogsObserver (NULL), |
|
138 |
iSysApUsbIndicatorController(NULL), |
|
139 |
iKeyguardController (NULL), |
|
140 |
iKeyLockOnBeforeCall (EFalse), |
|
61 | 141 |
iCheckLongPowerKeyEvent (EFalse), |
142 |
iMMCEjectUsed( EFalse ), |
|
143 |
iMemCardPwdDialog(NULL) |
|
46 | 144 |
{ |
145 |
TRACES( RDebug::Print( _L("CSysApAppUi::CSysApAppUi()") ) ); |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
146 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
147 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
148 |
// ---------------------------------------------------------------------------- |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
149 |
// CSysApAppUi::ConstructL() |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
150 |
// ---------------------------------------------------------------------------- |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
151 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
152 |
void CSysApAppUi::ConstructL() |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
153 |
{ |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
154 |
TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: START") ) ); |
46 | 155 |
TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: trying BaseConstructL()") ) ); |
156 |
BaseConstructL(); |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
157 |
TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: BaseConstructL() OK") ) ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
158 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
159 |
iEikonEnv->SetSystem( ETrue ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
160 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
161 |
iEikonEnv->WsSession().ComputeMode( RWsSession::EPriorityControlDisabled ); |
46 | 162 |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
163 |
RThread().SetProcessPriority( EPriorityForeground ); |
46 | 164 |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
165 |
TInt mode; |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
166 |
User::LeaveIfError( RProperty::Get( KPSUidStartup, KPSGlobalStartupMode, mode ) ); |
46 | 167 |
TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: KPSGlobalStartupMode = %d"), mode ) ); |
168 |
||
169 |
//SysAp needs to capture PowerKey events because it handles all functionality related to that |
|
170 |
TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: trying CEikApplication::RootWin()") ) ); |
|
171 |
RWindowGroup groupWin = iCoeEnv->RootWin(); |
|
172 |
User::LeaveIfError ( iCapturedEKeyPowerOff = groupWin.CaptureKey( EKeyPowerOff, KModifierMask, KModifierMask ) ); |
|
173 |
User::LeaveIfError ( iCapturedEKeyPowerOffUpAndDowns = groupWin.CaptureKeyUpAndDowns( EStdKeyDevice2, KModifierMask, KModifierMask ) ); |
|
72 | 174 |
//Capture SEND and END keys |
175 |
User::LeaveIfError ( iCapturedEKeySendKey = groupWin.CaptureKey( EKeyPhoneSend, KModifierMask, KModifierMask ) ); |
|
176 |
User::LeaveIfError ( iCapturedEKeyEndKey = groupWin.CaptureKey( EKeyPhoneEnd, KModifierMask, KModifierMask ) ); |
|
177 |
||
46 | 178 |
TRACES ( RDebug::Print( _L("CSysApAppUi::ConstructL: trying CSysApDefaultKeyHandler::NewL()") ) ); |
179 |
iSysApDefaultKeyHandler = CSysApDefaultKeyHandler::NewL(*this); |
|
180 |
||
181 |
// Define P&S keys "owned" by SysAp |
|
182 |
RProperty::Define( KPSUidUikon, KUikMMCInserted, RProperty::EInt, KAlwaysPassPolicy, KWriteDeviceDataPolicy ); |
|
183 |
//initially assuming that the memory card is not inserted |
|
184 |
RProperty::Set( KPSUidUikon, KUikMMCInserted, 0 ); |
|
185 |
TDriveInfo driveInfo; |
|
186 |
TInt driveNumber; |
|
187 |
TInt err; |
|
188 |
RFs& fileServer = iEikonEnv->FsSession(); |
|
189 |
for ( driveNumber = EDriveD; driveNumber < EDriveZ; driveNumber++ ) |
|
190 |
{ |
|
191 |
err = fileServer.Drive(driveInfo,driveNumber); |
|
192 |
if(driveNumber == EDriveF && err == KErrNone && driveInfo.iType == EMediaHardDisk && driveInfo.iDriveAtt & KDriveAttRemovable) |
|
193 |
{ |
|
194 |
TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: err = %d, driveInfo.iType = %d, driveInfo.iDriveAtt %d, KDriveAttRemovable = %d "),err,driveInfo.iType,driveInfo.iDriveAtt,KDriveAttRemovable) ); |
|
195 |
RProperty::Set( KPSUidUikon, KUikMMCInserted, 1 ); |
|
196 |
break; // Memory card drive found... |
|
197 |
} |
|
198 |
} |
|
199 |
||
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
200 |
TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: trying CSysApFeatureManager::NewL()") ) ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
201 |
iSysApFeatureManager = CSysApFeatureManager::NewL(); |
46 | 202 |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
203 |
// Setup USB charging detector |
46 | 204 |
iSysApUsbChargerDetector.EnableUsbCharging( |
205 |
iSysApFeatureManager->Supported( KSysApFeatureIdChargerReminderNotes ) && |
|
206 |
iSysApFeatureManager->Supported( KSysApFeatureIdUsbChargingWithoutReminderNotes ) ); |
|
207 |
||
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
208 |
TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: trying CSysApPubSubObserver::NewL()") ) ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
209 |
iSysApPubSubObserver = CSysApPubSubObserver::NewL( *this ); |
46 | 210 |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
211 |
RProperty::Define( KPSUidCoreApplicationUIs, KCoreAppUIsPoCIndicator, RProperty::EInt, KAlwaysPassPolicy, KWriteDeviceDataPolicy ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
212 |
RProperty::Set( KPSUidCoreApplicationUIs, KCoreAppUIsPoCIndicator, ECoreAppUIsPocIndicatorUninitialized ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
213 |
RProperty::Define( KPSUidCoreApplicationUIs, KCoreAppUIsPoCMissedIndicator, RProperty::EInt, KAlwaysPassPolicy, KWriteDeviceDataPolicy ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
214 |
RProperty::Set( KPSUidCoreApplicationUIs, KCoreAppUIsPoCMissedIndicator, ECoreAppUIsPocMissedIndicatorUninitialized ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
215 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
216 |
// initial value won't be set to KCoreAppUIsUSBFileTransfer, because UsbMscPersonality-plugin may also define it if USB cable is connected during boot |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
217 |
// remove this definition after all clients have taken the USB personality ids in use |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
218 |
RProperty::Define( KPSUidCoreApplicationUIs, KCoreAppUIsUSBFileTransfer, RProperty::EInt, KAlwaysPassPolicy, KWriteDeviceDataPolicy ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
219 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
220 |
RProperty::Define( KPSUidCoreApplicationUIs, KCoreAppUIsVideoSharingIndicator, RProperty::EInt, KAlwaysPassPolicy, KWriteDeviceDataPolicy ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
221 |
RProperty::Set( KPSUidCoreApplicationUIs, KCoreAppUIsVideoSharingIndicator, ECoreAppUIsVideoSharingIndicatorUninitialized ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
222 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
223 |
RProperty::Define( KPSUidCoreApplicationUIs, KCoreAppUIsHideAlarm, RProperty::EInt, KAlwaysPassPolicy, KWriteDeviceDataPolicy ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
224 |
RProperty::Define( KPSUidCoreApplicationUIs, KCoreAppUIsDisableKeyguard, RProperty::EInt, KAlwaysPassPolicy, KWriteDeviceDataPolicy ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
225 |
RProperty::Define( KPSUidCoreApplicationUIs, KCoreAppUIsSoftReject, RProperty::EInt, KAlwaysPassPolicy, KWriteDeviceDataPolicy ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
226 |
RProperty::Define( KPSUidCoreApplicationUIs, KCoreAppUIsUipInd, RProperty::EInt, KAlwaysPassPolicy, KWriteDeviceDataPolicy ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
227 |
RProperty::Define( KPSUidCoreApplicationUIs, KCoreAppUIsMessageToneQuit, RProperty::EInt, KAlwaysPassPolicy, KWriteDeviceDataPolicy ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
228 |
RProperty::Define( KPSUidCoreApplicationUIs, KCoreAppUIsNspsRawKeyEvent, RProperty::EInt, KAlwaysPassPolicy, KWriteDeviceDataPolicy ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
229 |
RProperty::Define( KPSUidCoreApplicationUIs, KCoreAppUIsLightsRawKeyEvent, RProperty::EInt, KAlwaysPassPolicy, KWriteDeviceDataPolicy ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
230 |
RProperty::Define( KPSUidCoreApplicationUIs, KCoreAppUIsMmcRemovedWithoutEject, RProperty::EInt, KAlwaysPassPolicy, KWriteDeviceDataPolicy ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
231 |
RProperty::Define( KPSUidCoreApplicationUIs, KLightsAlarmLightActive, RProperty::EInt, KAlwaysPassPolicy, KWriteDeviceDataPolicy ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
232 |
RProperty::Define( KPSUidCoreApplicationUIs, KLightsVTForcedLightsOn, RProperty::EInt, KAlwaysPassPolicy, KWriteDeviceDataPolicy ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
233 |
RProperty::Define( KPSUidCoreApplicationUIs, KLightsSSForcedLightsOn, RProperty::EInt, KAlwaysPassPolicy, KWriteDeviceDataPolicy ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
234 |
RProperty::Define( KPSUidCoreApplicationUIs, KLightsATCForcedLightsOn, RProperty::EInt, KAlwaysPassPolicy, KWriteDeviceDataPolicy ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
235 |
RProperty::Define( KPSUidCoreApplicationUIs, KLightsControl, RProperty::EInt, KAlwaysPassPolicy, KWriteDeviceDataPolicy ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
236 |
RProperty::Define( KPSUidCoreApplicationUIs, KCoreAppUIsTarmIndicator, RProperty::EInt, KAlwaysPassPolicy, KWriteDeviceDataPolicy ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
237 |
RProperty::Define( KPSUidCoreApplicationUIs, KCoreAppUIsMtvRecStatus, RProperty::EInt, KAlwaysPassPolicy, KWriteDeviceDataPolicy ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
238 |
RProperty::Define( KPSUidCoreApplicationUIs, KCoreAppUIsMtvDvbhStatus, RProperty::EInt, KAlwaysPassPolicy, KWriteDeviceDataPolicy ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
239 |
RProperty::Define( KPSUidCoreApplicationUIs, KCoreAppUIsNewEmailStatus, RProperty::EInt, KAlwaysPassPolicy, KWriteDeviceDataPolicy ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
240 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
241 |
// Initialize P&S keys "owned" by SysAp |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
242 |
RProperty::Set( KPSUidCoreApplicationUIs, KCoreAppUIsHideAlarm, ECoreAppUIsHideAlarmUninitialized ); |
46 | 243 |
|
244 |
TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: trying CSysApAccessoryObserver::NewL()") ) ); |
|
245 |
iSysApAccessoryObserver = CSysApAccessoryObserver::NewL( *this ); |
|
246 |
||
247 |
TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: trying CSysApCenRepController::NewL()") ) ); |
|
248 |
iSysApCenRepController = CSysApCenRepController::NewL(); |
|
249 |
||
250 |
TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: trying CSysApCenRepLightSettingsObserver::NewL") ) ); |
|
251 |
iSysApCenRepLightSettingsObserver = CSysApCenRepLightSettingsObserver::NewL( *this ); |
|
252 |
||
253 |
TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: trying CSysApCenRepBtObserver::NewL") ) ); |
|
254 |
iSysApCenRepBtObserver = CSysApCenRepBtObserver::NewL( *this ); |
|
255 |
||
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
256 |
TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: trying CSysApStartupController::NewL()") ) ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
257 |
iSysApStartupController = CSysApStartupController::NewL( *this, iSysApFeatureManager->OfflineModeSupported() ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
258 |
|
46 | 259 |
iActiveProfileBeforeOfflineMode = iSysApCenRepController->GetInt( KCRUidCoreApplicationUIsSysAp, KSysApProfileBeforeOfflineMode ); |
260 |
||
261 |
iSysApFeatureManager->FeatureVariationCheckDone(); |
|
262 |
||
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
263 |
TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: trying CSysApLightsController::NewL()") ) ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
264 |
iSysApLightsController = CSysApLightsController::NewL( *this, |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
265 |
iSysApCenRepLightSettingsObserver->GetLightsTimeout(), |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
266 |
iSysApFeatureManager->CoverDisplaySupported() ); |
46 | 267 |
|
268 |
TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL : trying CreateSysApOfflineModeControllerL()") ) ); |
|
269 |
iSysApOfflineModeController = CreateSysApOfflineModeControllerL( *this ); |
|
270 |
||
271 |
TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL : trying DoInitialSwStateCheckL()") ) ); |
|
272 |
iSysApStartupController->DoInitialSwStateCheckL(); |
|
273 |
||
274 |
TRACES( RDebug::Print( _L("CCSysApAppUi::ConstructL trying CSysApCenRepHacSettingObserver::NewL") ) ); |
|
275 |
iSysApCenRepHacSettingObserver = CSysApCenRepHacSettingObserver::NewL( *this ); |
|
276 |
||
72 | 277 |
TRACES( RDebug::Print( _L("CCSysApAppUi::ConstructL trying CSysApCenRepSilentModeObserver::NewL") ) ); |
278 |
iSysApCenRepSilentModeObserver = CSysApCenRepSilentModeObserver::NewL( ); |
|
279 |
||
280 |
||
61 | 281 |
#ifndef RD_MULTIPLE_DRIVE |
282 |
if ( iSysApFeatureManager->MmcSupported() ) |
|
283 |
{ |
|
284 |
iSysApMMCObserver = CSysApMMCObserver::NewL( this, &iEikonEnv->FsSession(), iSysApFeatureManager->MmcHotSwapSupported() ); |
|
285 |
} |
|
286 |
#else // RD_MULTIPLE_DRIVE |
|
287 |
iSysApDriveList = CSysApDriveList::NewL( iEikonEnv->FsSession() ); |
|
288 |
if ( iSysApFeatureManager->MmcSupported() ) |
|
289 |
{ |
|
290 |
iSysApMMCObserver = CSysApMMCObserver::NewL( |
|
291 |
iEikonEnv->FsSession(), *iSysApDriveList, *this, iSysApFeatureManager->MmcHotSwapSupported() ); |
|
292 |
iSysApDriveUnlockHandler = CSysApDriveUnlockHandler::NewL( |
|
293 |
*iSysApDriveList, *this, iSysApFeatureManager->MemoryCardLockSupported() ); |
|
294 |
iSysApDriveEjectHandler = CSysApDriveEjectHandler::NewL( |
|
295 |
*iSysApDriveList, *this, iEikonEnv->FsSession() ); |
|
296 |
} |
|
297 |
#endif // RD_MULTIPLE_DRIVE |
|
298 |
||
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
299 |
//Instantiate the KEF plugin manager |
46 | 300 |
//Trap constuction, since Sysap may live without iSysApKeyManagement |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
301 |
TRAPD(keyManagementErr, iSysApKeyManagement=CSysApKeyManagement::NewL(CCoeEnv::Static()->RootWin(), *this)); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
302 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
303 |
if (keyManagementErr) |
46 | 304 |
{ |
305 |
TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL : CSysApKeyManagement::NewL returns error=%d"), keyManagementErr ) ); |
|
306 |
} |
|
307 |
||
51 | 308 |
TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: trying CSysApEtelConnector::NewL()") ) ); |
309 |
iSysApEtelConnector = CSysApEtelConnector::NewL( *this ); |
|
310 |
||
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
311 |
// Initialize animdll for handling side volume keys |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
312 |
// (needed before normal mode in case emergency number is dialed from PIN query) |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
313 |
iSysApKeySndHandler = CSysApKeySndHandler::NewL(iEikonEnv->WsSession()); |
46 | 314 |
iKeyguardController = CKeyguardAccessApi::NewL(); |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
315 |
TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: trying CSysApShutdownImage::NewL()") ) ); |
46 | 316 |
iSysApShutdownImage = CSysApShutdownImage::NewL();//NULL; // |
317 |
||
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
318 |
// Initialize nsps handler. Needed for proper lights control during PIN query. |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
319 |
TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: trying CSysApNspsHandler::NewL") ) ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
320 |
iSysApNspsHandler = CSysApNspsHandler::NewL( iEikonEnv->WsSession(), iSysApShutdownImage->ShutdownCoeControlWindow() ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
321 |
|
46 | 322 |
RProperty::Define( KPSUidCoreApplicationUIs,KCoreAppUIsPowerMenuCustomDialogStatus, RProperty::EInt, KAlwaysPassPolicy, KWriteDeviceDataPolicy ); |
323 |
RProperty::Set( KPSUidCoreApplicationUIs, KCoreAppUIsPowerMenuCustomDialogStatus, ECoreAppUIsPowerMenuCustomDialogUninitialized ); |
|
324 |
||
51 | 325 |
TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: trying CHbIndicatorSymbian::NewL()") ) ); |
326 |
iHbIndicatorSymbian = CHbIndicatorSymbian::NewL(); |
|
327 |
||
54 | 328 |
TBool result = HbTextResolverSymbian::Init(KPsmlocalisationfile, KtsfilePath); |
51 | 329 |
|
46 | 330 |
TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: END") ) ); |
331 |
} |
|
332 |
||
333 |
// ---------------------------------------------------------------------------- |
|
334 |
// CSysApAppUi::FreeResources() |
|
335 |
// ---------------------------------------------------------------------------- |
|
336 |
||
337 |
void CSysApAppUi::FreeResources() |
|
338 |
{ |
|
339 |
TRACES( RDebug::Print( _L("CSysApAppUi::FreeResources") ) ); |
|
340 |
delete iSysApBatteryInfoController; |
|
341 |
delete iSysApPsmController; |
|
51 | 342 |
delete iVariantAccState; |
46 | 343 |
|
344 |
delete iSysApAudioRoutingObserver; |
|
61 | 345 |
|
346 |
if (iMemCardPwdDialog!=NULL) |
|
347 |
{ |
|
348 |
//PowerMenu already exist |
|
349 |
delete iMemCardPwdDialog; |
|
350 |
iMemCardPwdDialog = NULL; |
|
351 |
} |
|
352 |
||
46 | 353 |
if ( iSapTimer ) |
354 |
{ |
|
355 |
iSapTimer->Cancel(); |
|
356 |
delete iSapTimer; |
|
357 |
} |
|
358 |
//Powermenu |
|
359 |
if (iPowerMenuDialog!=NULL) |
|
360 |
{ |
|
361 |
//PowerMenu already exist |
|
362 |
delete iPowerMenuDialog; |
|
363 |
iPowerMenuDialog = NULL; |
|
364 |
} |
|
365 |
||
366 |
RWindowGroup groupWin = iCoeEnv->RootWin(); |
|
367 |
groupWin.CancelCaptureKey( iCapturedEKeyPowerOff ); |
|
368 |
groupWin.CancelCaptureKeyUpAndDowns( iCapturedEKeyPowerOffUpAndDowns ); |
|
72 | 369 |
//Deregister SendKey |
370 |
groupWin.CancelCaptureKey( iCapturedEKeySendKey ); |
|
371 |
//Deregister EndKey |
|
372 |
groupWin.CancelCaptureKey( iCapturedEKeyEndKey ); |
|
46 | 373 |
|
374 |
delete iSysApDefaultKeyHandler; |
|
375 |
delete iSysApCenRepLightSettingsObserver; |
|
376 |
delete iSysApCenRepBtObserver; |
|
377 |
delete iSysApCenRepHacSettingObserver; |
|
378 |
delete iSysApCenRepController; |
|
72 | 379 |
delete iSysApCenRepSilentModeObserver; |
46 | 380 |
delete iSysApPubSubObserver; |
381 |
||
382 |
delete iSysApLightsController; |
|
383 |
delete iSysApFeatureManager; |
|
384 |
||
385 |
delete iSysApCenRepLogsObserver; |
|
386 |
delete iSysApOfflineModeController; |
|
387 |
||
388 |
delete iSysApUsbIndicatorController; |
|
389 |
delete iKeyguardController; |
|
51 | 390 |
delete iHbIndicatorSymbian; |
46 | 391 |
delete iSysApKeyManagement; |
392 |
iSysApKeyManagement = NULL; |
|
393 |
||
394 |
REComSession::FinalClose(); |
|
395 |
iResourcesFreed = ETrue; |
|
396 |
TRACES( RDebug::Print( _L("CSysApAppUi::FreeResources:END") ) ); |
|
397 |
} |
|
398 |
||
399 |
// --------------------------------------------------------------------------- |
|
400 |
// CStartupAppUi::PrepareToExit() |
|
401 |
// --------------------------------------------------------------------------- |
|
402 |
void CSysApAppUi::PrepareToExit() |
|
403 |
{ |
|
51 | 404 |
TRACES(RDebug::Print( _L("CSysApAppUi::PrepareToExit()"))); |
46 | 405 |
CEikAppUi::PrepareToExit(); |
406 |
} |
|
407 |
||
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
408 |
|
46 | 409 |
// ---------------------------------------------------------------------------- |
410 |
// CSysApAppUi::StateOfProperty() |
|
411 |
// ---------------------------------------------------------------------------- |
|
412 |
TInt CSysApAppUi::StateOfProperty( const TUid& aCategory, const TUint aKey ) const |
|
413 |
{ |
|
414 |
TInt err( KErrNone ); |
|
415 |
TInt value( 0 ); |
|
416 |
err = RProperty::Get( aCategory, aKey, value ); |
|
417 |
if ( err ) |
|
418 |
{ |
|
419 |
TRACES( RDebug::Print( _L("CSysApAppUi::StateOfProperty. RProperty::Get: err=%d"), err ) ); |
|
420 |
return err; |
|
421 |
} |
|
422 |
return value; |
|
423 |
} |
|
424 |
||
425 |
// ---------------------------------------------------------------------------- |
|
426 |
// CSysApAppUi::OfflineModeActive() |
|
427 |
// ---------------------------------------------------------------------------- |
|
428 |
TBool CSysApAppUi::OfflineModeActive() |
|
429 |
{ |
|
430 |
if(iSysApOfflineModeController) |
|
431 |
{ |
|
432 |
return iSysApOfflineModeController->OfflineModeActive(); |
|
433 |
} |
|
434 |
else |
|
435 |
{ |
|
436 |
return EFalse; |
|
437 |
} |
|
438 |
} |
|
439 |
||
440 |
// ---------------------------------------------------------------------------- |
|
441 |
// CSysApAppUi::GoOnlineL() |
|
442 |
// ---------------------------------------------------------------------------- |
|
443 |
||
444 |
void CSysApAppUi::GoOnlineL( TBool /* aDoProfileChange */ ) |
|
445 |
{ |
|
446 |
if ( iSysApFeatureManager->OfflineModeSupported() ) |
|
447 |
{ |
|
448 |
// TRACES( RDebug::Print( _L("CSysApAppUi::GoOnlineL: going from off-line into on-line: aDoProfileChange=%d" ), aDoProfileChange ) ); |
|
449 |
iActivateBt = iSysApOfflineModeController->MustBtBeActivated(); |
|
450 |
iSysApOfflineModeController->SwitchFromOfflineToOnlineModeL(); |
|
451 |
TRACES( RDebug::Print( _L("CSysApAppUi::GoOnlineL: iActivateBt = %d" ), iActivateBt ) ); |
|
452 |
} |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
453 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
454 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
455 |
// ---------------------------------------------------------------------------- |
46 | 456 |
// CSysApAppUi::GoOfflineL() |
457 |
// ---------------------------------------------------------------------------- |
|
458 |
||
459 |
void CSysApAppUi::GoOfflineL() |
|
460 |
{ |
|
461 |
if ( iSysApFeatureManager->OfflineModeSupported() ) |
|
462 |
{ |
|
463 |
TRACES( RDebug::Print( _L("CSysApAppUi::GoOfflineL" ) ) ); |
|
464 |
iDeactivateBt = ETrue; |
|
465 |
iSysApOfflineModeController->SwitchFromOnlineToOfflineModeL(); |
|
466 |
} |
|
467 |
} |
|
468 |
||
469 |
#ifndef SYSAP_USE_STARTUP_UI_PHASE |
|
470 |
// need to configure the above macro. |
|
471 |
#else // SYSAP_USE_STARTUP_UI_PHASE |
|
472 |
||
473 |
// ---------------------------------------------------------------------------- |
|
474 |
// CSysApAppUi::HandleUiReadyAfterBootL() |
|
475 |
// Called when startup UI activities has been finished |
|
476 |
// ---------------------------------------------------------------------------- |
|
477 |
||
478 |
void CSysApAppUi::HandleUiReadyAfterBootL() |
|
479 |
{ |
|
480 |
TRACES( RDebug::Print(_L("CSysApAppUi::HandleUiReadyAfterBootL" ) ) ); |
|
481 |
TInt state( StateOfProperty( KPSUidHWRMPowerState, KHWRMBatteryLevel ) ); |
|
482 |
||
483 |
UpdateBatteryBarsL( state ); |
|
484 |
DoSwStateNormalConstructionL(); |
|
51 | 485 |
HandleAccessoryProfileInStartupL(); |
486 |
||
61 | 487 |
if ( iSysApFeatureManager->MmcSupported() ) |
488 |
{ |
|
489 |
#ifndef RD_MULTIPLE_DRIVE |
|
490 |
MountMMC(); |
|
491 |
MMCStatusChangedL(); |
|
492 |
iHideFirstBeep = EFalse; |
|
493 |
#else // RD_MULTIPLE_DRIVE |
|
71 | 494 |
if(iSysApDriveList == NULL) |
495 |
{ |
|
496 |
iSysApDriveList = CSysApDriveList::NewL( iEikonEnv->FsSession() ); |
|
497 |
} |
|
61 | 498 |
iSysApDriveList->MountDrive( iSysApDriveList->DefaultMemoryCard() ); |
499 |
UpdateInsertedMemoryCardsL(); |
|
500 |
#endif // RD_MULTIPLE_DRIVE |
|
501 |
} |
|
502 |
||
503 |
if ( iSysApFeatureManager->MmcHotSwapSupported() ) |
|
504 |
{ |
|
71 | 505 |
if(iSysApMMCObserver == NULL) |
506 |
{ |
|
507 |
iSysApMMCObserver = CSysApMMCObserver::NewL( |
|
508 |
iEikonEnv->FsSession(), *iSysApDriveList, *this, iSysApFeatureManager->MmcHotSwapSupported() ); |
|
509 |
} |
|
61 | 510 |
iSysApMMCObserver->StartMountObserver(); |
511 |
} |
|
46 | 512 |
|
513 |
if ( !iSysApPsmController ) // created here if first state change has not occurred yet |
|
514 |
{ |
|
515 |
iSysApPsmController = CSysApPsmController::NewL( *this ); |
|
516 |
} |
|
517 |
||
518 |
if ( iSysApPsmController ) |
|
519 |
{ |
|
51 | 520 |
if ( iCharging ) // if charger is connected on boot PSM queries may need to be shown |
46 | 521 |
{ |
522 |
HandleChargingStatusL( StateOfProperty( KPSUidHWRMPowerState, KHWRMChargingStatus ) ); |
|
523 |
} |
|
51 | 524 |
|
525 |
if ( iSysApPsmController->FullPsmEnabled() ) |
|
526 |
{ |
|
527 |
// activate psm indicator |
|
528 |
iVariantAccState = CHbSymbianVariant::NewL(&KPsm, CHbSymbianVariant::EDes); |
|
529 |
if (!iHbIndicatorSymbian->Activate(KPsmPlugin,iVariantAccState)) |
|
530 |
{ |
|
531 |
int error = iHbIndicatorSymbian->Error(); |
|
532 |
//use the errorcode... |
|
533 |
} |
|
534 |
} |
|
535 |
||
46 | 536 |
} |
537 |
||
538 |
TInt batteryStatus = StateOfProperty( KPSUidHWRMPowerState, KHWRMBatteryStatus ); |
|
539 |
TRACES( RDebug::Print(_L("CSysApAppUi::HandleUiReadyAfterBootL: batteryStatus %d" ), batteryStatus ) ); |
|
540 |
if( batteryStatus == EBatteryStatusLow || batteryStatus == EBatteryStatusEmpty ) |
|
541 |
{ |
|
542 |
// low and empty battery states are informed to the user in device startup |
|
543 |
HandleBatteryStatusL( batteryStatus ); |
|
544 |
} |
|
545 |
else if ( iSysApPsmController && !iCharging ) |
|
546 |
{ |
|
547 |
TRACES( RDebug::Print(_L("CSysApAppUi::HandleUiReadyAfterBootL: batteryStatus %d, iCharging %d -> disable partial psm" ), batteryStatus, iCharging ) ); |
|
548 |
||
549 |
iSysApPsmController->BatteryLow( EFalse ); |
|
550 |
iSysApPsmController->DoEnablePartialPsm( EFalse ); |
|
551 |
} |
|
552 |
||
553 |
if ( ! iSysApUsbIndicatorController ) |
|
554 |
{ |
|
555 |
TRAPD ( usbErr, iSysApUsbIndicatorController = CreateSysApUsbIndicatorL( *this ) ); |
|
556 |
if ( usbErr ) |
|
557 |
{ |
|
558 |
TRACES( RDebug::Print(_L("CSysApAppUi::HandleUiReadyAfterBootL: error in constructing USB ind. controller %d" ), usbErr ) ); |
|
559 |
} |
|
560 |
} |
|
561 |
} |
|
562 |
||
563 |
// ---------------------------------------------------------------------------- |
|
564 |
// CSysApAppUi::DoStateChangedL(const RStarterSession::TGlobalState aSwState) |
|
565 |
// This method is not called after boot has finished. |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
566 |
// ---------------------------------------------------------------------------- |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
567 |
|
46 | 568 |
void CSysApAppUi::DoStateChangedL(const RStarterSession::TGlobalState aSwState) |
569 |
{ |
|
570 |
TRACES( RDebug::Print(_L("CSysApAppUi::DoStateChangedL: %d" ), aSwState ) ); |
|
571 |
||
572 |
TRAPD( simChangedErr, DoSimChangedFromPreviousBootL() ); |
|
573 |
TRACES( RDebug::Print( _L("CSysApAppUi::DoStateChangedL: simChangedErr = %d" ), simChangedErr ) ); |
|
574 |
simChangedErr = simChangedErr; // suppress 'variable not used' warning |
|
575 |
LogsObserverL().HandleSimChangedCheckDoneL(); |
|
576 |
||
577 |
if ( iSysApFeatureManager->PowerSaveSupported() ) |
|
578 |
{ |
|
579 |
// create controller before checking battery state, so that power saving can be enabled during boot if needed |
|
580 |
if ( !iSysApPsmController ) // created only in first state change |
|
581 |
{ |
|
582 |
iSysApPsmController = CSysApPsmController::NewL( *this ); |
|
583 |
} |
|
584 |
||
585 |
// in charger boot explicitly disable power save mode |
|
586 |
if ( aSwState == RStarterSession::ECharging ) |
|
587 |
{ |
|
588 |
iSysApPsmController->ChargerConnected(); |
|
51 | 589 |
iSysApPsmController->DoEnableFullPsm(EFalse); // disable power save now |
46 | 590 |
} |
591 |
} |
|
592 |
||
593 |
if ( aSwState == RStarterSession::ECharging || aSwState == RStarterSession::EAlarm ) |
|
594 |
{ |
|
595 |
TInt state( StateOfProperty( KPSUidHWRMPowerState, KHWRMBatteryLevel ) ); |
|
596 |
//Also Charging status will be updated with the following function. |
|
597 |
UpdateBatteryBarsL( state ); |
|
598 |
} |
|
599 |
||
600 |
if( IsStateNormal() ) |
|
601 |
{ |
|
602 |
TRACES( RDebug::Print(_L("CSysApAppUi::DoStateChangedL to normal state.") ) ); |
|
71 | 603 |
|
46 | 604 |
iSysApBtController = CreateSysApBtControllerL( *this ); |
605 |
iSysApBtSapController = CreateSysApBtSapControllerL( *this ); |
|
606 |
||
607 |
if ( iActivateBt ) |
|
608 |
{ |
|
609 |
TRACES( RDebug::Print(_L("CSysApAppUi::DoStateChangedL Activating BT" ) ) ); |
|
610 |
SetBtPowerState( ETrue ); |
|
611 |
} |
|
612 |
||
613 |
if ( iDeactivateBt ) |
|
614 |
{ |
|
615 |
TRACES( RDebug::Print(_L("CSysApAppUi::DoStateChangedL Deactivating BT" ) ) ); |
|
616 |
SetBtPowerState( EFalse ); |
|
617 |
} |
|
618 |
||
619 |
if ( !StarterSession().Handle() ) |
|
620 |
{ |
|
621 |
User::Leave( KErrBadHandle ); |
|
622 |
} |
|
623 |
||
624 |
/* if ( !KeyLock().Handle() ) |
|
625 |
{ |
|
626 |
User::Leave( KErrBadHandle ); |
|
627 |
} |
|
628 |
*/ |
|
629 |
#ifdef __SYSAP_MODULE_TEST |
|
630 |
ModuleTestShowUiNoteL( _L("SysAp: SW state normal!") ); |
|
631 |
#endif |
|
632 |
} |
|
633 |
||
634 |
// Allow lights |
|
635 |
iSysApLightsController->AllowLightsOn(); |
|
636 |
} |
|
637 |
||
638 |
#endif // SYSAP_USE_STARTUP_UI_PHASE |
|
639 |
||
61 | 640 |
// ---------------------------------------------------------------------------- |
641 |
// CSysApAppUi::~CSysApAppUi() |
|
642 |
// ---------------------------------------------------------------------------- |
|
643 |
||
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
644 |
CSysApAppUi::~CSysApAppUi() |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
645 |
{ |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
646 |
TRACES( RDebug::Print( _L("~CSysApAppUi() started") ) ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
647 |
if( !iResourcesFreed ) |
46 | 648 |
{ |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
649 |
FreeResources(); |
51 | 650 |
|
651 |
iStarterSession.Close(); |
|
652 |
||
653 |
} |
|
654 |
||
655 |
delete iSysApShutdownImage; |
|
656 |
||
657 |
#ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
658 |
if (iSysApShutdownAnimation) |
|
659 |
{ |
|
660 |
RemoveFromStack( iSysApShutdownAnimation ); |
|
661 |
#endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
662 |
delete iSysApShutdownAnimation; |
|
663 |
#ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
664 |
} |
|
665 |
#endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
666 |
||
667 |
// delete iProfileNote; |
|
668 |
||
669 |
#ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
670 |
if( iAnimTimer ) |
|
671 |
{ |
|
672 |
iAnimTimer->Cancel(); |
|
673 |
} |
|
674 |
delete iAnimTimer; |
|
675 |
#endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
676 |
||
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
677 |
delete iSysApStartupController; |
61 | 678 |
|
679 |
#ifdef RD_MULTIPLE_DRIVE |
|
680 |
iInsertedMemoryCards.Close(); |
|
681 |
delete iSysApDriveEjectHandler; |
|
682 |
delete iSysApDriveUnlockHandler; |
|
683 |
delete iSysApDriveList; |
|
684 |
#endif // RD_MULTIPLE_DRIVE |
|
685 |
||
51 | 686 |
TRACES( RDebug::Print( _L("~CSysApAppUi() completed") ) ); |
46 | 687 |
} |
688 |
||
689 |
TBool CSysApAppUi::ResourcesFreed() const |
|
690 |
{ |
|
691 |
return iResourcesFreed; |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
692 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
693 |
|
72 | 694 |
void CSysApAppUi::ShowNoteL( const TDesC& noteText )const |
46 | 695 |
{ |
72 | 696 |
TRACES( RDebug::Print( _L("CSysApAppUi::ShowNoteL:: constructing CHbDeviceMessageBoxSymbian:BeGIN") ) ); |
46 | 697 |
CHbDeviceMessageBoxSymbian *note = CHbDeviceMessageBoxSymbian::NewL(CHbDeviceMessageBoxSymbian::EInformation); |
698 |
CleanupStack::PushL(note); |
|
72 | 699 |
TRACES( RDebug::Print( _L("CSysApAppUi::ShowNoteL:: construction of CHbDeviceMessageBoxSymbian:END") ) ); |
46 | 700 |
note->SetTextL(noteText); |
72 | 701 |
note->SetTimeout(3000); |
46 | 702 |
TRACES( RDebug::Print( _L("CSysApAppUi:: Display of CHbDeviceMessageBoxSymbian::Begin") ) ); |
703 |
note->ShowL(); |
|
704 |
TRACES( RDebug::Print( _L("CSysApAppUi:: Display of CHbDeviceMessageBoxSymbian::End") ) ); |
|
705 |
CleanupStack::PopAndDestroy(note); |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
706 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
707 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
708 |
|
46 | 709 |
void CSysApAppUi::ExecQueryL( TSysapQuery aQuery, TDes8& aReturn ) |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
710 |
{ |
46 | 711 |
ExecQueryL( aQuery, aReturn, KNullDesC8 ); |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
712 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
713 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
714 |
// ---------------------------------------------------------------------------- |
46 | 715 |
// CSysApAppUi::ExecQueryL |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
716 |
// ---------------------------------------------------------------------------- |
46 | 717 |
// |
718 |
void CSysApAppUi::ExecQueryL( TSysapQuery aQuery, TDes8& aReturn, const TDesC8& /*aParam*/ ) |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
719 |
{ |
46 | 720 |
TRACES( RDebug::Print(_L("CSysApAppUi::ExecQueryL: aQuery=%d"), aQuery ) ); |
721 |
||
722 |
switch ( aQuery ) |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
723 |
{ |
46 | 724 |
case EGetHwrmLight: // get handle to HWRM client session. Returns CHWRMLight*. |
725 |
{ |
|
726 |
THwrmLightBuf retBuf( iSysApLightsController->GetHwrmLight() ); |
|
727 |
aReturn.Copy( retBuf ); |
|
728 |
} |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
729 |
break; |
46 | 730 |
|
731 |
case EGetKeylock: // get handle to keylock client session. Returns RAknKeylock2*. |
|
732 |
{ |
|
733 |
// do nothing |
|
734 |
} |
|
735 |
break; |
|
736 |
||
737 |
||
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
738 |
default: |
46 | 739 |
__ASSERT_DEBUG( EFalse, User::Panic( _L("CSysApAppUi::ExecQueryL: Invalid query"), KErrArgument ) ); |
740 |
User::Leave( KErrArgument ); |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
741 |
break; |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
742 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
743 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
744 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
745 |
// ---------------------------------------------------------------------------- |
46 | 746 |
// CSysApAppUi::ExecCommandL |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
747 |
// ---------------------------------------------------------------------------- |
46 | 748 |
// |
749 |
void CSysApAppUi::ExecCommandL( TSysapCommand aCommand ) |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
750 |
{ |
46 | 751 |
ExecCommandL( aCommand, KNullDesC8 ); |
752 |
} |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
753 |
|
46 | 754 |
// ---------------------------------------------------------------------------- |
755 |
// CSysApAppUi::ExecCommandL |
|
756 |
// ---------------------------------------------------------------------------- |
|
757 |
// |
|
758 |
void CSysApAppUi::ExecCommandL( TSysapCommand aCommand, const TDesC8& /* aParam */ ) |
|
759 |
{ |
|
760 |
TRACES( RDebug::Print(_L("CSysApAppUi::ExecCommandL: aCommand=%d"), aCommand ) ); |
|
761 |
||
762 |
switch ( aCommand ) |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
763 |
{ |
46 | 764 |
case EResetKeyguardState: // reset the internal keyguard flags of the SysAp, except for iKeyLockOnBeforeCradle |
765 |
iKeyLockOnBeforeCall = EFalse; |
|
766 |
iKeyLockOnBeforeAlarm = EFalse; |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
767 |
break; |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
768 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
769 |
default: |
46 | 770 |
// do nothing in release builds since no harm is done |
771 |
__ASSERT_DEBUG( EFalse, User::Panic( _L("CSysApAppUi::ExecCommandL: Invalid command"), KErrArgument ) ); |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
772 |
break; |
46 | 773 |
} |
774 |
} |
|
775 |
||
776 |
// ---------------------------------------------------------------------------- |
|
777 |
// CSysApAppUi::TimerExpiredL() |
|
778 |
// ---------------------------------------------------------------------------- |
|
779 |
void CSysApAppUi::TimerExpiredL() |
|
780 |
{ |
|
781 |
/* |
|
782 |
* Not suppported , will take care in wk25 |
|
783 |
* #ifndef RD_MULTIPLE_DRIVE |
|
784 |
* CloseUIAppsInHotSwapL(); |
|
785 |
* #endif // RD_MULTIPLE_DRIVE |
|
786 |
*/ |
|
787 |
} |
|
788 |
||
789 |
||
790 |
// ---------------------------------------------------------------------------- |
|
791 |
// CSysApAppUi::KeyLockState() const |
|
792 |
// ---------------------------------------------------------------------------- |
|
793 |
||
794 |
TBool CSysApAppUi::KeyLockState() const |
|
795 |
{ |
|
796 |
return iKeyLockEnabled; |
|
797 |
} |
|
798 |
||
799 |
// ---------------------------------------------------------------------------- |
|
800 |
// CSysApAppUi::DeviceLockState() const |
|
801 |
// ---------------------------------------------------------------------------- |
|
802 |
||
803 |
TBool CSysApAppUi::DeviceLockState() const |
|
804 |
{ |
|
805 |
return iDeviceLockEnabled; |
|
806 |
} |
|
807 |
||
808 |
// ---------------------------------------------------------------------------- |
|
809 |
// CSysApAppUi::SysApFeatureManager |
|
810 |
// ---------------------------------------------------------------------------- |
|
811 |
||
812 |
CSysApFeatureManager& CSysApAppUi::SysApFeatureManager() |
|
813 |
{ |
|
814 |
__ASSERT_DEBUG( iSysApFeatureManager, User::Panic( _L("iSysApFeatureManager == NULL"), KErrBadHandle ) ); |
|
815 |
||
816 |
return *iSysApFeatureManager; |
|
817 |
} |
|
818 |
||
819 |
// ---------------------------------------------------------------------------- |
|
820 |
// CSysApAppUi::ActivateKeyeventForwardingForLights() |
|
821 |
// ---------------------------------------------------------------------------- |
|
822 |
||
823 |
void CSysApAppUi::ActivateKeyeventForwardingForLights(TBool aActivate) |
|
824 |
{ |
|
825 |
if( iSysApNspsHandler ) |
|
826 |
{ |
|
827 |
if ( aActivate ) |
|
828 |
{ |
|
829 |
iSysApNspsHandler->ActivateKeyeventForwardingForLights(); |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
830 |
} |
46 | 831 |
else |
832 |
{ |
|
833 |
iSysApNspsHandler->DeActivateKeyeventForwardingForLights(); |
|
834 |
} |
|
835 |
} |
|
836 |
} |
|
837 |
||
838 |
// ---------------------------------------------------------------------------- |
|
839 |
// CSysApAppUi::StarterSession() |
|
840 |
// ---------------------------------------------------------------------------- |
|
841 |
||
842 |
RStarterSession& CSysApAppUi::StarterSession() |
|
843 |
{ |
|
844 |
if ( !iStarterSession.Handle() ) |
|
845 |
{ |
|
846 |
// All server connections are tried to be made KTriesToConnectServer times because occasional |
|
847 |
// fails on connections are possible at least on some servers |
|
848 |
TRACES( RDebug::Print( _L("CSysApAppUi::StarterSession: trying RStarterSession::Connect()") ) ); |
|
849 |
TInt thisTry = 0; |
|
850 |
TInt err; |
|
851 |
while ( ( err = iStarterSession.Connect() ) != KErrNone && ( thisTry++ ) <= KTriesToConnectServer ) |
|
852 |
{ |
|
853 |
User::After( KTimeBeforeRetryingServerConnection ); |
|
854 |
} |
|
855 |
||
856 |
if ( err != KErrNone ) |
|
857 |
{ |
|
858 |
// What do in error case? |
|
859 |
TRACES( RDebug::Print( _L("CSysApAppUi::StarterSession: RStarterSession::Connect() failed with %d"), err ) ); |
|
860 |
} |
|
861 |
} |
|
862 |
||
863 |
return iStarterSession; |
|
864 |
} |
|
865 |
||
866 |
// ---------------------------------------------------------------------------- |
|
867 |
// CSysApAppUi::SetBtPowerState() |
|
868 |
// ---------------------------------------------------------------------------- |
|
869 |
TInt CSysApAppUi::SetBtPowerState( TBool aBtState ) |
|
870 |
{ |
|
871 |
if ( iSysApBtController ) |
|
872 |
{ |
|
873 |
return iSysApBtController->SetPowerState( aBtState ); |
|
874 |
} |
|
875 |
else |
|
876 |
{ |
|
877 |
return KErrNotReady; |
|
878 |
} |
|
879 |
} |
|
880 |
||
881 |
// ---------------------------------------------------------------------------- |
|
882 |
// CSysApAppUi::SetStarterState() |
|
883 |
// ---------------------------------------------------------------------------- |
|
884 |
||
885 |
TInt CSysApAppUi::SetStarterState( const RStarterSession::TGlobalState aState ) |
|
886 |
{ |
|
887 |
if ( iSysApStartupController->GlobalStateChangeAllowed( aState ) ) |
|
888 |
{ |
|
889 |
TRACES( RDebug::Print( _L("CSysApAppUi::SetStarterState: aState=%d" ), aState ) ); |
|
890 |
return StarterSession().SetState( aState ); |
|
891 |
} |
|
892 |
else |
|
893 |
{ |
|
894 |
TRACES( RDebug::Print( _L("CSysApAppUi::SetStarterState: aState=%d - not allowed" ), aState ) ); |
|
895 |
return KErrNone; |
|
896 |
} |
|
897 |
} |
|
898 |
||
899 |
// ---------------------------------------------------------------------------- |
|
900 |
// CSysApAppUi::SetNetworkConnectionAllowed() |
|
901 |
// ---------------------------------------------------------------------------- |
|
902 |
||
903 |
void CSysApAppUi::SetNetworkConnectionAllowed( TCoreAppUIsNetworkConnectionAllowed aNetworkConnectionAllowed ) |
|
904 |
{ |
|
905 |
TRACES( RDebug::Print( _L("CSysApAppUi::SetNetworkConnectionAllowed: status: %d" ), aNetworkConnectionAllowed ) ); |
|
906 |
||
907 |
iSysApCenRepController->SetInt( KCRUidCoreApplicationUIs, KCoreAppUIsNetworkConnectionAllowed, (TInt) aNetworkConnectionAllowed ); |
|
908 |
||
909 |
// Also set the Symbian PS key used for the same purpose: |
|
910 |
RProperty::Set(KUidSystemCategory, KUidPhonePwr.iUid, aNetworkConnectionAllowed ? ESAPhoneOn : ESAPhoneOff); |
|
911 |
} |
|
912 |
||
913 |
// ---------------------------------------------------------------------------- |
|
914 |
// CSysApAppUi::BluetoothPowerMode() |
|
915 |
// ---------------------------------------------------------------------------- |
|
916 |
TInt CSysApAppUi::BluetoothPowerMode() const |
|
917 |
{ |
|
918 |
return iSysApCenRepBtObserver->BluetoothPowerMode(); |
|
919 |
} |
|
920 |
||
921 |
// ---------------------------------------------------------------------------- |
|
922 |
// CSysApAppUi::SimSupported() |
|
923 |
// ---------------------------------------------------------------------------- |
|
924 |
TBool CSysApAppUi::SimSupported() |
|
925 |
{ |
|
926 |
return iSysApFeatureManager->SimSupported(); |
|
927 |
} |
|
928 |
||
929 |
// ---------------------------------------------------------------------------- |
|
930 |
// CSysApAppUi::BtSapEnabled() |
|
931 |
// ---------------------------------------------------------------------------- |
|
932 |
||
933 |
TBool CSysApAppUi::BtSapEnabled() |
|
934 |
{ |
|
935 |
if ( iSysApBtSapController ) |
|
936 |
{ |
|
937 |
return iSysApBtSapController->BtSapEnabled(); |
|
938 |
} |
|
939 |
return EFalse; |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
940 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
941 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
942 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
943 |
// ---------------------------------------------------------------------------- |
46 | 944 |
// CSysApAppUi::OfflineModeChangedL() |
945 |
// ---------------------------------------------------------------------------- |
|
946 |
void CSysApAppUi::OfflineModeChangedL() |
|
947 |
{ |
|
948 |
#ifdef SYSAP_USE_STARTUP_UI_PHASE |
|
949 |
// if UI is not ready, don't update indicators |
|
950 |
if ( !UiReady() ) |
|
951 |
{ |
|
952 |
return; |
|
953 |
} |
|
954 |
#endif // SYSAP_USE_STARTUP_UI_PHASE |
|
955 |
||
956 |
#if 0 // Not used as of now |
|
957 |
SetHacIndicatorL(); |
|
958 |
#endif //0 |
|
959 |
} |
|
960 |
||
961 |
// ---------------------------------------------------------------------------- |
|
962 |
// CSysApAppUi::UiReady() |
|
963 |
// |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
964 |
// ---------------------------------------------------------------------------- |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
965 |
|
46 | 966 |
TBool CSysApAppUi::UiReady() const |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
967 |
{ |
46 | 968 |
#ifdef SYSAP_USE_STARTUP_UI_PHASE |
969 |
return iSysApStartupController->UiReady(); |
|
970 |
#else // SYSAP_USE_STARTUP_UI_PHASE |
|
971 |
// if startup UI phase information is not used, global system state normal is handled as UI idle state |
|
972 |
return IsStateNormal(); |
|
973 |
#endif // SYSAP_USE_STARTUP_UI_PHASE |
|
974 |
} |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
975 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
976 |
|
46 | 977 |
// ---------------------------------------------------------------------------- |
978 |
// CSysApAppUi::CompleteShutdown() |
|
979 |
// ---------------------------------------------------------------------------- |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
980 |
|
46 | 981 |
void CSysApAppUi::CompleteShutdown( const TBool aReset, const TInt aResetReason ) |
982 |
{ |
|
983 |
TRACES( RDebug::Print(_L("CSysApAppUi::CompleteShutdown(): START" ) ) ); |
|
984 |
||
985 |
iCheckLongPowerKeyEvent = ETrue; |
|
986 |
||
987 |
PrepareForShutdownImage();//SysAp's internal preparation for ShutDown with image |
|
988 |
||
989 |
FreeResources(); |
|
990 |
||
991 |
if ( aReset ) |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
992 |
{ |
46 | 993 |
__ASSERT_DEBUG( aResetReason >= RStarterSession::ELanguageSwitchReset && |
994 |
aResetReason <= RStarterSession::EDataRestoreReset, |
|
995 |
User::Invariant() ); |
|
996 |
StarterSession().Reset( static_cast<RStarterSession::TResetReason>( aResetReason ) ); |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
997 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
998 |
else |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
999 |
{ |
46 | 1000 |
StarterSession().Shutdown(); |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1001 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1002 |
|
46 | 1003 |
StarterSession().Close(); |
1004 |
||
1005 |
TRACES( RDebug::Print(_L("CSysApAppUi::CompleteShutdown(): END" ) ) ); |
|
1006 |
} |
|
1007 |
||
1008 |
||
1009 |
||
1010 |
// ---------------------------------------------------------------------------- |
|
1011 |
// CSysApAppUi::DoShutdownL( const TBool aReset, const TSWStartupReason aSWStartupReason ) |
|
1012 |
// ---------------------------------------------------------------------------- |
|
1013 |
||
1014 |
void CSysApAppUi::DoShutdownL( const TBool aReset, const TInt aResetReason ) |
|
1015 |
{ |
|
1016 |
TRACES( RDebug::Print(_L("CSysApAppUi::DoShutdownL: aResetReason:%d, aReset:%d" ), |
|
1017 |
aResetReason, aReset ) ); |
|
1018 |
#ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1019 |
TBool animationenabled( EFalse ); |
|
1020 |
#endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1021 |
||
1022 |
if( OkToInitiateShutdown() ) |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1023 |
{ |
46 | 1024 |
TRACES( RDebug::Print(_L("CSysApAppUi::DoShutdownL: Was OkToToInitiateShutdown" ) ) ); |
1025 |
||
1026 |
||
1027 |
if ( !aReset && iSysApFeatureManager->Supported(KSysApFeatureIdGoodbyeNote) ) |
|
1028 |
{ |
|
1029 |
// show shutdown note |
|
1030 |
} |
|
1031 |
||
1032 |
if( !aReset ) |
|
1033 |
{ |
|
1034 |
#ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
51 | 1035 |
TRAPD( err, ShowAnimationL() ); |
1036 |
if ( err ) |
|
46 | 1037 |
{ |
51 | 1038 |
TRACES( RDebug::Print(_L("CSysApAppUi::DoShutdownL ShowAnimationL() leaved: %d" ), err ) ); |
46 | 1039 |
CompleteShutdown(aReset, aResetReason); |
1040 |
} |
|
1041 |
} |
|
1042 |
else // aReset |
|
1043 |
{ |
|
1044 |
CompleteShutdown(aReset, aResetReason); |
|
1045 |
} |
|
1046 |
#else // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1047 |
TRAPD( err, animationenabled = ShowAnimationL() ); |
|
1048 |
if ( err ) |
|
1049 |
{ |
|
1050 |
TRACES( RDebug::Print(_L("CSysApAppUi::DoShutdownL ShowAnimationL() leaved: %d" ), err ) ); |
|
1051 |
} |
|
1052 |
} |
|
1053 |
||
1054 |
if ( !animationenabled ) |
|
1055 |
{ |
|
1056 |
CompleteShutdown(aReset, aResetReason); |
|
1057 |
} |
|
1058 |
#endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1059 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1060 |
else |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1061 |
{ |
46 | 1062 |
TRACES( RDebug::Print(_L("CSysApAppUi::DoShutdownL: Was not OkToToInitiateShutdown" ) ) ); |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1063 |
} |
46 | 1064 |
TRACES( RDebug::Print(_L("CSysApAppUi::DoShutdownL: END" ) ) ); |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1065 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1066 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1067 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1068 |
|
46 | 1069 |
/* |
1070 |
---------------------------------------------------------------------------- |
|
1071 |
CSysApAppUi::IsEncryptionOperationOngoingL() |
|
1072 |
Introduced the code as a part of Sub : 405-3362 - Power Management SUB for ES |
|
1073 |
recapture functionalities in platform which support multidrive as well. |
|
1074 |
------------------------------------------------------------------------------- |
|
1075 |
*/ |
|
1076 |
TBool CSysApAppUi::IsEncryptionOperationOngoingL() const |
|
1077 |
{ |
|
1078 |
TBool deFeatureSupported(EFalse); |
|
1079 |
FeatureManager::InitializeLibL(); |
|
1080 |
deFeatureSupported = FeatureManager::FeatureSupported( KFeatureIdFfDeviceEncryptionFeature); |
|
1081 |
FeatureManager::UnInitializeLib(); |
|
1082 |
||
1083 |
if(deFeatureSupported) |
|
1084 |
{ |
|
1085 |
/** |
|
1086 |
* Store the last memory status changed |
|
1087 |
* 0: Idle. It can be Encrypted or Decrypted |
|
1088 |
* 1: Encrypting |
|
1089 |
* 2: Decrypting |
|
1090 |
**/ |
|
1091 |
||
1092 |
RProperty deProperty; |
|
1093 |
User::LeaveIfError(deProperty.Attach(KDevEncProtectedUid, KDevEncOperationKey,EOwnerThread)); |
|
1094 |
TInt deValue = 0; |
|
1095 |
if((deProperty.Get(deValue)== KErrNone)&&( deValue == EOpEncrypting || deValue == EOpDecrypting)) |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1096 |
{ |
46 | 1097 |
deProperty.Close(); |
1098 |
return ETrue; |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1099 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1100 |
else |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1101 |
{ |
46 | 1102 |
deProperty.Close(); |
1103 |
return EFalse; |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1104 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1105 |
} |
46 | 1106 |
else |
1107 |
{ |
|
1108 |
return EFalse; |
|
1109 |
} |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1110 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1111 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1112 |
// ---------------------------------------------------------------------------- |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1113 |
// CSysApAppUi::HandleLongPowerKeyPressedL() |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1114 |
// ---------------------------------------------------------------------------- |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1115 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1116 |
void CSysApAppUi::HandleLongPowerKeyPressedL() |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1117 |
{ |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1118 |
TRACES( RDebug::Print( _L("CSysApAppUi::HandleLongPowerKeyPressedL()") ) ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1119 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1120 |
TInt swState; |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1121 |
RProperty::Get( KPSUidStartup, KPSGlobalSystemState, swState ); |
46 | 1122 |
|
1123 |
iSysApLightsController->PowerKeyPressedL(); //need to handle later. |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1124 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1125 |
if( swState == ESwStateStartingCriticalApps || |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1126 |
swState == ESwStateSelfTestOK || |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1127 |
swState == ESwStateSecurityCheck || |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1128 |
swState == ESwStateCriticalPhaseOK || |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1129 |
swState == ESwStateEmergencyCallsOnly || |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1130 |
swState == ESwStateNormalRfOn || |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1131 |
swState == ESwStateNormalRfOff || |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1132 |
swState == ESwStateNormalBTSap || |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1133 |
swState == ESwStateFatalStartupError ) |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1134 |
{ |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1135 |
if( !iDeviceLockEnabled ) |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1136 |
{ |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1137 |
if( iPowerKeyPopupMenuActive ) |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1138 |
{ |
46 | 1139 |
// do nothing |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1140 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1141 |
else if( !iIgnoreNextPowerKeyRepeats ) |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1142 |
{ |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1143 |
if( !iKeyLockEnabled && !IsEncryptionOperationOngoingL() ) |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1144 |
{ |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1145 |
DoShutdownL( EFalse, KDummyReason ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1146 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1147 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1148 |
iIgnoreNextPowerKeyRepeats = ETrue; |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1149 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1150 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1151 |
else if( swState == ESwStateAlarm ) |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1152 |
{ |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1153 |
//Just comment here to highlight that this is not possible since |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1154 |
//from alarm state already a short press always shuts the device down. |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1155 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1156 |
else if( swState == ESwStateCharging ) |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1157 |
//Startup to Normal state |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1158 |
{ |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1159 |
if( !iIgnoreNextPowerKeyRepeats ) |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1160 |
{ |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1161 |
iIgnoreNextPowerKeyRepeats = ETrue; |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1162 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1163 |
SetStarterState( RStarterSession::ENormal ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1164 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1165 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1166 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1167 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1168 |
// ---------------------------------------------------------------------------- |
46 | 1169 |
// CSysApAppUi::IsDeviceModeKey |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1170 |
// ---------------------------------------------------------------------------- |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1171 |
|
46 | 1172 |
TBool CSysApAppUi::IsDeviceModeKey( const TKeyEvent& aKeyEvent ) const |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1173 |
{ |
46 | 1174 |
return CSysApDefaultKeyHandler::IsDeviceModeKey( aKeyEvent ); |
1175 |
} |
|
1176 |
||
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1177 |
|
46 | 1178 |
// ---------------------------------------------------------------------------- |
1179 |
// CSysApAppUi::ShowShutdownImage |
|
1180 |
// ---------------------------------------------------------------------------- |
|
1181 |
// |
|
1182 |
TInt CSysApAppUi::ShowShutdownImage( TInt aBitmapId ) |
|
1183 |
{ |
|
1184 |
TRACES( RDebug::Print(_L("CSysApAppUi::ShowShutdownImage") ) ); |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1185 |
|
46 | 1186 |
TRAPD( err, ShowShutdownImageL( aBitmapId ) ); |
1187 |
||
1188 |
if ( err != KErrNone ) |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1189 |
{ |
46 | 1190 |
TRACES( RDebug::Print(_L("CSysApAppUi::ShowShutdownImageL failed, err=%d"), err ) ); |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1191 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1192 |
|
46 | 1193 |
return err; |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1194 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1195 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1196 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1197 |
// ---------------------------------------------------------------------------- |
46 | 1198 |
// CSysApAppUi::ShowShutdownImageL |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1199 |
// ---------------------------------------------------------------------------- |
46 | 1200 |
// |
1201 |
void CSysApAppUi::ShowShutdownImageL( TInt aBitmapId ) |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1202 |
{ |
46 | 1203 |
TRACES( RDebug::Print(_L("CSysApAppUi::ShowShutdownImageL") ) ); |
1204 |
// do nothing |
|
1205 |
if ( !iSysApShutdownImage ) // Shutdown image may be shown without entering normal state (e.g. charging), so construct here |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1206 |
{ |
46 | 1207 |
TRACES( RDebug::Print( _L("CSysApAppUi::ShowShutdownImageL: trying CSysApShutdownImage::NewL()") ) ); |
1208 |
iSysApShutdownImage = CSysApShutdownImage::NewL(); |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1209 |
} |
46 | 1210 |
TRACES( RDebug::Print( _L("CSysApAppUi::ShowShutdownImageL: trying CSysApShutdownImage::ShowShutdownImageL()") ) ); |
1211 |
iSysApShutdownImage->ShowShutdownImageL( aBitmapId ); |
|
1212 |
} |
|
1213 |
||
1214 |
// ---------------------------------------------------------------------------- |
|
1215 |
// CSysApAppUi::PrepareForShutdownImage() |
|
1216 |
// ---------------------------------------------------------------------------- |
|
1217 |
||
1218 |
void CSysApAppUi::PrepareForShutdownImage() |
|
1219 |
{ |
|
1220 |
TRACES( RDebug::Print( _L("CSysApAppUi::PrepareForShutdownImage() START" ) ) ); |
|
1221 |
||
1222 |
// If RD_STARTUP_ANIMATION_CUSTOMIZATION is enabled, the following actions are always taken in PrepareForShutdownAnimation |
|
1223 |
#ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1224 |
if ( !iAnimationShowingTime ) // actions already taken in PrepareForShutdownAnimation |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1225 |
{ |
46 | 1226 |
static_cast<CAknAppUi*>(iEikonEnv->EikAppUi())->KeySounds()->PlaySound( EAvkonSIDPowerOffTone ); |
1227 |
CancelGlobalListQuery(); |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1228 |
|
46 | 1229 |
if ( iSysApPowerKeyMenuObserver ) |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1230 |
{ |
46 | 1231 |
iSysApPowerKeyMenuObserver->Cancel(); |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1232 |
} |
46 | 1233 |
|
1234 |
// deactivate notifiers before showing the shutdown image |
|
1235 |
AknNotifierController::CancelAllNotifications(); |
|
1236 |
AknNotifierController::HideAllNotifications(ETrue); |
|
1237 |
RWindowGroup groupWin = iCoeEnv->RootWin(); |
|
1238 |
iCapturedAppskey = groupWin.CaptureKey( EKeyApplication, KModifierMask, KModifierMask ); |
|
1239 |
iCapturedAppskeyUpAndDowns = groupWin.CaptureKeyUpAndDowns( EStdKeyApplication0, KModifierMask, KModifierMask ); |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1240 |
} |
46 | 1241 |
#endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
1242 |
||
1243 |
#ifndef __SYSAP_MODULE_TEST //to make errors during shutdown sequence being seen more easily |
|
1244 |
iEikonEnv->RootWin().SetOrdinalPosition(0, ECoeWinPriorityAlwaysAtFront ); |
|
1245 |
TRACES( RDebug::Print( _L("CSysApAppUi::PrepareForShutdownImage() Show Shutdown image" ) ) ); |
|
1246 |
ShowShutdownImage( 1 );//EMbmSysapQgn_startup_screen |
|
1247 |
#endif |
|
1248 |
TRACES( RDebug::Print( _L("CSysApAppUi::PrepareForShutdownImage() END" ) ) ); |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1249 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1250 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1251 |
// ---------------------------------------------------------------------------- |
46 | 1252 |
// CSysApAppUi::OkToInitiateShutdown() |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1253 |
// ---------------------------------------------------------------------------- |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1254 |
|
46 | 1255 |
TBool CSysApAppUi::OkToInitiateShutdown() |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1256 |
{ |
46 | 1257 |
TInt swState; |
1258 |
RProperty::Get( KPSUidStartup, KPSGlobalSystemState, swState ); |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1259 |
|
46 | 1260 |
if( !iShutdownStarted && |
1261 |
swState == ESwStateStartingCriticalApps || |
|
1262 |
swState == ESwStateSelfTestOK || |
|
1263 |
swState == ESwStateSecurityCheck || |
|
1264 |
swState == ESwStateCriticalPhaseOK || |
|
1265 |
swState == ESwStateEmergencyCallsOnly || |
|
1266 |
swState == ESwStateCharging || |
|
1267 |
swState == ESwStateAlarm || |
|
1268 |
swState == ESwStateNormalRfOn || |
|
1269 |
swState == ESwStateNormalRfOff || |
|
1270 |
swState == ESwStateNormalBTSap || |
|
1271 |
swState == ESwStateFatalStartupError ) |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1272 |
{ |
46 | 1273 |
iShutdownStarted = ETrue; |
1274 |
return ETrue; |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1275 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1276 |
else |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1277 |
{ |
46 | 1278 |
return EFalse; |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1279 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1280 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1281 |
|
46 | 1282 |
|
1283 |
void CSysApAppUi::PopupNote() |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1284 |
{ |
46 | 1285 |
iIgnoreNextPowerKeyUpEvent = ETrue; |
1286 |
// TRACES( RDebug::Print( _L("CSysApAppUi::Key was consumed") ) ); |
|
1287 |
_LIT(KPowerPressKey,"Short power key"); |
|
1288 |
HBufC* aString = HBufC16::NewLC(50); |
|
1289 |
TPtrC aStringPointer = aString->Des(); |
|
1290 |
aStringPointer.Set(KPowerPressKey); |
|
1291 |
TRACES( RDebug::Print( _L("CSysApWsClient::RunL(): Key EEventKeyUp 01") ) ); |
|
72 | 1292 |
ShowNoteL( aStringPointer ); |
46 | 1293 |
CleanupStack::PopAndDestroy(); // aString |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1294 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1295 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1296 |
|
46 | 1297 |
// ---------------------------------------------------------------------------- |
1298 |
// CSysApAppUi::SetUsbAttachStatus |
|
1299 |
// ---------------------------------------------------------------------------- |
|
1300 |
#ifndef RD_MULTIPLE_DRIVE |
|
1301 |
void CSysApAppUi::SetUsbAttachStatus( const TBool aUsbAttached ) |
|
1302 |
{ |
|
1303 |
// Prevent double beep when USB file transfer gets activated but |
|
1304 |
// allow MMC inserted beep when: |
|
1305 |
// a) USB file transfer is active |
|
1306 |
// b) MMC is not inserted when USB cable is attached |
|
1307 |
iHideNextBeep = ( iMMCInserted && aUsbAttached ); |
|
1308 |
} |
|
1309 |
#else // RD_MULTIPLE_DRIVE |
|
1310 |
void CSysApAppUi::SetUsbAttachStatus( const TBool aUsbAttached ) |
|
1311 |
{ |
|
1312 |
TRACES( RDebug::Print( |
|
1313 |
_L( "CSysApAppUi::SetUsbAttachStatus: aUsbAttached: %d" ), |
|
1314 |
aUsbAttached ) ); |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1315 |
|
46 | 1316 |
if ( aUsbAttached ) |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1317 |
{ |
46 | 1318 |
// For ignoring extra beeps caused by USB file transfer |
61 | 1319 |
iSysApDriveList->ResetDrivesInsertBeepIgnored(); |
46 | 1320 |
iSysApDriveList->MarkDrivesInsertBeepIgnored( iInsertedMemoryCards ); |
61 | 1321 |
} |
46 | 1322 |
} |
1323 |
#endif // RD_MULTIPLE_DRIVE |
|
1324 |
||
1325 |
||
1326 |
// ---------------------------------------------------------------------------- |
|
1327 |
// CSysApAppUi::UsbChargerDetector |
|
1328 |
// ---------------------------------------------------------------------------- |
|
1329 |
// |
|
1330 |
TSysApUsbChargerDetector& CSysApAppUi::UsbChargerDetector() |
|
1331 |
{ |
|
1332 |
return iSysApUsbChargerDetector; |
|
1333 |
} |
|
1334 |
||
1335 |
||
1336 |
// ---------------------------------------------------------------------------- |
|
1337 |
// CSysApAppUi::HandleAccessoryDisconnectedL() |
|
1338 |
// ---------------------------------------------------------------------------- |
|
1339 |
||
1340 |
void CSysApAppUi::HandleAccessoryDisconnectedL() |
|
1341 |
{ |
|
1342 |
TRACES( RDebug::Print( _L("CSysApAppUi::HandleAccessoryDisconnectedL()" ) ) ); |
|
1343 |
||
1344 |
||
1345 |
TAccMode accessoryState(EAccModeHandPortable); |
|
1346 |
if ( iSysApAccessoryObserver ) |
|
1347 |
{ |
|
1348 |
accessoryState = iSysApAccessoryObserver->GetAccessoryMode(); |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1349 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1350 |
|
46 | 1351 |
if ( accessoryState == EAccModeHandPortable ) |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1352 |
{ |
51 | 1353 |
TRACES( RDebug::Print( _L("CSysApAppUi::HandleAccessoryDisconnectedL:Before Deactivating accessory Plugin"))); |
1354 |
iHbIndicatorSymbian->Deactivate(KAccesoryPlugin); |
|
1355 |
TRACES( RDebug::Print( _L("CSysApAppUi::HandleAccessoryDisconnectedL:After Deactivating accessory Plugin"))); |
|
46 | 1356 |
iSysApLightsController->AccessoryConnectedL( EFalse ); |
1357 |
iSysApCenRepController->SetInt( KCRUidCoreApplicationUIsSysAp, KSysApAccessoryConnected, 0 ); |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1358 |
} |
46 | 1359 |
|
1360 |
SetIhfIndicatorL(); |
|
1361 |
SetHacIndicatorL(); |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1362 |
|
46 | 1363 |
// If lock disabled because of accessory, reactivate it, unless phone call or alarm is ongoing |
1364 |
if ( iKeyLockOnBeforeCradle ) |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1365 |
{ |
46 | 1366 |
iKeyLockOnBeforeCradle = EFalse; |
1367 |
if ( !iKeyLockOnBeforeCall && !iKeyLockOnBeforeAlarm ) |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1368 |
{ |
46 | 1369 |
if ( !iDeviceLockEnabled ) |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1370 |
{ |
46 | 1371 |
iKeyguardController->EnableKeyguard(ETrue); |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1372 |
} |
46 | 1373 |
else |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1374 |
{ |
46 | 1375 |
iKeyguardController->EnableKeyguard(EFalse); |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1376 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1377 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1378 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1379 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1380 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1381 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1382 |
// ---------------------------------------------------------------------------- |
46 | 1383 |
// CSysApAppUi::HandleAccessoryConnectedL() |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1384 |
// ---------------------------------------------------------------------------- |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1385 |
|
51 | 1386 |
void CSysApAppUi::HandleAccessoryConnectedL( TAccMode aAccessoryState, TInt aPhysicalConnectionType ) |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1387 |
{ |
51 | 1388 |
TRACES( RDebug::Print( _L("CSysApAppUi::HandleAccessoryConnectedL( aAccessoryState: %d )(aPhysicalConnectionType: %d "), aAccessoryState, aPhysicalConnectionType ) ); |
1389 |
||
1390 |
CHbSymbianVariantMap* iAccVariantMap = CHbSymbianVariantMap::NewL(); |
|
1391 |
CleanupStack::PushL(iAccVariantMap); |
|
1392 |
CHbSymbianVariant* variantAccState = CHbSymbianVariant::NewL(&aAccessoryState, CHbSymbianVariant::EInt); |
|
1393 |
iAccVariantMap->Add(KAccMode,variantAccState); |
|
1394 |
CHbSymbianVariant* variantAccType = CHbSymbianVariant::NewL(&aPhysicalConnectionType, CHbSymbianVariant::EInt); |
|
1395 |
iAccVariantMap->Add(KAccPhyConType,variantAccType); |
|
1396 |
||
1397 |
||
1398 |
CHbSymbianVariant* iAccVariant = CHbSymbianVariant::NewL(iAccVariantMap, CHbSymbianVariant::EVariantMap ); |
|
1399 |
CleanupStack::PushL(iAccVariant); |
|
1400 |
iHbIndicatorSymbian->Activate(KAccesoryPlugin, iAccVariant); |
|
1401 |
||
46 | 1402 |
|
1403 |
TInt swState( StateOfProperty( KPSUidStartup, KPSGlobalSystemState ) ); |
|
1404 |
TRACES( RDebug::Print( _L("CSysApAppUi::HandleAccessoryConnectedL: swState: %d"), swState ) ); |
|
1405 |
||
1406 |
if( UiReady() || swState == ESwStateSecurityCheck ) |
|
1407 |
{ |
|
1408 |
iSysApLightsController->AccessoryConnectedL( ETrue ); |
|
1409 |
} |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1410 |
|
46 | 1411 |
if ( ( ! iSysApOfflineModeController->OfflineModeActive() )) |
1412 |
{ |
|
1413 |
if ( iSysApCenRepController->GetInt( KCRUidCoreApplicationUIsSysAp, KSysApAccessoryConnected ) < 1 ) |
|
1414 |
// accessory not connected already |
|
1415 |
{ |
|
1416 |
iSysApCenRepController->SetInt( KCRUidCoreApplicationUIsSysAp, KSysApAccessoryConnected, 1 ); |
|
1417 |
} |
|
1418 |
} |
|
1419 |
||
1420 |
// Carkit and music stand have also light on permanently option that needs to be checked |
|
1421 |
if( aAccessoryState == EAccModeWiredCarKit || aAccessoryState == EAccModeMusicStand ) |
|
1422 |
{ |
|
1423 |
// When device is placed on a handsfree cradle, keyguard must be disabled (unless device is locked) |
|
1424 |
// Note: It is assumed that if carkit/music stand is connected, the phone is in the cradle. |
|
1425 |
if ( iKeyLockEnabled || iDeviceLockEnabled || iKeyLockOnBeforeCall || iKeyLockOnBeforeAlarm ) |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1426 |
{ |
46 | 1427 |
iKeyLockOnBeforeCradle = ETrue; |
1428 |
||
1429 |
if ( iKeyLockEnabled && !iDeviceLockEnabled ) |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1430 |
{ |
46 | 1431 |
iKeyguardController->DisableKeyguard(EFalse); |
1432 |
} |
|
1433 |
} |
|
1434 |
} |
|
1435 |
SetIhfIndicatorL(); |
|
1436 |
SetHacIndicatorL(); |
|
51 | 1437 |
CleanupStack::PopAndDestroy(2); |
46 | 1438 |
} |
1439 |
||
1440 |
||
1441 |
// ---------------------------------------------------------------------------- |
|
1442 |
// CSysApAppUi::SetHacIndicatorL() |
|
1443 |
// ---------------------------------------------------------------------------- |
|
1444 |
void CSysApAppUi::SetHacIndicatorL() |
|
1445 |
{ |
|
1446 |
||
1447 |
if ( !iSysApCenRepHacSettingObserver ) |
|
1448 |
{ |
|
1449 |
// Do nothing if HAC setting observer has not been created yet |
|
1450 |
// This occurs in case some party is trying to set HAC indicator during |
|
1451 |
// ConstructL(), e.g. when switching from offline to online during startup |
|
1452 |
TRACES( RDebug::Print( _L("CSysApAppUi::SetHacIndicatorL: do nothing, HAC observer does not exist yet") ) ); |
|
1453 |
return; |
|
1454 |
} |
|
1455 |
||
1456 |
if ( iSysApCenRepHacSettingObserver->HacMode() ) |
|
1457 |
{ |
|
1458 |
TBool accessoryConnected ( EFalse ); |
|
1459 |
||
1460 |
TAccMode accMode(EAccModeHandPortable); |
|
1461 |
||
1462 |
if ( iSysApAccessoryObserver ) |
|
1463 |
{ |
|
1464 |
accMode = iSysApAccessoryObserver->GetAccessoryMode(); |
|
1465 |
||
1466 |
if ( accMode != EAccModeHandPortable ) |
|
1467 |
{ |
|
1468 |
accessoryConnected = ETrue; |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1469 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1470 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1471 |
|
46 | 1472 |
// TInt indicatorState = EAknIndicatorStateOn; |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1473 |
|
46 | 1474 |
if ( !accessoryConnected ) // When accessory is not connected, check offline and call state |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1475 |
{ |
46 | 1476 |
if ( OfflineModeActive() ) // HAC indicator is not shown in offline mode |
1477 |
{ |
|
1478 |
// indicatorState = EAknIndicatorStateOff; |
|
1479 |
} |
|
1480 |
else |
|
1481 |
{ |
|
1482 |
// during active call with IHF activated HAC indicator is not shown |
|
1483 |
TInt callState( StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ) ); |
|
1484 |
if ( callState < KErrNone ) |
|
1485 |
{ |
|
1486 |
callState = EPSCTsyCallStateNone; |
|
1487 |
} |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1488 |
|
46 | 1489 |
if ( callState != EPSCTsyCallStateNone && IhfEnabledL() ) |
1490 |
{ |
|
1491 |
// indicatorState = EAknIndicatorStateOff; |
|
1492 |
} |
|
1493 |
} |
|
1494 |
||
1495 |
} |
|
1496 |
else |
|
1497 |
{ |
|
1498 |
// If an accessory is connected, HAC indicator should not be shown |
|
1499 |
// indicatorState = EAknIndicatorStateOff; |
|
1500 |
} |
|
1501 |
||
1502 |
// SetIndicatorStateL( EAknIndicatorHAC, indicatorState ); |
|
1503 |
||
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1504 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1505 |
else |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1506 |
{ |
46 | 1507 |
// If HAC is not active, always disable indicator regardless of accessory state |
1508 |
// SetIndicatorStateL( EAknIndicatorHAC, EAknIndicatorStateOff ); |
|
1509 |
} |
|
1510 |
||
1511 |
||
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1512 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1513 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1514 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1515 |
// ---------------------------------------------------------------------------- |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1516 |
// CSysApAppUi::DoNotActivateBt() |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1517 |
// ---------------------------------------------------------------------------- |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1518 |
void CSysApAppUi::DoNotActivateBt() |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1519 |
{ |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1520 |
iSysApOfflineModeController->DoNotActivateBt(); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1521 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1522 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1523 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1524 |
// ---------------------------------------------------------------------------- |
46 | 1525 |
// CSysApAppUi::IhfEnabledL |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1526 |
// ---------------------------------------------------------------------------- |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1527 |
|
46 | 1528 |
TBool CSysApAppUi::IhfEnabledL() |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1529 |
{ |
46 | 1530 |
TRACES( RDebug::Print( _L("CSysApAppUi::IhfEnabledL(): iSysApAudioRoutingObserver=0x%x"), iSysApAudioRoutingObserver ) ); |
1531 |
||
1532 |
if ( !iSysApAudioRoutingObserver ) // create observer if needed |
|
1533 |
{ |
|
1534 |
iSysApAudioRoutingObserver = CSysApAudioRoutingObserver::NewL( *this ); |
|
1535 |
} |
|
1536 |
||
1537 |
return iSysApAudioRoutingObserver->IhfEnabled(); |
|
1538 |
} |
|
1539 |
||
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1540 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1541 |
// ---------------------------------------------------------------------------- |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1542 |
// CSysApAppUi::SetIhfIndicatorL() |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1543 |
// ---------------------------------------------------------------------------- |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1544 |
void CSysApAppUi::SetIhfIndicatorL() |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1545 |
{ |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1546 |
TBool accessoryConnected ( EFalse ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1547 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1548 |
TInt callState( StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ) ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1549 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1550 |
TAccMode accMode(EAccModeHandPortable); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1551 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1552 |
if ( iSysApAccessoryObserver ) |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1553 |
{ |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1554 |
accMode = iSysApAccessoryObserver->GetAccessoryMode(); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1555 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1556 |
if ( accMode != EAccModeHandPortable ) |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1557 |
{ |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1558 |
accessoryConnected = ETrue; |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1559 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1560 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1561 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1562 |
if( (callState != EPSCTsyCallStateNone && IhfEnabledL() && !accessoryConnected) |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1563 |
|| accMode == EAccModeMusicStand ) // Music stand always shows IHF indicator |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1564 |
{ |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1565 |
if ( accMode == EAccModeMusicStand ) |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1566 |
{ |
46 | 1567 |
// do nothing |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1568 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1569 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1570 |
else |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1571 |
{ |
46 | 1572 |
// do nothing |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1573 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1574 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1575 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1576 |
// ---------------------------------------------------------------------------- |
61 | 1577 |
// CSysApAppUi::EjectStarted() |
1578 |
// ---------------------------------------------------------------------------- |
|
1579 |
||
1580 |
void CSysApAppUi::EjectStarted( TBool ejectStarted ) |
|
1581 |
{ |
|
1582 |
TRACES( RDebug::Print( _L( "CSysApAppUi::EjectStarted" ) ) ); |
|
1583 |
iMMCEjectUsed = ejectStarted; |
|
1584 |
||
1585 |
#ifndef RD_MULTIPLE_DRIVE |
|
1586 |
iFileManagerCloseDisabled = ejectStarted; |
|
1587 |
#endif // RD_MULTIPLE_DRIVE |
|
1588 |
} |
|
1589 |
||
1590 |
// ---------------------------------------------------------------------------- |
|
46 | 1591 |
// CSysApAppUi::DoLightsTimeoutChangedL |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1592 |
// ---------------------------------------------------------------------------- |
46 | 1593 |
void CSysApAppUi::DoLightsTimeoutChangedL( const TInt aTimeout ) |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1594 |
{ |
46 | 1595 |
iSysApLightsController->DoLightsTimeoutChangedL( aTimeout ); |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1596 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1597 |
|
46 | 1598 |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1599 |
// ---------------------------------------------------------------------------- |
46 | 1600 |
// CSysApAppUi::DoSwStateNormalConstructionL() |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1601 |
// ---------------------------------------------------------------------------- |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1602 |
|
46 | 1603 |
void CSysApAppUi::DoSwStateNormalConstructionL() |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1604 |
{ |
46 | 1605 |
// Let's ensure that the lights will remain on for 15 secs after sw state normal |
1606 |
User::ResetInactivityTime(); |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1607 |
|
46 | 1608 |
TRACES( RDebug::Print( _L("CSysApAppUi::DoSwStateNormalConstructionL : START" ) ) ); |
1609 |
||
1610 |
// In case of unexpected reset (e.g. hidden boot) the keylock must be enabled silently. Locking is done |
|
1611 |
// prior to time-consuming initializations, because otherwise UI is in unlocked state for a few seconds. |
|
1612 |
if ( iSysApCenRepController->GetInt( KCRUidCoreApplicationUIsSysAp, KSysApKeyguardActive ) == 1 ) |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1613 |
{ |
46 | 1614 |
TRACES( RDebug::Print( _L("CSysApAppUi::DoSwStateNormalConstructionL: enabling keylock") ) ); |
1615 |
iKeyguardController->EnableKeyguard(ETrue); |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1616 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1617 |
|
46 | 1618 |
// Initiate bearer change observation |
1619 |
// iSysApConnectionMonitorObserver = CSysApConnectionMonitorObserver::NewL( *this ); |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1620 |
|
46 | 1621 |
TRACES( RDebug::Print( _L("SysAp: trying CSystemLock::NewL" ) ) ); |
1622 |
iSysApSystemLock = CSystemLock::NewL(); |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1623 |
|
46 | 1624 |
|
1625 |
if ( iSysApFeatureManager->Supported( KSysApFeatureIdBatteryInfoPopup ) ) |
|
1626 |
{ |
|
1627 |
iSysApBatteryInfoController = CSysApBatteryInfoController::NewL( iSysApCenRepController->GetInt( KCRUidCoreApplicationUIsConf, |
|
1628 |
KCoreAppUIsBatteryInformationLowThreshold ) ); |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1629 |
} |
46 | 1630 |
TRACES( RDebug::Print( _L("CSysApAppUi::DoSwStateNormalConstructionL : END" ) ) ); |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1631 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1632 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1633 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1634 |
|
46 | 1635 |
// ---------------------------------------------------------------------------- |
1636 |
// CSysApAppUi::DoSimChangedFromPreviousBootL() |
|
1637 |
// ---------------------------------------------------------------------------- |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1638 |
|
46 | 1639 |
void CSysApAppUi::DoSimChangedFromPreviousBootL() |
1640 |
{ |
|
1641 |
TRACES( RDebug::Print( _L("CSysApAppUi::DoSimChangedFromPreviousBootL: iSimChangedDone=%d" ), iSimChangedDone ) ); |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1642 |
|
46 | 1643 |
if ( !iSimChangedDone ) |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1644 |
{ |
46 | 1645 |
iSimChangedDone = ETrue; |
1646 |
CSysApSimChanged* simChanged = CSysApSimChanged::NewL( *this, iEikonEnv->FsSession() ); |
|
1647 |
CleanupStack::PushL( simChanged ); |
|
1648 |
simChanged->HandleSimChangedL(); |
|
1649 |
CleanupStack::PopAndDestroy( simChanged ); |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1650 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1651 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1652 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1653 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1654 |
// ---------------------------------------------------------------------------- |
46 | 1655 |
// CSysApAppUi::IgnoreZeroNetworkBarNotifications |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1656 |
// ---------------------------------------------------------------------------- |
46 | 1657 |
// |
1658 |
void CSysApAppUi::IgnoreZeroNetworkBarNotifications(TBool aIgnore) |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1659 |
{ |
46 | 1660 |
iIgnoreZeroNetworkBarNotifications = aIgnore; |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1661 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1662 |
|
46 | 1663 |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1664 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1665 |
// ---------------------------------------------------------------------------- |
46 | 1666 |
// CSysApAppUi::SwitchFromOnlineToOfflineModeL() |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1667 |
// ---------------------------------------------------------------------------- |
46 | 1668 |
void CSysApAppUi::SwitchFromOnlineToOfflineModeL() |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1669 |
{ |
46 | 1670 |
iSysApOfflineModeController->SwitchFromOnlineToOfflineModeL(); |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1671 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1672 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1673 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1674 |
// ---------------------------------------------------------------------------- |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1675 |
// CSysApAppUi::InitCloseSimApplicationsL() |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1676 |
// ---------------------------------------------------------------------------- |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1677 |
void CSysApAppUi::InitCloseSimApplicationsL() |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1678 |
{ |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1679 |
iApplicationScanningRoundNumberInBtSap = 0; |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1680 |
iTimeToKillInBtSap = EFalse; |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1681 |
CloseSimApplicationsL(); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1682 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1683 |
|
46 | 1684 |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1685 |
// ---------------------------------------------------------------------------- |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1686 |
// CSysApAppUi::CloseSimApplicationsL() |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1687 |
// ---------------------------------------------------------------------------- |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1688 |
void CSysApAppUi::CloseSimApplicationsL() |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1689 |
{ |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1690 |
iApplicationScanningRoundNumberInBtSap++; |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1691 |
TRACES( RDebug::Print( _L("CSysApAppUi::CloseSimApplicationsL: scanning round = %d"), |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1692 |
iApplicationScanningRoundNumberInBtSap ) ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1693 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1694 |
if ( iApplicationScanningRoundNumberInBtSap == KMaxExitTimeInBtSap ) |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1695 |
{ |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1696 |
iTimeToKillInBtSap = ETrue; |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1697 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1698 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1699 |
const TInt KNumberOfSimDependantApps( 7 ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1700 |
TUid simDependantAppUid[ KNumberOfSimDependantApps ]; |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1701 |
simDependantAppUid[ 0 ] = KSysApGSUid; |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1702 |
simDependantAppUid[ 1 ] = KSysApSATUid; |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1703 |
simDependantAppUid[ 2 ] = KSysApMailboxUid; |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1704 |
simDependantAppUid[ 3 ] = KSysApSpeedDialingUid; |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1705 |
simDependantAppUid[ 4 ] = KSysApSimDirectoryUid; |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1706 |
simDependantAppUid[ 5 ] = KSysApMCEUid; |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1707 |
simDependantAppUid[ 6 ] = KSysApCellBroadcastMessagesUid; |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1708 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1709 |
TBool appsExiting( EFalse ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1710 |
TApaTaskList apaTaskList( CCoeEnv::Static()->WsSession() ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1711 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1712 |
for ( TInt i = 0; i < KNumberOfSimDependantApps; i++ ) |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1713 |
{ |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1714 |
TApaTask apaTask = apaTaskList.FindApp( simDependantAppUid[ i ] ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1715 |
if ( apaTask.Exists() ) |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1716 |
{ |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1717 |
appsExiting = ETrue; |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1718 |
if ( iApplicationScanningRoundNumberInBtSap == 1 ) |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1719 |
{ |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1720 |
apaTask.EndTask(); // applications are kindly requested to close themselves on the first round |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1721 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1722 |
else if ( iTimeToKillInBtSap ) |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1723 |
{ |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1724 |
apaTask.KillTask(); // used after timeout on the last round |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1725 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1726 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1727 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1728 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1729 |
if ( !appsExiting || iTimeToKillInBtSap ) |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1730 |
{ |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1731 |
iSysApBtSapController->SimApplicationsClosed(); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1732 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1733 |
else |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1734 |
{ |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1735 |
if ( !iSapTimer ) |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1736 |
{ |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1737 |
iSapTimer = CPeriodic::NewL( EPriorityNormal ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1738 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1739 |
iSapTimer->Cancel(); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1740 |
iSapTimer->Start( KDelayBeforeNextScanningRound, |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1741 |
KDelayBeforeNextScanningRound, |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1742 |
TCallBack( DoCloseSimApplicationsAfterCallBack, this ) ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1743 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1744 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1745 |
|
46 | 1746 |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1747 |
// ---------------------------------------------------------------------------- |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1748 |
// CSysApAppUi::DoCloseSimApplicationsAfterCallBack |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1749 |
// ---------------------------------------------------------------------------- |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1750 |
TInt CSysApAppUi::DoCloseSimApplicationsAfterCallBack( TAny* aObject ) |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1751 |
{ |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1752 |
CSysApAppUi* appUi = STATIC_CAST( CSysApAppUi*, aObject ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1753 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1754 |
if ( appUi->iSapTimer ) |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1755 |
{ |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1756 |
appUi->iSapTimer->Cancel(); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1757 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1758 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1759 |
TRAP_IGNORE( appUi->CloseSimApplicationsL() ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1760 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1761 |
return KErrNone; |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1762 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1763 |
|
46 | 1764 |
|
1765 |
// ---------------------------------------------------------------------------- |
|
1766 |
// CSysApAppUi::NotifyPowerSaveModeL |
|
1767 |
// ---------------------------------------------------------------------------- |
|
1768 |
// |
|
1769 |
void CSysApAppUi::NotifyPowerSaveModeL( TSysApPsmStatus aStatus ) |
|
1770 |
{ |
|
1771 |
TRACES( RDebug::Print( _L("CSysApAppUi::NotifyPowerSaveModeL aStatus: %d"), aStatus ) ); |
|
1772 |
||
1773 |
// cancel any active power saving query because user has changed the state manually |
|
1774 |
// CancelQuery( ESysApBattChargingPowerSavingQuery ); |
|
1775 |
// CancelQuery( ESysApBattLowPowerSavingQuery ); |
|
1776 |
// will take care in next sub |
|
1777 |
||
1778 |
switch ( aStatus ) |
|
1779 |
{ |
|
1780 |
case MSysApPsmControllerNotifyCallback::EPsmActivationComplete: |
|
1781 |
UpdateBatteryBarsL( StateOfProperty( KPSUidHWRMPowerState, KHWRMBatteryLevel ) ); |
|
51 | 1782 |
iVariantAccState = CHbSymbianVariant::NewL(&KPsm, CHbSymbianVariant::EDes); |
1783 |
if (!iHbIndicatorSymbian->Activate(KPsmPlugin,iVariantAccState)) |
|
1784 |
{ |
|
1785 |
int error = iHbIndicatorSymbian->Error(); |
|
1786 |
//use the errorcode... |
|
1787 |
} |
|
46 | 1788 |
break; |
1789 |
||
1790 |
case MSysApPsmControllerNotifyCallback::EPsmDeactivationComplete: |
|
1791 |
UpdateBatteryBarsL( StateOfProperty( KPSUidHWRMPowerState, KHWRMBatteryLevel ) ); |
|
51 | 1792 |
if (!iHbIndicatorSymbian->Deactivate(KPsmPlugin)) |
1793 |
{ |
|
1794 |
int error = iHbIndicatorSymbian->Error(); |
|
1795 |
//use the errorcode... |
|
1796 |
} |
|
1797 |
break; |
|
46 | 1798 |
|
1799 |
case MSysApPsmControllerNotifyCallback::EPsmActivationFailed: |
|
1800 |
ShowUiNoteL( ECannotActivatePowerSaveMode ); |
|
1801 |
break; |
|
1802 |
||
1803 |
case MSysApPsmControllerNotifyCallback::EPsmDeactivationFailed: |
|
1804 |
ShowUiNoteL( ECannotDeactivatePowerSaveMode ); |
|
1805 |
break; |
|
1806 |
||
1807 |
default: |
|
1808 |
break; |
|
1809 |
} |
|
1810 |
} |
|
1811 |
||
1812 |
||
1813 |
// ---------------------------------------------------------------------------- |
|
1814 |
// CSysApAppUi::ShowAlarmIndicatorL() |
|
1815 |
// ---------------------------------------------------------------------------- |
|
1816 |
||
1817 |
void CSysApAppUi::ShowAlarmIndicatorL( TBool aShowIndicator ) |
|
1818 |
{ |
|
1819 |
if ( aShowIndicator) |
|
1820 |
{ |
|
1821 |
// do nothing |
|
1822 |
} |
|
1823 |
else |
|
1824 |
{ |
|
1825 |
// do nothing |
|
1826 |
} |
|
1827 |
} |
|
1828 |
||
1829 |
||
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1830 |
// ---------------------------------------------------------------------------- |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1831 |
// CSysApAppUi::AlertUiAlertingL( const TBool aAlerting ) |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1832 |
// ---------------------------------------------------------------------------- |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1833 |
void CSysApAppUi::AlertUiAlertingL( const TBool aAlerting ) |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1834 |
{ |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1835 |
TRACES( RDebug::Print( _L("CSysApAppUi::AlertUiAlerting aAlerting:%d"), aAlerting ) ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1836 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1837 |
if ( aAlerting ) |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1838 |
{ |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1839 |
TInt swState; |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1840 |
RProperty::Get( KPSUidStartup, KPSGlobalSystemState, swState ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1841 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1842 |
if( swState == ESwStateCharging ) |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1843 |
{ |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1844 |
SetStarterState( RStarterSession::EAlarm ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1845 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1846 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1847 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1848 |
iSysApLightsController->AlarmOccuredL( aAlerting ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1849 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1850 |
|
46 | 1851 |
|
1852 |
// ---------------------------------------------------------------------------- |
|
1853 |
// CSysApAppUi::HandleForcedLightsVTRequireL( const TInt aLightParameter ) |
|
1854 |
// ---------------------------------------------------------------------------- |
|
1855 |
||
1856 |
void CSysApAppUi::HandleForcedLightsVTRequireL( const TInt aLightsParameter ) const |
|
1857 |
{ |
|
1858 |
iSysApLightsController->HandleForcedLightsVTRequireL( aLightsParameter ); |
|
1859 |
} |
|
1860 |
||
1861 |
||
1862 |
// ---------------------------------------------------------------------------- |
|
1863 |
// CSysApAppUi::HandleForcedLightsSSRequireL( const TInt aLightParameter ) |
|
1864 |
// ---------------------------------------------------------------------------- |
|
1865 |
||
1866 |
void CSysApAppUi::HandleForcedLightsSSRequireL( const TInt aLightsParameter ) const |
|
1867 |
{ |
|
1868 |
iSysApLightsController->HandleForcedLightsSSRequireL( aLightsParameter ); |
|
1869 |
} |
|
1870 |
||
1871 |
// ---------------------------------------------------------------------------- |
|
1872 |
// CSysApAppUi::HandleForcedLightsATCRequireL( const TInt aLightParameter ) |
|
1873 |
// ---------------------------------------------------------------------------- |
|
1874 |
void CSysApAppUi::HandleForcedLightsATCRequireL( const TInt aLightsParameter ) const |
|
1875 |
{ |
|
1876 |
iSysApLightsController->HandleForcedLightsATCRequireL( aLightsParameter ); |
|
1877 |
} |
|
1878 |
||
1879 |
||
1880 |
// ---------------------------------------------------------------------------- |
|
1881 |
// CSysApAppUi::HandleLightsRequireL() |
|
1882 |
// ---------------------------------------------------------------------------- |
|
1883 |
||
1884 |
void CSysApAppUi::HandleLightsRequireL() const |
|
1885 |
{ |
|
1886 |
iSysApLightsController->HandleLightsRequireL(); |
|
1887 |
} |
|
1888 |
||
1889 |
||
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1890 |
// ---------------------------------------------------------------------------- |
51 | 1891 |
// CSysApAppUi::HandleRawKeyEventLightsRequireL() |
1892 |
// ---------------------------------------------------------------------------- |
|
1893 |
||
1894 |
void CSysApAppUi::HandleRawKeyEventLightsRequireL() const |
|
1895 |
{ |
|
1896 |
iSysApLightsController->HandleRawKeyEventLightsRequireL(); |
|
1897 |
} |
|
1898 |
||
1899 |
||
1900 |
// ---------------------------------------------------------------------------- |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1901 |
// CSysApAppUi::AlertUiKeyLockOff( const TBool aKeyLockOff ) |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1902 |
// ---------------------------------------------------------------------------- |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1903 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1904 |
void CSysApAppUi::AlertUiKeyLockOff( const TBool aKeyLockOff ) |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1905 |
{ |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1906 |
TRACES( RDebug::Print( _L("CSysApAppUi::AlertUiKeyLockOff aKeyLockOff:%d, devicelock:%d"), |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1907 |
aKeyLockOff, iDeviceLockEnabled ) ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1908 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1909 |
if( aKeyLockOff ) |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1910 |
{ |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1911 |
// Notification to release keypad might come several times if e.g. calls are received |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1912 |
if ( !iKeyLockOnBeforeAlarm ) |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1913 |
{ |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1914 |
if ( iKeyLockEnabled || iKeyLockOnBeforeCradle || iKeyLockOnBeforeCall ) |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1915 |
{ |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1916 |
iKeyLockOnBeforeAlarm = ETrue; |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1917 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1918 |
} |
46 | 1919 |
iKeyguardController->DisableKeyguard(EFalse); |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1920 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1921 |
else |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1922 |
{ |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1923 |
if (iDeviceLockEnabled) |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1924 |
{ |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1925 |
// Re-enable keylock in devicelock case only if phone call is not ongoing or is |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1926 |
// connected. Otherwise e.g. messages can be read using softkeys during ongoing call. |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1927 |
TInt callState( StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ) ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1928 |
if ( callState == EPSCTsyCallStateNone || callState == EPSCTsyCallStateConnected ) |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1929 |
{ |
46 | 1930 |
iKeyguardController->EnableKeyguard(EFalse); |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1931 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1932 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1933 |
else if ( iKeyLockOnBeforeAlarm && !iKeyLockOnBeforeCradle && !iKeyLockOnBeforeCall ) |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1934 |
{ |
46 | 1935 |
iKeyguardController->EnableKeyguard(ETrue); |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1936 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1937 |
iKeyLockOnBeforeAlarm = EFalse; |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1938 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1939 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1940 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1941 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1942 |
// ---------------------------------------------------------------------------- |
46 | 1943 |
// CSysApAppUi::DoNotEnableKeylock() |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1944 |
// ---------------------------------------------------------------------------- |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1945 |
|
46 | 1946 |
void CSysApAppUi::DoNotEnableKeylock() |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1947 |
{ |
46 | 1948 |
if ( !iKeyLockOnBeforeCradle ) |
1949 |
{ |
|
1950 |
iShowkeypadActivatedNoteAfterSoftReject = iKeyLockOnBeforeCall; |
|
1951 |
} |
|
1952 |
||
1953 |
iKeyLockOnBeforeCall = EFalse; |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1954 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1955 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1956 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1957 |
// ---------------------------------------------------------------------------- |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1958 |
// CSysApAppUi::SwitchLightsOnSoftRejectL() |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1959 |
// ---------------------------------------------------------------------------- |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1960 |
void CSysApAppUi::SwitchLightsOnSoftRejectL() |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1961 |
{ |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1962 |
iSysApLightsController->SwitchLightsOnSoftRejectL(); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1963 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1964 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1965 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1966 |
// ---------------------------------------------------------------------------- |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1967 |
// CSysApAppUi::SetDeviceLockEnabledL( const TBool aLockEnabled ) |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1968 |
// ---------------------------------------------------------------------------- |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1969 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1970 |
void CSysApAppUi::SetDeviceLockEnabledL( const TBool aLockEnabled ) |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1971 |
{ |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1972 |
TRACES( RDebug::Print(_L("CSysApAppUi::SetDeviceLockEnabledL aLockEnabled:%d" ), aLockEnabled ) ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1973 |
TBool currentState( iDeviceLockEnabled ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1974 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1975 |
iDeviceLockEnabled = aLockEnabled; |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1976 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1977 |
if ( currentState != iDeviceLockEnabled ) // filter out unnecessary light status modifications |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1978 |
{ |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1979 |
iSysApLightsController->DeviceLockStateChangedL( iDeviceLockEnabled ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1980 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1981 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1982 |
if( iDeviceLockEnabled ) |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1983 |
{ |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1984 |
if( iKeyLockEnabled ) |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1985 |
{ |
46 | 1986 |
iKeyguardController->DisableKeyguard(EFalse); |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1987 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1988 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1989 |
else |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1990 |
{ |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1991 |
// let's not activate keylock in case device lock was disabled during call or in cradle |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1992 |
iKeyLockOnBeforeCall = EFalse; |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1993 |
iKeyLockOnBeforeCradle = EFalse; |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1994 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1995 |
// Memory card needs to be unlocked when device is unlocked |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1996 |
if ( iSysApFeatureManager->MmcHotSwapSupported() ) |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1997 |
{ |
61 | 1998 |
RunUnlockNotifierL(); |
46 | 1999 |
// Need to handle feature for unlocking the MMC card |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2000 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2001 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2002 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2003 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2004 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2005 |
// ---------------------------------------------------------------------------- |
46 | 2006 |
// CSysApAppUi::HandleBatteryStatusL |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2007 |
// ---------------------------------------------------------------------------- |
46 | 2008 |
// |
2009 |
void CSysApAppUi::HandleBatteryStatusL( const TInt aValue ) |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2010 |
{ |
46 | 2011 |
TRACES( RDebug::Print( _L("CSysApAppUi::HandleBatteryStatusL aValue: %d"), aValue ) ); |
2012 |
||
51 | 2013 |
TBool enableAutoPsm(EFalse); |
2014 |
CRepository* repository( NULL ); |
|
2015 |
TRAPD( err, repository = CRepository::NewL( KCRUidDeviceManagementSettings ) ); |
|
2016 |
||
2017 |
if ( err == KErrNone ) |
|
2018 |
{ |
|
2019 |
TInt value( 0 ); |
|
2020 |
err = repository->Get( KSettingsPowerSavingQuery, value ); |
|
2021 |
||
2022 |
if ( err == KErrNone ) |
|
2023 |
{ |
|
2024 |
enableAutoPsm = value ? EFalse: ETrue; |
|
2025 |
} |
|
2026 |
} |
|
2027 |
||
2028 |
_LIT(Klowbattery, "txt_power_management_dpopinfo_low_battery"); |
|
2029 |
// returns the string "low battery" |
|
2030 |
HBufC* lowBattery = HbTextResolverSymbian::LoadL(Klowbattery); |
|
2031 |
||
2032 |
||
46 | 2033 |
if ( aValue == EBatteryStatusEmpty ) |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2034 |
{ |
46 | 2035 |
//Display Recharge Battery note |
2036 |
ShowUiNoteL( ERechargeBatteryNote ); |
|
2037 |
BatteryEmptyL(); |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2038 |
} |
46 | 2039 |
else if ( aValue == EBatteryStatusLow ) |
2040 |
{ |
|
2041 |
if ( iSysApPsmController && UiReady() ) |
|
2042 |
{ |
|
2043 |
iSysApPsmController->BatteryLow( ETrue ); |
|
2044 |
||
2045 |
||
51 | 2046 |
if ( enableAutoPsm) |
46 | 2047 |
{ |
51 | 2048 |
iSysApPsmController->DoEnableFullPsm( ETrue ); |
2049 |
||
2050 |
_LIT(KPsmOn, "txt_power_management_dpopinfo_psm_activated_automa"); |
|
2051 |
// returns the string "power saving mode on" |
|
2052 |
HBufC* psmOn = HbTextResolverSymbian::LoadL(KPsmOn); |
|
2053 |
||
2054 |
_LIT(Kicon, "qgn_indi_battery_ps_activate"); |
|
2055 |
// returns the power save mode icon |
|
2056 |
HBufC* psmIcon = HbTextResolverSymbian::LoadL(Kicon); |
|
2057 |
||
2058 |
CHbDeviceNotificationDialogSymbian::NotificationL(*psmIcon,*psmOn,*lowBattery); |
|
46 | 2059 |
} |
2060 |
else // default low warning note must be shown |
|
2061 |
{ |
|
2062 |
//Display Battery Low note. |
|
51 | 2063 |
CHbDeviceNotificationDialogSymbian::NotificationL(KlowbatteryIcon,KNullDesC,*lowBattery); |
46 | 2064 |
} |
2065 |
} |
|
2066 |
else |
|
2067 |
{ |
|
2068 |
//Display Battery Low note. |
|
51 | 2069 |
CHbDeviceNotificationDialogSymbian::NotificationL(KlowbatteryIcon,KNullDesC,*lowBattery); |
46 | 2070 |
} |
2071 |
} |
|
2072 |
||
2073 |
if ( iSysApBatteryInfoController ) |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2074 |
{ |
46 | 2075 |
iSysApBatteryInfoController->BatteryStatusUpdated( aValue ); |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2076 |
} |
46 | 2077 |
|
51 | 2078 |
delete repository; |
46 | 2079 |
} |
21
c4cbaa4fb734
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2080 |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2081 |
// ---------------------------------------------------------------------------- |
46 | 2082 |
// CSysApAppUi::ShowUiNoteL( const TSysApNoteIds aNote ) const |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2083 |
// ---------------------------------------------------------------------------- |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2084 |
|
72 | 2085 |
void CSysApAppUi::ShowUiNoteL( const TSysApNoteIds aNote ) |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2086 |
{ |
72 | 2087 |
TRACES( RDebug::Print( _L("CSysApAppUi::ShowUiNoteL aNote") ) ); |
46 | 2088 |
TInt swState( StateOfProperty( KPSUidStartup, KPSGlobalSystemState ) ); |
2089 |
if( UiReady() || swState == ESwStateSecurityCheck) |
|
72 | 2090 |
{ |
2091 |
TRACES( RDebug::Print( _L("CSysApAppUi::ShowUiNoteL aNote: %d"), aNote ) ); |
|
46 | 2092 |
switch ( aNote ) |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2093 |
{ |
46 | 2094 |
case EBatteryLowNote: |
2095 |
{ |
|
72 | 2096 |
_LIT(KLowBattery,"Battery low"); |
2097 |
ShowNoteL( KLowBattery() ); |
|
46 | 2098 |
} |
2099 |
break; |
|
2100 |
case EBatteryFullNote: |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2101 |
{ |
72 | 2102 |
_LIT(KBatteryFull,"Battery full"); |
2103 |
ShowNoteL( KBatteryFull() ); |
|
46 | 2104 |
} |
2105 |
break; |
|
2106 |
case ERechargeBatteryNote: |
|
2107 |
{ |
|
2108 |
iSysApLightsController->BatteryEmptyL( ETrue ); |
|
72 | 2109 |
_LIT(KRechargeBattery,"Battery empty. Recharge"); |
2110 |
ShowNoteL( KRechargeBattery() ); |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2111 |
} |
46 | 2112 |
break; |
2113 |
case ENotChargingNote: |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2114 |
{ |
72 | 2115 |
_LIT(KNotCharging,"Not charging"); |
2116 |
ShowNoteL( KNotCharging() ); |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2117 |
} |
46 | 2118 |
break; |
2119 |
case EBatteryFullUnplugChargerNote: |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2120 |
{ |
46 | 2121 |
iSysApLightsController->BatteryEmptyL( ETrue ); |
2122 |
_LIT(KunplugCharger,"txt_power_dpopinfo_unplug_charger_to_save_energy"); |
|
2123 |
HBufC* unplugCharger = HbTextResolverSymbian::LoadL(KunplugCharger); |
|
2124 |
_LIT(KbatteryFull,"txt_power_management_dpophead_100_full"); |
|
2125 |
HBufC* batteryFull = HbTextResolverSymbian::LoadL(KbatteryFull); |
|
51 | 2126 |
CHbDeviceNotificationDialogSymbian::NotificationL(KbatteryFullIcon,*unplugCharger,*batteryFull); |
46 | 2127 |
} |
2128 |
break; |
|
2129 |
case EUnplugChargerNote: |
|
2130 |
{ |
|
72 | 2131 |
_LIT(KUnplugCharger,"Unplug charger from power supply to save energy"); |
2132 |
ShowNoteL( KUnplugCharger() ); |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2133 |
} |
46 | 2134 |
break; |
72 | 2135 |
case ESysApRestartPhone: |
2136 |
{ |
|
2137 |
//Show the restart note |
|
2138 |
_LIT(KRestartPhone,"Phone will be restarted"); |
|
2139 |
ShowNoteL( KRestartPhone() ); |
|
2140 |
//wait for 3 seconds to close note. Other wise the shutdown will continue |
|
2141 |
//without waiting for note to complete. |
|
2142 |
User::After(4000000); |
|
2143 |
//Now restart the device |
|
2144 |
DoShutdownL( ETrue, RStarterSession::EDataRestoreReset ); |
|
2145 |
} |
|
2146 |
break; |
|
46 | 2147 |
default: |
2148 |
break; |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2149 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2150 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2151 |
} |
72 | 2152 |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2153 |
// ---------------------------------------------------------------------------- |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2154 |
// CSysApAppUi::BatteryEmptyL() |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2155 |
// ---------------------------------------------------------------------------- |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2156 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2157 |
void CSysApAppUi::BatteryEmptyL() |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2158 |
{ |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2159 |
iSysApLightsController->BatteryEmptyL( ETrue ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2160 |
// Do not reactivate keyguard in the next startup |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2161 |
iSysApCenRepController->SetInt( KCRUidCoreApplicationUIsSysAp, KSysApKeyguardActive, 0 ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2162 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2163 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2164 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2165 |
// ---------------------------------------------------------------------------- |
46 | 2166 |
// CSysApAppUi::ShowQueryL() |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2167 |
// ---------------------------------------------------------------------------- |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2168 |
|
46 | 2169 |
void CSysApAppUi::ShowQueryL( const TSysApConfirmationQueryIds /* aQueryId */, const TDesC& /* aValue */) |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2170 |
{ |
46 | 2171 |
// do nothing |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2172 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2173 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2174 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2175 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2176 |
// ---------------------------------------------------------------------------- |
46 | 2177 |
// CSysApAppUi::HandleChargingStatusL |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2178 |
// ---------------------------------------------------------------------------- |
46 | 2179 |
// |
2180 |
void CSysApAppUi::HandleChargingStatusL( const TInt aValue ) |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2181 |
{ |
46 | 2182 |
TRACES( RDebug::Print( _L("CSysApAppUi::HandleChargingStatusL aValue: %d"), aValue ) ); |
2183 |
||
2184 |
TBool showNote( ETrue ); |
|
2185 |
||
2186 |
UpdateBatteryBarsL( StateOfProperty( KPSUidHWRMPowerState, KHWRMBatteryLevel ) ); |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2187 |
|
46 | 2188 |
if ( iSysApPsmController && UiReady() ) |
2189 |
{ |
|
2190 |
if ( iCharging && !iSysApPsmController->ChargerConnected() ) // first time after charger connection |
|
2191 |
{ |
|
2192 |
iSysApPsmController->ConnectCharger( ETrue ); |
|
51 | 2193 |
iSysApPsmController->DoEnableFullPsm(EFalse); |
2194 |
iVariantAccState = CHbSymbianVariant::NewL(&KCharging, CHbSymbianVariant::EDes); |
|
2195 |
||
2196 |
if (!iHbIndicatorSymbian->Activate(KPsmPlugin,iVariantAccState)) |
|
2197 |
{ |
|
2198 |
int error = iHbIndicatorSymbian->Error(); |
|
2199 |
//use the errorcode... |
|
2200 |
} |
|
2201 |
||
2202 |
||
46 | 2203 |
} |
2204 |
else if ( aValue == EChargingStatusNotConnected ) |
|
2205 |
{ |
|
2206 |
iSysApPsmController->ConnectCharger( EFalse ); |
|
51 | 2207 |
if (!iHbIndicatorSymbian->Deactivate(KPsmPlugin)) |
2208 |
{ |
|
2209 |
int error = iHbIndicatorSymbian->Error(); |
|
2210 |
//use the errorcode... |
|
2211 |
} |
|
46 | 2212 |
} |
2213 |
} |
|
2214 |
if( showNote ) |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2215 |
{ |
46 | 2216 |
HandleChargerNotesL( aValue ); |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2217 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2218 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2219 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2220 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2221 |
// ---------------------------------------------------------------------------- |
46 | 2222 |
// CSysApAppUi::HandleChargerNotesL() |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2223 |
// ---------------------------------------------------------------------------- |
46 | 2224 |
void CSysApAppUi::HandleChargerNotesL( const TInt aValue ) |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2225 |
{ |
46 | 2226 |
TBool showNote(StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ) != EPSCTsyCallStateRinging); |
2227 |
if ( aValue == EChargingStatusCharging ) |
|
2228 |
{ |
|
2229 |
iSysApLightsController->BatteryEmptyL( EFalse ); |
|
2230 |
TRACES( RDebug::Print( _L("SysAp: charger connected") ) ); |
|
2231 |
iSysApLightsController->ChargerConnectedL( ETrue ); |
|
2232 |
ShowChargingNoteL(); |
|
2233 |
} |
|
2234 |
//Display Not Charging note |
|
2235 |
else if ( aValue == EChargingStatusError ) |
|
2236 |
{ |
|
2237 |
if(showNote) |
|
2238 |
{ |
|
2239 |
ShowUiNoteL( ENotChargingNote ); |
|
2240 |
} |
|
2241 |
} |
|
2242 |
else if ( aValue == EChargingStatusChargingComplete ) |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2243 |
{ |
46 | 2244 |
iSysApLightsController->ChargingCompleteL(); |
2245 |
||
2246 |
TSysApNoteIds note( EBatteryFullNote ); |
|
2247 |
||
2248 |
if ( !iSysApUsbChargerDetector.HostOnlyUsbChargingUsed() && |
|
2249 |
iSysApFeatureManager->Supported( KSysApFeatureIdChargerReminderNotes ) ) |
|
2250 |
{ |
|
2251 |
note = EBatteryFullUnplugChargerNote; |
|
2252 |
} |
|
2253 |
iSysApUsbChargerDetector.Reset(); |
|
2254 |
if(showNote) |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2255 |
{ |
46 | 2256 |
ShowUiNoteL( note ); |
2257 |
} |
|
2258 |
} |
|
2259 |
else if ( aValue == EChargingStatusNotConnected ) |
|
2260 |
{ |
|
2261 |
TRACES( RDebug::Print( _L("SysAp: charger removed") ) ); |
|
2262 |
iSysApLightsController->ChargerConnectedL( EFalse ); |
|
2263 |
||
2264 |
if ( !iSysApUsbChargerDetector.HostOnlyUsbChargingUsed() && |
|
2265 |
iSysApFeatureManager->Supported( KSysApFeatureIdChargerReminderNotes ) ) |
|
2266 |
{ |
|
2267 |
if(showNote) |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2268 |
{ |
46 | 2269 |
ShowUiNoteL( EUnplugChargerNote ); |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2270 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2271 |
} |
46 | 2272 |
iSysApUsbChargerDetector.Reset(); |
2273 |
} |
|
2274 |
else if ( aValue == EChargingStatusNotCharging ) |
|
2275 |
{ |
|
2276 |
TRACES( RDebug::Print( _L("SysAp: Not charging") ) ); |
|
2277 |
} |
|
2278 |
else if ( aValue == EChargingStatusAlmostComplete ) |
|
2279 |
{ |
|
2280 |
TRACES( RDebug::Print( _L("SysAp: Charging almost complete") ) ); |
|
2281 |
} |
|
2282 |
else if ( aValue == EChargingStatusChargingContinued ) |
|
2283 |
{ |
|
2284 |
//in this case we simply want to scroll the battery bars and not turn light on or show ui note |
|
2285 |
// set lights controller iBatteryEmpty to EFalse |
|
2286 |
iSysApLightsController->BatteryEmptyL( EFalse ); |
|
2287 |
TRACES( RDebug::Print( _L("SysAp: charging continues") ) ); |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2288 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2289 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2290 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2291 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2292 |
// ---------------------------------------------------------------------------- |
46 | 2293 |
// CSysApAppUi::UpdateBatteryBarsL( const TInt aState ) |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2294 |
// ---------------------------------------------------------------------------- |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2295 |
|
46 | 2296 |
void CSysApAppUi::UpdateBatteryBarsL( const TInt /* aState */) |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2297 |
{ |
46 | 2298 |
TInt state( StateOfProperty( KPSUidHWRMPowerState, KHWRMChargingStatus ) ); |
2299 |
// TRACES( RDebug::Print( _L("CSysApAppUi::UpdateBatteryBarsL aState: %d, chargerState:%d"), aState, state ) ); |
|
2300 |
HandleUsbCharger( state ); |
|
2301 |
if( state == EChargingStatusCharging || |
|
2302 |
state == EChargingStatusChargingContinued || |
|
2303 |
state == EChargingStatusAlmostComplete ) |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2304 |
{ |
46 | 2305 |
if ( !iCharging ) |
2306 |
{ |
|
2307 |
TRACES( RDebug::Print( _L("CSysApAppUi::UpdateBatteryBarsL: Starting Charging") ) ); |
|
2308 |
iCharging = ETrue; |
|
2309 |
} |
|
2310 |
} |
|
2311 |
else |
|
2312 |
{ |
|
2313 |
if ( iCharging ) |
|
2314 |
{ |
|
2315 |
TRACES( RDebug::Print( _L("CSysApAppUi::UpdateBatteryBarsL: Stopping Charging") ) ); |
|
2316 |
iCharging = EFalse; |
|
2317 |
} |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2318 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2319 |
|
46 | 2320 |
if ( !iSysApPsmController ) // created here if first state change has not occurred yet |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2321 |
{ |
46 | 2322 |
iSysApPsmController = CSysApPsmController::NewL( *this ); |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2323 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2324 |
|
46 | 2325 |
if ( iSysApPsmController ) |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2326 |
{ |
46 | 2327 |
if ( iSysApPsmController->FullPsmEnabled() ) |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2328 |
{ |
46 | 2329 |
// activate psm indicator |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2330 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2331 |
else |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2332 |
{ |
46 | 2333 |
// deactivate psm indicator |
2334 |
} |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2335 |
} |
46 | 2336 |
|
2337 |
if ( iSysApBatteryInfoController ) |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2338 |
{ |
46 | 2339 |
iSysApBatteryInfoController->BatteryLevelUpdatedL(); |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2340 |
} |
46 | 2341 |
|
2342 |
} |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2343 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2344 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2345 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2346 |
// ---------------------------------------------------------------------------- |
46 | 2347 |
// CSysApAppUi::ShowChargingNoteL() |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2348 |
// ---------------------------------------------------------------------------- |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2349 |
|
46 | 2350 |
void CSysApAppUi::ShowChargingNoteL() |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2351 |
{ |
46 | 2352 |
TRACES( RDebug::Print( _L("CSysApAppUi::ShowChargingNoteL") ) ); |
2353 |
TBool showNote( ETrue ); |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2354 |
|
46 | 2355 |
TInt swState( StateOfProperty( KPSUidStartup, KPSGlobalSystemState ) ); |
2356 |
TRACES( RDebug::Print( _L("CSysApAppUi::ShowChargingNoteL: swState: %d"), swState ) ); |
|
2357 |
||
2358 |
if( UiReady() || swState == ESwStateSecurityCheck ) |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2359 |
{ |
46 | 2360 |
if ( StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ) == EPSCTsyCallStateRinging ) |
2361 |
{ |
|
2362 |
showNote = EFalse; |
|
2363 |
} |
|
2364 |
TRACES( RDebug::Print( _L("CSysApAppUi::ShowChargingNoteL KCTsyCallState=%d"), StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ) ) ); |
|
2365 |
if ( showNote ) // Power Mgmt UI spec defines that no Charging note is shown while the phone is ringing/alerting |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2366 |
{ |
46 | 2367 |
TRACES( RDebug::Print( _L("CSysApWsClient::RunL(): Key EEventKeyUp 01") ) ); |
2368 |
_LIT(KChargingNote,"txt_power_management_dblist_charging"); |
|
2369 |
HBufC* chargingNote = HbTextResolverSymbian::LoadL(KChargingNote); |
|
2370 |
CHbDeviceNotificationDialogSymbian::NotificationL(KNullDesC,*chargingNote); |
|
51 | 2371 |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2372 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2373 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2374 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2375 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2376 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2377 |
// ---------------------------------------------------------------------------- |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2378 |
// CSysApAppUi::HandleUsbCharger |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2379 |
// ---------------------------------------------------------------------------- |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2380 |
// |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2381 |
void CSysApAppUi::HandleUsbCharger( const TInt aValue ) |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2382 |
{ |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2383 |
if ( aValue == EChargingStatusCharging || |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2384 |
aValue == EChargingStatusChargingContinued || |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2385 |
aValue == EChargingStatusAlmostComplete ) |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2386 |
{ |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2387 |
iSysApUsbChargerDetector.SetChargingUsed( ETrue ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2388 |
if ( !iSysApUsbIndicatorController && |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2389 |
iSysApFeatureManager->Supported( KSysApFeatureIdChargerReminderNotes ) && |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2390 |
iSysApFeatureManager->Supported( KSysApFeatureIdUsbChargingWithoutReminderNotes ) ) |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2391 |
{ |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2392 |
// Start observing USB state for the reminder note |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2393 |
TRAPD ( usbErr, iSysApUsbIndicatorController = CreateSysApUsbIndicatorL( *this ) ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2394 |
if ( usbErr ) |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2395 |
{ |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2396 |
TRACES( RDebug::Print( |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2397 |
_L("CSysApAppUi::HandleUsbCharger: error in constructing USB ind. controller %d" ), |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2398 |
usbErr ) ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2399 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2400 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2401 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2402 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2403 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2404 |
// ---------------------------------------------------------------------------- |
46 | 2405 |
// CSysApAppUi::HandleCurrentCallStateChangeL() |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2406 |
// ---------------------------------------------------------------------------- |
46 | 2407 |
|
2408 |
void CSysApAppUi::HandleCurrentCallStateChangeL( TInt aCurrentCallState ) |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2409 |
{ |
46 | 2410 |
TRACES( RDebug::Print( _L("CSysApAppUi::HandleCurrentCallStateChangeL: KUidCurrentCall: %d" ), aCurrentCallState ) ); |
2411 |
||
2412 |
switch ( aCurrentCallState ) |
|
2413 |
{ |
|
2414 |
case EPSCTsyCallStateRinging: |
|
2415 |
{ |
|
2416 |
iSysApLightsController->CallComingInL( ETrue ); |
|
2417 |
// Disable keylock when a call is coming in |
|
2418 |
if ( iKeyLockEnabled || iDeviceLockEnabled || iKeyLockOnBeforeCradle || iKeyLockOnBeforeAlarm ) |
|
2419 |
{ |
|
2420 |
TRACES( RDebug::Print( _L("CSysApAppUi::HandleCurrentCallStateChangeL: EPSCTsyCallStateRinging: disable keylock") ) ); |
|
2421 |
iKeyLockOnBeforeCall = ETrue; |
|
2422 |
||
2423 |
if ( iKeyLockEnabled || iDeviceLockEnabled ) |
|
2424 |
{ |
|
2425 |
if ( !iSysApFeatureManager->TouchUnlockStrokeSupported() ) |
|
2426 |
{ |
|
2427 |
iKeyguardController->DisableKeyguard(EFalse); |
|
2428 |
} |
|
2429 |
} |
|
2430 |
} |
|
2431 |
break; |
|
2432 |
} |
|
2433 |
||
2434 |
case EPSCTsyCallStateDialling: |
|
2435 |
{ |
|
2436 |
// Disable keypad lock during an emergency call |
|
2437 |
// no need to disable the key lock when a call is made using the wireless car-kit |
|
2438 |
// but if the call is an emergency one then we will disable the keypad lock |
|
2439 |
if ( iKeyLockEnabled || iDeviceLockEnabled || iKeyLockOnBeforeCradle ) |
|
2440 |
{ |
|
2441 |
TRACES( RDebug::Print( _L("CSysApAppUi::HandleCurrentCallStateChangeL: EPSCTsyCallStateDialling: disable keylock") ) ); |
|
2442 |
iKeyLockOnBeforeCall = ETrue; |
|
2443 |
||
2444 |
if ( IsEmergencyCall() && (iKeyLockEnabled || iDeviceLockEnabled )) |
|
2445 |
{ |
|
2446 |
iKeyguardController->DisableKeyguard(EFalse); |
|
2447 |
} |
|
2448 |
} |
|
2449 |
||
2450 |
// Enable signal & network indicators when an emergency call is made in Offline Mode |
|
2451 |
if( iSysApOfflineModeController->OfflineModeActive() ) |
|
2452 |
{ |
|
2453 |
// Signal indicators not updated with VoIP call |
|
2454 |
if ( StateOfProperty(KPSUidCtsyCallInformation, KCTsyCallType) != EPSCTsyCallTypeVoIP) |
|
2455 |
{ |
|
2456 |
iEmergencyCallActive = ETrue; |
|
2457 |
// not supporting this |
|
2458 |
// UpdateSignalBarsL(); |
|
2459 |
// SetSignalIndicatorL(); |
|
2460 |
} |
|
2461 |
} |
|
2462 |
break; |
|
2463 |
} |
|
2464 |
||
2465 |
case EPSCTsyCallStateConnected: |
|
2466 |
{ |
|
2467 |
if (StateOfProperty(KPSUidCtsyCallInformation, KCTsyCallType) == EPSCTsyCallTypeCSVoice) |
|
2468 |
{ |
|
2469 |
// Check if GPRS suspended note is required |
|
2470 |
iCallActivated = ETrue; |
|
2471 |
// not supporting this |
|
2472 |
// HandleGprsNotesL(); |
|
2473 |
} |
|
2474 |
if ( iDeviceLockEnabled ) |
|
2475 |
{ |
|
2476 |
// Enable keylock via autolock emulation if device lock enabled. |
|
2477 |
// Otherwise e.g. messages can be read using softkeys during ongoing call. |
|
2478 |
iKeyguardController->EnableKeyguard(EFalse); |
|
2479 |
} |
|
2480 |
break; |
|
2481 |
} |
|
2482 |
||
2483 |
case EPSCTsyCallStateNone: |
|
2484 |
{ |
|
2485 |
// Reset timers in ScreenSaver and Autolock |
|
2486 |
User::ResetInactivityTime(); |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2487 |
|
46 | 2488 |
if ( iEmergencyCallActive ) |
2489 |
{ |
|
2490 |
iEmergencyCallActive = EFalse; |
|
2491 |
// not supporting this |
|
2492 |
// UpdateSignalBarsL( 0 ); |
|
2493 |
// SetSignalIndicatorL(); |
|
2494 |
} |
|
2495 |
if ( iKeyLockOnBeforeCall ) |
|
2496 |
{ |
|
2497 |
TRACES( RDebug::Print( _L("CSysApAppUi::HandleCurrentCallStateChangeL: EPSCTsyCallStateNone: enable keylock") ) ); |
|
2498 |
iKeyLockOnBeforeCall = EFalse; |
|
2499 |
if ( !iDeviceLockEnabled ) |
|
2500 |
{ |
|
2501 |
if ( !iKeyLockOnBeforeCradle && !iKeyLockOnBeforeAlarm && |
|
2502 |
!iSysApFeatureManager->TouchUnlockStrokeSupported() ) |
|
2503 |
{ |
|
2504 |
if ( iSysApCenRepController->GetInt( KCRUidCommonTelephonySettings, KSettingsSummaryAfterCall ) == 1 ) |
|
2505 |
{ |
|
2506 |
// Let's not hide "Summary After Call" dialog |
|
2507 |
iKeyguardController->EnableKeyguard(EFalse); |
|
2508 |
} |
|
2509 |
else |
|
2510 |
{ |
|
2511 |
iKeyguardController->EnableKeyguard(ETrue); |
|
2512 |
} |
|
2513 |
} |
|
2514 |
} |
|
2515 |
else |
|
2516 |
{ |
|
2517 |
iKeyguardController->EnableKeyguard(EFalse); |
|
2518 |
} |
|
2519 |
} |
|
2520 |
if ( iShowkeypadActivatedNoteAfterSoftReject ) |
|
2521 |
{ |
|
2522 |
ShowUiNoteL( EKeypadActiveNote ); |
|
2523 |
iShowkeypadActivatedNoteAfterSoftReject = EFalse; |
|
2524 |
} |
|
2525 |
iCallActivated = EFalse; |
|
2526 |
break; |
|
2527 |
} |
|
2528 |
||
2529 |
default: |
|
2530 |
break; |
|
2531 |
} |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2532 |
|
46 | 2533 |
if ( aCurrentCallState != EPSCTsyCallStateRinging ) |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2534 |
{ |
46 | 2535 |
iSysApLightsController->CallComingInL( EFalse ); |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2536 |
} |
46 | 2537 |
|
2538 |
SetIhfIndicatorL(); |
|
2539 |
SetHacIndicatorL(); |
|
2540 |
} |
|
2541 |
||
2542 |
||
2543 |
||
2544 |
/** |
|
2545 |
* To check the for an emergency call. |
|
2546 |
* |
|
2547 |
* @return ETrue if there is an emergency call active otherwise, EFalse. |
|
2548 |
*/ |
|
2549 |
TBool CSysApAppUi::IsEmergencyCall() |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2550 |
{ |
46 | 2551 |
TBool retVal( EFalse ); |
2552 |
TInt err( KErrNone ); |
|
2553 |
TInt state( 0 ); |
|
2554 |
||
2555 |
err = RProperty::Get(KPSUidCtsyEmergencyCallInfo, KCTSYEmergencyCallInfo, state ); |
|
2556 |
if ( err == KErrNone && state ) |
|
2557 |
{ |
|
2558 |
retVal = ETrue; |
|
2559 |
} |
|
2560 |
return retVal; |
|
2561 |
} |
|
2562 |
||
2563 |
||
2564 |
||
2565 |
// ---------------------------------------------------------------------------- |
|
2566 |
// CSysApAppUi::IsStateNormal() |
|
2567 |
// |
|
2568 |
// ---------------------------------------------------------------------------- |
|
2569 |
TBool CSysApAppUi::IsStateNormal() const |
|
2570 |
{ |
|
2571 |
TInt state; |
|
2572 |
TInt errorCode = |
|
2573 |
RProperty::Get( KPSUidStartup, KPSGlobalSystemState, state ); |
|
2574 |
if ( errorCode == KErrNone ) |
|
2575 |
{ |
|
2576 |
return state == ESwStateNormalRfOn || |
|
2577 |
state == ESwStateNormalRfOff || |
|
2578 |
state == ESwStateNormalBTSap; |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2579 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2580 |
else |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2581 |
{ |
46 | 2582 |
TRACES( RDebug::Print( _L( "CSysApAppUi::IsStateNormal: Failed to read global system state, error code %d." ), errorCode ) ); |
2583 |
return EFalse; |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2584 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2585 |
} |
46 | 2586 |
|
2587 |
||
2588 |
// ---------------------------------------------------------------------------- |
|
2589 |
// CSysApAppUi::HandleAccessoryProfileInStartupL() |
|
2590 |
// ---------------------------------------------------------------------------- |
|
2591 |
||
2592 |
void CSysApAppUi::HandleAccessoryProfileInStartupL() |
|
2593 |
{ |
|
2594 |
TRACES( RDebug::Print( _L( "CSysApAppUi::HandleAccessoryProfileInStartupL" ) ) ); |
|
2595 |
||
2596 |
if ( !iSysApOfflineModeController->OfflineModeActive() ) |
|
2597 |
{ |
|
2598 |
iIgnoreAccessorySpecificProfileChanges = EFalse; |
|
2599 |
TBool accessoryConnectedInShutdown( EFalse ); |
|
2600 |
TInt accessoryTemp( iSysApCenRepController->GetInt( KCRUidCoreApplicationUIsSysAp, KSysApAccessoryConnected ) ); |
|
2601 |
if ( accessoryTemp == 1 ) |
|
2602 |
{ |
|
2603 |
accessoryConnectedInShutdown = ETrue; |
|
2604 |
} |
|
2605 |
||
2606 |
TBool accessoryConnectedNow ( EFalse ); |
|
2607 |
||
2608 |
TAccMode accessoryState(EAccModeHandPortable); |
|
51 | 2609 |
TInt physicalConnectionType = 0; |
46 | 2610 |
if ( iSysApAccessoryObserver ) |
2611 |
{ |
|
2612 |
accessoryState = iSysApAccessoryObserver->GetAccessoryMode(); |
|
51 | 2613 |
physicalConnectionType = iSysApAccessoryObserver->GetAccessoryConnectionType(); |
46 | 2614 |
} |
2615 |
||
2616 |
if ( accessoryState != EAccModeHandPortable ) |
|
2617 |
{ |
|
2618 |
accessoryConnectedNow = ETrue; |
|
2619 |
} |
|
2620 |
TRACES( RDebug::Print( _L( "CSysApAppUi::HandleAccessoryProfileInStartupL: accessoryConnectedInShutdown: %d, accessoryConnectedNow: %d" ), |
|
2621 |
accessoryConnectedInShutdown, accessoryConnectedNow ) ); |
|
2622 |
||
2623 |
if ( accessoryConnectedInShutdown && !accessoryConnectedNow ) |
|
2624 |
{ |
|
2625 |
HandleAccessoryDisconnectedL(); |
|
2626 |
} |
|
2627 |
else if ( !accessoryConnectedInShutdown && accessoryConnectedNow ) |
|
2628 |
{ |
|
51 | 2629 |
HandleAccessoryConnectedL( accessoryState, physicalConnectionType ); |
46 | 2630 |
} |
2631 |
else if ( !accessoryConnectedNow ) |
|
2632 |
{ |
|
2633 |
// not supporting this |
|
2634 |
// TInt activeProfile ( ActiveProfileId() ); |
|
2635 |
// SysApCenRepController->SetInt( KCRUidCoreApplicationUIsSysAp, KSysApActiveProfileBeforeAccessoryConnected, activeProfile ); |
|
2636 |
} |
|
2637 |
} |
|
2638 |
} |
|
2639 |
||
2640 |
||
2641 |
// ---------------------------------------------------------------------------- |
|
2642 |
// CSysApAppUi::CenRepController() |
|
2643 |
// ---------------------------------------------------------------------------- |
|
2644 |
||
2645 |
CSysApCenRepController& CSysApAppUi::CenRepController() |
|
2646 |
{ |
|
2647 |
__ASSERT_ALWAYS( iSysApCenRepController, User::Panic( _L("CSysApAppUi::CenRepController"), KErrBadHandle ) ); |
|
2648 |
||
2649 |
return *iSysApCenRepController; |
|
2650 |
} |
|
2651 |
||
2652 |
||
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2653 |
// ---------------------------------------------------------------------------- |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2654 |
// CSysApAppUi::LogsObserverL |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2655 |
// ---------------------------------------------------------------------------- |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2656 |
// |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2657 |
CSysApCenRepLogsObserver& CSysApAppUi::LogsObserverL() |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2658 |
{ |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2659 |
TRACES( RDebug::Print( _L("CSysApAppUi::LogsObserverL()") ) ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2660 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2661 |
// Create Logs observer when it is needed for the first time |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2662 |
if ( !iSysApCenRepLogsObserver ) |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2663 |
{ |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2664 |
iSysApCenRepLogsObserver = CSysApCenRepLogsObserver::NewL( *this ); |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2665 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2666 |
|
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2667 |
return *iSysApCenRepLogsObserver; |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2668 |
} |
46 | 2669 |
|
2670 |
||
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2671 |
// ---------------------------------------------------------------------------- |
46 | 2672 |
// CSysApAppUi::HandleWlanIndicator() |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2673 |
// ---------------------------------------------------------------------------- |
46 | 2674 |
void CSysApAppUi::HandleWlanIndicatorL( TInt aValue ) |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2675 |
{ |
46 | 2676 |
if ( aValue == EPSWlanIndicatorAvailable ) |
2677 |
{ |
|
2678 |
// do nothing |
|
2679 |
} |
|
2680 |
else if ( aValue == EPSWlanIndicatorActive ) |
|
2681 |
{ |
|
2682 |
// do nothing |
|
2683 |
} |
|
2684 |
else if ( aValue == EPSWlanIndicatorActiveSecure ) |
|
2685 |
{ |
|
2686 |
// do nothing |
|
2687 |
} |
|
2688 |
else // No indication required |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2689 |
{ |
46 | 2690 |
// do nothing |
2691 |
} |
|
2692 |
} |
|
2693 |
||
2694 |
void CSysApAppUi::ShowNotificationDialog(const TDesC& noteText)const |
|
2695 |
{ |
|
2696 |
//Todo:4.Notification--Just Popup message |
|
2697 |
//Todo: #include <HbDeviceNotificationDialogSymbian.h> |
|
2698 |
CHbDeviceNotificationDialogSymbian *notificationDialog = CHbDeviceNotificationDialogSymbian::NewL(); |
|
2699 |
CleanupStack::PushL(notificationDialog); |
|
2700 |
notificationDialog->SetTextL(noteText);//noteText with Qm file input |
|
2701 |
notificationDialog->SetTimeout(100); |
|
2702 |
notificationDialog->ShowL(); |
|
2703 |
CleanupStack::PopAndDestroy(notificationDialog); |
|
2704 |
} |
|
2705 |
||
2706 |
void CSysApAppUi::SetKeyLockEnabledL() |
|
2707 |
{ |
|
2708 |
iKeyLockEnabled = ETrue; |
|
2709 |
iSysApCenRepController->SetInt( KCRUidCoreApplicationUIsSysAp, KSysApKeyguardActive, 1 ); |
|
2710 |
// not supporting indicator |
|
2711 |
// SetIndicatorStateL( EAknIndicatorKeyguard, EAknIndicatorStateOn ); |
|
2712 |
iSysApLightsController->KeylockStateChangedL( ETrue ); |
|
2713 |
} |
|
2714 |
||
2715 |
void CSysApAppUi::SetKeyLockDisabledL() |
|
2716 |
{ |
|
2717 |
iKeyLockEnabled = EFalse; |
|
2718 |
iSysApCenRepController->SetInt( KCRUidCoreApplicationUIsSysAp, KSysApKeyguardActive, 0 ); |
|
2719 |
// SetIndicatorStateL( EAknIndicatorKeyguard, EAknIndicatorStateOff ); |
|
2720 |
if (! iDeviceLockEnabled ) |
|
2721 |
{ |
|
2722 |
iSysApLightsController->KeylockStateChangedL( EFalse ); |
|
2723 |
if ( iSysApFeatureManager->MmcHotSwapSupported() ) |
|
2724 |
{ |
|
2725 |
if ( StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ) != EPSCTsyCallStateRinging && StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ) != EPSCTsyCallStateAlerting ) |
|
2726 |
{ |
|
61 | 2727 |
RunUnlockNotifierL(); |
46 | 2728 |
// need to handle MMC unlock query in next sub |
2729 |
} |
|
2730 |
} |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2731 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2732 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2733 |
|
46 | 2734 |
void CSysApAppUi::SetLightsOnUnlockNoteL() |
2735 |
{ |
|
2736 |
iSysApLightsController->SetLightsOnUnlockNoteL(); |
|
2737 |
} |
|
2738 |
||
2739 |
void CSysApAppUi::SetLightsOnEcsQueryL() |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2740 |
{ |
46 | 2741 |
iSysApLightsController->SetLightsOnEcsQueryL(); |
2742 |
} |
|
2743 |
||
2744 |
void CSysApAppUi::SetLightsOnSecurityQueryL() |
|
2745 |
{ |
|
2746 |
iSysApLightsController->SetLightsOnSecurityQueryL(); |
|
2747 |
} |
|
2748 |
||
2749 |
TBool CSysApAppUi::CheckLongPowerKeyPressed() |
|
2750 |
{ |
|
2751 |
return iCheckLongPowerKeyEvent; |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2752 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2753 |
|
46 | 2754 |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2755 |
// ---------------------------------------------------------------------------- |
46 | 2756 |
// CSysApAppUi::HandleKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType ) |
2757 |
// ---------------------------------------------------------------------------- |
|
2758 |
||
2759 |
TKeyResponse CSysApAppUi::HandleKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType ) |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2760 |
{ |
46 | 2761 |
if ( ! iShutdownStarted ) |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2762 |
{ |
46 | 2763 |
TRACES( RDebug::Print( _L("CSysApAppUi::HandleKeyEventL: aKeyEvent.iCode:%d, aKeyEvent.iScanCode:%d, aType:%d, iIgnoreNextPowerKeyUpEvent:%d, iPowerKeyPopupMenuActive:%d, iLastPowerKeyWasShort:%d, iPowerKeyPopupMenuDismissed:%d"), |
2764 |
aKeyEvent.iCode, aKeyEvent.iScanCode, aType, iIgnoreNextPowerKeyUpEvent, iPowerKeyPopupMenuActive, iLastPowerKeyWasShort, iPowerKeyPopupMenuDismissed ) ); |
|
2765 |
||
2766 |
#ifdef _DEBUG |
|
2767 |
// camery latency measurement environment instrumentation, don't remove |
|
2768 |
if ( aType == EEventKey && aKeyEvent.iCode == EKeyCamera ) |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2769 |
{ |
46 | 2770 |
TRACES( RDebug::Print( _L("e_KEY_EVENT_SENDING 0") ) ); |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2771 |
} |
46 | 2772 |
#endif // _DEBUG |
2773 |
||
2774 |
TKeyResponse response(EKeyWasNotConsumed); |
|
2775 |
if (response) |
|
2776 |
{ |
|
2777 |
//Do nothing:: To supress warning |
|
2778 |
} |
|
2779 |
||
2780 |
if( aType == EEventKey ) |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2781 |
{ |
46 | 2782 |
switch ( aKeyEvent.iCode ) |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2783 |
{ |
46 | 2784 |
#ifdef _DEBUG |
2785 |
case 'E': //For testing |
|
2786 |
Exit(); |
|
2787 |
break; |
|
2788 |
#endif |
|
72 | 2789 |
case EKeyPhoneSend: |
2790 |
{ |
|
2791 |
TRACES( RDebug::Print(_L("CSysApAppUi::HandleKeyEventL, Send key event received::Start") ) ); |
|
2792 |
if (UiReady()&& aKeyEvent.iRepeats == 0) |
|
2793 |
{ |
|
2794 |
//Ignore LongPress on SEND key event as Long press generates Short press event too, |
|
2795 |
//And there is no Different use case for long press. |
|
2796 |
HandleSendKeyEventL(); |
|
2797 |
} |
|
2798 |
TRACES( RDebug::Print(_L("CSysApAppUi::HandleKeyEventL, Send key event received::End") ) ); |
|
2799 |
break; |
|
2800 |
} |
|
2801 |
case EKeyPhoneEnd: |
|
2802 |
{ |
|
2803 |
TRACES( RDebug::Print(_L("CSysApAppUi::HandleKeyEventL, End key event received") ) ); |
|
2804 |
if (UiReady() && aKeyEvent.iRepeats == 0) |
|
2805 |
{ |
|
2806 |
//Ignore LongPress on END key event as Long press generates Short press event too, |
|
2807 |
//And there is no Different use case for long press. |
|
2808 |
HandleEndKeyEventL(); |
|
2809 |
} |
|
2810 |
TRACES( RDebug::Print(_L("CSysApAppUi::HandleKeyEventL()::EKeyPhoneEnd: End" ) ) ); |
|
2811 |
break; |
|
2812 |
} |
|
46 | 2813 |
case EKeyPowerOff: |
2814 |
//Short power key press |
|
2815 |
iKeyBoardRepeatCount++; |
|
2816 |
if( aKeyEvent.iRepeats == 0 ) |
|
2817 |
{ |
|
2818 |
TRACES( RDebug::Print(_L("CSysApAppUi::HandleKeyEventL, Short powerkey") ) ); |
|
2819 |
iLastPowerKeyWasShort = ETrue; |
|
2820 |
TRACES( RDebug::Print( _L("CSysApAppUi::Key was consumed by pressing short power") ) ); |
|
2821 |
//Powermenu |
|
61 | 2822 |
if (iPowerMenuDialog!=NULL) |
46 | 2823 |
{ |
2824 |
//PowerMenu already exist |
|
2825 |
delete iPowerMenuDialog; |
|
2826 |
iPowerMenuDialog = NULL; |
|
61 | 2827 |
} |
2828 |
iPowerMenuDialog = CHbDevicePowerMenuSymbian::NewL(*this); |
|
2829 |
iPowerMenuDialog->ShowL(); |
|
2830 |
||
46 | 2831 |
iIgnoreNextPowerKeyRepeats = EFalse; |
2832 |
} |
|
2833 |
//Long power key press |
|
2834 |
else if( aKeyEvent.iRepeats > 0 && iKeyBoardRepeatCount >= iSysApCenRepController->GetInt( KCRUidCoreApplicationUIsSysAp, KSysApPowerkeyRepeatcount )) |
|
2835 |
{ |
|
2836 |
iKeyBoardRepeatCount = -1; |
|
2837 |
TRACES( RDebug::Print(_L("CSysApAppUi::HandleKeyEventL, Long powerkey") ) ); |
|
2838 |
iLastPowerKeyWasShort = EFalse; |
|
2839 |
HandleLongPowerKeyPressedL(); |
|
2840 |
} |
|
2841 |
break; |
|
2842 |
||
2843 |
default: |
|
2844 |
{ |
|
2845 |
TKeyResponse response = EKeyWasNotConsumed; |
|
2846 |
if (iSysApKeyManagement) |
|
2847 |
{ |
|
2848 |
response = iSysApKeyManagement->HandleKeyEventL(aKeyEvent, aType ); |
|
2849 |
} |
|
2850 |
||
2851 |
if ( response == EKeyWasNotConsumed ) // none of the plugins consumed the key, offer it to default handling |
|
2852 |
{ |
|
2853 |
iSysApDefaultKeyHandler->HandleKeyEventL( aKeyEvent, aType ); |
|
2854 |
} |
|
2855 |
} |
|
2856 |
break; |
|
2857 |
} |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2858 |
} |
46 | 2859 |
else if( aType == EEventKeyUp ) |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2860 |
{ |
46 | 2861 |
if( aKeyEvent.iScanCode == EStdKeyDevice2 ) |
2862 |
{ |
|
2863 |
if ( iIgnoreNextPowerKeyUpEvent ) |
|
2864 |
{ |
|
2865 |
if ( !iPowerKeyPopupMenuDismissed ) // If the popup menu has been dismissed, do nothing |
|
2866 |
{ |
|
2867 |
iPowerKeyPopupMenuActive = ETrue; |
|
2868 |
iIgnoreNextPowerKeyUpEvent = EFalse; |
|
2869 |
} |
|
2870 |
} |
|
2871 |
else if( iLastPowerKeyWasShort ) |
|
2872 |
{ |
|
2873 |
if ( iPowerKeyPopupMenuActive ) |
|
2874 |
{ |
|
2875 |
} |
|
2876 |
} |
|
2877 |
||
2878 |
} |
|
2879 |
} |
|
2880 |
||
2881 |
TRACES( RDebug::Print( _L("CSysApAppUi::HandleKeyEventL:ended, aKeyEvent.iCode:%d, aKeyEvent.iScanCode:%d, aType:%d, iIgnoreNextPowerKeyUpEvent:%d, iPowerKeyPopupMenuActive:%d, iLastPowerKeyWasShort:%d, iPowerKeyPopupMenuDismissed:%d"), |
|
2882 |
aKeyEvent.iCode, aKeyEvent.iScanCode, aType, iIgnoreNextPowerKeyUpEvent, iPowerKeyPopupMenuActive, iLastPowerKeyWasShort, iPowerKeyPopupMenuDismissed ) ); |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2883 |
} |
46 | 2884 |
else // shutdown started |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2885 |
{ |
46 | 2886 |
TRACES( RDebug::Print( _L("CSysApAppUi::HandleKeyEventL: aKeyEvent.iCode:%d, aKeyEvent.iScanCode:%d, aType:%d"), |
2887 |
aKeyEvent.iCode, aKeyEvent.iScanCode, aType ) ); |
|
2888 |
||
2889 |
// When shutdown has been started, only device mode key events are passed to plug-in framework |
|
2890 |
// This for enabling plug-in activities during shutdown animation |
|
2891 |
if ( IsDeviceModeKey( aKeyEvent ) ) // Other key events are not passed, because they must cancel the shutdown animation as stated in UI spefication |
|
2892 |
{ |
|
2893 |
if ( aType == EEventKey && iSysApKeyManagement ) |
|
2894 |
{ |
|
2895 |
iSysApKeyManagement->HandleKeyEventL( aKeyEvent, aType ); |
|
2896 |
} |
|
2897 |
} |
|
2898 |
TRACES( RDebug::Print( _L("CSysApAppUi::HandleKeyEventL: ended") ) ); |
|
2899 |
} |
|
2900 |
return EKeyWasConsumed; |
|
2901 |
} |
|
2902 |
||
2903 |
||
2904 |
// ---------------------------------------------------------------------------- |
|
2905 |
// CSysApAppUi::HandleCommandL( TInt aCommand) |
|
2906 |
// ---------------------------------------------------------------------------- |
|
2907 |
||
2908 |
void CSysApAppUi::HandleCommandL( TInt aCommand ) |
|
2909 |
{ |
|
2910 |
TRACES( RDebug::Print( _L("CSysApAppUi::HandleCommandL aCommend: %d"), aCommand ) ); |
|
2911 |
switch ( aCommand ) |
|
2912 |
{ |
|
2913 |
case EEikCmdExit: // EAknCmdExit |
|
2914 |
Exit(); |
|
2915 |
break; |
|
2916 |
default: |
|
2917 |
break; |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2918 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2919 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2920 |
|
46 | 2921 |
TBool CSysApAppUi::ReleasePowerMenuCustomDialogMemory() |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2922 |
{ |
46 | 2923 |
if (iPowerMenuDialog!=NULL) |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2924 |
{ |
46 | 2925 |
//PowerMenu already exist |
2926 |
delete iPowerMenuDialog; |
|
2927 |
iPowerMenuDialog = NULL; |
|
51 | 2928 |
TRACES( RDebug::Print(_L("CSysApAppUi::ReleasePowerMenuCustomDialogMemory True") ) ); |
46 | 2929 |
return ETrue; |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2930 |
} |
51 | 2931 |
TRACES( RDebug::Print(_L("CSysApAppUi::ReleasePowerMenuCustomDialogMemory false") ) ); |
46 | 2932 |
return EFalse; |
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2933 |
} |
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2934 |
|
61 | 2935 |
TBool CSysApAppUi::NotifiedDialogIfRequiredAndReleaseMemory() |
2936 |
{ |
|
2937 |
TRACES( RDebug::Print(_L("CSysApAppUi::NotifiedDialogIfRequiredAndReleaseMemory(): Begin") ) ); |
|
2938 |
TRACES( RDebug::Print(_L("CSysApAppUi::NotifiedDialogIfRequiredAndReleaseMemory(): Enter for popping another dialog") ) ); |
|
2939 |
TInt popUpError = iSysApDriveUnlockHandler->CheckMemoryDialogIfNeeded(); |
|
2940 |
||
2941 |
//Deside if dialog required again !! |
|
2942 |
if(popUpError) |
|
2943 |
{ |
|
2944 |
iSysApDriveUnlockHandler->ReleaseMemoryForInputCardDialog(); // check memory has released. |
|
2945 |
iSysApDriveUnlockHandler->UnlockComplete(KErrNone); |
|
2946 |
} |
|
2947 |
else |
|
2948 |
{ |
|
2949 |
iSysApDriveUnlockHandler->StartUnlock();// pop up the dialog again !! |
|
2950 |
} |
|
2951 |
||
2952 |
TRACES( RDebug::Print(_L("CSysApAppUi::NotifiedDialogIfRequiredAndReleaseMemory(): End")) ); |
|
2953 |
return popUpError; |
|
2954 |
} |
|
2955 |
||
2956 |
void CSysApAppUi::ReleaseMemoryForMemoryCardDialog() |
|
2957 |
{ |
|
2958 |
TRACES( RDebug::Print(_L("CSysApAppUi::CSysApAppUi::ReleaseMemoryForMemoryCardDialog()")) ); |
|
2959 |
iSysApDriveUnlockHandler->ReleaseMemoryForInputCardDialog(); |
|
2960 |
} |
|
0
2e3d3ce01487
Revision: 201002
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2961 |
|
51 | 2962 |
// ---------------------------------------------------------------------------- |
2963 |
// CSysApAppUi::ShowAnimationL() |
|
2964 |
// ---------------------------------------------------------------------------- |
|
2965 |
||
2966 |
#ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
2967 |
void |
|
2968 |
#else // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
2969 |
TBool |
|
2970 |
#endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
2971 |
CSysApAppUi::ShowAnimationL() |
|
2972 |
{ |
|
2973 |
TRACES( RDebug::Print(_L("CSysApAppUi::ShowAnimationL(): START" ) ) ); |
|
2974 |
||
2975 |
TRACES( RDebug::Print( _L("CSysApAppUi::ShowAnimationL: Initialise shutdown animation") ) ); |
|
2976 |
||
2977 |
#ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
2978 |
||
2979 |
PrepareForShutdownAnimation(); |
|
2980 |
||
2981 |
iSysApShutdownAnimation = CSysApShutdownAnimation::NewL( *iSysApShutdownImage ); |
|
2982 |
iSysApShutdownAnimation->Play( TCallBack( DoStopAnimTiming, this ) ); |
|
2983 |
||
2984 |
TRACES( RDebug::Print(_L("CSysApAppUi::ShowAnimationL(): End" ) ) ); |
|
2985 |
||
2986 |
#else // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
2987 |
iSysApShutdownAnimation = CSysApShutdownAnimation::NewL( this ); |
|
2988 |
AddToStackL( iSysApShutdownAnimation ); |
|
2989 |
iAnimationShowingTime = iSysApShutdownAnimation->ShowingTime(); |
|
2990 |
TRACES( RDebug::Print( _L("CSysApAppUi::ShowAnimationL: Shutdown animation initialised. Animation time = %d") ,iAnimationShowingTime) ); |
|
2991 |
||
2992 |
TBool ret_val( EFalse ); |
|
2993 |
||
2994 |
if ( iAnimationShowingTime ) |
|
2995 |
{ |
|
2996 |
if ( iSysApFeatureManager->CoverDisplaySupported() ) |
|
2997 |
{ |
|
2998 |
// Construct mediator observer |
|
2999 |
iSysApMediatorObserver = CSysApMediatorObserver::NewL( this ); |
|
3000 |
||
3001 |
// Sync animation |
|
3002 |
TInt err = iSysApMediatorObserver->SyncShutdownAnimation(); |
|
3003 |
||
3004 |
if ( err != KErrNone ) |
|
3005 |
{ |
|
3006 |
// Pretend coverUI synced instantly if error in issuing command. |
|
3007 |
ShutdownAnimationSyncOK(); |
|
3008 |
} |
|
3009 |
} |
|
3010 |
else |
|
3011 |
{ |
|
3012 |
// Pretend coverUI synced instantly when it is not supported. |
|
3013 |
ShutdownAnimationSyncOK(); |
|
3014 |
} |
|
3015 |
||
3016 |
ret_val = ETrue; |
|
3017 |
} |
|
3018 |
||
3019 |
TRACES( RDebug::Print(_L("CSysApAppUi::ShowAnimationL(): returns: %d" ),ret_val ) ); |
|
3020 |
return ret_val; |
|
3021 |
#endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
3022 |
} |
|
3023 |
||
3024 |
||
3025 |
||
3026 |
// ---------------------------------------------------------------------------- |
|
3027 |
// CSysApAppUi::PrepareForShutdownAnimation() |
|
3028 |
// ---------------------------------------------------------------------------- |
|
3029 |
void CSysApAppUi::PrepareForShutdownAnimation() |
|
3030 |
{ |
|
3031 |
TRACES( RDebug::Print( _L("CSysApAppUi::PrepareForShutdownAnimation() begin") ) ); |
|
3032 |
||
3033 |
#ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
3034 |
TRACES( RDebug::Print( _L("CSysApAppUi::PrepareForShutdownAnimation() showtime = %d"), iAnimationShowingTime ) ); |
|
3035 |
if ( iAnimationShowingTime ) |
|
3036 |
{ |
|
3037 |
#endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
3038 |
||
3039 |
if (iPowerMenuDialog!=NULL) |
|
3040 |
{ |
|
3041 |
//PowerMenu already exist |
|
3042 |
delete iPowerMenuDialog; |
|
3043 |
iPowerMenuDialog = NULL; |
|
3044 |
} |
|
3045 |
||
3046 |
RWindowGroup groupWin = iCoeEnv->RootWin(); |
|
3047 |
iCapturedAppskey = groupWin.CaptureKey( EKeyApplication, KModifierMask, KModifierMask ); |
|
3048 |
iCapturedAppskeyUpAndDowns = groupWin.CaptureKeyUpAndDowns( EStdKeyApplication0, KModifierMask, KModifierMask ); |
|
3049 |
iEikonEnv->RootWin().SetOrdinalPosition(0, ECoeWinPriorityAlwaysAtFront ); |
|
3050 |
||
3051 |
TRACES( RDebug::Print( _L("CSysApAppUi::PrepareForShutdownAnimation() Draw background image" ) ) ); |
|
3052 |
||
3053 |
ShowShutdownImage( KBackgroundImageID ); |
|
3054 |
||
3055 |
#ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
3056 |
TRACES( RDebug::Print( _L("CSysApAppUi::PrepareForShutdownAnimation() Show Shutdown animation" ) ) ); |
|
3057 |
TInt err(0); |
|
3058 |
TRAP( err, iSysApShutdownAnimation->StartL( iLastPowerKeyWasShort ) ); |
|
3059 |
if ( err ) |
|
3060 |
{ |
|
3061 |
TRACES( RDebug::Print( _L("SysAp: Shutdown animation fails. Error code: %d" ), err ) ); |
|
3062 |
// Start animation timing immediatily if animation starting fails. |
|
3063 |
// Otherwise animation will call StartAnimTiming when it is ready. |
|
3064 |
StartAnimTiming(); |
|
3065 |
} |
|
3066 |
} |
|
3067 |
#endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
3068 |
||
3069 |
TRACES( RDebug::Print( _L("CSysApAppUi::PrepareForShutdownAnimation() end") ) ); |
|
3070 |
} |
|
3071 |
||
3072 |
||
3073 |
// ---------------------------------------------------------------------------- |
|
3074 |
// CSysApAppUi::DoStopAnimTiming( TAny* aObject ) |
|
3075 |
// ---------------------------------------------------------------------------- |
|
3076 |
||
3077 |
TInt CSysApAppUi::DoStopAnimTiming( TAny* aObject ) |
|
3078 |
{ |
|
3079 |
TInt err(KErrNone); |
|
3080 |
CSysApAppUi* appUi = STATIC_CAST( CSysApAppUi*, aObject ); |
|
3081 |
||
3082 |
// This method could theoretically be called by two timers (iAnimTimer and one in CSysApShutdownAnimation), |
|
3083 |
// so a check is needed to prevent multiple executions. |
|
3084 |
if ( !(appUi->iShutdownContinued) ) |
|
3085 |
{ |
|
3086 |
appUi->iShutdownContinued = ETrue; |
|
3087 |
||
3088 |
TRACES( RDebug::Print( _L("CSysApAppUi::DoStopAnimTiming() Animation timer completed or animation skipped" ) ) ); |
|
3089 |
||
3090 |
#ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
3091 |
if ( appUi->iAnimTimer ) |
|
3092 |
{ |
|
3093 |
appUi->iAnimTimer->Cancel(); |
|
3094 |
} |
|
3095 |
#endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
3096 |
||
3097 |
TRACES( RDebug::Print( _L("CSysApAppUi::DoStopAnimTiming() Call ContinueShutdown(...)" ) ) ); |
|
3098 |
appUi->ContinueShutdown(); |
|
3099 |
TRACES( RDebug::Print( _L("CSysApAppUi::DoStopAnimTiming() end") ) ); |
|
3100 |
} |
|
3101 |
||
3102 |
return err; |
|
3103 |
} |
|
3104 |
||
3105 |
||
3106 |
// ---------------------------------------------------------------------------- |
|
3107 |
// CSysApAppUi::ContinueShutdown() |
|
3108 |
// ---------------------------------------------------------------------------- |
|
3109 |
||
3110 |
void CSysApAppUi::ContinueShutdown() |
|
3111 |
{ |
|
3112 |
TRACES( RDebug::Print(_L("CSysApAppUi::ContinueShutdown() started" ) ) ); |
|
3113 |
CompleteShutdown(); |
|
3114 |
TRACES( RDebug::Print(_L("CSysApAppUi::ContinueShutdown() completed" ) ) ); |
|
3115 |
} |
|
3116 |
||
3117 |
CEikStatusPane* CSysApAppUi::StatusPane() |
|
3118 |
{ |
|
3119 |
return iEikonEnv->AppUiFactory()->StatusPane(); |
|
3120 |
} |
|
3121 |
||
3122 |
||
61 | 3123 |
#ifndef RD_MULTIPLE_DRIVE |
3124 |
||
3125 |
// ---------------------------------------------------------------------------- |
|
3126 |
// CSysApAppUi::EjectUsed |
|
3127 |
// ---------------------------------------------------------------------------- |
|
3128 |
||
3129 |
void CSysApAppUi::EjectUsed( TInt /*aDrive*/ ) |
|
3130 |
{ |
|
3131 |
} |
|
3132 |
||
3133 |
#else // RD_MULTIPLE_DRIVE |
|
51 | 3134 |
|
3135 |
// ---------------------------------------------------------------------------- |
|
3136 |
// CSysApAppUi::ShowEjectWaitNoteL |
|
3137 |
// ---------------------------------------------------------------------------- |
|
3138 |
||
61 | 3139 |
void CSysApAppUi::ShowEjectWaitNoteL( TInt /* aDriveToEject */ ) |
3140 |
{ |
|
3141 |
/* if ( iSysApWaitNote ) |
|
51 | 3142 |
{ |
3143 |
return; |
|
3144 |
} |
|
3145 |
HBufC* text = iSysApDriveList->GetFormattedDriveNameLC( |
|
3146 |
aDriveToEject, |
|
3147 |
0, // Not used |
|
3148 |
R_QTN_EJECTING_MEMORY_NAME_WAIT ); |
|
3149 |
iSysApWaitNote = CSysApWaitNote::NewL( |
|
3150 |
iSysApFeatureManager->CoverDisplaySupported() ); |
|
3151 |
iSysApWaitNote->ShowNoteL( EClosingApplicationsNote, text ); |
|
3152 |
CleanupStack::PopAndDestroy( text ); |
|
61 | 3153 |
*/ } |
3154 |
||
3155 |
// ---------------------------------------------------------------------------- |
|
3156 |
// CSysApAppUi::IsEjectQueryVisible |
|
3157 |
// ---------------------------------------------------------------------------- |
|
3158 |
||
3159 |
TBool CSysApAppUi::IsEjectQueryVisible() |
|
3160 |
{ |
|
3161 |
// if ( !iSysApConfirmationQuery ) |
|
3162 |
{ |
|
3163 |
return EFalse; |
|
3164 |
} |
|
3165 |
// TInt queryId( iSysApConfirmationQuery->CurrentQuery() ); |
|
3166 |
// return ( queryId == ESysApEjectMmcQuery || queryId == ESysApRemoveMmcNote ); |
|
3167 |
} |
|
3168 |
||
3169 |
// ---------------------------------------------------------------------------- |
|
3170 |
// CSysApAppUi::UpdateInsertedMemoryCardsL |
|
3171 |
// ---------------------------------------------------------------------------- |
|
3172 |
||
3173 |
void CSysApAppUi::UpdateInsertedMemoryCardsL() |
|
3174 |
{ |
|
3175 |
// Update inserted memory cards |
|
3176 |
iSysApDriveList->GetMemoryCardsL( |
|
3177 |
iInsertedMemoryCards, CSysApDriveList::EIncludeInserted ); |
|
3178 |
||
3179 |
// Update memory card indicator status |
|
3180 |
// SetMemoryCardIndicatorL(); |
|
3181 |
||
3182 |
// Handle unlock |
|
3183 |
RunUnlockNotifierL(); |
|
3184 |
} |
|
3185 |
||
3186 |
// ---------------------------------------------------------------------------- |
|
3187 |
// CSysApAppUi::EjectUsed |
|
3188 |
// ---------------------------------------------------------------------------- |
|
3189 |
||
3190 |
void CSysApAppUi::EjectUsed( TInt aDrive ) |
|
3191 |
{ |
|
3192 |
// Check drive inserted before starting eject confirm query |
|
3193 |
TInt insertedIndex( CSysApDriveList::Find( iInsertedMemoryCards, aDrive ) ); |
|
3194 |
||
3195 |
TRACES( RDebug::Print( |
|
3196 |
_L( "CSysApAppUi::EjectUsed: drive: %d, index: %d" ), |
|
3197 |
aDrive, insertedIndex ) ); |
|
3198 |
||
3199 |
if ( insertedIndex == KErrNotFound ) |
|
3200 |
{ |
|
3201 |
return; |
|
3202 |
} |
|
3203 |
||
3204 |
iMMCEjectUsed = ETrue; |
|
3205 |
iDriveToEject = aDrive; |
|
3206 |
iSysApDriveList->ResetDrivesToEject(); |
|
3207 |
TRAPD( err, EjectMMCL() ); |
|
3208 |
if ( err != KErrNone ) |
|
3209 |
{ |
|
3210 |
TRACES( RDebug::Print( |
|
3211 |
_L( "CSysApAppUi::EjectUsed: err: %d" ), err ) ); |
|
3212 |
iMMCEjectUsed = EFalse; |
|
3213 |
} |
|
3214 |
} |
|
3215 |
#endif // RD_MULTIPLE_DRIVE |
|
3216 |
||
3217 |
||
3218 |
// ---------------------------------------------------------------------------- |
|
3219 |
// CSysApAppUi::EjectMMCCanceled |
|
3220 |
// ---------------------------------------------------------------------------- |
|
3221 |
||
3222 |
void CSysApAppUi::EjectMMCCanceled() |
|
3223 |
{ |
|
3224 |
// Called from eject confirm query, reset eject status |
|
3225 |
#ifdef RD_MULTIPLE_DRIVE |
|
3226 |
iMMCEjectUsed = EFalse; |
|
3227 |
#endif // RD_MULTIPLE_DRIVE |
|
3228 |
} |
|
3229 |
||
3230 |
||
3231 |
||
3232 |
#ifndef RD_MULTIPLE_DRIVE |
|
3233 |
// ---------------------------------------------------------------------------- |
|
3234 |
// CSysApAppUi::MountMMC() |
|
3235 |
// ---------------------------------------------------------------------------- |
|
3236 |
||
3237 |
TInt CSysApAppUi::MountMMC() |
|
3238 |
{ |
|
3239 |
TRACES( RDebug::Print( _L("CSysApAppUi::MountMMC") ) ); |
|
3240 |
TInt err ( KErrNotSupported ); |
|
3241 |
if ( iSysApFeatureManager->MmcSupported() ) |
|
3242 |
{ |
|
3243 |
#ifdef __WINS__ // Let's sleep a second in WINS |
|
3244 |
User::After( 1000000 ); |
|
3245 |
#endif |
|
3246 |
err = iEikonEnv->FsSession().MountFileSystem( KFSName, KMMCDrive ); |
|
3247 |
TRACES( RDebug::Print( _L("CSysApAppUi::MountMMC: RFs::MountFileSystem() returned: %d"), err ) ); |
|
3248 |
if ( err == KErrInUse ) |
|
3249 |
{ |
|
3250 |
User::After( 1000000 ); |
|
3251 |
err = iEikonEnv->FsSession().MountFileSystem( KFSName, KMMCDrive ); |
|
3252 |
TRACES( RDebug::Print( _L("CSysApAppUi::MountMMC: RFs::MountFileSystem() returned: %d"), err ) ); |
|
3253 |
} |
|
3254 |
} |
|
3255 |
return err; |
|
3256 |
} |
|
3257 |
||
3258 |
// ---------------------------------------------------------------------------- |
|
3259 |
// CSysApAppUi::DismountMMC() |
|
3260 |
// ---------------------------------------------------------------------------- |
|
3261 |
||
3262 |
TInt CSysApAppUi::DismountMMC() |
|
3263 |
{ |
|
3264 |
TRACES( RDebug::Print( _L("CSysApAppUi::DismountMMC") ) ); |
|
3265 |
#ifdef __WINS__ // Let's sleep a second in WINS |
|
3266 |
User::After( 1000000 ); |
|
3267 |
#endif |
|
3268 |
||
3269 |
TInt err ( KErrNotSupported ); |
|
3270 |
if ( iSysApFeatureManager->MmcSupported() ) |
|
3271 |
{ |
|
3272 |
err = iEikonEnv->FsSession().DismountFileSystem( KFSName, KMMCDrive ); |
|
3273 |
TRACES( RDebug::Print( _L("CSysApAppUi::DismountMMC: RFs::DismountFileSystem() returned: %d"), err ) ); |
|
3274 |
} |
|
3275 |
return err; |
|
3276 |
} |
|
3277 |
||
3278 |
// ---------------------------------------------------------------------------- |
|
3279 |
// CSysApAppUi::EjectMMCL() |
|
3280 |
// ---------------------------------------------------------------------------- |
|
3281 |
||
3282 |
void CSysApAppUi::EjectMMCL() |
|
3283 |
{ |
|
3284 |
TRACES( RDebug::Print( _L("CSysApAppUi::EjectMMCL") ) ); |
|
3285 |
iMMCEjectUsed = ETrue; |
|
3286 |
iMMCPowerMenuEjectUsed = ETrue; |
|
3287 |
iTimeToKill = EFalse; |
|
3288 |
iApplicationScanningRoundNumber = 0; |
|
3289 |
CloseUIAppsInHotSwapL(); |
|
3290 |
} |
|
3291 |
||
3292 |
#else // RD_MULTIPLE_DRIVE |
|
3293 |
||
3294 |
// ---------------------------------------------------------------------------- |
|
3295 |
// CSysApAppUi::EjectMMCL() |
|
3296 |
// ---------------------------------------------------------------------------- |
|
3297 |
||
3298 |
void CSysApAppUi::EjectMMCL() |
|
3299 |
{ |
|
3300 |
// Called from eject confirm query, check drive inserted before start |
|
3301 |
TInt insertedIndex( CSysApDriveList::Find( |
|
3302 |
iInsertedMemoryCards, iDriveToEject ) ); |
|
3303 |
||
3304 |
TRACES( RDebug::Print( |
|
3305 |
_L( "CSysApAppUi::EjectMMCL: iMMCEjectUsed: %d, drive: %d, index: %d "), |
|
3306 |
iMMCEjectUsed, iDriveToEject, insertedIndex ) ); |
|
3307 |
||
3308 |
if ( insertedIndex != KErrNotFound ) |
|
3309 |
{ |
|
3310 |
iSysApDriveList->MarkDriveToEject( |
|
3311 |
iDriveToEject, CSysApDriveList::EEjectFromMenu ); |
|
3312 |
iSysApDriveEjectHandler->StartEject(); |
|
3313 |
} |
|
3314 |
iMMCEjectUsed = EFalse; |
|
3315 |
} |
|
3316 |
||
3317 |
#endif // RD_MULTIPLE_DRIVE |
|
3318 |
||
3319 |
#ifndef RD_MULTIPLE_DRIVE |
|
3320 |
// ---------------------------------------------------------------------------- |
|
3321 |
// CSysApAppUi::RunUnlockNotifierL() |
|
3322 |
// ---------------------------------------------------------------------------- |
|
3323 |
||
3324 |
void CSysApAppUi::RunUnlockNotifierL( TSysApMemoryCardStatus aMemoryCardStatus ) |
|
3325 |
{ |
|
3326 |
TRACES( RDebug::Print( _L("CSysApAppUi::RunUnlockNotifierL: START") ) ); |
|
3327 |
if ( iSysApFeatureManager->MmcSupported() ) |
|
3328 |
{ |
|
3329 |
if ( UiReady() ) |
|
3330 |
{ |
|
3331 |
TSysApMemoryCardStatus memoryCardStatus; |
|
3332 |
if ( aMemoryCardStatus == ESysApMemoryCardStatusNotKnown ) |
|
3333 |
{ |
|
3334 |
memoryCardStatus = iSysApMMCObserver->MemoryCardStatus(); |
|
3335 |
} |
|
3336 |
else |
|
3337 |
{ |
|
3338 |
memoryCardStatus = aMemoryCardStatus; |
|
3339 |
} |
|
3340 |
||
3341 |
TRACES( RDebug::Print( _L("CSysApAppUi::RunUnlockNotifierL: memoryCardStatus=%d"), memoryCardStatus ) ); |
|
3342 |
||
3343 |
switch ( memoryCardStatus ) |
|
3344 |
{ |
|
3345 |
case ESysApMemoryCardInserted: |
|
3346 |
TRACES( RDebug::Print( _L("CSysApAppUi::RunUnlockNotifierL MMC inserted") ) ); |
|
3347 |
if ( aMemoryCardStatus == ESysApMemoryCardInserted ) |
|
3348 |
{ |
|
3349 |
RProperty::Set( KPSUidUikon, KUikMMCInserted, 1 ); |
|
3350 |
} |
|
3351 |
break; |
|
3352 |
case ESysApMemoryCardLocked: |
|
3353 |
{ |
|
3354 |
TRACES( RDebug::Print( _L("CSysApAppUi::RunUnlockNotifierL MMC locked") ) ); |
|
3355 |
RProperty::Set( KPSUidUikon, KUikMMCInserted, 0 ); |
|
3356 |
TInt callState = StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ); |
|
3357 |
||
3358 |
if ( (! ( iDeviceLockEnabled || iKeyLockEnabled ) ) && |
|
3359 |
callState != EPSCTsyCallStateRinging && // We don't want to see the MMC passwd query |
|
3360 |
callState != EPSCTsyCallStateAlerting ) // when the user is e.g. making an emergency call |
|
3361 |
{ |
|
3362 |
if ( iSysApFeatureManager->MemoryCardLockSupported() ) |
|
3363 |
{ |
|
3364 |
if ( ! iMemoryCardDialog ) |
|
3365 |
{ |
|
3366 |
TRACES( RDebug::Print( _L("CSysApAppUi::RunUnlockNotifierL: ACTIVATE MMC passwd query") ) ); |
|
3367 |
CAknMemoryCardDialog* mmcDialog = CAknMemoryCardDialog::NewLC( this ); |
|
3368 |
iMemoryCardDialog = mmcDialog; // temporary variable used for hiding codescanner error |
|
3369 |
iMemoryCardDialog->SetSelfPointer( &iMemoryCardDialog ); |
|
3370 |
iMemoryCardDialog->UnlockCardLD(); // when UnlockCardLD completes it calls UnlockComplete() |
|
3371 |
} |
|
3372 |
} |
|
3373 |
else |
|
3374 |
{ |
|
3375 |
// Since locked cards are not supported, notify user that card is locked. |
|
3376 |
ShowQueryL( ESysApMemoryCardLockedNote ); |
|
3377 |
} |
|
3378 |
} |
|
3379 |
} |
|
3380 |
break; |
|
3381 |
||
3382 |
case ESysApMemoryCardNotInserted: |
|
3383 |
default: |
|
3384 |
TRACES( RDebug::Print( _L("CSysApAppUi::RunUnlockNotifierL MMC not inserted") ) ); |
|
3385 |
if ( aMemoryCardStatus == ESysApMemoryCardNotInserted ) |
|
3386 |
{ |
|
3387 |
RProperty::Set( KPSUidUikon, KUikMMCInserted, 0 ); |
|
3388 |
} |
|
3389 |
} |
|
3390 |
} |
|
3391 |
} |
|
3392 |
TRACES( RDebug::Print( _L("CSysApAppUi::RunUnlockNotifierL: END") ) ); |
|
3393 |
} |
|
3394 |
||
3395 |
// ---------------------------------------------------------------------------- |
|
3396 |
// CSysApAppUi::UnlockComplete() from MAknMemoryCardDialogObserver |
|
3397 |
// ---------------------------------------------------------------------------- |
|
3398 |
||
3399 |
void CSysApAppUi::UnlockComplete( TInt aResult ) |
|
3400 |
{ |
|
3401 |
TRACES( RDebug::Print( _L("CSysApAppUi::UnlockComplete result: %d"), aResult ) ); |
|
3402 |
if ( aResult == KErrNone ) |
|
3403 |
{ |
|
3404 |
RProperty::Set( KPSUidUikon, KUikMMCInserted, 1 ); |
|
3405 |
} |
|
3406 |
} |
|
3407 |
||
3408 |
// ---------------------------------------------------------------------------- |
|
3409 |
// CSysApAppUi::MMCStatusChangedL() from MSysApMemoryCardObserver |
|
3410 |
// ---------------------------------------------------------------------------- |
|
3411 |
||
3412 |
void CSysApAppUi::MMCStatusChangedL() |
|
3413 |
{ |
|
3414 |
TRACES( RDebug::Print( _L( "CSysApAppUi::MMCStatusChangedL START: iMMCInserted: %d, iMMCEjectUsed: %d, iHideFirstBeep: %d, iHideNextBeep: %d" ), iMMCInserted, iMMCEjectUsed, iHideFirstBeep, iHideNextBeep ) ); |
|
3415 |
||
3416 |
if ( iSysApFeatureManager->MmcSupported() && !iShutdownStarted ) |
|
3417 |
{ |
|
3418 |
TSysApMemoryCardStatus memoryCardStatus = iSysApMMCObserver->MemoryCardStatus(); |
|
3419 |
TRACES( RDebug::Print( _L( "CSysApAppUi::MMCStatusChangedL memoryCardStatus=%d" ), memoryCardStatus ) ); |
|
3420 |
||
3421 |
switch ( memoryCardStatus ) |
|
3422 |
{ |
|
3423 |
case ESysApMemoryCardInserted: |
|
3424 |
case ESysApMemoryCardLocked: |
|
3425 |
TRACES( RDebug::Print( _L( "CSysApAppUi::MMCStatusChangedL: MMC drive mounted" ) ) ); |
|
3426 |
if ( ! iMMCInserted ) // MMC was not inserted before |
|
3427 |
{ |
|
3428 |
TRACES( RDebug::Print( _L( "CSysApAppUi::MMCStatusChangedL: MMC newly inserted" ) ) ); |
|
3429 |
CancelWaitNote(); // just to be sure, the user might keep on closing and opening the MMC latch |
|
3430 |
// An MMC has been newly inserted, so play a sound and check if its password protected |
|
3431 |
||
3432 |
if ( UiReady() ) |
|
3433 |
{ |
|
3434 |
if ( !iHideFirstBeep && !iHideNextBeep ) // starting up |
|
3435 |
{ |
|
3436 |
Beep(); |
|
3437 |
// Switch lights on |
|
3438 |
iSysApLightsController->MemoryCardInsertedL(); |
|
3439 |
} |
|
3440 |
iHideNextBeep = EFalse; |
|
3441 |
} |
|
3442 |
||
3443 |
iMMCPowerMenuEjectUsed = EFalse; |
|
3444 |
iMMCEjectUsed = EFalse; |
|
3445 |
iMMCInserted = ETrue; |
|
3446 |
||
3447 |
// No need to show ESysApRemoveMmcNote after MMC already mounted |
|
3448 |
if ( iSysApConfirmationQuery ) |
|
3449 |
{ |
|
3450 |
if ( iSysApConfirmationQuery->CurrentQuery() == ESysApRemoveMmcNote ) |
|
3451 |
{ |
|
3452 |
iSysApConfirmationQuery->Cancel(); |
|
3453 |
} |
|
3454 |
} |
|
3455 |
||
3456 |
// Check if the MMC is locked and unlock it if necessary |
|
3457 |
RunUnlockNotifierL( memoryCardStatus ); |
|
3458 |
} |
|
3459 |
break; |
|
3460 |
default: |
|
3461 |
TRACES( RDebug::Print( _L( "CSysApAppUi::MMCStatusChangedL: MMC drive not mounted" ) ) ); |
|
3462 |
delete iMemoryCardDialog; // sets itself to null |
|
3463 |
RProperty::Set( KPSUidUikon, KUikMMCInserted, 0 ); |
|
3464 |
if ( iMMCInserted ) |
|
3465 |
{ |
|
3466 |
// No need to show ESysApEjectMmcQuery after MMC already removed |
|
3467 |
if ( iSysApConfirmationQuery ) |
|
3468 |
{ |
|
3469 |
if ( iSysApConfirmationQuery->CurrentQuery() == ESysApEjectMmcQuery ) |
|
3470 |
{ |
|
3471 |
iSysApConfirmationQuery->Cancel(); |
|
3472 |
} |
|
3473 |
} |
|
3474 |
||
3475 |
iMMCInserted = EFalse; |
|
3476 |
||
3477 |
TInt propertyValue( StateOfProperty( KPSUidUsbWatcher, KUsbWatcherSelectedPersonality ) ); |
|
3478 |
if ( !iMMCEjectUsed && propertyValue != KUsbPersonalityIdMS ) |
|
3479 |
{ |
|
3480 |
// if USB file transfer active, do not close applications |
|
3481 |
// if eject selected in MMC App, MMC App takes care of the following and |
|
3482 |
// if eject selected from powerkeymenu, applications have already been shutdown |
|
3483 |
iTimeToKill = EFalse; |
|
3484 |
iApplicationScanningRoundNumber = 0; |
|
3485 |
CloseUIAppsInHotSwapL(); |
|
3486 |
} |
|
3487 |
} |
|
3488 |
else |
|
3489 |
{ |
|
3490 |
// If MMC was not previously inserted and eject was chosed from power key menu, attempt to remount. |
|
3491 |
if ( iMMCPowerMenuEjectUsed ) |
|
3492 |
{ |
|
3493 |
TRACES( RDebug::Print( _L( "CSysApAppUi::MMCStatusChangedL: Attempt to remount" ) ) ); |
|
3494 |
MountMMC(); |
|
3495 |
// If mount was successful, unnecessary note will be canceled in insert notification handling. |
|
3496 |
} |
|
3497 |
} |
|
3498 |
break; |
|
3499 |
} |
|
3500 |
||
3501 |
// Update memory card indicator status |
|
3502 |
SetMemoryCardIndicatorL(); |
|
3503 |
} |
|
3504 |
TRACES( RDebug::Print( _L( "CSysApAppUi::MMCStatusChangedL END: iMMCInserted: %d, iMMCEjectUsed: %d, iHideFirstBeep: %d, iHideNextBeep: %d" ), iMMCInserted, iMMCEjectUsed, iHideFirstBeep, iHideNextBeep ) ); |
|
3505 |
} |
|
3506 |
||
3507 |
// ---------------------------------------------------------------------------- |
|
3508 |
// CSysApAppUi::ShowMMCDismountedDialogL() |
|
3509 |
// ---------------------------------------------------------------------------- |
|
3510 |
||
3511 |
void CSysApAppUi::ShowMMCDismountedDialogL() |
|
3512 |
{ |
|
3513 |
TInt propertyValue( StateOfProperty( KPSUidUsbWatcher, KUsbWatcherSelectedPersonality ) ); |
|
3514 |
||
3515 |
// Do not show any note if USB file transfer is active. |
|
3516 |
if ( propertyValue != KUsbPersonalityIdMS ) |
|
3517 |
{ |
|
3518 |
if ( iSysApFeatureManager->MemoryCardHatchSupported() ) |
|
3519 |
{ // MMC hatch has been opened and MMC has been dismounted |
|
3520 |
TRACES( RDebug::Print( _L( "CSysApAppUi::ShowMMCDismountedDialogL: Show note: Remove MMC and press OK." ) ) ); |
|
3521 |
ShowQueryL( ESysApRemoveMmcNote ); |
|
3522 |
} |
|
3523 |
else |
|
3524 |
{ |
|
3525 |
// MMC has been removed and dismounted |
|
3526 |
TRACES( RDebug::Print( _L( "CSysApAppUi::ShowMMCDismountedDialogL: Show note: You might have lost some data." ) ) ); |
|
3527 |
// No confirmation but let's set this true to enable MMC passwd query |
|
3528 |
ShowUiNoteL( EMemoryCardRemovedWithoutEjectNote ); |
|
3529 |
} |
|
3530 |
} |
|
3531 |
else |
|
3532 |
{ |
|
3533 |
TRACES( RDebug::Print( _L( "CSysApAppUi::ShowMMCDismountedDialogL: No note shown, USB file transfer caused dismount." ) ) ); |
|
3534 |
} |
|
3535 |
} |
|
3536 |
||
3537 |
// ---------------------------------------------------------------------------- |
|
3538 |
// CSysApAppUi::MMCDismountedDialogConfirmed |
|
3539 |
// ---------------------------------------------------------------------------- |
|
3540 |
||
3541 |
void CSysApAppUi::MMCDismountedDialogConfirmed() |
|
3542 |
{ |
|
3543 |
TRACES( RDebug::Print( _L( "CSysApAppUi::MMCDismountedDialogConfirmed") ) ); |
|
3544 |
||
3545 |
// Try to remount just in case when eject was chosen from power key menu |
|
3546 |
if ( iMMCPowerMenuEjectUsed ) |
|
3547 |
{ |
|
3548 |
iMMCPowerMenuEjectUsed = EFalse; |
|
3549 |
||
3550 |
if ( MountMMC() == KErrLocked ) // In case a locked card was not removed after all |
|
3551 |
{ |
|
3552 |
TRAPD( err, MMCStatusChangedL() ); // This will update power menu and memory card icon. Also memory card password is requeried. |
|
3553 |
if ( err != KErrNone ) |
|
3554 |
{ |
|
3555 |
TRACES( RDebug::Print( _L( "CSysApAppUi::MMCDismountedDialogConfirmed: MMCStatusChangedL failed, err=%d"), err ) ); |
|
3556 |
} |
|
3557 |
} |
|
3558 |
} |
|
3559 |
||
3560 |
} |
|
3561 |
||
3562 |
#else // RD_MULTIPLE_DRIVE |
|
3563 |
||
3564 |
// ---------------------------------------------------------------------------- |
|
3565 |
// CSysApAppUi::MMCInsertedL |
|
3566 |
// ---------------------------------------------------------------------------- |
|
3567 |
||
3568 |
void CSysApAppUi::MMCInsertedL() |
|
3569 |
{ |
|
3570 |
TRACES( RDebug::Print( _L( "CSysApAppUi::MMCInsertedL") ) ); |
|
3571 |
||
3572 |
if ( iSysApFeatureManager->MmcSupported() && !iShutdownStarted ) |
|
3573 |
{ |
|
3574 |
TBool normalState( UiReady() ); |
|
3575 |
||
3576 |
if ( normalState ) |
|
3577 |
{ |
|
3578 |
TInt defaultMemoryCard( iSysApDriveList->DefaultMemoryCard() ); |
|
3579 |
TSysApMemoryCardStatus memoryCardStatus( iSysApDriveList->MemoryCardStatus( defaultMemoryCard ) ); |
|
3580 |
||
3581 |
TRACES( RDebug::Print( |
|
3582 |
_L( "CSysApAppUi::MMCInsertedL: drive: %d, memoryCardStatus: %d" ), defaultMemoryCard, memoryCardStatus ) ); |
|
3583 |
||
3584 |
switch ( memoryCardStatus ) |
|
3585 |
{ |
|
3586 |
case ESysApMemoryCardInserted: // Fall through |
|
3587 |
case ESysApMemoryCardLocked: |
|
3588 |
{ |
|
3589 |
// Reset eject and unlock of inserted memory card |
|
3590 |
iSysApDriveList->ResetDriveToEject( defaultMemoryCard ); |
|
3591 |
iSysApDriveList->ResetDriveUnlockQueryShown( defaultMemoryCard ); |
|
3592 |
||
3593 |
// CancelWaitNote(); |
|
3594 |
||
3595 |
if ( memoryCardStatus == ESysApMemoryCardInserted ) |
|
3596 |
{ |
|
3597 |
TRACES( RDebug::Print( |
|
3598 |
_L( "CSysApAppUi::MMCInsertedL: memoryCardStatus ESysApMemoryCardInserted: %d" ), memoryCardStatus ) ); |
|
3599 |
RProperty::Set( KPSUidUikon, KUikMMCInserted, 1 ); |
|
3600 |
} |
|
3601 |
else |
|
3602 |
{ |
|
3603 |
TRACES( RDebug::Print( |
|
3604 |
_L( "CSysApAppUi::MMCInsertedL: memoryCardStatus ESysApMemoryCardLocked: %d" ), memoryCardStatus ) ); |
|
3605 |
RProperty::Set( KPSUidUikon, KUikMMCInserted, 0 ); |
|
3606 |
} |
|
3607 |
break; |
|
3608 |
} |
|
3609 |
case ESysApMemoryCardNotInserted: |
|
3610 |
{ |
|
3611 |
// Always reset eject and unlock of removed memory card |
|
3612 |
TBool isEject( iSysApDriveList->IsDriveToEject( defaultMemoryCard ) ); |
|
3613 |
||
3614 |
TRACES( RDebug::Print( |
|
3615 |
_L( "CSysApAppUi::MMCInsertedL: isEject: %d, drive: %d" ), |
|
3616 |
isEject, defaultMemoryCard ) ); |
|
3617 |
||
3618 |
iSysApDriveList->ResetDriveToEject( defaultMemoryCard ); |
|
3619 |
iSysApDriveList->ResetDriveUnlockQueryShown( defaultMemoryCard ); |
|
3620 |
||
3621 |
TRACES( RDebug::Print( |
|
3622 |
_L( "SysApAppUi::MMCInsertedL: memoryCardStatus ESysApMemoryCardNotInserted: %d" ), memoryCardStatus ) ); |
|
3623 |
||
3624 |
RProperty::Set( KPSUidUikon, KUikMMCInserted, 0 ); |
|
3625 |
break; |
|
3626 |
} |
|
3627 |
case ESysApMemoryCardStatusNotKnown: // Fall through |
|
3628 |
default: |
|
3629 |
{ |
|
3630 |
break; |
|
3631 |
} |
|
3632 |
} |
|
3633 |
RunUnlockNotifierL(); |
|
3634 |
} |
|
3635 |
} |
|
3636 |
} |
|
3637 |
||
3638 |
||
3639 |
// ---------------------------------------------------------------------------- |
|
3640 |
// CSysApAppUi::RunUnlockNotifierL() |
|
3641 |
// ---------------------------------------------------------------------------- |
|
3642 |
||
3643 |
void CSysApAppUi::RunUnlockNotifierL() |
|
3644 |
{ |
|
3645 |
TRACES( RDebug::Print( |
|
3646 |
_L("CSysApAppUi::RunUnlockNotifierL: START iDeviceLockEnabled: %d, iKeyLockEnabled: %d" ), |
|
3647 |
iDeviceLockEnabled, iKeyLockEnabled ) ); |
|
3648 |
||
3649 |
if ( !iSysApFeatureManager->MmcSupported() || |
|
3650 |
iDeviceLockEnabled || |
|
3651 |
iKeyLockEnabled || |
|
3652 |
!UiReady() ) |
|
3653 |
{ |
|
3654 |
TRACES( RDebug::Print( _L("CSysApAppUi::RunUnlockNotifierL: END") ) ); |
|
3655 |
return; |
|
3656 |
} |
|
3657 |
||
3658 |
// We don't want to see the MMC passwd query |
|
3659 |
// when the user is e.g. making an emergency call |
|
3660 |
TInt callState( StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ) ); |
|
3661 |
if ( callState != EPSCTsyCallStateRinging && |
|
3662 |
callState != EPSCTsyCallStateAlerting ) |
|
3663 |
{ |
|
3664 |
TInt defaultMemoryCard( iSysApDriveList->DefaultMemoryCard() ); |
|
3665 |
TSysApMemoryCardStatus memoryCardStatus( iSysApDriveList->MemoryCardStatus( defaultMemoryCard ) ); |
|
3666 |
if ( memoryCardStatus == ESysApMemoryCardLocked) |
|
3667 |
{ |
|
3668 |
iSysApDriveUnlockHandler->StartUnlock(); |
|
3669 |
} |
|
3670 |
} |
|
3671 |
||
3672 |
TRACES( RDebug::Print( |
|
3673 |
_L("CSysApAppUi::RunUnlockNotifierL: END callState: %d"), callState ) ); |
|
3674 |
} |
|
3675 |
||
3676 |
// ---------------------------------------------------------------------------- |
|
3677 |
// CSysApAppUi::MMCStatusChangedL() from MSysApMemoryCardObserver |
|
3678 |
// ---------------------------------------------------------------------------- |
|
3679 |
||
3680 |
void CSysApAppUi::MMCStatusChangedL( TInt aDrive ) |
|
3681 |
{ |
|
3682 |
TRACES( RDebug::Print( |
|
3683 |
_L( "CSysApAppUi::MMCStatusChangedL START: MMCCount: %d, iMMCEjectUsed: %d" ), |
|
3684 |
iInsertedMemoryCards.Count(), iMMCEjectUsed ) ); |
|
3685 |
||
3686 |
if ( iShutdownStarted || !iSysApFeatureManager->MmcSupported() ) |
|
3687 |
{ |
|
3688 |
TRACES( RDebug::Print( |
|
3689 |
_L( "CSysApAppUi::MMCStatusChangedL iShutdownStarted: %d END" ), |
|
3690 |
iShutdownStarted ) ); |
|
3691 |
return; |
|
3692 |
} |
|
3693 |
||
3694 |
TBool normalState( UiReady() ); |
|
3695 |
||
3696 |
TInt defaultMemoryCard( iSysApDriveList->DefaultMemoryCard() ); |
|
3697 |
TSysApMemoryCardStatus memoryCardStatus( iSysApDriveList->MemoryCardStatus( aDrive ) ); |
|
3698 |
TInt insertedIndex( CSysApDriveList::Find( iInsertedMemoryCards, aDrive ) ); |
|
3699 |
||
3700 |
TRACES( RDebug::Print( |
|
3701 |
_L( "CSysApAppUi::MMCStatusChangedL: normalState: %d, index: %d, drive: %d, memoryCardStatus: %d" ), |
|
3702 |
normalState, insertedIndex, aDrive, memoryCardStatus ) ); |
|
3703 |
||
3704 |
switch ( memoryCardStatus ) |
|
3705 |
{ |
|
3706 |
case ESysApMemoryCardInserted: // Fall through |
|
3707 |
case ESysApMemoryCardLocked: |
|
3708 |
{ |
|
3709 |
if ( insertedIndex == KErrNotFound ) // Not inserted before |
|
3710 |
{ |
|
3711 |
// Reset eject and unlock of inserted memory card |
|
3712 |
iSysApDriveList->ResetDriveToEject( aDrive ); |
|
3713 |
iSysApDriveList->ResetDriveUnlockQueryShown( aDrive ); |
|
3714 |
||
3715 |
// CancelWaitNote(); |
|
3716 |
||
3717 |
if ( aDrive == defaultMemoryCard ) |
|
3718 |
{ |
|
3719 |
if ( memoryCardStatus == ESysApMemoryCardInserted ) |
|
3720 |
{ |
|
3721 |
RProperty::Set( KPSUidUikon, KUikMMCInserted, 1 ); |
|
3722 |
} |
|
3723 |
else |
|
3724 |
{ |
|
3725 |
RProperty::Set( KPSUidUikon, KUikMMCInserted, 0 ); |
|
3726 |
} |
|
3727 |
} |
|
3728 |
||
3729 |
if ( normalState ) |
|
3730 |
{ |
|
3731 |
// Ignore extra beep from USB file transfer |
|
3732 |
TBool ignoreBeep( |
|
3733 |
iSysApDriveList->IsDriveInsertBeepIgnored( aDrive ) ); |
|
3734 |
||
3735 |
TRACES( RDebug::Print( |
|
3736 |
_L( "CSysApAppUi::MMCStatusChangedL: ignoreBeep: %d, drive: %d" ), |
|
3737 |
ignoreBeep, aDrive ) ); |
|
3738 |
||
3739 |
if ( !ignoreBeep ) |
|
3740 |
{ |
|
3741 |
// Beep(); |
|
3742 |
iSysApLightsController->MemoryCardInsertedL(); |
|
3743 |
} |
|
3744 |
||
3745 |
iSysApDriveList->ResetDriveInsertBeepIgnored( aDrive ); |
|
3746 |
||
3747 |
// Keep ignoring extra beep if USB file transfer is active |
|
3748 |
TInt propertyValue( StateOfProperty( KPSUidUsbWatcher, KUsbWatcherSelectedPersonality ) ); |
|
3749 |
||
3750 |
TRACES( RDebug::Print( |
|
3751 |
_L( "CSysApAppUi::MMCStatusChangedL: usbState: %d" ), propertyValue ) ); |
|
3752 |
||
3753 |
if ( propertyValue == KUsbPersonalityIdMS ) |
|
3754 |
{ |
|
3755 |
iSysApDriveList->MarkDriveInsertBeepIgnored( aDrive ); |
|
3756 |
} |
|
3757 |
} |
|
3758 |
||
3759 |
// if ( iDriveToDismount == aDrive && iSysApConfirmationQuery ) |
|
3760 |
{ |
|
3761 |
// if ( iSysApConfirmationQuery->CurrentQuery() == ESysApRemoveMmcNote ) |
|
3762 |
{ |
|
3763 |
// User put back ejected memory card or did not remove it |
|
3764 |
// iSysApConfirmationQuery->Cancel(); |
|
3765 |
} |
|
3766 |
} |
|
3767 |
RunUnlockNotifierL(); |
|
3768 |
} |
|
3769 |
break; |
|
3770 |
} |
|
3771 |
case ESysApMemoryCardNotInserted: |
|
3772 |
{ |
|
3773 |
// Always reset eject and unlock of removed memory card |
|
3774 |
TBool isEject( iSysApDriveList->IsDriveToEject( aDrive ) ); |
|
3775 |
||
3776 |
TRACES( RDebug::Print( |
|
3777 |
_L( "CSysApAppUi::MMCStatusChangedL: isEject: %d, drive: %d" ), |
|
3778 |
isEject, aDrive ) ); |
|
3779 |
||
3780 |
iSysApDriveList->ResetDriveToEject( aDrive ); |
|
3781 |
iSysApDriveList->ResetDriveUnlockQueryShown( aDrive ); |
|
3782 |
||
3783 |
if ( insertedIndex != KErrNotFound ) // Inserted before |
|
3784 |
{ |
|
3785 |
if ( memoryCardStatus == ESysApMemoryCardNotInserted ) |
|
3786 |
{ |
|
3787 |
// Reset extra beep ignore if memory card was removed without eject |
|
3788 |
iSysApDriveList->ResetDriveInsertBeepIgnored( aDrive ); |
|
3789 |
} |
|
3790 |
||
3791 |
// CancelGlobalListQuery(); // Cancel power menu |
|
3792 |
||
3793 |
if ( aDrive == defaultMemoryCard ) |
|
3794 |
{ |
|
3795 |
RProperty::Set( KPSUidUikon, KUikMMCInserted, 0 ); |
|
3796 |
} |
|
3797 |
||
3798 |
// if ( iSysApConfirmationQuery ) |
|
3799 |
{ |
|
3800 |
// if ( iSysApConfirmationQuery->CurrentQuery() == ESysApEjectMmcQuery ) |
|
3801 |
{ |
|
3802 |
// User removed memory card too early |
|
3803 |
// iSysApConfirmationQuery->Cancel(); |
|
3804 |
// Allow application closing to execute. |
|
3805 |
// Also FileManager is closed in this case, regardless where the eject was initiated from. |
|
3806 |
iMMCEjectUsed = EFalse; |
|
3807 |
} |
|
3808 |
} |
|
3809 |
||
3810 |
// Stop unlock of removed memory card |
|
3811 |
iSysApDriveUnlockHandler->StopUnlock( aDrive ); |
|
3812 |
||
3813 |
if ( !iMMCEjectUsed && !isEject ) |
|
3814 |
{ |
|
3815 |
TInt propertyValue( StateOfProperty( KPSUidUsbWatcher, KUsbWatcherSelectedPersonality ) ); |
|
3816 |
||
3817 |
TRACES( RDebug::Print( |
|
3818 |
_L( "CSysApAppUi::MMCStatusChangedL: usbState: %d" ), propertyValue ) ); |
|
3819 |
||
3820 |
if ( propertyValue != KUsbPersonalityIdMS ) |
|
3821 |
{ |
|
3822 |
if ( iSysApFeatureManager->MemoryCardHatchSupported() ) |
|
3823 |
{ |
|
3824 |
// Store drive removed without eject and start eject handling |
|
3825 |
iSysApDriveList->MarkDriveToEject( |
|
3826 |
aDrive, CSysApDriveList::EEjectRemovedWithoutEject ); |
|
3827 |
iSysApDriveEjectHandler->StartEject(); |
|
3828 |
} |
|
3829 |
else |
|
3830 |
{ |
|
3831 |
// Just show the note |
|
3832 |
ShowUiNoteL( EMemoryCardRemovedWithoutEjectNote ); |
|
3833 |
} |
|
3834 |
} |
|
3835 |
} |
|
3836 |
iMMCEjectUsed = EFalse; |
|
3837 |
} |
|
3838 |
break; |
|
3839 |
} |
|
3840 |
case ESysApMemoryCardStatusNotKnown: // Fall through |
|
3841 |
default: |
|
3842 |
{ |
|
3843 |
break; |
|
3844 |
} |
|
3845 |
} |
|
3846 |
||
3847 |
// Update inserted memory cards |
|
3848 |
iSysApDriveList->GetMemoryCardsL( |
|
3849 |
iInsertedMemoryCards, CSysApDriveList::EIncludeInserted ); |
|
3850 |
||
3851 |
// Update memory card indicator status |
|
3852 |
// SetMemoryCardIndicatorL(); |
|
3853 |
||
3854 |
TRACES( RDebug::Print( |
|
3855 |
_L( "CSysApAppUi::MMCStatusChangedL END: MMCCount: %d, iMMCEjectUsed: %d" ), |
|
3856 |
iInsertedMemoryCards.Count(), iMMCEjectUsed ) ); |
|
3857 |
} |
|
3858 |
||
3859 |
// ---------------------------------------------------------------------------- |
|
3860 |
// CSysApAppUi::ShowMMCDismountedDialogL() |
|
3861 |
// ---------------------------------------------------------------------------- |
|
3862 |
||
3863 |
TBool CSysApAppUi::ShowMMCDismountedDialogL( |
|
3864 |
TInt aDrive, CSysApDriveList::TDriveEjectType aEjectType ) |
|
3865 |
{ |
|
3866 |
TRACES( RDebug::Print( |
|
3867 |
_L( "CSysApAppUi::ShowMMCDismountedDialogL: aDrive: %d, aEjectType: %d" ), |
|
3868 |
aDrive, aEjectType ) ); |
|
3869 |
||
3870 |
TBool ret( EFalse ); |
|
3871 |
iDriveToDismount = aDrive; |
|
3872 |
HBufC* driveName = iSysApDriveList->GetFormattedDriveNameLC( |
|
3873 |
aDrive, |
|
3874 |
R_QTN_EJECT_REMOVE_MEMORY_INFO ); |
|
3875 |
||
3876 |
if ( aEjectType == CSysApDriveList::EEjectFromMenu ) |
|
3877 |
{ |
|
3878 |
TRACES( RDebug::Print( |
|
3879 |
_L( "CSysApAppUi::ShowMMCDismountedDialogL: Show note: Remove MMC and press OK...." ) ) ); |
|
3880 |
ShowQueryL( ESysApRemoveMmcNote, *driveName ); |
|
3881 |
ret = ETrue; |
|
3882 |
} |
|
3883 |
else |
|
3884 |
{ |
|
3885 |
// Memory card was removed without eject |
|
3886 |
TInt propertyValue( StateOfProperty( KPSUidUsbWatcher, KUsbWatcherSelectedPersonality ) ); |
|
3887 |
||
3888 |
// Do not show any note if USB file transfer is active. |
|
3889 |
if ( propertyValue != KUsbPersonalityIdMS ) |
|
3890 |
{ |
|
3891 |
if ( iSysApFeatureManager->MemoryCardHatchSupported() ) |
|
3892 |
{ |
|
3893 |
// MMC hatch has been opened and MMC has been dismounted |
|
3894 |
TRACES( RDebug::Print( |
|
3895 |
_L( "CSysApAppUi::ShowMMCDismountedDialogL: Show note: Remove MMC and press OK." ) ) ); |
|
3896 |
ShowQueryL( ESysApRemoveMmcNote, *driveName ); |
|
3897 |
ret = ETrue; |
|
3898 |
} |
|
3899 |
else |
|
3900 |
{ |
|
3901 |
iSysApDriveList->ResetDrivesToEject(); |
|
3902 |
||
3903 |
// MMC has been removed and dismounted |
|
3904 |
TRACES( RDebug::Print( _L( |
|
3905 |
"CSysApAppUi::ShowMMCDismountedDialogL: Show note: You might have lost some data." ) ) ); |
|
3906 |
||
3907 |
// No confirmation but let's set this true to enable MMC passwd query |
|
3908 |
ShowUiNoteL( EMemoryCardRemovedWithoutEjectNote ); |
|
3909 |
} |
|
3910 |
} |
|
3911 |
else |
|
3912 |
{ |
|
3913 |
iSysApDriveList->ResetDrivesToEject(); |
|
3914 |
TRACES( RDebug::Print( |
|
3915 |
_L( "CSysApAppUi::ShowMMCDismountedDialogL: No note shown, USB file transfer caused dismount." ) ) ); |
|
3916 |
} |
|
3917 |
} |
|
3918 |
||
3919 |
CleanupStack::PopAndDestroy( driveName ); |
|
3920 |
||
3921 |
TRACES( RDebug::Print( |
|
3922 |
_L( "CSysApAppUi::ShowMMCDismountedDialogL: ret: %d" ), ret ) ); |
|
3923 |
||
3924 |
return ret; |
|
3925 |
} |
|
3926 |
||
3927 |
// ---------------------------------------------------------------------------- |
|
3928 |
// CSysApAppUi::MMCDismountedDialogConfirmed |
|
3929 |
// ---------------------------------------------------------------------------- |
|
3930 |
||
3931 |
void CSysApAppUi::MMCDismountedDialogConfirmed() |
|
3932 |
{ |
|
3933 |
TRACES( RDebug::Print( |
|
3934 |
_L( "CSysApAppUi::MMCDismountedDialogConfirmed: iDriveToDismount: %d" ), |
|
3935 |
iDriveToDismount ) ); |
|
3936 |
||
3937 |
// Try remount to check if drive was put back |
|
3938 |
iSysApDriveList->MountDrive( iDriveToDismount ); |
|
3939 |
if ( !iSysApDriveEjectHandler->CompleteDismount( iDriveToDismount ) ) |
|
3940 |
{ |
|
3941 |
// When ready, check for locked memory cards and update indicators |
|
3942 |
// TRAP_IGNORE( SetMemoryCardIndicatorL() ); |
|
3943 |
TRAP_IGNORE( RunUnlockNotifierL() ); |
|
3944 |
} |
|
3945 |
} |
|
3946 |
||
3947 |
#endif // RD_MULTIPLE_DRIVE |
|
51 | 3948 |
|
3949 |
||
3950 |
// ---------------------------------------------------------------------------- |
|
3951 |
// CSysApAppUi::HandleApplicationSpecificEventL(TInt aType,const TWsEvent& aEvent) |
|
3952 |
// ---------------------------------------------------------------------------- |
|
3953 |
||
3954 |
void CSysApAppUi::HandleApplicationSpecificEventL(TInt aType,const TWsEvent& aEvent) |
|
3955 |
{ |
|
3956 |
TRACES( RDebug::Print( _L("CSysApAppUi::HandleApplicationSpecificEventL: aType:%d"), aType ) ); |
|
3957 |
||
3958 |
CEikAppUi::HandleApplicationSpecificEventL(aType, aEvent); |
|
3959 |
||
3960 |
if ( ResourcesFreed() ) |
|
3961 |
{ |
|
3962 |
TRACES( RDebug::Print( _L("CSysApAppUi::HandleApplicationSpecificEventL: discarded, shutting down") ) ); |
|
3963 |
return; |
|
3964 |
} |
|
3965 |
||
3966 |
switch( aType ) |
|
3967 |
{ |
|
3968 |
case EEikKeyLockEnabled: |
|
3969 |
iKeyLockEnabled = ETrue; |
|
3970 |
iSysApCenRepController->SetInt( KCRUidCoreApplicationUIsSysAp, KSysApKeyguardActive, 1 ); |
|
3971 |
// SetIndicatorStateL( EAknIndicatorKeyguard, EAknIndicatorStateOn ); |
|
3972 |
iSysApLightsController->KeylockStateChangedL( ETrue ); |
|
3973 |
break; |
|
3974 |
case EEikKeyLockDisabled: |
|
3975 |
iKeyLockEnabled = EFalse; |
|
3976 |
iSysApCenRepController->SetInt( KCRUidCoreApplicationUIsSysAp, KSysApKeyguardActive, 0 ); |
|
3977 |
// SetIndicatorStateL( EAknIndicatorKeyguard, EAknIndicatorStateOff ); |
|
3978 |
if (! iDeviceLockEnabled ) |
|
3979 |
{ |
|
3980 |
iSysApLightsController->KeylockStateChangedL( EFalse ); |
|
3981 |
if ( iSysApFeatureManager->MmcHotSwapSupported() ) |
|
3982 |
{ |
|
3983 |
if ( StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ) != EPSCTsyCallStateRinging && StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ) != EPSCTsyCallStateAlerting ) |
|
3984 |
{ |
|
61 | 3985 |
RunUnlockNotifierL(); |
51 | 3986 |
} |
3987 |
} |
|
3988 |
} |
|
3989 |
break; |
|
3990 |
case EEikKeyLockPowerKeyPressed: //sent when power key is captured by keylockserver |
|
3991 |
// HandleShortPowerKeyPressedL(); |
|
3992 |
break; |
|
3993 |
||
3994 |
case EEikKeyLockLightsOnRequest: |
|
3995 |
iSysApLightsController->SetLightsOnUnlockNoteL(); |
|
3996 |
break; |
|
3997 |
||
3998 |
case EEikEcsQueryLights: // emergency note is shown |
|
3999 |
iSysApLightsController->SetLightsOnEcsQueryL(); |
|
4000 |
break; |
|
4001 |
||
4002 |
case EEikSecurityQueryLights: // for device lock security query |
|
4003 |
iSysApLightsController->SetLightsOnSecurityQueryL(); |
|
4004 |
break; |
|
4005 |
||
4006 |
default: |
|
4007 |
break; |
|
4008 |
} |
|
4009 |
} |
|
4010 |
||
4011 |
||
4012 |
||
4013 |
// ---------------------------------------------------------------------------- |
|
4014 |
// CSysApAppUi::HandleNspsRawKeyEventL() |
|
4015 |
// ---------------------------------------------------------------------------- |
|
4016 |
||
4017 |
void CSysApAppUi::HandleNspsRawKeyEventL() |
|
4018 |
{ |
|
4019 |
#ifdef __SYSAP_MODULE_TEST |
|
4020 |
ModuleTestShowUiNoteL( _L("Network wakeup from NSPS") ); |
|
4021 |
#endif |
|
4022 |
||
4023 |
if ( iSysApEtelConnector ) |
|
4024 |
{ |
|
4025 |
iSysApEtelConnector->CommandNetCsWakeupOnNsps(); |
|
4026 |
} |
|
4027 |
} |
|
4028 |
||
4029 |
// ---------------------------------------------------------------------------- |
|
4030 |
// CSysApAppUi::UpdateSignalBarsL() |
|
4031 |
// ---------------------------------------------------------------------------- |
|
4032 |
||
4033 |
void CSysApAppUi::UpdateSignalBarsL() |
|
4034 |
{ |
|
4035 |
// UpdateSignalBarsL(iSysApEtelConnector->GetSignalBars()); |
|
4036 |
} |
|
4037 |
||
4038 |
// ---------------------------------------------------------------------------- |
|
4039 |
// CSysApAppUi::HandleSmsStorageNotificationL( TBool aSimStoreFull ) |
|
4040 |
// ---------------------------------------------------------------------------- |
|
4041 |
||
4042 |
void CSysApAppUi::HandleSmsStorageNotificationL( TBool aSimStoreFull ) |
|
4043 |
{ |
|
4044 |
TRACES( RDebug::Print( _L("CSysApAppUi::HandleSmsStorageNotificationL: aSimStoreFull: %d "), aSimStoreFull ) ); |
|
4045 |
||
4046 |
if ( aSimStoreFull ) |
|
4047 |
{ |
|
4048 |
/* HBufC* noteStringBuf; |
|
4049 |
noteStringBuf = StringLoader::LoadLC( R_QTN_MEMLO_MEMORY_LOW_SIM_MES, iEikonEnv ); |
|
4050 |
TPtr textBuffer = noteStringBuf->Des(); |
|
4051 |
iSysApMsgSimMemLowQuery->StartL( textBuffer ); |
|
4052 |
CleanupStack::PopAndDestroy(); |
|
4053 |
*/ } |
|
4054 |
||
4055 |
// SetEnvelopeIndicatorL(); |
|
4056 |
} |
|
4057 |
||
4058 |
// ---------------------------------------------------------------------------- |
|
4059 |
// CSysApAppUi::HandleNetworkNspsNotification( RMmCustomAPI::TNspsStatus aNspsStatus ) |
|
4060 |
// ---------------------------------------------------------------------------- |
|
4061 |
||
4062 |
void CSysApAppUi::HandleNetworkNspsNotification( RMmCustomAPI::TNspsStatus aNspsStatus ) |
|
4063 |
{ |
|
4064 |
TRACES( RDebug::Print( _L("CSysApAppUi::HandleNetworkNspsNotification aNspsStatus:%d, iNsps:%d )" ), aNspsStatus, iNsps ) ); |
|
4065 |
if( iSysApNspsHandler ) |
|
4066 |
{ |
|
4067 |
if( aNspsStatus == RMmCustomAPI::ENspsOn ) |
|
4068 |
{ |
|
4069 |
if( !iNsps ) |
|
4070 |
{ |
|
4071 |
#ifdef __SYSAP_MODULE_TEST |
|
4072 |
TRAPD( err, ModuleTestShowUiNoteL( _L("Setting NSPS on") ) ); |
|
4073 |
#endif |
|
4074 |
iSysApNspsHandler->SetNspsOn(); |
|
4075 |
iNsps = ETrue; |
|
4076 |
} |
|
4077 |
} |
|
4078 |
else if( aNspsStatus == RMmCustomAPI::ENspsOff ) |
|
4079 |
{ |
|
4080 |
if( iNsps ) |
|
4081 |
{ |
|
4082 |
#ifdef __SYSAP_MODULE_TEST |
|
4083 |
TRAPD( err, ModuleTestShowUiNoteL( _L("Setting NSPS off") ) ); |
|
4084 |
#endif |
|
4085 |
iSysApNspsHandler->SetNspsOff(); |
|
4086 |
iNsps = EFalse; |
|
4087 |
} |
|
4088 |
} |
|
4089 |
} |
|
4090 |
} |
|
4091 |
||
72 | 4092 |
/** |
4093 |
* Handles SEND key events |
|
4094 |
* If SEND key is pressed in idle Home screen view, This will bring LOGS View without DialPad. |
|
4095 |
* otherwise, it brings LOGS&Dial pad. |
|
4096 |
*/ |
|
4097 |
void CSysApAppUi::HandleSendKeyEventL() |
|
4098 |
{ |
|
4099 |
TRACES( RDebug::Print( _L("CSysApAppUi::HandleSendKeyEventL: START") ) ); |
|
4100 |
//Check whether ForeGround app is HomeScreen |
|
4101 |
TInt hsStatus(EHomeScreenIdleState) ; |
|
4102 |
//Get the RProperty |
|
4103 |
User::LeaveIfError( RProperty::Get(KHsCategoryUid, KHsCategoryStateKey, hsStatus)); |
|
4104 |
//Enable dialpad in Non-HS view |
|
4105 |
const TBool enableDialPad( EHomeScreenIdleState != hsStatus ); |
|
4106 |
||
4107 |
//invoke LOGS/Dialer app |
|
4108 |
XQApplicationManager appMgr; |
|
4109 |
QScopedPointer<XQAiwRequest> request(appMgr.create(QString("logs"), XQI_LOGS_VIEW, XQOP_LOGS_SHOW, false)); |
|
4110 |
||
4111 |
if (!request.isNull()) |
|
4112 |
{ |
|
4113 |
TRACES( RDebug::Print( _L("CSysApAppUi::HandleSendKeyEventL::Request::Begin") ) ); |
|
4114 |
int retValue = -1; |
|
4115 |
||
4116 |
QVariantMap map; |
|
4117 |
map.insert(XQLOGS_VIEW_INDEX, QVariant(0)); |
|
4118 |
map.insert(XQLOGS_SHOW_DIALPAD, QVariant(enableDialPad)); |
|
4119 |
map.insert(XQLOGS_DIALPAD_TEXT, QVariant(QString())); |
|
4120 |
||
4121 |
QList<QVariant> arglist; |
|
4122 |
||
4123 |
arglist.append(QVariant(map)); |
|
4124 |
request->setArguments(arglist); |
|
4125 |
QVariant ret(retValue); |
|
4126 |
request->send(ret); |
|
4127 |
TRACES( RDebug::Print( _L("CSysApAppUi::InvokeApp::Request::End") ) ); |
|
4128 |
} |
|
4129 |
||
4130 |
TRACES( RDebug::Print( _L("CSysApAppUi::HandleSendKeyEventL: End") ) ); |
|
4131 |
} |
|
4132 |
||
4133 |
/** |
|
4134 |
* Handles END key events |
|
4135 |
* If END key is pressed, Fore ground app will be exits and |
|
4136 |
* Home screen view will brought to Foreground |
|
4137 |
*/ |
|
4138 |
void CSysApAppUi::HandleEndKeyEventL() |
|
4139 |
{ |
|
4140 |
TRACES( RDebug::Print( _L("CSysApAppUi::HandleEndKeyEventL: Start") ) ); |
|
4141 |
//Get ForeGround App |
|
4142 |
TInt foregroundWindowGroupId = iEikonEnv->WsSession().GetFocusWindowGroup(); |
|
4143 |
CApaWindowGroupName* doomedApp = CApaWindowGroupName::NewLC(iEikonEnv->WsSession(),foregroundWindowGroupId ); |
|
4144 |
||
4145 |
//Bring the HS before killing the ForeGround App. |
|
4146 |
_LIT(KHsActivactionUri, "appto://20022F35?activityname=HsIdleView"); |
|
4147 |
RApaLsSession apaLsSession; |
|
4148 |
CleanupClosePushL(apaLsSession); |
|
4149 |
User::LeaveIfError(apaLsSession.Connect()); |
|
4150 |
CAfActivityLauncher *activityEnabler = CAfActivityLauncher::NewLC(apaLsSession, iEikonEnv->WsSession()); |
|
4151 |
activityEnabler->launchActivityL(KHsActivactionUri); |
|
4152 |
CleanupStack::PopAndDestroy(activityEnabler); |
|
4153 |
CleanupStack::PopAndDestroy(&apaLsSession); |
|
4154 |
||
4155 |
//End or Kill the Foreground App |
|
4156 |
//If Phone is in HS idle view, End key have no impact. |
|
4157 |
if ( !doomedApp->IsSystem() ) |
|
4158 |
{ |
|
4159 |
TApaTask task( iEikonEnv->WsSession() ); |
|
4160 |
task.SetWgId( foregroundWindowGroupId ); |
|
4161 |
TRACES ( |
|
4162 |
const TDesC& caption = doomedApp->Caption(); |
|
4163 |
const TDesC& docname = doomedApp->DocName(); |
|
4164 |
const TDesC& wgname = doomedApp->WindowGroupName(); |
|
4165 |
TUid uid = doomedApp->AppUid(); |
|
4166 |
RDebug::Print( _L("CSysApAppUi::HandleEndKeyEventL: Closing app \"%S\" (ThreadId %d, WgId %d, UID 0x%X); Docname: %S, WGName : %S"), |
|
4167 |
&caption, |
|
4168 |
(TUint)(task.ThreadId()), |
|
4169 |
foregroundWindowGroupId, |
|
4170 |
uid.iUid, |
|
4171 |
&docname, |
|
4172 |
&wgname); |
|
4173 |
); |
|
4174 |
task.EndTask(); |
|
4175 |
TRACES( RDebug::Print(_L("CSysApAppUi::HandleKeyEventL::HandleEndKeyEventL, End task event triggered") ) ); |
|
4176 |
} |
|
4177 |
CleanupStack::PopAndDestroy(doomedApp);//doomedApp |
|
4178 |
TRACES( RDebug::Print( _L("CSysApAppUi::HandleEndKeyEventL: End") ) ); |
|
4179 |
} |
|
51 | 4180 |
|
46 | 4181 |
//end of file |