12 * Contributors: |
12 * Contributors: |
13 * |
13 * |
14 * Description: CSysApAppUi implementation. |
14 * Description: CSysApAppUi implementation. |
15 * |
15 * |
16 */ |
16 */ |
17 |
|
18 |
|
19 // INCLUDES |
17 // INCLUDES |
20 |
18 |
21 #include<akndiscreetpopup.h> |
19 #include <startupdomainpskeys.h> |
22 #include <avkon.hrh> |
20 #include "sysapappui.h" |
23 #include <avkon.rsg> |
21 #include "coreapplicationuisprivatepskeys.h" |
24 #include <eikon.hrh> |
22 #include <HbDeviceMessageBoxSymbian.h> |
25 #include <apgwgnam.h> |
23 //#include <hbdevicepowermenusymbian.h> |
26 #include <eiksrv.h> |
24 #include <sacls.h> |
27 #include <eikdll.h> |
25 #include <featmgr.h> |
28 #include <AknSmallIndicator.h> |
26 #include <DevEncProtectedPSKey.h> |
29 #include <AknBatteryNotify.h> |
27 #include <ctsydomainpskeys.h> |
30 #include <AknSignalNotify.h> |
28 #include <secuisystemlock.h> |
31 #include <AknGlobalNote.h> |
29 #include <apgtask.h> |
32 #include <AknGlobalListQuery.h> |
|
33 #include <aknsoundsystem.h> |
|
34 #include <apgcli.h> |
|
35 |
|
36 #include <hwrmpowerstatesdkpskeys.h> |
30 #include <hwrmpowerstatesdkpskeys.h> |
37 #include <hwrmdomainpskeys.h> |
31 #include <wlaninternalpskeys.h> |
38 |
32 #include <HbDeviceNotificationDialogSymbian.h> |
39 #include <PSVariables.h> |
33 #include <hbsymbianvariant.h> |
40 #include "CoreApplicationUIsPrivatePSKeys.h" |
34 #include <hbtextresolversymbian.h> |
41 #include <ctsydomainpskeys.h> |
35 #include <UikonInternalPSKeys.h> |
42 #include <startupdomainpskeys.h> |
36 |
43 #include <startupdomaincrkeys.h> |
37 //#include "SysApWsClient.h" |
44 |
38 #include "SysApFeatureManager.h" |
45 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS |
39 #include "SysApNspsHandler.h" |
46 #include <ASShdAlarm.h> |
|
47 #else |
|
48 #include <asshddefs.h> |
|
49 #include <ASShdAlarmCal.h> |
|
50 #include <asshdalarm.h> |
|
51 #endif //SYMBIAN_ENABLE_SPLIT_HEADERS |
|
52 |
|
53 #include <MProfileEngine.h> |
|
54 #include <MProfileName.h> |
|
55 #include <MProfilesNamesArray.h> |
|
56 #include <MProfile.h> |
|
57 #include <StringLoader.h> |
|
58 #include <secuisystemlock.h> |
|
59 #include <secui.h> |
|
60 #include <settingsinternalcrkeys.h> |
|
61 |
|
62 #include "sysapganhandler.h" |
|
63 #include <AknNotifierController.h> |
|
64 #include <eikappui.h> |
|
65 #include <es_enum.h> |
|
66 #include <data_caging_path_literals.hrh> |
|
67 #include <eikon.hrh> |
|
68 |
|
69 #include "SysApSimChanged.h" |
|
70 |
|
71 #include <SysAp.rsg> |
|
72 #include "SysApLightsController.h" |
|
73 |
|
74 #include "SysApPubSubObserver.h" |
40 #include "SysApPubSubObserver.h" |
75 #include "SysApProfileObserver.h" |
41 #include "sysapdefaultkeyhandler.h" |
76 |
42 #include "SysApStartupController.h" |
|
43 #include "MSysApOfflineModeController.h" |
|
44 #include "SysApCenRepController.h" |
77 #include "sysapcenreplightsettingsobserver.h" |
45 #include "sysapcenreplightsettingsobserver.h" |
78 #include "SysApCenRepLogsObserver.h" |
46 #include "SysApCenRepLogsObserver.h" |
79 #include "SysApCenRepBTObserver.h" |
47 #include "SysApCenRepBTObserver.h" |
80 #include "SysApCenRepHacSettingObserver.h" |
48 #include "SysApCenRepHacSettingObserver.h" |
81 #include "SysApCenRepController.h" |
49 #include "sysapaudioroutingobserver.h" |
82 #include "CoreApplicationUIsPrivateCRKeys.h" |
50 #include "sysapbatteryinfocontroller.h" |
83 #include "CoreApplicationUIsPrivatePSKeys.h" |
51 #include "SysApSimChanged.h" |
84 #include <UikonInternalPSKeys.h> |
52 #include "MSysApBtSapController.h" |
85 |
53 #include "MSysApBtController.h" |
86 #include "SysApStartupController.h" |
54 #include "MSysApUsbIndicator.h" |
87 #include "SysApConnectionMonitorObserver.h" |
55 #include "sysapkeymanagement.h" |
88 #include "SysApPowerKeyMenuObserver.h" |
|
89 #include "SysApSsSettingsObserver.h" |
|
90 #include "SysApAppUi.h" |
|
91 #include "SysApShutdownImage.h" |
56 #include "SysApShutdownImage.h" |
|
57 #include "SysApKeySndHandler.h" |
|
58 |
|
59 #include "SysApShutdownAnimation.h" |
92 #include "SysApEtelConnector.h" |
60 #include "SysApEtelConnector.h" |
93 |
61 |
94 #include "SysApApp.h" |
|
95 #include "SysApMsgSimMemLowQuery.h" |
|
96 #include "SysApNspsHandler.h" |
|
97 #include "SysApWaitNote.h" |
|
98 #include "SysApConfirmationQuery.h" |
|
99 #include "SysApFeatureManager.h" |
|
100 #include "SysApSubscriber.h" |
|
101 #include "MSysApOfflineModeController.h" |
|
102 #include "MSysApBtController.h" |
|
103 #include "MSysApBtSapController.h" |
|
104 #include "MSysApLocationPrivacyIndicator.h" |
|
105 #include "MSysApUsbIndicator.h" |
|
106 |
|
107 #include <sysap.mbg> |
|
108 |
|
109 #include "SysApShutdownAnimation.h" |
|
110 |
|
111 #include <hwrmfmtx.h> |
|
112 #include <hwrmfmtxdomainpskeys.h> |
|
113 #include <hwrmfmtxdomaincrkeys.h> |
|
114 #include "sysapcenrepfmtxobserver.h" |
|
115 |
|
116 #include "SysApKeySndHandler.h" |
|
117 |
|
118 #include <ir_sock.h> // KIrdaPropertyCategory // KIrdaStatus |
|
119 |
|
120 #include <NetworkHandlingDomainPSKeys.h> |
|
121 |
|
122 // POC launching |
|
123 #include <AiwServiceHandler.h> |
|
124 #include <AiwPoCParameters.h> |
|
125 |
|
126 #include <sacls.h> // KUidPhonePwr |
|
127 |
|
128 #include <wlaninternalpskeys.h> // WLan indicator |
|
129 |
|
130 #include <ecom/ecom.h> |
|
131 #include "sysapkeymanagement.h" |
|
132 |
|
133 #include "SysApMediatorObserver.h" |
|
134 |
|
135 #include <secondarydisplay/SecondaryDisplaySysApAPI.h> |
|
136 #include "aknSDData.h" |
|
137 |
|
138 #include <AknTaskList.h> |
|
139 #include <layoutmetadata.cdl.h> |
|
140 |
|
141 #include "sysapdefaultkeyhandler.h" |
|
142 #include "sysapaudioroutingobserver.h" |
|
143 #include "sysapcenrepcallforwardingobserver.h" |
|
144 #include "sysapcenrepmsgwaitingobserver.h" |
|
145 |
|
146 #ifdef RD_MULTIPLE_DRIVE |
62 #ifdef RD_MULTIPLE_DRIVE |
147 #include "sysapdrivelist.h" |
63 #include "sysapdrivelist.h" |
148 #include "sysapdriveunlockhandler.h" |
64 #include "sysapdriveunlockhandler.h" |
149 #include "sysapdriveejecthandler.h" |
65 #include "sysapdriveejecthandler.h" |
|
66 #include "hbdeviceinputdialogsymbian.h" |
150 #endif // RD_MULTIPLE_DRIVE |
67 #endif // RD_MULTIPLE_DRIVE |
151 |
68 |
152 #include "sysappsmcontroller.h" |
69 #include <settingsinternalcrkeys.h> |
153 #include "sysapbatteryinfocontroller.h" |
70 #include <keyguardaccessapi.h> |
154 |
71 #include <eikdef.h> |
155 #include <keylockpolicyapi.h> |
72 #include <eikenv.h> |
156 |
|
157 #include <UsbWatcherInternalPSKeys.h> // USB transfer modes |
73 #include <UsbWatcherInternalPSKeys.h> // USB transfer modes |
158 #include <usbpersonalityids.h> |
74 #include <usbpersonalityids.h> |
159 #include <smsuaddr.h> |
75 #include "sysap.rsg" |
160 #include <featmgr.h> |
76 #include <hbindicatorsymbian.h> |
161 #include <DevEncProtectedPSKey.h> |
77 |
162 |
78 class CHbSymbianVariant; |
163 // CONSTANTS |
|
164 const TInt KPowerKeyMenuSelectionCancelled( -1 ); |
|
165 const TInt KPowerKeyMenuSelectionSwitchOff( 0 ); |
|
166 const TInt KModifierMask( 0 ); |
79 const TInt KModifierMask( 0 ); |
167 const TInt KDelayBeforeShuttingDownInAlarmAndChargingStates( 500000 ); |
80 _LIT_SECURITY_POLICY_PASS(KAlwaysPassPolicy); |
168 const TInt KDelayBeforeShowingGprsSuspendedNote( 500000 ); |
81 _LIT_SECURITY_POLICY_C1(KWriteDeviceDataPolicy, ECapabilityWriteDeviceData); |
169 const TInt KDelayBeforeNextScanningRound( 1000000 ); |
82 const TInt KDelayBeforeNextScanningRound( 1000000 ); |
170 const TInt KActiveProfile( 0 ); //The value of ActiveProfile for accessory default profile selection in GS/SD. |
|
171 const TInt KProfileListInitialIndex( 0 ); |
|
172 const TInt KMaxProfileNameLength( 64 ); |
|
173 const TInt KTimeToShowShutdownNote( 2000000 ); //2 seconds time for Goodbye note to show before being shutdown |
|
174 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
175 const TInt KCoefficientToMakeMicroToMilliSeconds = 1000; |
|
176 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
177 |
83 |
178 /* ENABLE ANIMATION: Add id of background image. |
84 /* ENABLE ANIMATION: Add id of background image. |
179 Example: const TInt KBackgroundImageID = EMbmSysapQgn_graf_startup_bg; |
85 Example: const TInt KBackgroundImageID = EMbmSysapQgn_graf_startup_bg; |
180 If there is no image defined, clear screen is used.*/ |
86 If there is no image defined, clear screen is used.*/ |
181 const TInt KBackgroundImageID = 0; |
87 const TInt KBackgroundImageID = 0; |
182 #ifndef RD_MULTIPLE_DRIVE |
88 |
183 const TInt32 KAutolockAppUid = 0x100059B5; |
89 |
184 const TInt KFileManagerAppUid = 0x101F84EB; |
90 _LIT(KAccesoryPlugin,"com.nokia.accessory.indicatorplugin/1.0"); |
185 #endif // RD_MULTIPLE_DRIVE |
91 _LIT(KAccMode, "AccMode"); |
186 const TInt KCoefficientKhzToMhz = 1000; |
92 _LIT(KAccPhyConType, "AccType"); |
187 const TInt KDecimalsInMhzFrequency = 2; |
93 |
188 |
94 _LIT(KPsmPlugin,"com.nokia.hb.powersavemodeplugin/1.0"); |
189 const TInt KHWSwitchGroup( 29 ); |
95 _LIT(KPsm,"PSM"); |
190 const TInt KHWSwitchGrip( 2 ); |
96 _LIT(KCharging,"Charging"); |
191 |
97 _LIT(KPsmlocalisationfile, "powermanagement_"); |
192 _LIT_SECURITY_POLICY_PASS(KAlwaysPassPolicy); |
98 _LIT(KtsfilePath, "z:/resource/qt/translations/"); |
193 _LIT_SECURITY_POLICY_C1(KWriteDeviceDataPolicy, ECapabilityWriteDeviceData); |
99 _LIT(KlowbatteryIcon,"qtg_small_bt_low_battery.svg"); |
|
100 _LIT(KbatteryFullIcon,"qtg_status_battery.svg"); |
|
101 |
|
102 |
194 |
103 |
195 // ============================ MEMBER FUNCTIONS ============================== |
104 // ============================ MEMBER FUNCTIONS ============================== |
196 |
105 |
197 // ---------------------------------------------------------------------------- |
106 // ---------------------------------------------------------------------------- |
198 // CSysApAppUi::CSysApAppUi() |
107 // CSysApAppUi::CSysApAppUi() |
199 // ---------------------------------------------------------------------------- |
108 // ---------------------------------------------------------------------------- |
200 |
109 |
201 CSysApAppUi::CSysApAppUi() : |
110 CSysApAppUi::CSysApAppUi() |
202 iSysApCenRepLogsObserver( NULL ), |
111 :iSysApShutdownImage(NULL), |
203 iSysApCenRepHacSettingObserver( NULL ), |
112 iPowerMenuDialog(NULL), |
204 iSysApPowerKeyMenuObserver( NULL ), |
113 iDeviceLockEnabled(EFalse), |
205 iSysApShutdownImage( NULL ), |
114 iKeyLockEnabled(EFalse), |
206 iSysApConfirmationQuery( NULL ), |
115 iPowerKeyPopupMenuActive(EFalse), |
207 iSysApConfirmationQueryForRestart( NULL ), |
116 iResourcesFreed (EFalse), |
208 iSignalNotify( NULL ), |
117 iShutdownStarted (EFalse), |
209 #ifndef RD_MULTIPLE_DRIVE |
118 iSysApAudioRoutingObserver (NULL), |
210 iMemoryCardDialog( 0 ), |
119 iSysApBatteryInfoController (NULL), |
211 #endif // RD_MULTIPLE_DRIVE |
120 iSysApPsmController(NULL), |
212 iPowerKeyPopupMenuActive( EFalse ), |
121 iSapTimer (NULL), |
213 iDisablePowerkeyMenu( EFalse ), |
122 iSysApCenRepLogsObserver (NULL), |
214 iDeviceLockEnabled( EFalse ), |
123 iSysApUsbIndicatorController(NULL), |
215 iKeyLockEnabled( EFalse ), |
124 iKeyguardController (NULL), |
216 iShowkeypadActivatedNoteAfterSoftReject( EFalse ), |
125 iKeyLockOnBeforeCall (EFalse), |
217 iEmergencyCallActive( EFalse ), |
126 iCheckLongPowerKeyEvent (EFalse), |
218 iSimChangedDone( EFalse ), |
127 iMMCEjectUsed( EFalse ), |
219 iResourcesFreed( EFalse ), |
128 iMemCardPwdDialog(NULL) |
220 #ifndef RD_MULTIPLE_DRIVE |
129 { |
221 iHideFirstBeep( ETrue ), |
130 TRACES( RDebug::Print( _L("CSysApAppUi::CSysApAppUi()") ) ); |
222 #endif // RD_MULTIPLE_DRIVE |
|
223 iShutdownStarted( EFalse ), |
|
224 iIgnoreAccessorySpecificProfileChanges( ETrue ), |
|
225 iAccessoryJustConnected( EFalse ), |
|
226 iHandleNextProfileEvent( ETrue ), |
|
227 iActivateBt( EFalse ), |
|
228 iDeactivateBt( EFalse ), |
|
229 iGprsActivated( EFalse ), |
|
230 iGprsSuspended( EFalse ), |
|
231 iCallActivated( EFalse ), |
|
232 iGprsSuspendedNoteShown( EFalse ), |
|
233 iMMCEjectUsed( EFalse ), |
|
234 #ifndef RD_MULTIPLE_DRIVE |
|
235 iMMCPowerMenuEjectUsed( EFalse ), |
|
236 iMMCInserted( EFalse ), |
|
237 #endif // RD_MULTIPLE_DRIVE |
|
238 iTimer( NULL ), |
|
239 iSapTimer( NULL ), |
|
240 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
241 iAnimTimer( NULL ), |
|
242 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
243 iSysApTimer( NULL ), |
|
244 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
245 iAnimationShowingTime( 0 ), |
|
246 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
247 iShutdownContinued( EFalse ), |
|
248 iSysApAudioRoutingObserver( NULL ), |
|
249 iSysApCenRepCallForwardingObserver( NULL ), |
|
250 iSysApCenRepMsgWaitingObserver( NULL ), |
|
251 iSysApGanHandler( NULL ), |
|
252 iKeyBoardRepeatCount(-1) |
|
253 { |
|
254 TRACES( RDebug::Print( _L("CSysApAppUi::CSysApAppUi()") ) ); |
|
255 } |
131 } |
256 |
132 |
257 // ---------------------------------------------------------------------------- |
133 // ---------------------------------------------------------------------------- |
258 // CSysApAppUi::ConstructL() |
134 // CSysApAppUi::ConstructL() |
259 // ---------------------------------------------------------------------------- |
135 // ---------------------------------------------------------------------------- |
260 |
136 |
261 void CSysApAppUi::ConstructL() |
137 void CSysApAppUi::ConstructL() |
262 { |
138 { |
263 TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: START") ) ); |
139 TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: START") ) ); |
264 TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: trying BaseConstructL( EAknEnableSkin )") ) ); |
140 TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: trying BaseConstructL()") ) ); |
265 BaseConstructL( EAknEnableSkin ); |
141 BaseConstructL(); |
266 TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: BaseConstructL() OK") ) ); |
142 TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: BaseConstructL() OK") ) ); |
267 |
143 |
268 |
|
269 /*SysAp is set as system application (Symbian terminology). This means some special privilege compared |
|
270 to other applications. For example it does not get closed when system is asked to close applications |
|
271 */ |
|
272 iEikonEnv->SetSystem( ETrue ); |
144 iEikonEnv->SetSystem( ETrue ); |
273 // For cdma |
|
274 |
|
275 iTDEnable = FeatureManager::FeatureSupported( KFeatureIdFfTdScdma ); |
|
276 |
145 |
277 iEikonEnv->WsSession().ComputeMode( RWsSession::EPriorityControlDisabled ); |
146 iEikonEnv->WsSession().ComputeMode( RWsSession::EPriorityControlDisabled ); |
278 |
147 |
279 static_cast<CAknAppUi*>(iEikonEnv->EikAppUi())->KeySounds()->PushContextL( R_AVKON_SILENT_SKEY_LIST ); |
|
280 |
|
281 RThread().SetProcessPriority( EPriorityForeground ); |
148 RThread().SetProcessPriority( EPriorityForeground ); |
282 |
149 |
283 /*SysAp does not have any visible Status pane. An exception will be Charging state |
|
284 where SysAp shows Status Pane as it is the only running application. |
|
285 */ |
|
286 TInt mode; |
150 TInt mode; |
287 User::LeaveIfError( RProperty::Get( KPSUidStartup, KPSGlobalStartupMode, mode ) ); |
151 User::LeaveIfError( RProperty::Get( KPSUidStartup, KPSGlobalStartupMode, mode ) ); |
288 |
152 TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: KPSGlobalStartupMode = %d"), mode ) ); |
289 if( mode == EStartupModeCharging || mode == EStartupModeAlarm ) |
153 |
290 { |
154 //SysAp needs to capture PowerKey events because it handles all functionality related to that |
291 SetStatusPaneLayoutL( |
155 TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: trying CEikApplication::RootWin()") ) ); |
292 mode == EStartupModeCharging ? ESysApCharging : ESysApAlarm ); |
156 RWindowGroup groupWin = iCoeEnv->RootWin(); |
293 |
157 User::LeaveIfError ( iCapturedEKeyPowerOff = groupWin.CaptureKey( EKeyPowerOff, KModifierMask, KModifierMask ) ); |
294 SetKeyEventFlags( |
158 User::LeaveIfError ( iCapturedEKeyPowerOffUpAndDowns = groupWin.CaptureKeyUpAndDowns( EStdKeyDevice2, KModifierMask, KModifierMask ) ); |
295 CAknAppUiBase::EDisableSendKeyShort | |
159 |
296 CAknAppUiBase::EDisableSendKeyLong ); |
160 TRACES ( RDebug::Print( _L("CSysApAppUi::ConstructL: trying CSysApDefaultKeyHandler::NewL()") ) ); |
297 } |
161 iSysApDefaultKeyHandler = CSysApDefaultKeyHandler::NewL(*this); |
298 else |
162 |
299 { |
|
300 SetStatusPaneLayoutL( ESysApNormal ); |
|
301 } |
|
302 |
|
303 TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: trying CSysApFeatureManager::NewL()") ) ); |
|
304 iSysApFeatureManager = CSysApFeatureManager::NewL(); |
|
305 |
|
306 // Setup USB charging detector |
|
307 iSysApUsbChargerDetector.EnableUsbCharging( |
|
308 iSysApFeatureManager->Supported( KSysApFeatureIdChargerReminderNotes ) && |
|
309 iSysApFeatureManager->Supported( KSysApFeatureIdUsbChargingWithoutReminderNotes ) ); |
|
310 |
|
311 // Construct notifiers that are used frequently or in OOM situations. |
|
312 TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: trying CAknBatteryNotify::NewL()") ) ); |
|
313 iBatteryNotify = CAknBatteryNotify::NewL(); |
|
314 TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: trying CAknSignalNotify::NewL()") ) ); |
|
315 iSignalNotify = CAknSignalNotify::NewL(); |
|
316 TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: trying new ( ELeave ) CSysApMsgSimMemLowQuery") ) ); |
|
317 iSysApMsgSimMemLowQuery = new( ELeave ) CSysApMsgSimMemLowQuery( iSysApFeatureManager->CoverDisplaySupported() ); |
|
318 |
|
319 TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: trying CSysApPubSubObserver::NewL()") ) ); |
|
320 iSysApPubSubObserver = CSysApPubSubObserver::NewL( *this ); |
|
321 RProperty::Define( KPSUidCoreApplicationUIs, KCoreAppUIsPoCIndicator, RProperty::EInt, KAlwaysPassPolicy, KWriteDeviceDataPolicy ); |
|
322 RProperty::Set( KPSUidCoreApplicationUIs, KCoreAppUIsPoCIndicator, ECoreAppUIsPocIndicatorUninitialized ); |
|
323 RProperty::Define( KPSUidCoreApplicationUIs, KCoreAppUIsPoCMissedIndicator, RProperty::EInt, KAlwaysPassPolicy, KWriteDeviceDataPolicy ); |
|
324 RProperty::Set( KPSUidCoreApplicationUIs, KCoreAppUIsPoCMissedIndicator, ECoreAppUIsPocMissedIndicatorUninitialized ); |
|
325 |
|
326 // initial value won't be set to KCoreAppUIsUSBFileTransfer, because UsbMscPersonality-plugin may also define it if USB cable is connected during boot |
|
327 // remove this definition after all clients have taken the USB personality ids in use |
|
328 RProperty::Define( KPSUidCoreApplicationUIs, KCoreAppUIsUSBFileTransfer, RProperty::EInt, KAlwaysPassPolicy, KWriteDeviceDataPolicy ); |
|
329 |
|
330 RProperty::Define( KPSUidCoreApplicationUIs, KCoreAppUIsVideoSharingIndicator, RProperty::EInt, KAlwaysPassPolicy, KWriteDeviceDataPolicy ); |
|
331 RProperty::Set( KPSUidCoreApplicationUIs, KCoreAppUIsVideoSharingIndicator, ECoreAppUIsVideoSharingIndicatorUninitialized ); |
|
332 |
|
333 TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: trying CSysApAccessoryObserver::NewL()") ) ); |
|
334 iSysApAccessoryObserver = CSysApAccessoryObserver::NewL( *this ); |
|
335 |
|
336 TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: trying CSysApCenRepController::NewL()") ) ); |
|
337 iSysApCenRepController = CSysApCenRepController::NewL(); |
|
338 |
|
339 TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: trying CSysApCenRepLightSettingsObserver::NewL") ) ); |
|
340 iSysApCenRepLightSettingsObserver = CSysApCenRepLightSettingsObserver::NewL( *this ); |
|
341 |
|
342 TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: trying CSysApCenRepBtObserver::NewL") ) ); |
|
343 iSysApCenRepBtObserver = CSysApCenRepBtObserver::NewL( *this ); |
|
344 |
|
345 if ( iSysApFeatureManager->FmTxSupported() ) |
|
346 { |
|
347 TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: trying CSysApCenRepFmTxObserver::NewL") ) ); |
|
348 iSysApCenRepFmTxObserver = CSysApCenRepFmTxObserver::NewL( *this ); |
|
349 } |
|
350 |
|
351 // Define P&S keys "owned" by SysAp |
163 // Define P&S keys "owned" by SysAp |
352 RProperty::Define( KPSUidUikon, KUikMMCInserted, RProperty::EInt, KAlwaysPassPolicy, KWriteDeviceDataPolicy ); |
164 RProperty::Define( KPSUidUikon, KUikMMCInserted, RProperty::EInt, KAlwaysPassPolicy, KWriteDeviceDataPolicy ); |
353 //initially set the value as 0 assuming mmc is not inserted |
165 //initially assuming that the memory card is not inserted |
354 RProperty::Set( KPSUidUikon, KUikMMCInserted, 0 ); |
166 RProperty::Set( KPSUidUikon, KUikMMCInserted, 0 ); |
355 TDriveInfo driveInfo; |
167 TDriveInfo driveInfo; |
356 TInt driveNumber; |
168 TInt driveNumber; |
357 TInt err; |
169 TInt err; |
358 RFs& fileServer = iEikonEnv->FsSession(); |
170 RFs& fileServer = iEikonEnv->FsSession(); |
359 for ( driveNumber = EDriveD; driveNumber < EDriveZ; driveNumber++ ) |
171 for ( driveNumber = EDriveD; driveNumber < EDriveZ; driveNumber++ ) |
360 { |
172 { |
361 err = fileServer.Drive(driveInfo,driveNumber); |
173 err = fileServer.Drive(driveInfo,driveNumber); |
362 if(driveNumber==EDriveF && err == KErrNone && driveInfo.iType == EMediaHardDisk && driveInfo.iDriveAtt & KDriveAttRemovable) |
174 if(driveNumber == EDriveF && err == KErrNone && driveInfo.iType == EMediaHardDisk && driveInfo.iDriveAtt & KDriveAttRemovable) |
363 { |
175 { |
364 TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: err = %d, driveInfo.iType = %d, driveInfo.iDriveAtt %d, KDriveAttRemovable = %d "),err,driveInfo.iType,driveInfo.iDriveAtt,KDriveAttRemovable) ); |
176 TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: err = %d, driveInfo.iType = %d, driveInfo.iDriveAtt %d, KDriveAttRemovable = %d "),err,driveInfo.iType,driveInfo.iDriveAtt,KDriveAttRemovable) ); |
365 RProperty::Set( KPSUidUikon, KUikMMCInserted, 1 ); |
177 RProperty::Set( KPSUidUikon, KUikMMCInserted, 1 ); |
366 break; // Memory card drive found... |
178 break; // Memory card drive found... |
367 } |
179 } |
368 } |
180 } |
|
181 |
|
182 TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: trying CSysApFeatureManager::NewL()") ) ); |
|
183 iSysApFeatureManager = CSysApFeatureManager::NewL(); |
|
184 |
|
185 // Setup USB charging detector |
|
186 iSysApUsbChargerDetector.EnableUsbCharging( |
|
187 iSysApFeatureManager->Supported( KSysApFeatureIdChargerReminderNotes ) && |
|
188 iSysApFeatureManager->Supported( KSysApFeatureIdUsbChargingWithoutReminderNotes ) ); |
|
189 |
|
190 TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: trying CSysApPubSubObserver::NewL()") ) ); |
|
191 iSysApPubSubObserver = CSysApPubSubObserver::NewL( *this ); |
|
192 |
|
193 RProperty::Define( KPSUidCoreApplicationUIs, KCoreAppUIsPoCIndicator, RProperty::EInt, KAlwaysPassPolicy, KWriteDeviceDataPolicy ); |
|
194 RProperty::Set( KPSUidCoreApplicationUIs, KCoreAppUIsPoCIndicator, ECoreAppUIsPocIndicatorUninitialized ); |
|
195 RProperty::Define( KPSUidCoreApplicationUIs, KCoreAppUIsPoCMissedIndicator, RProperty::EInt, KAlwaysPassPolicy, KWriteDeviceDataPolicy ); |
|
196 RProperty::Set( KPSUidCoreApplicationUIs, KCoreAppUIsPoCMissedIndicator, ECoreAppUIsPocMissedIndicatorUninitialized ); |
|
197 |
|
198 // initial value won't be set to KCoreAppUIsUSBFileTransfer, because UsbMscPersonality-plugin may also define it if USB cable is connected during boot |
|
199 // remove this definition after all clients have taken the USB personality ids in use |
|
200 RProperty::Define( KPSUidCoreApplicationUIs, KCoreAppUIsUSBFileTransfer, RProperty::EInt, KAlwaysPassPolicy, KWriteDeviceDataPolicy ); |
|
201 |
|
202 RProperty::Define( KPSUidCoreApplicationUIs, KCoreAppUIsVideoSharingIndicator, RProperty::EInt, KAlwaysPassPolicy, KWriteDeviceDataPolicy ); |
|
203 RProperty::Set( KPSUidCoreApplicationUIs, KCoreAppUIsVideoSharingIndicator, ECoreAppUIsVideoSharingIndicatorUninitialized ); |
369 |
204 |
370 RProperty::Define( KPSUidCoreApplicationUIs, KCoreAppUIsHideAlarm, RProperty::EInt, KAlwaysPassPolicy, KWriteDeviceDataPolicy ); |
205 RProperty::Define( KPSUidCoreApplicationUIs, KCoreAppUIsHideAlarm, RProperty::EInt, KAlwaysPassPolicy, KWriteDeviceDataPolicy ); |
371 RProperty::Define( KPSUidCoreApplicationUIs, KCoreAppUIsDisableKeyguard, RProperty::EInt, KAlwaysPassPolicy, KWriteDeviceDataPolicy ); |
206 RProperty::Define( KPSUidCoreApplicationUIs, KCoreAppUIsDisableKeyguard, RProperty::EInt, KAlwaysPassPolicy, KWriteDeviceDataPolicy ); |
372 RProperty::Define( KPSUidCoreApplicationUIs, KCoreAppUIsSoftReject, RProperty::EInt, KAlwaysPassPolicy, KWriteDeviceDataPolicy ); |
207 RProperty::Define( KPSUidCoreApplicationUIs, KCoreAppUIsSoftReject, RProperty::EInt, KAlwaysPassPolicy, KWriteDeviceDataPolicy ); |
373 RProperty::Define( KPSUidCoreApplicationUIs, KCoreAppUIsUipInd, RProperty::EInt, KAlwaysPassPolicy, KWriteDeviceDataPolicy ); |
208 RProperty::Define( KPSUidCoreApplicationUIs, KCoreAppUIsUipInd, RProperty::EInt, KAlwaysPassPolicy, KWriteDeviceDataPolicy ); |
565 delete iSysApShutdownAnimation; |
643 delete iSysApShutdownAnimation; |
566 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
644 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
567 } |
645 } |
568 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
646 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
569 |
647 |
570 |
648 // delete iProfileNote; |
571 |
649 |
572 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
650 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
573 if( iAnimTimer ) |
651 if( iAnimTimer ) |
574 { |
652 { |
575 iAnimTimer->Cancel(); |
653 iAnimTimer->Cancel(); |
576 } |
654 } |
577 delete iAnimTimer; |
655 delete iAnimTimer; |
578 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
656 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
579 |
657 |
580 delete iSysApPowerKeyMenuObserver; |
|
581 |
|
582 delete iSysApStartupController; |
658 delete iSysApStartupController; |
583 |
|
584 delete iSysApGanHandler; |
|
585 |
659 |
586 #ifdef RD_MULTIPLE_DRIVE |
660 #ifdef RD_MULTIPLE_DRIVE |
587 iInsertedMemoryCards.Close(); |
661 iInsertedMemoryCards.Close(); |
588 delete iSysApDriveEjectHandler; |
662 delete iSysApDriveEjectHandler; |
589 delete iSysApDriveUnlockHandler; |
663 delete iSysApDriveUnlockHandler; |
590 delete iSysApDriveList; |
664 delete iSysApDriveList; |
591 #endif // RD_MULTIPLE_DRIVE |
665 #endif // RD_MULTIPLE_DRIVE |
592 |
666 |
593 TRACES( RDebug::Print( _L("~CSysApAppUi() completed") ) ); |
667 TRACES( RDebug::Print( _L("~CSysApAppUi() completed") ) ); |
594 } |
668 } |
595 |
669 |
596 |
670 TBool CSysApAppUi::ResourcesFreed() const |
597 // ---------------------------------------------------------------------------- |
671 { |
598 // CSysApAppUi::HandleLocationPrivacyIndicatorL() |
672 return iResourcesFreed; |
599 // ---------------------------------------------------------------------------- |
673 } |
600 |
674 |
601 void CSysApAppUi::HandleLocationPrivacyIndicatorL( const TInt aState ) |
675 void CSysApAppUi::ShowExampleUiNoteL( const TDesC& noteText )const |
602 { |
676 { |
603 TRACES( RDebug::Print( _L("CSysApAppUi::HandleLocationPrivacyIndicatorL() state=%d"), aState ) ); |
677 TRACES( RDebug::Print( _L("CSysApAppUi::ShowExampleUiNoteL:: constructing CHbDeviceMessageBoxSymbian:BeGIN") ) ); |
604 if ( iSysApFeatureManager->LocationPrivacySupported() ) |
678 CHbDeviceMessageBoxSymbian *note = CHbDeviceMessageBoxSymbian::NewL(CHbDeviceMessageBoxSymbian::EInformation); |
605 { |
679 CleanupStack::PushL(note); |
606 // Phase 1. Set all Location Privacy indicators off |
680 TRACES( RDebug::Print( _L("CSysApAppUi::ShowExampleUiNoteL:: construction of CHbDeviceMessageBoxSymbian:END") ) ); |
607 if ( iSysApLocationPrivacyIndicator->iIndicatorIdAcceptAll != KSysApNoIndicator ) |
681 note->SetTextL(noteText); |
608 { |
682 note->SetTimeout(300); |
609 SetIndicatorStateL( iSysApLocationPrivacyIndicator->iIndicatorIdRejectAll, EAknIndicatorStateOff ); |
683 TRACES( RDebug::Print( _L("CSysApAppUi:: Display of CHbDeviceMessageBoxSymbian::Begin") ) ); |
610 } |
684 note->ShowL(); |
611 if ( iSysApLocationPrivacyIndicator->iIndicatorIdRejectAll != KSysApNoIndicator ) |
685 TRACES( RDebug::Print( _L("CSysApAppUi:: Display of CHbDeviceMessageBoxSymbian::End") ) ); |
612 { |
686 CleanupStack::PopAndDestroy(note); |
613 SetIndicatorStateL( iSysApLocationPrivacyIndicator->iIndicatorIdRejectAll, EAknIndicatorStateOff ); |
687 } |
614 } |
688 |
615 if ( iSysApLocationPrivacyIndicator->iIndicatorIdAlwaysAsk != KSysApNoIndicator ) |
689 |
616 { |
690 void CSysApAppUi::ExecQueryL( TSysapQuery aQuery, TDes8& aReturn ) |
617 SetIndicatorStateL( iSysApLocationPrivacyIndicator->iIndicatorIdAlwaysAsk, EAknIndicatorStateOff ); |
691 { |
618 } |
692 ExecQueryL( aQuery, aReturn, KNullDesC8 ); |
619 if ( iSysApLocationPrivacyIndicator->iIndicatorIdIndividualPrivacy != KSysApNoIndicator ) |
693 } |
620 { |
694 |
621 SetIndicatorStateL( iSysApLocationPrivacyIndicator->iIndicatorIdIndividualPrivacy, EAknIndicatorStateOff ); |
695 // ---------------------------------------------------------------------------- |
622 } |
696 // CSysApAppUi::ExecQueryL |
623 // Phase 2. Set the required Location Privacy indicator on |
697 // ---------------------------------------------------------------------------- |
624 switch ( aState ) |
698 // |
625 { |
699 void CSysApAppUi::ExecQueryL( TSysapQuery aQuery, TDes8& aReturn, const TDesC8& /*aParam*/ ) |
626 case EPSLocPrivAcceptAll: |
700 { |
627 if ( iSysApLocationPrivacyIndicator->iIndicatorIdAcceptAll != KSysApNoIndicator ) |
701 TRACES( RDebug::Print(_L("CSysApAppUi::ExecQueryL: aQuery=%d"), aQuery ) ); |
|
702 |
|
703 switch ( aQuery ) |
|
704 { |
|
705 case EGetHwrmLight: // get handle to HWRM client session. Returns CHWRMLight*. |
|
706 { |
|
707 THwrmLightBuf retBuf( iSysApLightsController->GetHwrmLight() ); |
|
708 aReturn.Copy( retBuf ); |
|
709 } |
|
710 break; |
|
711 |
|
712 case EGetKeylock: // get handle to keylock client session. Returns RAknKeylock2*. |
|
713 { |
|
714 // do nothing |
|
715 } |
|
716 break; |
|
717 |
|
718 |
|
719 default: |
|
720 __ASSERT_DEBUG( EFalse, User::Panic( _L("CSysApAppUi::ExecQueryL: Invalid query"), KErrArgument ) ); |
|
721 User::Leave( KErrArgument ); |
|
722 break; |
|
723 } |
|
724 } |
|
725 |
|
726 // ---------------------------------------------------------------------------- |
|
727 // CSysApAppUi::ExecCommandL |
|
728 // ---------------------------------------------------------------------------- |
|
729 // |
|
730 void CSysApAppUi::ExecCommandL( TSysapCommand aCommand ) |
|
731 { |
|
732 ExecCommandL( aCommand, KNullDesC8 ); |
|
733 } |
|
734 |
|
735 // ---------------------------------------------------------------------------- |
|
736 // CSysApAppUi::ExecCommandL |
|
737 // ---------------------------------------------------------------------------- |
|
738 // |
|
739 void CSysApAppUi::ExecCommandL( TSysapCommand aCommand, const TDesC8& /* aParam */ ) |
|
740 { |
|
741 TRACES( RDebug::Print(_L("CSysApAppUi::ExecCommandL: aCommand=%d"), aCommand ) ); |
|
742 |
|
743 switch ( aCommand ) |
|
744 { |
|
745 case EResetKeyguardState: // reset the internal keyguard flags of the SysAp, except for iKeyLockOnBeforeCradle |
|
746 iKeyLockOnBeforeCall = EFalse; |
|
747 iKeyLockOnBeforeAlarm = EFalse; |
|
748 break; |
|
749 |
|
750 default: |
|
751 // do nothing in release builds since no harm is done |
|
752 __ASSERT_DEBUG( EFalse, User::Panic( _L("CSysApAppUi::ExecCommandL: Invalid command"), KErrArgument ) ); |
|
753 break; |
|
754 } |
|
755 } |
|
756 |
|
757 // ---------------------------------------------------------------------------- |
|
758 // CSysApAppUi::TimerExpiredL() |
|
759 // ---------------------------------------------------------------------------- |
|
760 void CSysApAppUi::TimerExpiredL() |
|
761 { |
|
762 /* |
|
763 * Not suppported , will take care in wk25 |
|
764 * #ifndef RD_MULTIPLE_DRIVE |
|
765 * CloseUIAppsInHotSwapL(); |
|
766 * #endif // RD_MULTIPLE_DRIVE |
|
767 */ |
|
768 } |
|
769 |
|
770 |
|
771 // ---------------------------------------------------------------------------- |
|
772 // CSysApAppUi::KeyLockState() const |
|
773 // ---------------------------------------------------------------------------- |
|
774 |
|
775 TBool CSysApAppUi::KeyLockState() const |
|
776 { |
|
777 return iKeyLockEnabled; |
|
778 } |
|
779 |
|
780 // ---------------------------------------------------------------------------- |
|
781 // CSysApAppUi::DeviceLockState() const |
|
782 // ---------------------------------------------------------------------------- |
|
783 |
|
784 TBool CSysApAppUi::DeviceLockState() const |
|
785 { |
|
786 return iDeviceLockEnabled; |
|
787 } |
|
788 |
|
789 // ---------------------------------------------------------------------------- |
|
790 // CSysApAppUi::SysApFeatureManager |
|
791 // ---------------------------------------------------------------------------- |
|
792 |
|
793 CSysApFeatureManager& CSysApAppUi::SysApFeatureManager() |
|
794 { |
|
795 __ASSERT_DEBUG( iSysApFeatureManager, User::Panic( _L("iSysApFeatureManager == NULL"), KErrBadHandle ) ); |
|
796 |
|
797 return *iSysApFeatureManager; |
|
798 } |
|
799 |
|
800 // ---------------------------------------------------------------------------- |
|
801 // CSysApAppUi::ActivateKeyeventForwardingForLights() |
|
802 // ---------------------------------------------------------------------------- |
|
803 |
|
804 void CSysApAppUi::ActivateKeyeventForwardingForLights(TBool aActivate) |
|
805 { |
|
806 if( iSysApNspsHandler ) |
|
807 { |
|
808 if ( aActivate ) |
|
809 { |
|
810 iSysApNspsHandler->ActivateKeyeventForwardingForLights(); |
|
811 } |
|
812 else |
|
813 { |
|
814 iSysApNspsHandler->DeActivateKeyeventForwardingForLights(); |
|
815 } |
|
816 } |
|
817 } |
|
818 |
|
819 // ---------------------------------------------------------------------------- |
|
820 // CSysApAppUi::StarterSession() |
|
821 // ---------------------------------------------------------------------------- |
|
822 |
|
823 RStarterSession& CSysApAppUi::StarterSession() |
|
824 { |
|
825 if ( !iStarterSession.Handle() ) |
|
826 { |
|
827 // All server connections are tried to be made KTriesToConnectServer times because occasional |
|
828 // fails on connections are possible at least on some servers |
|
829 TRACES( RDebug::Print( _L("CSysApAppUi::StarterSession: trying RStarterSession::Connect()") ) ); |
|
830 TInt thisTry = 0; |
|
831 TInt err; |
|
832 while ( ( err = iStarterSession.Connect() ) != KErrNone && ( thisTry++ ) <= KTriesToConnectServer ) |
|
833 { |
|
834 User::After( KTimeBeforeRetryingServerConnection ); |
|
835 } |
|
836 |
|
837 if ( err != KErrNone ) |
|
838 { |
|
839 // What do in error case? |
|
840 TRACES( RDebug::Print( _L("CSysApAppUi::StarterSession: RStarterSession::Connect() failed with %d"), err ) ); |
|
841 } |
|
842 } |
|
843 |
|
844 return iStarterSession; |
|
845 } |
|
846 |
|
847 // ---------------------------------------------------------------------------- |
|
848 // CSysApAppUi::SetBtPowerState() |
|
849 // ---------------------------------------------------------------------------- |
|
850 TInt CSysApAppUi::SetBtPowerState( TBool aBtState ) |
|
851 { |
|
852 if ( iSysApBtController ) |
|
853 { |
|
854 return iSysApBtController->SetPowerState( aBtState ); |
|
855 } |
|
856 else |
|
857 { |
|
858 return KErrNotReady; |
|
859 } |
|
860 } |
|
861 |
|
862 // ---------------------------------------------------------------------------- |
|
863 // CSysApAppUi::SetStarterState() |
|
864 // ---------------------------------------------------------------------------- |
|
865 |
|
866 TInt CSysApAppUi::SetStarterState( const RStarterSession::TGlobalState aState ) |
|
867 { |
|
868 if ( iSysApStartupController->GlobalStateChangeAllowed( aState ) ) |
|
869 { |
|
870 TRACES( RDebug::Print( _L("CSysApAppUi::SetStarterState: aState=%d" ), aState ) ); |
|
871 return StarterSession().SetState( aState ); |
|
872 } |
|
873 else |
|
874 { |
|
875 TRACES( RDebug::Print( _L("CSysApAppUi::SetStarterState: aState=%d - not allowed" ), aState ) ); |
|
876 return KErrNone; |
|
877 } |
|
878 } |
|
879 |
|
880 // ---------------------------------------------------------------------------- |
|
881 // CSysApAppUi::SetNetworkConnectionAllowed() |
|
882 // ---------------------------------------------------------------------------- |
|
883 |
|
884 void CSysApAppUi::SetNetworkConnectionAllowed( TCoreAppUIsNetworkConnectionAllowed aNetworkConnectionAllowed ) |
|
885 { |
|
886 TRACES( RDebug::Print( _L("CSysApAppUi::SetNetworkConnectionAllowed: status: %d" ), aNetworkConnectionAllowed ) ); |
|
887 |
|
888 iSysApCenRepController->SetInt( KCRUidCoreApplicationUIs, KCoreAppUIsNetworkConnectionAllowed, (TInt) aNetworkConnectionAllowed ); |
|
889 |
|
890 // Also set the Symbian PS key used for the same purpose: |
|
891 RProperty::Set(KUidSystemCategory, KUidPhonePwr.iUid, aNetworkConnectionAllowed ? ESAPhoneOn : ESAPhoneOff); |
|
892 } |
|
893 |
|
894 // ---------------------------------------------------------------------------- |
|
895 // CSysApAppUi::BluetoothPowerMode() |
|
896 // ---------------------------------------------------------------------------- |
|
897 TInt CSysApAppUi::BluetoothPowerMode() const |
|
898 { |
|
899 return iSysApCenRepBtObserver->BluetoothPowerMode(); |
|
900 } |
|
901 |
|
902 // ---------------------------------------------------------------------------- |
|
903 // CSysApAppUi::SimSupported() |
|
904 // ---------------------------------------------------------------------------- |
|
905 TBool CSysApAppUi::SimSupported() |
|
906 { |
|
907 return iSysApFeatureManager->SimSupported(); |
|
908 } |
|
909 |
|
910 // ---------------------------------------------------------------------------- |
|
911 // CSysApAppUi::BtSapEnabled() |
|
912 // ---------------------------------------------------------------------------- |
|
913 |
|
914 TBool CSysApAppUi::BtSapEnabled() |
|
915 { |
|
916 if ( iSysApBtSapController ) |
|
917 { |
|
918 return iSysApBtSapController->BtSapEnabled(); |
|
919 } |
|
920 return EFalse; |
|
921 } |
|
922 |
|
923 |
|
924 // ---------------------------------------------------------------------------- |
|
925 // CSysApAppUi::OfflineModeChangedL() |
|
926 // ---------------------------------------------------------------------------- |
|
927 void CSysApAppUi::OfflineModeChangedL() |
|
928 { |
|
929 #ifdef SYSAP_USE_STARTUP_UI_PHASE |
|
930 // if UI is not ready, don't update indicators |
|
931 if ( !UiReady() ) |
|
932 { |
|
933 return; |
|
934 } |
|
935 #endif // SYSAP_USE_STARTUP_UI_PHASE |
|
936 |
|
937 #if 0 // Not used as of now |
|
938 SetHacIndicatorL(); |
|
939 #endif //0 |
|
940 } |
|
941 |
|
942 // ---------------------------------------------------------------------------- |
|
943 // CSysApAppUi::UiReady() |
|
944 // |
|
945 // ---------------------------------------------------------------------------- |
|
946 |
|
947 TBool CSysApAppUi::UiReady() const |
|
948 { |
|
949 #ifdef SYSAP_USE_STARTUP_UI_PHASE |
|
950 return iSysApStartupController->UiReady(); |
|
951 #else // SYSAP_USE_STARTUP_UI_PHASE |
|
952 // if startup UI phase information is not used, global system state normal is handled as UI idle state |
|
953 return IsStateNormal(); |
|
954 #endif // SYSAP_USE_STARTUP_UI_PHASE |
|
955 } |
|
956 |
|
957 |
|
958 // ---------------------------------------------------------------------------- |
|
959 // CSysApAppUi::CompleteShutdown() |
|
960 // ---------------------------------------------------------------------------- |
|
961 |
|
962 void CSysApAppUi::CompleteShutdown( const TBool aReset, const TInt aResetReason ) |
|
963 { |
|
964 TRACES( RDebug::Print(_L("CSysApAppUi::CompleteShutdown(): START" ) ) ); |
|
965 |
|
966 iCheckLongPowerKeyEvent = ETrue; |
|
967 |
|
968 PrepareForShutdownImage();//SysAp's internal preparation for ShutDown with image |
|
969 |
|
970 FreeResources(); |
|
971 |
|
972 if ( aReset ) |
|
973 { |
|
974 __ASSERT_DEBUG( aResetReason >= RStarterSession::ELanguageSwitchReset && |
|
975 aResetReason <= RStarterSession::EDataRestoreReset, |
|
976 User::Invariant() ); |
|
977 StarterSession().Reset( static_cast<RStarterSession::TResetReason>( aResetReason ) ); |
|
978 } |
|
979 else |
|
980 { |
|
981 StarterSession().Shutdown(); |
|
982 } |
|
983 |
|
984 StarterSession().Close(); |
|
985 |
|
986 TRACES( RDebug::Print(_L("CSysApAppUi::CompleteShutdown(): END" ) ) ); |
|
987 } |
|
988 |
|
989 |
|
990 |
|
991 // ---------------------------------------------------------------------------- |
|
992 // CSysApAppUi::DoShutdownL( const TBool aReset, const TSWStartupReason aSWStartupReason ) |
|
993 // ---------------------------------------------------------------------------- |
|
994 |
|
995 void CSysApAppUi::DoShutdownL( const TBool aReset, const TInt aResetReason ) |
|
996 { |
|
997 TRACES( RDebug::Print(_L("CSysApAppUi::DoShutdownL: aResetReason:%d, aReset:%d" ), |
|
998 aResetReason, aReset ) ); |
|
999 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1000 TBool animationenabled( EFalse ); |
|
1001 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1002 |
|
1003 if( OkToInitiateShutdown() ) |
|
1004 { |
|
1005 TRACES( RDebug::Print(_L("CSysApAppUi::DoShutdownL: Was OkToToInitiateShutdown" ) ) ); |
|
1006 |
|
1007 |
|
1008 if ( !aReset && iSysApFeatureManager->Supported(KSysApFeatureIdGoodbyeNote) ) |
|
1009 { |
|
1010 // show shutdown note |
|
1011 } |
|
1012 |
|
1013 if( !aReset ) |
|
1014 { |
|
1015 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1016 TRAPD( err, ShowAnimationL() ); |
|
1017 if ( err ) |
|
1018 { |
|
1019 TRACES( RDebug::Print(_L("CSysApAppUi::DoShutdownL ShowAnimationL() leaved: %d" ), err ) ); |
|
1020 CompleteShutdown(aReset, aResetReason); |
|
1021 } |
|
1022 } |
|
1023 else // aReset |
|
1024 { |
|
1025 CompleteShutdown(aReset, aResetReason); |
|
1026 } |
|
1027 #else // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1028 TRAPD( err, animationenabled = ShowAnimationL() ); |
|
1029 if ( err ) |
|
1030 { |
|
1031 TRACES( RDebug::Print(_L("CSysApAppUi::DoShutdownL ShowAnimationL() leaved: %d" ), err ) ); |
|
1032 } |
|
1033 } |
|
1034 |
|
1035 if ( !animationenabled ) |
|
1036 { |
|
1037 CompleteShutdown(aReset, aResetReason); |
|
1038 } |
|
1039 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1040 } |
|
1041 else |
|
1042 { |
|
1043 TRACES( RDebug::Print(_L("CSysApAppUi::DoShutdownL: Was not OkToToInitiateShutdown" ) ) ); |
|
1044 } |
|
1045 TRACES( RDebug::Print(_L("CSysApAppUi::DoShutdownL: END" ) ) ); |
|
1046 } |
|
1047 |
|
1048 |
|
1049 |
|
1050 /* |
|
1051 ---------------------------------------------------------------------------- |
|
1052 CSysApAppUi::IsEncryptionOperationOngoingL() |
|
1053 Introduced the code as a part of Sub : 405-3362 - Power Management SUB for ES |
|
1054 recapture functionalities in platform which support multidrive as well. |
|
1055 ------------------------------------------------------------------------------- |
|
1056 */ |
|
1057 TBool CSysApAppUi::IsEncryptionOperationOngoingL() const |
|
1058 { |
|
1059 TBool deFeatureSupported(EFalse); |
|
1060 FeatureManager::InitializeLibL(); |
|
1061 deFeatureSupported = FeatureManager::FeatureSupported( KFeatureIdFfDeviceEncryptionFeature); |
|
1062 FeatureManager::UnInitializeLib(); |
|
1063 |
|
1064 if(deFeatureSupported) |
|
1065 { |
|
1066 /** |
|
1067 * Store the last memory status changed |
|
1068 * 0: Idle. It can be Encrypted or Decrypted |
|
1069 * 1: Encrypting |
|
1070 * 2: Decrypting |
|
1071 **/ |
|
1072 |
|
1073 RProperty deProperty; |
|
1074 User::LeaveIfError(deProperty.Attach(KDevEncProtectedUid, KDevEncOperationKey,EOwnerThread)); |
|
1075 TInt deValue = 0; |
|
1076 if((deProperty.Get(deValue)== KErrNone)&&( deValue == EOpEncrypting || deValue == EOpDecrypting)) |
|
1077 { |
|
1078 deProperty.Close(); |
|
1079 return ETrue; |
|
1080 } |
|
1081 else |
|
1082 { |
|
1083 deProperty.Close(); |
|
1084 return EFalse; |
|
1085 } |
|
1086 } |
|
1087 else |
|
1088 { |
|
1089 return EFalse; |
|
1090 } |
|
1091 } |
|
1092 |
|
1093 // ---------------------------------------------------------------------------- |
|
1094 // CSysApAppUi::HandleLongPowerKeyPressedL() |
|
1095 // ---------------------------------------------------------------------------- |
|
1096 |
|
1097 void CSysApAppUi::HandleLongPowerKeyPressedL() |
|
1098 { |
|
1099 TRACES( RDebug::Print( _L("CSysApAppUi::HandleLongPowerKeyPressedL()") ) ); |
|
1100 |
|
1101 TInt swState; |
|
1102 RProperty::Get( KPSUidStartup, KPSGlobalSystemState, swState ); |
|
1103 |
|
1104 iSysApLightsController->PowerKeyPressedL(); //need to handle later. |
|
1105 |
|
1106 if( swState == ESwStateStartingCriticalApps || |
|
1107 swState == ESwStateSelfTestOK || |
|
1108 swState == ESwStateSecurityCheck || |
|
1109 swState == ESwStateCriticalPhaseOK || |
|
1110 swState == ESwStateEmergencyCallsOnly || |
|
1111 swState == ESwStateNormalRfOn || |
|
1112 swState == ESwStateNormalRfOff || |
|
1113 swState == ESwStateNormalBTSap || |
|
1114 swState == ESwStateFatalStartupError ) |
|
1115 { |
|
1116 if( !iDeviceLockEnabled ) |
|
1117 { |
|
1118 if( iPowerKeyPopupMenuActive ) |
|
1119 { |
|
1120 // do nothing |
|
1121 } |
|
1122 else if( !iIgnoreNextPowerKeyRepeats ) |
|
1123 { |
|
1124 if( !iKeyLockEnabled && !IsEncryptionOperationOngoingL() ) |
628 { |
1125 { |
629 SetIndicatorStateL( iSysApLocationPrivacyIndicator->iIndicatorIdAcceptAll, EAknIndicatorStateOn ); |
1126 DoShutdownL( EFalse, KDummyReason ); |
630 } |
1127 } |
|
1128 } |
|
1129 iIgnoreNextPowerKeyRepeats = ETrue; |
|
1130 } |
|
1131 } |
|
1132 else if( swState == ESwStateAlarm ) |
|
1133 { |
|
1134 //Just comment here to highlight that this is not possible since |
|
1135 //from alarm state already a short press always shuts the device down. |
|
1136 } |
|
1137 else if( swState == ESwStateCharging ) |
|
1138 //Startup to Normal state |
|
1139 { |
|
1140 if( !iIgnoreNextPowerKeyRepeats ) |
|
1141 { |
|
1142 iIgnoreNextPowerKeyRepeats = ETrue; |
|
1143 |
|
1144 SetStarterState( RStarterSession::ENormal ); |
|
1145 } |
|
1146 } |
|
1147 } |
|
1148 |
|
1149 // ---------------------------------------------------------------------------- |
|
1150 // CSysApAppUi::IsDeviceModeKey |
|
1151 // ---------------------------------------------------------------------------- |
|
1152 |
|
1153 TBool CSysApAppUi::IsDeviceModeKey( const TKeyEvent& aKeyEvent ) const |
|
1154 { |
|
1155 return CSysApDefaultKeyHandler::IsDeviceModeKey( aKeyEvent ); |
|
1156 } |
|
1157 |
|
1158 |
|
1159 // ---------------------------------------------------------------------------- |
|
1160 // CSysApAppUi::ShowShutdownImage |
|
1161 // ---------------------------------------------------------------------------- |
|
1162 // |
|
1163 TInt CSysApAppUi::ShowShutdownImage( TInt aBitmapId ) |
|
1164 { |
|
1165 TRACES( RDebug::Print(_L("CSysApAppUi::ShowShutdownImage") ) ); |
|
1166 |
|
1167 TRAPD( err, ShowShutdownImageL( aBitmapId ) ); |
|
1168 |
|
1169 if ( err != KErrNone ) |
|
1170 { |
|
1171 TRACES( RDebug::Print(_L("CSysApAppUi::ShowShutdownImageL failed, err=%d"), err ) ); |
|
1172 } |
|
1173 |
|
1174 return err; |
|
1175 } |
|
1176 |
|
1177 |
|
1178 // ---------------------------------------------------------------------------- |
|
1179 // CSysApAppUi::ShowShutdownImageL |
|
1180 // ---------------------------------------------------------------------------- |
|
1181 // |
|
1182 void CSysApAppUi::ShowShutdownImageL( TInt aBitmapId ) |
|
1183 { |
|
1184 TRACES( RDebug::Print(_L("CSysApAppUi::ShowShutdownImageL") ) ); |
|
1185 // do nothing |
|
1186 if ( !iSysApShutdownImage ) // Shutdown image may be shown without entering normal state (e.g. charging), so construct here |
|
1187 { |
|
1188 TRACES( RDebug::Print( _L("CSysApAppUi::ShowShutdownImageL: trying CSysApShutdownImage::NewL()") ) ); |
|
1189 iSysApShutdownImage = CSysApShutdownImage::NewL(); |
|
1190 } |
|
1191 TRACES( RDebug::Print( _L("CSysApAppUi::ShowShutdownImageL: trying CSysApShutdownImage::ShowShutdownImageL()") ) ); |
|
1192 iSysApShutdownImage->ShowShutdownImageL( aBitmapId ); |
|
1193 } |
|
1194 |
|
1195 // ---------------------------------------------------------------------------- |
|
1196 // CSysApAppUi::PrepareForShutdownImage() |
|
1197 // ---------------------------------------------------------------------------- |
|
1198 |
|
1199 void CSysApAppUi::PrepareForShutdownImage() |
|
1200 { |
|
1201 TRACES( RDebug::Print( _L("CSysApAppUi::PrepareForShutdownImage() START" ) ) ); |
|
1202 |
|
1203 // If RD_STARTUP_ANIMATION_CUSTOMIZATION is enabled, the following actions are always taken in PrepareForShutdownAnimation |
|
1204 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1205 if ( !iAnimationShowingTime ) // actions already taken in PrepareForShutdownAnimation |
|
1206 { |
|
1207 static_cast<CAknAppUi*>(iEikonEnv->EikAppUi())->KeySounds()->PlaySound( EAvkonSIDPowerOffTone ); |
|
1208 CancelGlobalListQuery(); |
|
1209 |
|
1210 if ( iSysApPowerKeyMenuObserver ) |
|
1211 { |
|
1212 iSysApPowerKeyMenuObserver->Cancel(); |
|
1213 } |
|
1214 |
|
1215 // deactivate notifiers before showing the shutdown image |
|
1216 AknNotifierController::CancelAllNotifications(); |
|
1217 AknNotifierController::HideAllNotifications(ETrue); |
|
1218 RWindowGroup groupWin = iCoeEnv->RootWin(); |
|
1219 iCapturedAppskey = groupWin.CaptureKey( EKeyApplication, KModifierMask, KModifierMask ); |
|
1220 iCapturedAppskeyUpAndDowns = groupWin.CaptureKeyUpAndDowns( EStdKeyApplication0, KModifierMask, KModifierMask ); |
|
1221 } |
|
1222 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1223 |
|
1224 #ifndef __SYSAP_MODULE_TEST //to make errors during shutdown sequence being seen more easily |
|
1225 iEikonEnv->RootWin().SetOrdinalPosition(0, ECoeWinPriorityAlwaysAtFront ); |
|
1226 TRACES( RDebug::Print( _L("CSysApAppUi::PrepareForShutdownImage() Show Shutdown image" ) ) ); |
|
1227 ShowShutdownImage( 1 );//EMbmSysapQgn_startup_screen |
|
1228 #endif |
|
1229 TRACES( RDebug::Print( _L("CSysApAppUi::PrepareForShutdownImage() END" ) ) ); |
|
1230 } |
|
1231 |
|
1232 // ---------------------------------------------------------------------------- |
|
1233 // CSysApAppUi::OkToInitiateShutdown() |
|
1234 // ---------------------------------------------------------------------------- |
|
1235 |
|
1236 TBool CSysApAppUi::OkToInitiateShutdown() |
|
1237 { |
|
1238 TInt swState; |
|
1239 RProperty::Get( KPSUidStartup, KPSGlobalSystemState, swState ); |
|
1240 |
|
1241 if( !iShutdownStarted && |
|
1242 swState == ESwStateStartingCriticalApps || |
|
1243 swState == ESwStateSelfTestOK || |
|
1244 swState == ESwStateSecurityCheck || |
|
1245 swState == ESwStateCriticalPhaseOK || |
|
1246 swState == ESwStateEmergencyCallsOnly || |
|
1247 swState == ESwStateCharging || |
|
1248 swState == ESwStateAlarm || |
|
1249 swState == ESwStateNormalRfOn || |
|
1250 swState == ESwStateNormalRfOff || |
|
1251 swState == ESwStateNormalBTSap || |
|
1252 swState == ESwStateFatalStartupError ) |
|
1253 { |
|
1254 iShutdownStarted = ETrue; |
|
1255 return ETrue; |
|
1256 } |
|
1257 else |
|
1258 { |
|
1259 return EFalse; |
|
1260 } |
|
1261 } |
|
1262 |
|
1263 |
|
1264 void CSysApAppUi::PopupNote() |
|
1265 { |
|
1266 iIgnoreNextPowerKeyUpEvent = ETrue; |
|
1267 // TRACES( RDebug::Print( _L("CSysApAppUi::Key was consumed") ) ); |
|
1268 _LIT(KPowerPressKey,"Short power key"); |
|
1269 HBufC* aString = HBufC16::NewLC(50); |
|
1270 TPtrC aStringPointer = aString->Des(); |
|
1271 aStringPointer.Set(KPowerPressKey); |
|
1272 TRACES( RDebug::Print( _L("CSysApWsClient::RunL(): Key EEventKeyUp 01") ) ); |
|
1273 ShowExampleUiNoteL( aStringPointer ); |
|
1274 CleanupStack::PopAndDestroy(); // aString |
|
1275 } |
|
1276 |
|
1277 |
|
1278 // ---------------------------------------------------------------------------- |
|
1279 // CSysApAppUi::SetUsbAttachStatus |
|
1280 // ---------------------------------------------------------------------------- |
|
1281 #ifndef RD_MULTIPLE_DRIVE |
|
1282 void CSysApAppUi::SetUsbAttachStatus( const TBool aUsbAttached ) |
|
1283 { |
|
1284 // Prevent double beep when USB file transfer gets activated but |
|
1285 // allow MMC inserted beep when: |
|
1286 // a) USB file transfer is active |
|
1287 // b) MMC is not inserted when USB cable is attached |
|
1288 iHideNextBeep = ( iMMCInserted && aUsbAttached ); |
|
1289 } |
|
1290 #else // RD_MULTIPLE_DRIVE |
|
1291 void CSysApAppUi::SetUsbAttachStatus( const TBool aUsbAttached ) |
|
1292 { |
|
1293 TRACES( RDebug::Print( |
|
1294 _L( "CSysApAppUi::SetUsbAttachStatus: aUsbAttached: %d" ), |
|
1295 aUsbAttached ) ); |
|
1296 |
|
1297 if ( aUsbAttached ) |
|
1298 { |
|
1299 // For ignoring extra beeps caused by USB file transfer |
|
1300 iSysApDriveList->ResetDrivesInsertBeepIgnored(); |
|
1301 iSysApDriveList->MarkDrivesInsertBeepIgnored( iInsertedMemoryCards ); |
|
1302 } |
|
1303 } |
|
1304 #endif // RD_MULTIPLE_DRIVE |
|
1305 |
|
1306 |
|
1307 // ---------------------------------------------------------------------------- |
|
1308 // CSysApAppUi::UsbChargerDetector |
|
1309 // ---------------------------------------------------------------------------- |
|
1310 // |
|
1311 TSysApUsbChargerDetector& CSysApAppUi::UsbChargerDetector() |
|
1312 { |
|
1313 return iSysApUsbChargerDetector; |
|
1314 } |
|
1315 |
|
1316 |
|
1317 // ---------------------------------------------------------------------------- |
|
1318 // CSysApAppUi::HandleAccessoryDisconnectedL() |
|
1319 // ---------------------------------------------------------------------------- |
|
1320 |
|
1321 void CSysApAppUi::HandleAccessoryDisconnectedL() |
|
1322 { |
|
1323 TRACES( RDebug::Print( _L("CSysApAppUi::HandleAccessoryDisconnectedL()" ) ) ); |
|
1324 |
|
1325 |
|
1326 TAccMode accessoryState(EAccModeHandPortable); |
|
1327 if ( iSysApAccessoryObserver ) |
|
1328 { |
|
1329 accessoryState = iSysApAccessoryObserver->GetAccessoryMode(); |
|
1330 } |
|
1331 |
|
1332 if ( accessoryState == EAccModeHandPortable ) |
|
1333 { |
|
1334 TRACES( RDebug::Print( _L("CSysApAppUi::HandleAccessoryDisconnectedL:Before Deactivating accessory Plugin"))); |
|
1335 iHbIndicatorSymbian->Deactivate(KAccesoryPlugin); |
|
1336 TRACES( RDebug::Print( _L("CSysApAppUi::HandleAccessoryDisconnectedL:After Deactivating accessory Plugin"))); |
|
1337 iSysApLightsController->AccessoryConnectedL( EFalse ); |
|
1338 iSysApCenRepController->SetInt( KCRUidCoreApplicationUIsSysAp, KSysApAccessoryConnected, 0 ); |
|
1339 } |
|
1340 |
|
1341 SetIhfIndicatorL(); |
|
1342 SetHacIndicatorL(); |
|
1343 |
|
1344 // If lock disabled because of accessory, reactivate it, unless phone call or alarm is ongoing |
|
1345 if ( iKeyLockOnBeforeCradle ) |
|
1346 { |
|
1347 iKeyLockOnBeforeCradle = EFalse; |
|
1348 if ( !iKeyLockOnBeforeCall && !iKeyLockOnBeforeAlarm ) |
|
1349 { |
|
1350 if ( !iDeviceLockEnabled ) |
|
1351 { |
|
1352 iKeyguardController->EnableKeyguard(ETrue); |
|
1353 } |
|
1354 else |
|
1355 { |
|
1356 iKeyguardController->EnableKeyguard(EFalse); |
|
1357 } |
|
1358 } |
|
1359 } |
|
1360 } |
|
1361 |
|
1362 |
|
1363 // ---------------------------------------------------------------------------- |
|
1364 // CSysApAppUi::HandleAccessoryConnectedL() |
|
1365 // ---------------------------------------------------------------------------- |
|
1366 |
|
1367 void CSysApAppUi::HandleAccessoryConnectedL( TAccMode aAccessoryState, TInt aPhysicalConnectionType ) |
|
1368 { |
|
1369 TRACES( RDebug::Print( _L("CSysApAppUi::HandleAccessoryConnectedL( aAccessoryState: %d )(aPhysicalConnectionType: %d "), aAccessoryState, aPhysicalConnectionType ) ); |
|
1370 |
|
1371 CHbSymbianVariantMap* iAccVariantMap = CHbSymbianVariantMap::NewL(); |
|
1372 CleanupStack::PushL(iAccVariantMap); |
|
1373 CHbSymbianVariant* variantAccState = CHbSymbianVariant::NewL(&aAccessoryState, CHbSymbianVariant::EInt); |
|
1374 iAccVariantMap->Add(KAccMode,variantAccState); |
|
1375 CHbSymbianVariant* variantAccType = CHbSymbianVariant::NewL(&aPhysicalConnectionType, CHbSymbianVariant::EInt); |
|
1376 iAccVariantMap->Add(KAccPhyConType,variantAccType); |
|
1377 |
|
1378 |
|
1379 CHbSymbianVariant* iAccVariant = CHbSymbianVariant::NewL(iAccVariantMap, CHbSymbianVariant::EVariantMap ); |
|
1380 CleanupStack::PushL(iAccVariant); |
|
1381 iHbIndicatorSymbian->Activate(KAccesoryPlugin, iAccVariant); |
|
1382 |
|
1383 |
|
1384 TInt swState( StateOfProperty( KPSUidStartup, KPSGlobalSystemState ) ); |
|
1385 TRACES( RDebug::Print( _L("CSysApAppUi::HandleAccessoryConnectedL: swState: %d"), swState ) ); |
|
1386 |
|
1387 if( UiReady() || swState == ESwStateSecurityCheck ) |
|
1388 { |
|
1389 iSysApLightsController->AccessoryConnectedL( ETrue ); |
|
1390 } |
|
1391 |
|
1392 if ( ( ! iSysApOfflineModeController->OfflineModeActive() )) |
|
1393 { |
|
1394 if ( iSysApCenRepController->GetInt( KCRUidCoreApplicationUIsSysAp, KSysApAccessoryConnected ) < 1 ) |
|
1395 // accessory not connected already |
|
1396 { |
|
1397 iSysApCenRepController->SetInt( KCRUidCoreApplicationUIsSysAp, KSysApAccessoryConnected, 1 ); |
|
1398 } |
|
1399 } |
|
1400 |
|
1401 // Carkit and music stand have also light on permanently option that needs to be checked |
|
1402 if( aAccessoryState == EAccModeWiredCarKit || aAccessoryState == EAccModeMusicStand ) |
|
1403 { |
|
1404 // When device is placed on a handsfree cradle, keyguard must be disabled (unless device is locked) |
|
1405 // Note: It is assumed that if carkit/music stand is connected, the phone is in the cradle. |
|
1406 if ( iKeyLockEnabled || iDeviceLockEnabled || iKeyLockOnBeforeCall || iKeyLockOnBeforeAlarm ) |
|
1407 { |
|
1408 iKeyLockOnBeforeCradle = ETrue; |
|
1409 |
|
1410 if ( iKeyLockEnabled && !iDeviceLockEnabled ) |
|
1411 { |
|
1412 iKeyguardController->DisableKeyguard(EFalse); |
|
1413 } |
|
1414 } |
|
1415 } |
|
1416 SetIhfIndicatorL(); |
|
1417 SetHacIndicatorL(); |
|
1418 CleanupStack::PopAndDestroy(2); |
|
1419 } |
|
1420 |
|
1421 |
|
1422 // ---------------------------------------------------------------------------- |
|
1423 // CSysApAppUi::SetHacIndicatorL() |
|
1424 // ---------------------------------------------------------------------------- |
|
1425 void CSysApAppUi::SetHacIndicatorL() |
|
1426 { |
|
1427 |
|
1428 if ( !iSysApCenRepHacSettingObserver ) |
|
1429 { |
|
1430 // Do nothing if HAC setting observer has not been created yet |
|
1431 // This occurs in case some party is trying to set HAC indicator during |
|
1432 // ConstructL(), e.g. when switching from offline to online during startup |
|
1433 TRACES( RDebug::Print( _L("CSysApAppUi::SetHacIndicatorL: do nothing, HAC observer does not exist yet") ) ); |
|
1434 return; |
|
1435 } |
|
1436 |
|
1437 if ( iSysApCenRepHacSettingObserver->HacMode() ) |
|
1438 { |
|
1439 TBool accessoryConnected ( EFalse ); |
|
1440 |
|
1441 TAccMode accMode(EAccModeHandPortable); |
|
1442 |
|
1443 if ( iSysApAccessoryObserver ) |
|
1444 { |
|
1445 accMode = iSysApAccessoryObserver->GetAccessoryMode(); |
|
1446 |
|
1447 if ( accMode != EAccModeHandPortable ) |
|
1448 { |
|
1449 accessoryConnected = ETrue; |
|
1450 } |
|
1451 } |
|
1452 |
|
1453 // TInt indicatorState = EAknIndicatorStateOn; |
|
1454 |
|
1455 if ( !accessoryConnected ) // When accessory is not connected, check offline and call state |
|
1456 { |
|
1457 if ( OfflineModeActive() ) // HAC indicator is not shown in offline mode |
|
1458 { |
|
1459 // indicatorState = EAknIndicatorStateOff; |
|
1460 } |
|
1461 else |
|
1462 { |
|
1463 // during active call with IHF activated HAC indicator is not shown |
|
1464 TInt callState( StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ) ); |
|
1465 if ( callState < KErrNone ) |
|
1466 { |
|
1467 callState = EPSCTsyCallStateNone; |
|
1468 } |
|
1469 |
|
1470 if ( callState != EPSCTsyCallStateNone && IhfEnabledL() ) |
|
1471 { |
|
1472 // indicatorState = EAknIndicatorStateOff; |
|
1473 } |
|
1474 } |
|
1475 |
|
1476 } |
|
1477 else |
|
1478 { |
|
1479 // If an accessory is connected, HAC indicator should not be shown |
|
1480 // indicatorState = EAknIndicatorStateOff; |
|
1481 } |
|
1482 |
|
1483 // SetIndicatorStateL( EAknIndicatorHAC, indicatorState ); |
|
1484 |
|
1485 } |
|
1486 else |
|
1487 { |
|
1488 // If HAC is not active, always disable indicator regardless of accessory state |
|
1489 // SetIndicatorStateL( EAknIndicatorHAC, EAknIndicatorStateOff ); |
|
1490 } |
|
1491 |
|
1492 |
|
1493 } |
|
1494 |
|
1495 |
|
1496 // ---------------------------------------------------------------------------- |
|
1497 // CSysApAppUi::DoNotActivateBt() |
|
1498 // ---------------------------------------------------------------------------- |
|
1499 void CSysApAppUi::DoNotActivateBt() |
|
1500 { |
|
1501 iSysApOfflineModeController->DoNotActivateBt(); |
|
1502 } |
|
1503 |
|
1504 |
|
1505 // ---------------------------------------------------------------------------- |
|
1506 // CSysApAppUi::IhfEnabledL |
|
1507 // ---------------------------------------------------------------------------- |
|
1508 |
|
1509 TBool CSysApAppUi::IhfEnabledL() |
|
1510 { |
|
1511 TRACES( RDebug::Print( _L("CSysApAppUi::IhfEnabledL(): iSysApAudioRoutingObserver=0x%x"), iSysApAudioRoutingObserver ) ); |
|
1512 |
|
1513 if ( !iSysApAudioRoutingObserver ) // create observer if needed |
|
1514 { |
|
1515 iSysApAudioRoutingObserver = CSysApAudioRoutingObserver::NewL( *this ); |
|
1516 } |
|
1517 |
|
1518 return iSysApAudioRoutingObserver->IhfEnabled(); |
|
1519 } |
|
1520 |
|
1521 |
|
1522 // ---------------------------------------------------------------------------- |
|
1523 // CSysApAppUi::SetIhfIndicatorL() |
|
1524 // ---------------------------------------------------------------------------- |
|
1525 void CSysApAppUi::SetIhfIndicatorL() |
|
1526 { |
|
1527 TBool accessoryConnected ( EFalse ); |
|
1528 |
|
1529 TInt callState( StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ) ); |
|
1530 |
|
1531 TAccMode accMode(EAccModeHandPortable); |
|
1532 |
|
1533 if ( iSysApAccessoryObserver ) |
|
1534 { |
|
1535 accMode = iSysApAccessoryObserver->GetAccessoryMode(); |
|
1536 |
|
1537 if ( accMode != EAccModeHandPortable ) |
|
1538 { |
|
1539 accessoryConnected = ETrue; |
|
1540 } |
|
1541 } |
|
1542 |
|
1543 if( (callState != EPSCTsyCallStateNone && IhfEnabledL() && !accessoryConnected) |
|
1544 || accMode == EAccModeMusicStand ) // Music stand always shows IHF indicator |
|
1545 { |
|
1546 if ( accMode == EAccModeMusicStand ) |
|
1547 { |
|
1548 // do nothing |
|
1549 } |
|
1550 } |
|
1551 else |
|
1552 { |
|
1553 // do nothing |
|
1554 } |
|
1555 } |
|
1556 |
|
1557 // ---------------------------------------------------------------------------- |
|
1558 // CSysApAppUi::EjectStarted() |
|
1559 // ---------------------------------------------------------------------------- |
|
1560 |
|
1561 void CSysApAppUi::EjectStarted( TBool ejectStarted ) |
|
1562 { |
|
1563 TRACES( RDebug::Print( _L( "CSysApAppUi::EjectStarted" ) ) ); |
|
1564 iMMCEjectUsed = ejectStarted; |
|
1565 |
|
1566 #ifndef RD_MULTIPLE_DRIVE |
|
1567 iFileManagerCloseDisabled = ejectStarted; |
|
1568 #endif // RD_MULTIPLE_DRIVE |
|
1569 } |
|
1570 |
|
1571 // ---------------------------------------------------------------------------- |
|
1572 // CSysApAppUi::DoLightsTimeoutChangedL |
|
1573 // ---------------------------------------------------------------------------- |
|
1574 void CSysApAppUi::DoLightsTimeoutChangedL( const TInt aTimeout ) |
|
1575 { |
|
1576 iSysApLightsController->DoLightsTimeoutChangedL( aTimeout ); |
|
1577 } |
|
1578 |
|
1579 |
|
1580 // ---------------------------------------------------------------------------- |
|
1581 // CSysApAppUi::DoSwStateNormalConstructionL() |
|
1582 // ---------------------------------------------------------------------------- |
|
1583 |
|
1584 void CSysApAppUi::DoSwStateNormalConstructionL() |
|
1585 { |
|
1586 // Let's ensure that the lights will remain on for 15 secs after sw state normal |
|
1587 User::ResetInactivityTime(); |
|
1588 |
|
1589 TRACES( RDebug::Print( _L("CSysApAppUi::DoSwStateNormalConstructionL : START" ) ) ); |
|
1590 |
|
1591 // In case of unexpected reset (e.g. hidden boot) the keylock must be enabled silently. Locking is done |
|
1592 // prior to time-consuming initializations, because otherwise UI is in unlocked state for a few seconds. |
|
1593 if ( iSysApCenRepController->GetInt( KCRUidCoreApplicationUIsSysAp, KSysApKeyguardActive ) == 1 ) |
|
1594 { |
|
1595 TRACES( RDebug::Print( _L("CSysApAppUi::DoSwStateNormalConstructionL: enabling keylock") ) ); |
|
1596 iKeyguardController->EnableKeyguard(ETrue); |
|
1597 } |
|
1598 |
|
1599 // Initiate bearer change observation |
|
1600 // iSysApConnectionMonitorObserver = CSysApConnectionMonitorObserver::NewL( *this ); |
|
1601 |
|
1602 TRACES( RDebug::Print( _L("SysAp: trying CSystemLock::NewL" ) ) ); |
|
1603 iSysApSystemLock = CSystemLock::NewL(); |
|
1604 |
|
1605 |
|
1606 if ( iSysApFeatureManager->Supported( KSysApFeatureIdBatteryInfoPopup ) ) |
|
1607 { |
|
1608 iSysApBatteryInfoController = CSysApBatteryInfoController::NewL( iSysApCenRepController->GetInt( KCRUidCoreApplicationUIsConf, |
|
1609 KCoreAppUIsBatteryInformationLowThreshold ) ); |
|
1610 } |
|
1611 TRACES( RDebug::Print( _L("CSysApAppUi::DoSwStateNormalConstructionL : END" ) ) ); |
|
1612 } |
|
1613 |
|
1614 |
|
1615 |
|
1616 // ---------------------------------------------------------------------------- |
|
1617 // CSysApAppUi::DoSimChangedFromPreviousBootL() |
|
1618 // ---------------------------------------------------------------------------- |
|
1619 |
|
1620 void CSysApAppUi::DoSimChangedFromPreviousBootL() |
|
1621 { |
|
1622 TRACES( RDebug::Print( _L("CSysApAppUi::DoSimChangedFromPreviousBootL: iSimChangedDone=%d" ), iSimChangedDone ) ); |
|
1623 |
|
1624 if ( !iSimChangedDone ) |
|
1625 { |
|
1626 iSimChangedDone = ETrue; |
|
1627 CSysApSimChanged* simChanged = CSysApSimChanged::NewL( *this, iEikonEnv->FsSession() ); |
|
1628 CleanupStack::PushL( simChanged ); |
|
1629 simChanged->HandleSimChangedL(); |
|
1630 CleanupStack::PopAndDestroy( simChanged ); |
|
1631 } |
|
1632 } |
|
1633 |
|
1634 |
|
1635 // ---------------------------------------------------------------------------- |
|
1636 // CSysApAppUi::IgnoreZeroNetworkBarNotifications |
|
1637 // ---------------------------------------------------------------------------- |
|
1638 // |
|
1639 void CSysApAppUi::IgnoreZeroNetworkBarNotifications(TBool aIgnore) |
|
1640 { |
|
1641 iIgnoreZeroNetworkBarNotifications = aIgnore; |
|
1642 } |
|
1643 |
|
1644 |
|
1645 |
|
1646 // ---------------------------------------------------------------------------- |
|
1647 // CSysApAppUi::SwitchFromOnlineToOfflineModeL() |
|
1648 // ---------------------------------------------------------------------------- |
|
1649 void CSysApAppUi::SwitchFromOnlineToOfflineModeL() |
|
1650 { |
|
1651 iSysApOfflineModeController->SwitchFromOnlineToOfflineModeL(); |
|
1652 } |
|
1653 |
|
1654 |
|
1655 // ---------------------------------------------------------------------------- |
|
1656 // CSysApAppUi::InitCloseSimApplicationsL() |
|
1657 // ---------------------------------------------------------------------------- |
|
1658 void CSysApAppUi::InitCloseSimApplicationsL() |
|
1659 { |
|
1660 iApplicationScanningRoundNumberInBtSap = 0; |
|
1661 iTimeToKillInBtSap = EFalse; |
|
1662 CloseSimApplicationsL(); |
|
1663 } |
|
1664 |
|
1665 |
|
1666 // ---------------------------------------------------------------------------- |
|
1667 // CSysApAppUi::CloseSimApplicationsL() |
|
1668 // ---------------------------------------------------------------------------- |
|
1669 void CSysApAppUi::CloseSimApplicationsL() |
|
1670 { |
|
1671 iApplicationScanningRoundNumberInBtSap++; |
|
1672 TRACES( RDebug::Print( _L("CSysApAppUi::CloseSimApplicationsL: scanning round = %d"), |
|
1673 iApplicationScanningRoundNumberInBtSap ) ); |
|
1674 |
|
1675 if ( iApplicationScanningRoundNumberInBtSap == KMaxExitTimeInBtSap ) |
|
1676 { |
|
1677 iTimeToKillInBtSap = ETrue; |
|
1678 } |
|
1679 |
|
1680 const TInt KNumberOfSimDependantApps( 7 ); |
|
1681 TUid simDependantAppUid[ KNumberOfSimDependantApps ]; |
|
1682 simDependantAppUid[ 0 ] = KSysApGSUid; |
|
1683 simDependantAppUid[ 1 ] = KSysApSATUid; |
|
1684 simDependantAppUid[ 2 ] = KSysApMailboxUid; |
|
1685 simDependantAppUid[ 3 ] = KSysApSpeedDialingUid; |
|
1686 simDependantAppUid[ 4 ] = KSysApSimDirectoryUid; |
|
1687 simDependantAppUid[ 5 ] = KSysApMCEUid; |
|
1688 simDependantAppUid[ 6 ] = KSysApCellBroadcastMessagesUid; |
|
1689 |
|
1690 TBool appsExiting( EFalse ); |
|
1691 TApaTaskList apaTaskList( CCoeEnv::Static()->WsSession() ); |
|
1692 |
|
1693 for ( TInt i = 0; i < KNumberOfSimDependantApps; i++ ) |
|
1694 { |
|
1695 TApaTask apaTask = apaTaskList.FindApp( simDependantAppUid[ i ] ); |
|
1696 if ( apaTask.Exists() ) |
|
1697 { |
|
1698 appsExiting = ETrue; |
|
1699 if ( iApplicationScanningRoundNumberInBtSap == 1 ) |
|
1700 { |
|
1701 apaTask.EndTask(); // applications are kindly requested to close themselves on the first round |
|
1702 } |
|
1703 else if ( iTimeToKillInBtSap ) |
|
1704 { |
|
1705 apaTask.KillTask(); // used after timeout on the last round |
|
1706 } |
|
1707 } |
|
1708 } |
|
1709 |
|
1710 if ( !appsExiting || iTimeToKillInBtSap ) |
|
1711 { |
|
1712 iSysApBtSapController->SimApplicationsClosed(); |
|
1713 } |
|
1714 else |
|
1715 { |
|
1716 if ( !iSapTimer ) |
|
1717 { |
|
1718 iSapTimer = CPeriodic::NewL( EPriorityNormal ); |
|
1719 } |
|
1720 iSapTimer->Cancel(); |
|
1721 iSapTimer->Start( KDelayBeforeNextScanningRound, |
|
1722 KDelayBeforeNextScanningRound, |
|
1723 TCallBack( DoCloseSimApplicationsAfterCallBack, this ) ); |
|
1724 } |
|
1725 } |
|
1726 |
|
1727 |
|
1728 // ---------------------------------------------------------------------------- |
|
1729 // CSysApAppUi::DoCloseSimApplicationsAfterCallBack |
|
1730 // ---------------------------------------------------------------------------- |
|
1731 TInt CSysApAppUi::DoCloseSimApplicationsAfterCallBack( TAny* aObject ) |
|
1732 { |
|
1733 CSysApAppUi* appUi = STATIC_CAST( CSysApAppUi*, aObject ); |
|
1734 |
|
1735 if ( appUi->iSapTimer ) |
|
1736 { |
|
1737 appUi->iSapTimer->Cancel(); |
|
1738 } |
|
1739 |
|
1740 TRAP_IGNORE( appUi->CloseSimApplicationsL() ); |
|
1741 |
|
1742 return KErrNone; |
|
1743 } |
|
1744 |
|
1745 |
|
1746 // ---------------------------------------------------------------------------- |
|
1747 // CSysApAppUi::NotifyPowerSaveModeL |
|
1748 // ---------------------------------------------------------------------------- |
|
1749 // |
|
1750 void CSysApAppUi::NotifyPowerSaveModeL( TSysApPsmStatus aStatus ) |
|
1751 { |
|
1752 TRACES( RDebug::Print( _L("CSysApAppUi::NotifyPowerSaveModeL aStatus: %d"), aStatus ) ); |
|
1753 |
|
1754 // cancel any active power saving query because user has changed the state manually |
|
1755 // CancelQuery( ESysApBattChargingPowerSavingQuery ); |
|
1756 // CancelQuery( ESysApBattLowPowerSavingQuery ); |
|
1757 // will take care in next sub |
|
1758 |
|
1759 switch ( aStatus ) |
|
1760 { |
|
1761 case MSysApPsmControllerNotifyCallback::EPsmActivationComplete: |
|
1762 UpdateBatteryBarsL( StateOfProperty( KPSUidHWRMPowerState, KHWRMBatteryLevel ) ); |
|
1763 iVariantAccState = CHbSymbianVariant::NewL(&KPsm, CHbSymbianVariant::EDes); |
|
1764 if (!iHbIndicatorSymbian->Activate(KPsmPlugin,iVariantAccState)) |
|
1765 { |
|
1766 int error = iHbIndicatorSymbian->Error(); |
|
1767 //use the errorcode... |
|
1768 } |
|
1769 break; |
|
1770 |
|
1771 case MSysApPsmControllerNotifyCallback::EPsmDeactivationComplete: |
|
1772 UpdateBatteryBarsL( StateOfProperty( KPSUidHWRMPowerState, KHWRMBatteryLevel ) ); |
|
1773 if (!iHbIndicatorSymbian->Deactivate(KPsmPlugin)) |
|
1774 { |
|
1775 int error = iHbIndicatorSymbian->Error(); |
|
1776 //use the errorcode... |
|
1777 } |
|
1778 break; |
|
1779 |
|
1780 case MSysApPsmControllerNotifyCallback::EPsmActivationFailed: |
|
1781 ShowUiNoteL( ECannotActivatePowerSaveMode ); |
|
1782 break; |
|
1783 |
|
1784 case MSysApPsmControllerNotifyCallback::EPsmDeactivationFailed: |
|
1785 ShowUiNoteL( ECannotDeactivatePowerSaveMode ); |
|
1786 break; |
|
1787 |
|
1788 default: |
|
1789 break; |
|
1790 } |
|
1791 } |
|
1792 |
|
1793 |
|
1794 // ---------------------------------------------------------------------------- |
|
1795 // CSysApAppUi::ShowAlarmIndicatorL() |
|
1796 // ---------------------------------------------------------------------------- |
|
1797 |
|
1798 void CSysApAppUi::ShowAlarmIndicatorL( TBool aShowIndicator ) |
|
1799 { |
|
1800 if ( aShowIndicator) |
|
1801 { |
|
1802 // do nothing |
|
1803 } |
|
1804 else |
|
1805 { |
|
1806 // do nothing |
|
1807 } |
|
1808 } |
|
1809 |
|
1810 |
|
1811 // ---------------------------------------------------------------------------- |
|
1812 // CSysApAppUi::AlertUiAlertingL( const TBool aAlerting ) |
|
1813 // ---------------------------------------------------------------------------- |
|
1814 void CSysApAppUi::AlertUiAlertingL( const TBool aAlerting ) |
|
1815 { |
|
1816 TRACES( RDebug::Print( _L("CSysApAppUi::AlertUiAlerting aAlerting:%d"), aAlerting ) ); |
|
1817 |
|
1818 if ( aAlerting ) |
|
1819 { |
|
1820 TInt swState; |
|
1821 RProperty::Get( KPSUidStartup, KPSGlobalSystemState, swState ); |
|
1822 |
|
1823 if( swState == ESwStateCharging ) |
|
1824 { |
|
1825 SetStarterState( RStarterSession::EAlarm ); |
|
1826 } |
|
1827 } |
|
1828 |
|
1829 iSysApLightsController->AlarmOccuredL( aAlerting ); |
|
1830 } |
|
1831 |
|
1832 |
|
1833 // ---------------------------------------------------------------------------- |
|
1834 // CSysApAppUi::HandleForcedLightsVTRequireL( const TInt aLightParameter ) |
|
1835 // ---------------------------------------------------------------------------- |
|
1836 |
|
1837 void CSysApAppUi::HandleForcedLightsVTRequireL( const TInt aLightsParameter ) const |
|
1838 { |
|
1839 iSysApLightsController->HandleForcedLightsVTRequireL( aLightsParameter ); |
|
1840 } |
|
1841 |
|
1842 |
|
1843 // ---------------------------------------------------------------------------- |
|
1844 // CSysApAppUi::HandleForcedLightsSSRequireL( const TInt aLightParameter ) |
|
1845 // ---------------------------------------------------------------------------- |
|
1846 |
|
1847 void CSysApAppUi::HandleForcedLightsSSRequireL( const TInt aLightsParameter ) const |
|
1848 { |
|
1849 iSysApLightsController->HandleForcedLightsSSRequireL( aLightsParameter ); |
|
1850 } |
|
1851 |
|
1852 // ---------------------------------------------------------------------------- |
|
1853 // CSysApAppUi::HandleForcedLightsATCRequireL( const TInt aLightParameter ) |
|
1854 // ---------------------------------------------------------------------------- |
|
1855 void CSysApAppUi::HandleForcedLightsATCRequireL( const TInt aLightsParameter ) const |
|
1856 { |
|
1857 iSysApLightsController->HandleForcedLightsATCRequireL( aLightsParameter ); |
|
1858 } |
|
1859 |
|
1860 |
|
1861 // ---------------------------------------------------------------------------- |
|
1862 // CSysApAppUi::HandleLightsRequireL() |
|
1863 // ---------------------------------------------------------------------------- |
|
1864 |
|
1865 void CSysApAppUi::HandleLightsRequireL() const |
|
1866 { |
|
1867 iSysApLightsController->HandleLightsRequireL(); |
|
1868 } |
|
1869 |
|
1870 |
|
1871 // ---------------------------------------------------------------------------- |
|
1872 // CSysApAppUi::HandleRawKeyEventLightsRequireL() |
|
1873 // ---------------------------------------------------------------------------- |
|
1874 |
|
1875 void CSysApAppUi::HandleRawKeyEventLightsRequireL() const |
|
1876 { |
|
1877 iSysApLightsController->HandleRawKeyEventLightsRequireL(); |
|
1878 } |
|
1879 |
|
1880 |
|
1881 // ---------------------------------------------------------------------------- |
|
1882 // CSysApAppUi::AlertUiKeyLockOff( const TBool aKeyLockOff ) |
|
1883 // ---------------------------------------------------------------------------- |
|
1884 |
|
1885 void CSysApAppUi::AlertUiKeyLockOff( const TBool aKeyLockOff ) |
|
1886 { |
|
1887 TRACES( RDebug::Print( _L("CSysApAppUi::AlertUiKeyLockOff aKeyLockOff:%d, devicelock:%d"), |
|
1888 aKeyLockOff, iDeviceLockEnabled ) ); |
|
1889 |
|
1890 if( aKeyLockOff ) |
|
1891 { |
|
1892 // Notification to release keypad might come several times if e.g. calls are received |
|
1893 if ( !iKeyLockOnBeforeAlarm ) |
|
1894 { |
|
1895 if ( iKeyLockEnabled || iKeyLockOnBeforeCradle || iKeyLockOnBeforeCall ) |
|
1896 { |
|
1897 iKeyLockOnBeforeAlarm = ETrue; |
|
1898 } |
|
1899 } |
|
1900 iKeyguardController->DisableKeyguard(EFalse); |
|
1901 } |
|
1902 else |
|
1903 { |
|
1904 if (iDeviceLockEnabled) |
|
1905 { |
|
1906 // Re-enable keylock in devicelock case only if phone call is not ongoing or is |
|
1907 // connected. Otherwise e.g. messages can be read using softkeys during ongoing call. |
|
1908 TInt callState( StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ) ); |
|
1909 if ( callState == EPSCTsyCallStateNone || callState == EPSCTsyCallStateConnected ) |
|
1910 { |
|
1911 iKeyguardController->EnableKeyguard(EFalse); |
|
1912 } |
|
1913 } |
|
1914 else if ( iKeyLockOnBeforeAlarm && !iKeyLockOnBeforeCradle && !iKeyLockOnBeforeCall ) |
|
1915 { |
|
1916 iKeyguardController->EnableKeyguard(ETrue); |
|
1917 } |
|
1918 iKeyLockOnBeforeAlarm = EFalse; |
|
1919 } |
|
1920 } |
|
1921 |
|
1922 |
|
1923 // ---------------------------------------------------------------------------- |
|
1924 // CSysApAppUi::DoNotEnableKeylock() |
|
1925 // ---------------------------------------------------------------------------- |
|
1926 |
|
1927 void CSysApAppUi::DoNotEnableKeylock() |
|
1928 { |
|
1929 if ( !iKeyLockOnBeforeCradle ) |
|
1930 { |
|
1931 iShowkeypadActivatedNoteAfterSoftReject = iKeyLockOnBeforeCall; |
|
1932 } |
|
1933 |
|
1934 iKeyLockOnBeforeCall = EFalse; |
|
1935 } |
|
1936 |
|
1937 |
|
1938 // ---------------------------------------------------------------------------- |
|
1939 // CSysApAppUi::SwitchLightsOnSoftRejectL() |
|
1940 // ---------------------------------------------------------------------------- |
|
1941 void CSysApAppUi::SwitchLightsOnSoftRejectL() |
|
1942 { |
|
1943 iSysApLightsController->SwitchLightsOnSoftRejectL(); |
|
1944 } |
|
1945 |
|
1946 |
|
1947 // ---------------------------------------------------------------------------- |
|
1948 // CSysApAppUi::SetDeviceLockEnabledL( const TBool aLockEnabled ) |
|
1949 // ---------------------------------------------------------------------------- |
|
1950 |
|
1951 void CSysApAppUi::SetDeviceLockEnabledL( const TBool aLockEnabled ) |
|
1952 { |
|
1953 TRACES( RDebug::Print(_L("CSysApAppUi::SetDeviceLockEnabledL aLockEnabled:%d" ), aLockEnabled ) ); |
|
1954 TBool currentState( iDeviceLockEnabled ); |
|
1955 |
|
1956 iDeviceLockEnabled = aLockEnabled; |
|
1957 |
|
1958 if ( currentState != iDeviceLockEnabled ) // filter out unnecessary light status modifications |
|
1959 { |
|
1960 iSysApLightsController->DeviceLockStateChangedL( iDeviceLockEnabled ); |
|
1961 } |
|
1962 |
|
1963 if( iDeviceLockEnabled ) |
|
1964 { |
|
1965 if( iKeyLockEnabled ) |
|
1966 { |
|
1967 iKeyguardController->DisableKeyguard(EFalse); |
|
1968 } |
|
1969 } |
|
1970 else |
|
1971 { |
|
1972 // let's not activate keylock in case device lock was disabled during call or in cradle |
|
1973 iKeyLockOnBeforeCall = EFalse; |
|
1974 iKeyLockOnBeforeCradle = EFalse; |
|
1975 |
|
1976 // Memory card needs to be unlocked when device is unlocked |
|
1977 if ( iSysApFeatureManager->MmcHotSwapSupported() ) |
|
1978 { |
|
1979 RunUnlockNotifierL(); |
|
1980 // Need to handle feature for unlocking the MMC card |
|
1981 } |
|
1982 } |
|
1983 } |
|
1984 |
|
1985 |
|
1986 // ---------------------------------------------------------------------------- |
|
1987 // CSysApAppUi::HandleBatteryStatusL |
|
1988 // ---------------------------------------------------------------------------- |
|
1989 // |
|
1990 void CSysApAppUi::HandleBatteryStatusL( const TInt aValue ) |
|
1991 { |
|
1992 TRACES( RDebug::Print( _L("CSysApAppUi::HandleBatteryStatusL aValue: %d"), aValue ) ); |
|
1993 |
|
1994 TBool enableAutoPsm(EFalse); |
|
1995 CRepository* repository( NULL ); |
|
1996 TRAPD( err, repository = CRepository::NewL( KCRUidDeviceManagementSettings ) ); |
|
1997 |
|
1998 if ( err == KErrNone ) |
|
1999 { |
|
2000 TInt value( 0 ); |
|
2001 err = repository->Get( KSettingsPowerSavingQuery, value ); |
|
2002 |
|
2003 if ( err == KErrNone ) |
|
2004 { |
|
2005 enableAutoPsm = value ? EFalse: ETrue; |
|
2006 } |
|
2007 } |
|
2008 |
|
2009 _LIT(Klowbattery, "txt_power_management_dpopinfo_low_battery"); |
|
2010 // returns the string "low battery" |
|
2011 HBufC* lowBattery = HbTextResolverSymbian::LoadL(Klowbattery); |
|
2012 |
|
2013 |
|
2014 if ( aValue == EBatteryStatusEmpty ) |
|
2015 { |
|
2016 //Display Recharge Battery note |
|
2017 ShowUiNoteL( ERechargeBatteryNote ); |
|
2018 BatteryEmptyL(); |
|
2019 } |
|
2020 else if ( aValue == EBatteryStatusLow ) |
|
2021 { |
|
2022 if ( iSysApPsmController && UiReady() ) |
|
2023 { |
|
2024 iSysApPsmController->BatteryLow( ETrue ); |
|
2025 |
|
2026 |
|
2027 if ( enableAutoPsm) |
|
2028 { |
|
2029 iSysApPsmController->DoEnableFullPsm( ETrue ); |
|
2030 |
|
2031 _LIT(KPsmOn, "txt_power_management_dpopinfo_psm_activated_automa"); |
|
2032 // returns the string "power saving mode on" |
|
2033 HBufC* psmOn = HbTextResolverSymbian::LoadL(KPsmOn); |
|
2034 |
|
2035 _LIT(Kicon, "qgn_indi_battery_ps_activate"); |
|
2036 // returns the power save mode icon |
|
2037 HBufC* psmIcon = HbTextResolverSymbian::LoadL(Kicon); |
|
2038 |
|
2039 CHbDeviceNotificationDialogSymbian::NotificationL(*psmIcon,*psmOn,*lowBattery); |
|
2040 } |
|
2041 else // default low warning note must be shown |
|
2042 { |
|
2043 //Display Battery Low note. |
|
2044 CHbDeviceNotificationDialogSymbian::NotificationL(KlowbatteryIcon,KNullDesC,*lowBattery); |
|
2045 } |
|
2046 } |
|
2047 else |
|
2048 { |
|
2049 //Display Battery Low note. |
|
2050 CHbDeviceNotificationDialogSymbian::NotificationL(KlowbatteryIcon,KNullDesC,*lowBattery); |
|
2051 } |
|
2052 } |
|
2053 |
|
2054 if ( iSysApBatteryInfoController ) |
|
2055 { |
|
2056 iSysApBatteryInfoController->BatteryStatusUpdated( aValue ); |
|
2057 } |
|
2058 |
|
2059 delete repository; |
|
2060 } |
|
2061 |
|
2062 // ---------------------------------------------------------------------------- |
|
2063 // CSysApAppUi::ShowUiNoteL( const TSysApNoteIds aNote ) const |
|
2064 // ---------------------------------------------------------------------------- |
|
2065 |
|
2066 void CSysApAppUi::ShowUiNoteL( const TSysApNoteIds aNote ) const |
|
2067 { |
|
2068 TRACES( RDebug::Print( _L("CSysApAppUi::ShowUiNoteL aNote: %d"), aNote ) ); |
|
2069 |
|
2070 TInt swState( StateOfProperty( KPSUidStartup, KPSGlobalSystemState ) ); |
|
2071 |
|
2072 if( UiReady() || swState == ESwStateSecurityCheck) |
|
2073 { |
|
2074 switch ( aNote ) |
|
2075 { |
|
2076 case EBatteryLowNote: |
|
2077 { |
|
2078 _LIT(KPowerPressKey,"Battery low"); |
|
2079 HBufC* aString = HBufC16::NewLC(100); |
|
2080 TPtrC aStringPointer = aString->Des(); |
|
2081 aStringPointer.Set(KPowerPressKey); |
|
2082 TRACES( RDebug::Print( _L("CSysApWsClient::RunL(): Key EEventKeyUp 01") ) ); |
|
2083 ShowExampleUiNoteL( aStringPointer ); |
|
2084 CleanupStack::PopAndDestroy(); // aString |
|
2085 } |
631 break; |
2086 break; |
632 case EPSLocPrivRejectAll: |
2087 case EBatteryFullNote: |
633 if ( iSysApLocationPrivacyIndicator->iIndicatorIdRejectAll != KSysApNoIndicator ) |
2088 { |
634 { |
2089 _LIT(KPowerPressKey,"Battery full"); |
635 SetIndicatorStateL( iSysApLocationPrivacyIndicator->iIndicatorIdRejectAll, EAknIndicatorStateOn ); |
2090 HBufC* aString = HBufC16::NewLC(100); |
636 } |
2091 TPtrC aStringPointer = aString->Des(); |
|
2092 aStringPointer.Set(KPowerPressKey); |
|
2093 TRACES( RDebug::Print( _L("CSysApWsClient::RunL(): Key EEventKeyUp 01") ) ); |
|
2094 ShowExampleUiNoteL( aStringPointer ); |
|
2095 CleanupStack::PopAndDestroy(); // aString |
|
2096 } |
637 break; |
2097 break; |
638 case EPSLocPrivAlwaysAsk: |
2098 case ERechargeBatteryNote: |
639 if ( iSysApLocationPrivacyIndicator->iIndicatorIdAlwaysAsk != KSysApNoIndicator ) |
2099 { |
640 { |
2100 iSysApLightsController->BatteryEmptyL( ETrue ); |
641 SetIndicatorStateL( iSysApLocationPrivacyIndicator->iIndicatorIdAlwaysAsk, EAknIndicatorStateOn ); |
2101 _LIT(KPowerPressKey,"Battery empty. Recharge"); |
642 } |
2102 HBufC* aString = HBufC16::NewLC(100); |
|
2103 TPtrC aStringPointer = aString->Des(); |
|
2104 aStringPointer.Set(KPowerPressKey); |
|
2105 TRACES( RDebug::Print( _L("CSysApWsClient::RunL(): Key EEventKeyUp 01") ) ); |
|
2106 ShowExampleUiNoteL( aStringPointer ); |
|
2107 CleanupStack::PopAndDestroy(); // aString |
|
2108 } |
643 break; |
2109 break; |
644 case EPSLocPrivIndividualPrivacy: |
2110 case ENotChargingNote: |
645 if ( iSysApLocationPrivacyIndicator->iIndicatorIdIndividualPrivacy != KSysApNoIndicator ) |
2111 { |
646 { |
2112 _LIT(KPowerPressKey,"Not charging"); |
647 SetIndicatorStateL( iSysApLocationPrivacyIndicator->iIndicatorIdIndividualPrivacy, EAknIndicatorStateOn ); |
2113 HBufC* aString = HBufC16::NewLC(100); |
648 } |
2114 TPtrC aStringPointer = aString->Des(); |
|
2115 aStringPointer.Set(KPowerPressKey); |
|
2116 TRACES( RDebug::Print( _L("CSysApWsClient::RunL(): Key EEventKeyUp 01") ) ); |
|
2117 ShowExampleUiNoteL( aStringPointer ); |
|
2118 CleanupStack::PopAndDestroy(); // aString |
|
2119 } |
|
2120 break; |
|
2121 case EBatteryFullUnplugChargerNote: |
|
2122 { |
|
2123 TRACES( RDebug::Print( _L("CSysApWsClient::RunL(): Key EEventKeyUp 01") ) ); |
|
2124 iSysApLightsController->BatteryEmptyL( ETrue ); |
|
2125 _LIT(KunplugCharger,"txt_power_dpopinfo_unplug_charger_to_save_energy"); |
|
2126 HBufC* unplugCharger = HbTextResolverSymbian::LoadL(KunplugCharger); |
|
2127 _LIT(KbatteryFull,"txt_power_management_dpophead_100_full"); |
|
2128 HBufC* batteryFull = HbTextResolverSymbian::LoadL(KbatteryFull); |
|
2129 CHbDeviceNotificationDialogSymbian::NotificationL(KbatteryFullIcon,*unplugCharger,*batteryFull); |
|
2130 } |
|
2131 break; |
|
2132 case EUnplugChargerNote: |
|
2133 { |
|
2134 _LIT(KPowerPressKey,"Unplug charger from power supply to save energy"); |
|
2135 HBufC* aString = HBufC16::NewLC(250); |
|
2136 TPtrC aStringPointer = aString->Des(); |
|
2137 aStringPointer.Set(KPowerPressKey); |
|
2138 TRACES( RDebug::Print( _L("CSysApWsClient::RunL(): Key EEventKeyUp 01") ) ); |
|
2139 ShowExampleUiNoteL( aStringPointer ); |
|
2140 CleanupStack::PopAndDestroy(); // aString |
|
2141 } |
649 break; |
2142 break; |
650 default: |
2143 default: |
651 break; |
2144 break; |
652 } |
2145 } |
653 } |
2146 } |
654 } |
2147 } |
655 |
2148 |
656 |
2149 |
657 // ---------------------------------------------------------------------------- |
2150 // ---------------------------------------------------------------------------- |
|
2151 // CSysApAppUi::BatteryEmptyL() |
|
2152 // ---------------------------------------------------------------------------- |
|
2153 |
|
2154 void CSysApAppUi::BatteryEmptyL() |
|
2155 { |
|
2156 iSysApLightsController->BatteryEmptyL( ETrue ); |
|
2157 // Do not reactivate keyguard in the next startup |
|
2158 iSysApCenRepController->SetInt( KCRUidCoreApplicationUIsSysAp, KSysApKeyguardActive, 0 ); |
|
2159 } |
|
2160 |
|
2161 |
|
2162 // ---------------------------------------------------------------------------- |
|
2163 // CSysApAppUi::ShowQueryL() |
|
2164 // ---------------------------------------------------------------------------- |
|
2165 |
|
2166 void CSysApAppUi::ShowQueryL( const TSysApConfirmationQueryIds /* aQueryId */, const TDesC& /* aValue */) |
|
2167 { |
|
2168 // do nothing |
|
2169 } |
|
2170 |
|
2171 |
|
2172 |
|
2173 // ---------------------------------------------------------------------------- |
|
2174 // CSysApAppUi::HandleChargingStatusL |
|
2175 // ---------------------------------------------------------------------------- |
|
2176 // |
|
2177 void CSysApAppUi::HandleChargingStatusL( const TInt aValue ) |
|
2178 { |
|
2179 TRACES( RDebug::Print( _L("CSysApAppUi::HandleChargingStatusL aValue: %d"), aValue ) ); |
|
2180 |
|
2181 TBool showNote( ETrue ); |
|
2182 |
|
2183 UpdateBatteryBarsL( StateOfProperty( KPSUidHWRMPowerState, KHWRMBatteryLevel ) ); |
|
2184 |
|
2185 if ( iSysApPsmController && UiReady() ) |
|
2186 { |
|
2187 if ( iCharging && !iSysApPsmController->ChargerConnected() ) // first time after charger connection |
|
2188 { |
|
2189 iSysApPsmController->ConnectCharger( ETrue ); |
|
2190 iSysApPsmController->DoEnableFullPsm(EFalse); |
|
2191 iVariantAccState = CHbSymbianVariant::NewL(&KCharging, CHbSymbianVariant::EDes); |
|
2192 |
|
2193 if (!iHbIndicatorSymbian->Activate(KPsmPlugin,iVariantAccState)) |
|
2194 { |
|
2195 int error = iHbIndicatorSymbian->Error(); |
|
2196 //use the errorcode... |
|
2197 } |
|
2198 |
|
2199 |
|
2200 } |
|
2201 else if ( aValue == EChargingStatusNotConnected ) |
|
2202 { |
|
2203 iSysApPsmController->ConnectCharger( EFalse ); |
|
2204 if (!iHbIndicatorSymbian->Deactivate(KPsmPlugin)) |
|
2205 { |
|
2206 int error = iHbIndicatorSymbian->Error(); |
|
2207 //use the errorcode... |
|
2208 } |
|
2209 } |
|
2210 } |
|
2211 if( showNote ) |
|
2212 { |
|
2213 HandleChargerNotesL( aValue ); |
|
2214 } |
|
2215 } |
|
2216 |
|
2217 |
|
2218 // ---------------------------------------------------------------------------- |
|
2219 // CSysApAppUi::HandleChargerNotesL() |
|
2220 // ---------------------------------------------------------------------------- |
|
2221 void CSysApAppUi::HandleChargerNotesL( const TInt aValue ) |
|
2222 { |
|
2223 TBool showNote(StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ) != EPSCTsyCallStateRinging); |
|
2224 if ( aValue == EChargingStatusCharging ) |
|
2225 { |
|
2226 iSysApLightsController->BatteryEmptyL( EFalse ); |
|
2227 TRACES( RDebug::Print( _L("SysAp: charger connected") ) ); |
|
2228 iSysApLightsController->ChargerConnectedL( ETrue ); |
|
2229 ShowChargingNoteL(); |
|
2230 } |
|
2231 //Display Not Charging note |
|
2232 else if ( aValue == EChargingStatusError ) |
|
2233 { |
|
2234 if(showNote) |
|
2235 { |
|
2236 ShowUiNoteL( ENotChargingNote ); |
|
2237 } |
|
2238 } |
|
2239 else if ( aValue == EChargingStatusChargingComplete ) |
|
2240 { |
|
2241 iSysApLightsController->ChargingCompleteL(); |
|
2242 |
|
2243 TSysApNoteIds note( EBatteryFullNote ); |
|
2244 |
|
2245 if ( !iSysApUsbChargerDetector.HostOnlyUsbChargingUsed() && |
|
2246 iSysApFeatureManager->Supported( KSysApFeatureIdChargerReminderNotes ) ) |
|
2247 { |
|
2248 note = EBatteryFullUnplugChargerNote; |
|
2249 } |
|
2250 iSysApUsbChargerDetector.Reset(); |
|
2251 if(showNote) |
|
2252 { |
|
2253 ShowUiNoteL( note ); |
|
2254 } |
|
2255 } |
|
2256 else if ( aValue == EChargingStatusNotConnected ) |
|
2257 { |
|
2258 TRACES( RDebug::Print( _L("SysAp: charger removed") ) ); |
|
2259 iSysApLightsController->ChargerConnectedL( EFalse ); |
|
2260 |
|
2261 if ( !iSysApUsbChargerDetector.HostOnlyUsbChargingUsed() && |
|
2262 iSysApFeatureManager->Supported( KSysApFeatureIdChargerReminderNotes ) ) |
|
2263 { |
|
2264 if(showNote) |
|
2265 { |
|
2266 ShowUiNoteL( EUnplugChargerNote ); |
|
2267 } |
|
2268 } |
|
2269 iSysApUsbChargerDetector.Reset(); |
|
2270 } |
|
2271 else if ( aValue == EChargingStatusNotCharging ) |
|
2272 { |
|
2273 TRACES( RDebug::Print( _L("SysAp: Not charging") ) ); |
|
2274 } |
|
2275 else if ( aValue == EChargingStatusAlmostComplete ) |
|
2276 { |
|
2277 TRACES( RDebug::Print( _L("SysAp: Charging almost complete") ) ); |
|
2278 } |
|
2279 else if ( aValue == EChargingStatusChargingContinued ) |
|
2280 { |
|
2281 //in this case we simply want to scroll the battery bars and not turn light on or show ui note |
|
2282 // set lights controller iBatteryEmpty to EFalse |
|
2283 iSysApLightsController->BatteryEmptyL( EFalse ); |
|
2284 TRACES( RDebug::Print( _L("SysAp: charging continues") ) ); |
|
2285 } |
|
2286 } |
|
2287 |
|
2288 |
|
2289 // ---------------------------------------------------------------------------- |
|
2290 // CSysApAppUi::UpdateBatteryBarsL( const TInt aState ) |
|
2291 // ---------------------------------------------------------------------------- |
|
2292 |
|
2293 void CSysApAppUi::UpdateBatteryBarsL( const TInt /* aState */) |
|
2294 { |
|
2295 TInt state( StateOfProperty( KPSUidHWRMPowerState, KHWRMChargingStatus ) ); |
|
2296 // TRACES( RDebug::Print( _L("CSysApAppUi::UpdateBatteryBarsL aState: %d, chargerState:%d"), aState, state ) ); |
|
2297 HandleUsbCharger( state ); |
|
2298 if( state == EChargingStatusCharging || |
|
2299 state == EChargingStatusChargingContinued || |
|
2300 state == EChargingStatusAlmostComplete ) |
|
2301 { |
|
2302 if ( !iCharging ) |
|
2303 { |
|
2304 TRACES( RDebug::Print( _L("CSysApAppUi::UpdateBatteryBarsL: Starting Charging") ) ); |
|
2305 iCharging = ETrue; |
|
2306 } |
|
2307 } |
|
2308 else |
|
2309 { |
|
2310 if ( iCharging ) |
|
2311 { |
|
2312 TRACES( RDebug::Print( _L("CSysApAppUi::UpdateBatteryBarsL: Stopping Charging") ) ); |
|
2313 iCharging = EFalse; |
|
2314 } |
|
2315 } |
|
2316 |
|
2317 if ( !iSysApPsmController ) // created here if first state change has not occurred yet |
|
2318 { |
|
2319 iSysApPsmController = CSysApPsmController::NewL( *this ); |
|
2320 } |
|
2321 |
|
2322 if ( iSysApPsmController ) |
|
2323 { |
|
2324 if ( iSysApPsmController->FullPsmEnabled() ) |
|
2325 { |
|
2326 // activate psm indicator |
|
2327 } |
|
2328 else |
|
2329 { |
|
2330 // deactivate psm indicator |
|
2331 } |
|
2332 } |
|
2333 |
|
2334 if ( iSysApBatteryInfoController ) |
|
2335 { |
|
2336 iSysApBatteryInfoController->BatteryLevelUpdatedL(); |
|
2337 } |
|
2338 |
|
2339 } |
|
2340 |
|
2341 |
|
2342 |
|
2343 // ---------------------------------------------------------------------------- |
|
2344 // CSysApAppUi::ShowChargingNoteL() |
|
2345 // ---------------------------------------------------------------------------- |
|
2346 |
|
2347 void CSysApAppUi::ShowChargingNoteL() |
|
2348 { |
|
2349 TRACES( RDebug::Print( _L("CSysApAppUi::ShowChargingNoteL") ) ); |
|
2350 TBool showNote( ETrue ); |
|
2351 |
|
2352 TInt swState( StateOfProperty( KPSUidStartup, KPSGlobalSystemState ) ); |
|
2353 TRACES( RDebug::Print( _L("CSysApAppUi::ShowChargingNoteL: swState: %d"), swState ) ); |
|
2354 |
|
2355 if( UiReady() || swState == ESwStateSecurityCheck ) |
|
2356 { |
|
2357 if ( StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ) == EPSCTsyCallStateRinging ) |
|
2358 { |
|
2359 showNote = EFalse; |
|
2360 } |
|
2361 TRACES( RDebug::Print( _L("CSysApAppUi::ShowChargingNoteL KCTsyCallState=%d"), StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ) ) ); |
|
2362 if ( showNote ) // Power Mgmt UI spec defines that no Charging note is shown while the phone is ringing/alerting |
|
2363 { |
|
2364 TRACES( RDebug::Print( _L("CSysApWsClient::RunL(): Key EEventKeyUp 01") ) ); |
|
2365 _LIT(KChargingNote,"txt_power_management_dblist_charging"); |
|
2366 HBufC* chargingNote = HbTextResolverSymbian::LoadL(KChargingNote); |
|
2367 CHbDeviceNotificationDialogSymbian::NotificationL(KNullDesC,*chargingNote); |
|
2368 |
|
2369 } |
|
2370 } |
|
2371 } |
|
2372 |
|
2373 |
|
2374 // ---------------------------------------------------------------------------- |
|
2375 // CSysApAppUi::HandleUsbCharger |
|
2376 // ---------------------------------------------------------------------------- |
|
2377 // |
|
2378 void CSysApAppUi::HandleUsbCharger( const TInt aValue ) |
|
2379 { |
|
2380 if ( aValue == EChargingStatusCharging || |
|
2381 aValue == EChargingStatusChargingContinued || |
|
2382 aValue == EChargingStatusAlmostComplete ) |
|
2383 { |
|
2384 iSysApUsbChargerDetector.SetChargingUsed( ETrue ); |
|
2385 if ( !iSysApUsbIndicatorController && |
|
2386 iSysApFeatureManager->Supported( KSysApFeatureIdChargerReminderNotes ) && |
|
2387 iSysApFeatureManager->Supported( KSysApFeatureIdUsbChargingWithoutReminderNotes ) ) |
|
2388 { |
|
2389 // Start observing USB state for the reminder note |
|
2390 TRAPD ( usbErr, iSysApUsbIndicatorController = CreateSysApUsbIndicatorL( *this ) ); |
|
2391 if ( usbErr ) |
|
2392 { |
|
2393 TRACES( RDebug::Print( |
|
2394 _L("CSysApAppUi::HandleUsbCharger: error in constructing USB ind. controller %d" ), |
|
2395 usbErr ) ); |
|
2396 } |
|
2397 } |
|
2398 } |
|
2399 } |
|
2400 |
|
2401 // ---------------------------------------------------------------------------- |
|
2402 // CSysApAppUi::HandleCurrentCallStateChangeL() |
|
2403 // ---------------------------------------------------------------------------- |
|
2404 |
|
2405 void CSysApAppUi::HandleCurrentCallStateChangeL( TInt aCurrentCallState ) |
|
2406 { |
|
2407 TRACES( RDebug::Print( _L("CSysApAppUi::HandleCurrentCallStateChangeL: KUidCurrentCall: %d" ), aCurrentCallState ) ); |
|
2408 |
|
2409 switch ( aCurrentCallState ) |
|
2410 { |
|
2411 case EPSCTsyCallStateRinging: |
|
2412 { |
|
2413 iSysApLightsController->CallComingInL( ETrue ); |
|
2414 // Disable keylock when a call is coming in |
|
2415 if ( iKeyLockEnabled || iDeviceLockEnabled || iKeyLockOnBeforeCradle || iKeyLockOnBeforeAlarm ) |
|
2416 { |
|
2417 TRACES( RDebug::Print( _L("CSysApAppUi::HandleCurrentCallStateChangeL: EPSCTsyCallStateRinging: disable keylock") ) ); |
|
2418 iKeyLockOnBeforeCall = ETrue; |
|
2419 |
|
2420 if ( iKeyLockEnabled || iDeviceLockEnabled ) |
|
2421 { |
|
2422 if ( !iSysApFeatureManager->TouchUnlockStrokeSupported() ) |
|
2423 { |
|
2424 iKeyguardController->DisableKeyguard(EFalse); |
|
2425 } |
|
2426 } |
|
2427 } |
|
2428 break; |
|
2429 } |
|
2430 |
|
2431 case EPSCTsyCallStateDialling: |
|
2432 { |
|
2433 // Disable keypad lock during an emergency call |
|
2434 // no need to disable the key lock when a call is made using the wireless car-kit |
|
2435 // but if the call is an emergency one then we will disable the keypad lock |
|
2436 if ( iKeyLockEnabled || iDeviceLockEnabled || iKeyLockOnBeforeCradle ) |
|
2437 { |
|
2438 TRACES( RDebug::Print( _L("CSysApAppUi::HandleCurrentCallStateChangeL: EPSCTsyCallStateDialling: disable keylock") ) ); |
|
2439 iKeyLockOnBeforeCall = ETrue; |
|
2440 |
|
2441 if ( IsEmergencyCall() && (iKeyLockEnabled || iDeviceLockEnabled )) |
|
2442 { |
|
2443 iKeyguardController->DisableKeyguard(EFalse); |
|
2444 } |
|
2445 } |
|
2446 |
|
2447 // Enable signal & network indicators when an emergency call is made in Offline Mode |
|
2448 if( iSysApOfflineModeController->OfflineModeActive() ) |
|
2449 { |
|
2450 // Signal indicators not updated with VoIP call |
|
2451 if ( StateOfProperty(KPSUidCtsyCallInformation, KCTsyCallType) != EPSCTsyCallTypeVoIP) |
|
2452 { |
|
2453 iEmergencyCallActive = ETrue; |
|
2454 // not supporting this |
|
2455 // UpdateSignalBarsL(); |
|
2456 // SetSignalIndicatorL(); |
|
2457 } |
|
2458 } |
|
2459 break; |
|
2460 } |
|
2461 |
|
2462 case EPSCTsyCallStateConnected: |
|
2463 { |
|
2464 if (StateOfProperty(KPSUidCtsyCallInformation, KCTsyCallType) == EPSCTsyCallTypeCSVoice) |
|
2465 { |
|
2466 // Check if GPRS suspended note is required |
|
2467 iCallActivated = ETrue; |
|
2468 // not supporting this |
|
2469 // HandleGprsNotesL(); |
|
2470 } |
|
2471 if ( iDeviceLockEnabled ) |
|
2472 { |
|
2473 // Enable keylock via autolock emulation if device lock enabled. |
|
2474 // Otherwise e.g. messages can be read using softkeys during ongoing call. |
|
2475 iKeyguardController->EnableKeyguard(EFalse); |
|
2476 } |
|
2477 break; |
|
2478 } |
|
2479 |
|
2480 case EPSCTsyCallStateNone: |
|
2481 { |
|
2482 // Reset timers in ScreenSaver and Autolock |
|
2483 User::ResetInactivityTime(); |
|
2484 |
|
2485 if ( iEmergencyCallActive ) |
|
2486 { |
|
2487 iEmergencyCallActive = EFalse; |
|
2488 // not supporting this |
|
2489 // UpdateSignalBarsL( 0 ); |
|
2490 // SetSignalIndicatorL(); |
|
2491 } |
|
2492 if ( iKeyLockOnBeforeCall ) |
|
2493 { |
|
2494 TRACES( RDebug::Print( _L("CSysApAppUi::HandleCurrentCallStateChangeL: EPSCTsyCallStateNone: enable keylock") ) ); |
|
2495 iKeyLockOnBeforeCall = EFalse; |
|
2496 if ( !iDeviceLockEnabled ) |
|
2497 { |
|
2498 if ( !iKeyLockOnBeforeCradle && !iKeyLockOnBeforeAlarm && |
|
2499 !iSysApFeatureManager->TouchUnlockStrokeSupported() ) |
|
2500 { |
|
2501 if ( iSysApCenRepController->GetInt( KCRUidCommonTelephonySettings, KSettingsSummaryAfterCall ) == 1 ) |
|
2502 { |
|
2503 // Let's not hide "Summary After Call" dialog |
|
2504 iKeyguardController->EnableKeyguard(EFalse); |
|
2505 } |
|
2506 else |
|
2507 { |
|
2508 iKeyguardController->EnableKeyguard(ETrue); |
|
2509 } |
|
2510 } |
|
2511 } |
|
2512 else |
|
2513 { |
|
2514 iKeyguardController->EnableKeyguard(EFalse); |
|
2515 } |
|
2516 } |
|
2517 if ( iShowkeypadActivatedNoteAfterSoftReject ) |
|
2518 { |
|
2519 ShowUiNoteL( EKeypadActiveNote ); |
|
2520 iShowkeypadActivatedNoteAfterSoftReject = EFalse; |
|
2521 } |
|
2522 iCallActivated = EFalse; |
|
2523 break; |
|
2524 } |
|
2525 |
|
2526 default: |
|
2527 break; |
|
2528 } |
|
2529 |
|
2530 if ( aCurrentCallState != EPSCTsyCallStateRinging ) |
|
2531 { |
|
2532 iSysApLightsController->CallComingInL( EFalse ); |
|
2533 } |
|
2534 |
|
2535 SetIhfIndicatorL(); |
|
2536 SetHacIndicatorL(); |
|
2537 } |
|
2538 |
|
2539 |
|
2540 |
|
2541 /** |
|
2542 * To check the for an emergency call. |
|
2543 * |
|
2544 * @return ETrue if there is an emergency call active otherwise, EFalse. |
|
2545 */ |
|
2546 TBool CSysApAppUi::IsEmergencyCall() |
|
2547 { |
|
2548 TBool retVal( EFalse ); |
|
2549 TInt err( KErrNone ); |
|
2550 TInt state( 0 ); |
|
2551 |
|
2552 err = RProperty::Get(KPSUidCtsyEmergencyCallInfo, KCTSYEmergencyCallInfo, state ); |
|
2553 if ( err == KErrNone && state ) |
|
2554 { |
|
2555 retVal = ETrue; |
|
2556 } |
|
2557 return retVal; |
|
2558 } |
|
2559 |
|
2560 |
|
2561 |
|
2562 // ---------------------------------------------------------------------------- |
|
2563 // CSysApAppUi::IsStateNormal() |
|
2564 // |
|
2565 // ---------------------------------------------------------------------------- |
|
2566 TBool CSysApAppUi::IsStateNormal() const |
|
2567 { |
|
2568 TInt state; |
|
2569 TInt errorCode = |
|
2570 RProperty::Get( KPSUidStartup, KPSGlobalSystemState, state ); |
|
2571 if ( errorCode == KErrNone ) |
|
2572 { |
|
2573 return state == ESwStateNormalRfOn || |
|
2574 state == ESwStateNormalRfOff || |
|
2575 state == ESwStateNormalBTSap; |
|
2576 } |
|
2577 else |
|
2578 { |
|
2579 TRACES( RDebug::Print( _L( "CSysApAppUi::IsStateNormal: Failed to read global system state, error code %d." ), errorCode ) ); |
|
2580 return EFalse; |
|
2581 } |
|
2582 } |
|
2583 |
|
2584 |
|
2585 // ---------------------------------------------------------------------------- |
|
2586 // CSysApAppUi::HandleAccessoryProfileInStartupL() |
|
2587 // ---------------------------------------------------------------------------- |
|
2588 |
|
2589 void CSysApAppUi::HandleAccessoryProfileInStartupL() |
|
2590 { |
|
2591 TRACES( RDebug::Print( _L( "CSysApAppUi::HandleAccessoryProfileInStartupL" ) ) ); |
|
2592 |
|
2593 if ( !iSysApOfflineModeController->OfflineModeActive() ) |
|
2594 { |
|
2595 iIgnoreAccessorySpecificProfileChanges = EFalse; |
|
2596 TBool accessoryConnectedInShutdown( EFalse ); |
|
2597 TInt accessoryTemp( iSysApCenRepController->GetInt( KCRUidCoreApplicationUIsSysAp, KSysApAccessoryConnected ) ); |
|
2598 if ( accessoryTemp == 1 ) |
|
2599 { |
|
2600 accessoryConnectedInShutdown = ETrue; |
|
2601 } |
|
2602 |
|
2603 TBool accessoryConnectedNow ( EFalse ); |
|
2604 |
|
2605 TAccMode accessoryState(EAccModeHandPortable); |
|
2606 TInt physicalConnectionType = 0; |
|
2607 if ( iSysApAccessoryObserver ) |
|
2608 { |
|
2609 accessoryState = iSysApAccessoryObserver->GetAccessoryMode(); |
|
2610 physicalConnectionType = iSysApAccessoryObserver->GetAccessoryConnectionType(); |
|
2611 } |
|
2612 |
|
2613 if ( accessoryState != EAccModeHandPortable ) |
|
2614 { |
|
2615 accessoryConnectedNow = ETrue; |
|
2616 } |
|
2617 TRACES( RDebug::Print( _L( "CSysApAppUi::HandleAccessoryProfileInStartupL: accessoryConnectedInShutdown: %d, accessoryConnectedNow: %d" ), |
|
2618 accessoryConnectedInShutdown, accessoryConnectedNow ) ); |
|
2619 |
|
2620 if ( accessoryConnectedInShutdown && !accessoryConnectedNow ) |
|
2621 { |
|
2622 HandleAccessoryDisconnectedL(); |
|
2623 } |
|
2624 else if ( !accessoryConnectedInShutdown && accessoryConnectedNow ) |
|
2625 { |
|
2626 HandleAccessoryConnectedL( accessoryState, physicalConnectionType ); |
|
2627 } |
|
2628 else if ( !accessoryConnectedNow ) |
|
2629 { |
|
2630 // not supporting this |
|
2631 // TInt activeProfile ( ActiveProfileId() ); |
|
2632 // SysApCenRepController->SetInt( KCRUidCoreApplicationUIsSysAp, KSysApActiveProfileBeforeAccessoryConnected, activeProfile ); |
|
2633 } |
|
2634 } |
|
2635 } |
|
2636 |
|
2637 |
|
2638 // ---------------------------------------------------------------------------- |
|
2639 // CSysApAppUi::CenRepController() |
|
2640 // ---------------------------------------------------------------------------- |
|
2641 |
|
2642 CSysApCenRepController& CSysApAppUi::CenRepController() |
|
2643 { |
|
2644 __ASSERT_ALWAYS( iSysApCenRepController, User::Panic( _L("CSysApAppUi::CenRepController"), KErrBadHandle ) ); |
|
2645 |
|
2646 return *iSysApCenRepController; |
|
2647 } |
|
2648 |
|
2649 |
|
2650 // ---------------------------------------------------------------------------- |
|
2651 // CSysApAppUi::LogsObserverL |
|
2652 // ---------------------------------------------------------------------------- |
|
2653 // |
|
2654 CSysApCenRepLogsObserver& CSysApAppUi::LogsObserverL() |
|
2655 { |
|
2656 TRACES( RDebug::Print( _L("CSysApAppUi::LogsObserverL()") ) ); |
|
2657 |
|
2658 // Create Logs observer when it is needed for the first time |
|
2659 if ( !iSysApCenRepLogsObserver ) |
|
2660 { |
|
2661 iSysApCenRepLogsObserver = CSysApCenRepLogsObserver::NewL( *this ); |
|
2662 } |
|
2663 |
|
2664 return *iSysApCenRepLogsObserver; |
|
2665 } |
|
2666 |
|
2667 |
|
2668 // ---------------------------------------------------------------------------- |
|
2669 // CSysApAppUi::HandleWlanIndicator() |
|
2670 // ---------------------------------------------------------------------------- |
|
2671 void CSysApAppUi::HandleWlanIndicatorL( TInt aValue ) |
|
2672 { |
|
2673 if ( aValue == EPSWlanIndicatorAvailable ) |
|
2674 { |
|
2675 // do nothing |
|
2676 } |
|
2677 else if ( aValue == EPSWlanIndicatorActive ) |
|
2678 { |
|
2679 // do nothing |
|
2680 } |
|
2681 else if ( aValue == EPSWlanIndicatorActiveSecure ) |
|
2682 { |
|
2683 // do nothing |
|
2684 } |
|
2685 else // No indication required |
|
2686 { |
|
2687 // do nothing |
|
2688 } |
|
2689 } |
|
2690 |
|
2691 void CSysApAppUi::ShowNotificationDialog(const TDesC& noteText)const |
|
2692 { |
|
2693 //Todo:4.Notification--Just Popup message |
|
2694 //Todo: #include <HbDeviceNotificationDialogSymbian.h> |
|
2695 CHbDeviceNotificationDialogSymbian *notificationDialog = CHbDeviceNotificationDialogSymbian::NewL(); |
|
2696 CleanupStack::PushL(notificationDialog); |
|
2697 notificationDialog->SetTextL(noteText);//noteText with Qm file input |
|
2698 notificationDialog->SetTimeout(100); |
|
2699 notificationDialog->ShowL(); |
|
2700 CleanupStack::PopAndDestroy(notificationDialog); |
|
2701 } |
|
2702 |
|
2703 void CSysApAppUi::SetKeyLockEnabledL() |
|
2704 { |
|
2705 iKeyLockEnabled = ETrue; |
|
2706 iSysApCenRepController->SetInt( KCRUidCoreApplicationUIsSysAp, KSysApKeyguardActive, 1 ); |
|
2707 // not supporting indicator |
|
2708 // SetIndicatorStateL( EAknIndicatorKeyguard, EAknIndicatorStateOn ); |
|
2709 iSysApLightsController->KeylockStateChangedL( ETrue ); |
|
2710 } |
|
2711 |
|
2712 void CSysApAppUi::SetKeyLockDisabledL() |
|
2713 { |
|
2714 iKeyLockEnabled = EFalse; |
|
2715 iSysApCenRepController->SetInt( KCRUidCoreApplicationUIsSysAp, KSysApKeyguardActive, 0 ); |
|
2716 // SetIndicatorStateL( EAknIndicatorKeyguard, EAknIndicatorStateOff ); |
|
2717 if (! iDeviceLockEnabled ) |
|
2718 { |
|
2719 iSysApLightsController->KeylockStateChangedL( EFalse ); |
|
2720 if ( iSysApFeatureManager->MmcHotSwapSupported() ) |
|
2721 { |
|
2722 if ( StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ) != EPSCTsyCallStateRinging && StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ) != EPSCTsyCallStateAlerting ) |
|
2723 { |
|
2724 RunUnlockNotifierL(); |
|
2725 // need to handle MMC unlock query in next sub |
|
2726 } |
|
2727 } |
|
2728 } |
|
2729 } |
|
2730 |
|
2731 void CSysApAppUi::SetLightsOnUnlockNoteL() |
|
2732 { |
|
2733 iSysApLightsController->SetLightsOnUnlockNoteL(); |
|
2734 } |
|
2735 |
|
2736 void CSysApAppUi::SetLightsOnEcsQueryL() |
|
2737 { |
|
2738 iSysApLightsController->SetLightsOnEcsQueryL(); |
|
2739 } |
|
2740 |
|
2741 void CSysApAppUi::SetLightsOnSecurityQueryL() |
|
2742 { |
|
2743 iSysApLightsController->SetLightsOnSecurityQueryL(); |
|
2744 } |
|
2745 |
|
2746 TBool CSysApAppUi::CheckLongPowerKeyPressed() |
|
2747 { |
|
2748 return iCheckLongPowerKeyEvent; |
|
2749 } |
|
2750 |
|
2751 |
|
2752 // ---------------------------------------------------------------------------- |
658 // CSysApAppUi::HandleKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType ) |
2753 // CSysApAppUi::HandleKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType ) |
659 // ---------------------------------------------------------------------------- |
2754 // ---------------------------------------------------------------------------- |
660 |
2755 |
661 TKeyResponse CSysApAppUi::HandleKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType ) |
2756 TKeyResponse CSysApAppUi::HandleKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType ) |
662 { |
2757 { |
849 { |
2886 { |
850 TRACES( RDebug::Print( _L("CSysApAppUi::HandleCommandL aCommend: %d"), aCommand ) ); |
2887 TRACES( RDebug::Print( _L("CSysApAppUi::HandleCommandL aCommend: %d"), aCommand ) ); |
851 switch ( aCommand ) |
2888 switch ( aCommand ) |
852 { |
2889 { |
853 case EEikCmdExit: // EAknCmdExit |
2890 case EEikCmdExit: // EAknCmdExit |
854 // Quick fix for Defect: UTUL-7ZQLJU |
|
855 Exit(); |
2891 Exit(); |
856 break; |
2892 break; |
857 default: |
2893 default: |
858 break; |
2894 break; |
859 } |
2895 } |
860 } |
2896 } |
861 |
2897 |
862 // ---------------------------------------------------------------------------- |
2898 TBool CSysApAppUi::ReleasePowerMenuCustomDialogMemory() |
863 // CSysApAppUi::HandleApplicationSpecificEventL(TInt aType,const TWsEvent& aEvent) |
2899 { |
864 // ---------------------------------------------------------------------------- |
2900 if (iPowerMenuDialog!=NULL) |
865 |
2901 { |
866 void CSysApAppUi::HandleApplicationSpecificEventL(TInt aType,const TWsEvent& aEvent) |
2902 //PowerMenu already exist |
867 { |
2903 delete iPowerMenuDialog; |
868 TRACES( RDebug::Print( _L("CSysApAppUi::HandleApplicationSpecificEventL: aType:%d"), aType ) ); |
2904 iPowerMenuDialog = NULL; |
869 |
2905 TRACES( RDebug::Print(_L("CSysApAppUi::ReleasePowerMenuCustomDialogMemory True") ) ); |
870 CAknAppUi::HandleApplicationSpecificEventL(aType, aEvent); |
2906 return ETrue; |
871 |
2907 } |
872 if ( ResourcesFreed() ) |
2908 TRACES( RDebug::Print(_L("CSysApAppUi::ReleasePowerMenuCustomDialogMemory false") ) ); |
873 { |
2909 return EFalse; |
874 TRACES( RDebug::Print( _L("CSysApAppUi::HandleApplicationSpecificEventL: discarded, shutting down") ) ); |
2910 } |
875 return; |
2911 |
876 } |
2912 TBool CSysApAppUi::NotifiedDialogIfRequiredAndReleaseMemory() |
877 |
2913 { |
878 switch( aType ) |
2914 TRACES( RDebug::Print(_L("CSysApAppUi::NotifiedDialogIfRequiredAndReleaseMemory(): Begin") ) ); |
879 { |
2915 TRACES( RDebug::Print(_L("CSysApAppUi::NotifiedDialogIfRequiredAndReleaseMemory(): Enter for popping another dialog") ) ); |
880 case EEikKeyLockEnabled: |
2916 TInt popUpError = iSysApDriveUnlockHandler->CheckMemoryDialogIfNeeded(); |
881 iKeyLockEnabled = ETrue; |
2917 |
882 iSysApCenRepController->SetInt( KCRUidCoreApplicationUIsSysAp, KSysApKeyguardActive, 1 ); |
2918 //Deside if dialog required again !! |
883 SetIndicatorStateL( EAknIndicatorKeyguard, EAknIndicatorStateOn ); |
2919 if(popUpError) |
884 iSysApLightsController->KeylockStateChangedL( ETrue ); |
2920 { |
885 break; |
2921 iSysApDriveUnlockHandler->ReleaseMemoryForInputCardDialog(); // check memory has released. |
886 case EEikKeyLockDisabled: |
2922 iSysApDriveUnlockHandler->UnlockComplete(KErrNone); |
887 iKeyLockEnabled = EFalse; |
|
888 iSysApCenRepController->SetInt( KCRUidCoreApplicationUIsSysAp, KSysApKeyguardActive, 0 ); |
|
889 SetIndicatorStateL( EAknIndicatorKeyguard, EAknIndicatorStateOff ); |
|
890 if (! iDeviceLockEnabled ) |
|
891 { |
|
892 iSysApLightsController->KeylockStateChangedL( EFalse ); |
|
893 if ( iSysApFeatureManager->MmcHotSwapSupported() ) |
|
894 { |
|
895 if ( StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ) != EPSCTsyCallStateRinging && StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ) != EPSCTsyCallStateAlerting ) |
|
896 { |
|
897 RunUnlockNotifierL(); |
|
898 } |
|
899 } |
|
900 } |
|
901 break; |
|
902 case EEikKeyLockPowerKeyPressed: //sent when power key is captured by keylockserver |
|
903 HandleShortPowerKeyPressedL(); |
|
904 break; |
|
905 |
|
906 case EEikKeyLockLightsOnRequest: |
|
907 iSysApLightsController->SetLightsOnUnlockNoteL(); |
|
908 break; |
|
909 |
|
910 case EEikEcsQueryLights: // emergency note is shown |
|
911 iSysApLightsController->SetLightsOnEcsQueryL(); |
|
912 break; |
|
913 |
|
914 case EEikSecurityQueryLights: // for device lock security query |
|
915 iSysApLightsController->SetLightsOnSecurityQueryL(); |
|
916 break; |
|
917 |
|
918 default: |
|
919 break; |
|
920 } |
|
921 } |
|
922 |
|
923 |
|
924 // ---------------------------------------------------------------------------- |
|
925 // CSysApAppUi::InitializeStatusPaneAreaL() |
|
926 // ---------------------------------------------------------------------------- |
|
927 |
|
928 void CSysApAppUi::InitializeStatusPaneAreaL() |
|
929 { |
|
930 TRACES( RDebug::Print( _L("CSysApAppUi::InitializeStatusPaneAreaL(): START") ) ); |
|
931 TInt state( StateOfProperty( KPSUidHWRMPowerState, KHWRMBatteryLevel ) ); |
|
932 |
|
933 //Also Charging status will be updated with the following function. |
|
934 UpdateBatteryBarsL( state ); |
|
935 |
|
936 #ifdef SYSAP_USE_STARTUP_UI_PHASE |
|
937 if ( OfflineModeActive() ) |
|
938 { |
|
939 UpdateSignalBarsL( KAknSignalOffLineMode ); |
|
940 } |
2923 } |
941 else |
2924 else |
942 { |
2925 { |
943 UpdateSignalBarsL(); |
2926 iSysApDriveUnlockHandler->StartUnlock();// pop up the dialog again !! |
944 } |
2927 } |
945 #else |
2928 |
946 UpdateSignalBarsL(); |
2929 TRACES( RDebug::Print(_L("CSysApAppUi::NotifiedDialogIfRequiredAndReleaseMemory(): End")) ); |
947 #endif // SYSAP_USE_STARTUP_UI_PHASE |
2930 return popUpError; |
948 |
2931 } |
949 SetSignalIndicatorL(); |
2932 |
950 SetIhfIndicatorL(); |
2933 void CSysApAppUi::ReleaseMemoryForMemoryCardDialog() |
951 SetHacIndicatorL(); |
2934 { |
952 LogsObserverL().HandleUiReadyL(); |
2935 TRACES( RDebug::Print(_L("CSysApAppUi::CSysApAppUi::ReleaseMemoryForMemoryCardDialog()")) ); |
953 |
2936 iSysApDriveUnlockHandler->ReleaseMemoryForInputCardDialog(); |
954 if ( iSysApEtelConnector ) |
|
955 { |
|
956 iSysApEtelConnector->ReadSimSmsStoreStatusInStartup(); |
|
957 } |
|
958 |
|
959 SetEnvelopeIndicatorL(); |
|
960 |
|
961 TRACES( RDebug::Print( _L("CSysApAppUi::InitializeStatusPaneAreaL(): accessories") ) ); |
|
962 |
|
963 TAccMode accessoryState(EAccModeHandPortable); |
|
964 if ( iSysApAccessoryObserver ) |
|
965 { |
|
966 accessoryState = iSysApAccessoryObserver->GetAccessoryMode(); |
|
967 } |
|
968 |
|
969 if( accessoryState == EAccModeWiredHeadset || |
|
970 accessoryState == EAccModeWirelessHeadset || |
|
971 accessoryState == EAccModeHeadphones ) |
|
972 { |
|
973 SetIndicatorStateL( EAknIndicatorLoopset, EAknIndicatorStateOff ); |
|
974 SetIndicatorStateL( EAknIndicatorTTY, EAknIndicatorStateOff ); |
|
975 SetIndicatorStateL( EAknIndicatorHeadset, EAknIndicatorStateOn ); |
|
976 SetIndicatorStateL( EAknIndicatorHeadsetUnavailable, EAknIndicatorStateOff ); |
|
977 SetIndicatorStateL( EAknIndicatorCarkit, EAknIndicatorStateOff ); |
|
978 SetIndicatorStateL( EAknIndicatorTvOut, EAknIndicatorStateOff ); |
|
979 SetIndicatorStateL( EAknIndicatorHDMI, EAknIndicatorStateOff ); |
|
980 } |
|
981 else if( accessoryState == EAccModeLoopset ) |
|
982 { |
|
983 SetIndicatorStateL( EAknIndicatorHeadset, EAknIndicatorStateOff ); |
|
984 SetIndicatorStateL( EAknIndicatorTTY, EAknIndicatorStateOff ); |
|
985 SetIndicatorStateL( EAknIndicatorLoopset, EAknIndicatorStateOn ); |
|
986 SetIndicatorStateL( EAknIndicatorHeadsetUnavailable, EAknIndicatorStateOff ); |
|
987 SetIndicatorStateL( EAknIndicatorCarkit, EAknIndicatorStateOff ); |
|
988 SetIndicatorStateL( EAknIndicatorTvOut, EAknIndicatorStateOff ); |
|
989 SetIndicatorStateL( EAknIndicatorHDMI, EAknIndicatorStateOff ); |
|
990 } |
|
991 else if( accessoryState == EAccModeTextDevice ) |
|
992 { |
|
993 SetIndicatorStateL( EAknIndicatorHeadset, EAknIndicatorStateOff ); |
|
994 SetIndicatorStateL( EAknIndicatorLoopset, EAknIndicatorStateOff ); |
|
995 SetIndicatorStateL( EAknIndicatorTTY, EAknIndicatorStateOn ); |
|
996 SetIndicatorStateL( EAknIndicatorHeadsetUnavailable, EAknIndicatorStateOff ); |
|
997 SetIndicatorStateL( EAknIndicatorCarkit, EAknIndicatorStateOff ); |
|
998 SetIndicatorStateL( EAknIndicatorTvOut, EAknIndicatorStateOff ); |
|
999 SetIndicatorStateL( EAknIndicatorHDMI, EAknIndicatorStateOff ); |
|
1000 } |
|
1001 else if( accessoryState == EAccModeWiredCarKit || accessoryState == EAccModeWirelessCarKit ) |
|
1002 { |
|
1003 SetIndicatorStateL( EAknIndicatorHeadset, EAknIndicatorStateOff ); |
|
1004 SetIndicatorStateL( EAknIndicatorLoopset, EAknIndicatorStateOff ); |
|
1005 SetIndicatorStateL( EAknIndicatorTTY, EAknIndicatorStateOff ); |
|
1006 SetIndicatorStateL( EAknIndicatorHeadsetUnavailable, EAknIndicatorStateOff ); |
|
1007 SetIndicatorStateL( EAknIndicatorCarkit, EAknIndicatorStateOn ); |
|
1008 SetIndicatorStateL( EAknIndicatorTvOut, EAknIndicatorStateOff ); |
|
1009 SetIndicatorStateL( EAknIndicatorHDMI, EAknIndicatorStateOff ); |
|
1010 } |
|
1011 else if( accessoryState == EAccModeTVOut ) |
|
1012 { |
|
1013 SetIndicatorStateL( EAknIndicatorHeadset, EAknIndicatorStateOff ); |
|
1014 SetIndicatorStateL( EAknIndicatorLoopset, EAknIndicatorStateOff ); |
|
1015 SetIndicatorStateL( EAknIndicatorTTY, EAknIndicatorStateOff ); |
|
1016 SetIndicatorStateL( EAknIndicatorHeadsetUnavailable, EAknIndicatorStateOff ); |
|
1017 SetIndicatorStateL( EAknIndicatorCarkit, EAknIndicatorStateOff ); |
|
1018 SetIndicatorStateL( EAknIndicatorTvOut, EAknIndicatorStateOn ); |
|
1019 SetIndicatorStateL( EAknIndicatorHDMI, EAknIndicatorStateOff ); |
|
1020 } |
|
1021 else if (accessoryState == EAccModeHDMI ) |
|
1022 { |
|
1023 SetIndicatorStateL( EAknIndicatorHeadset, EAknIndicatorStateOff ); |
|
1024 SetIndicatorStateL( EAknIndicatorLoopset, EAknIndicatorStateOff ); |
|
1025 SetIndicatorStateL( EAknIndicatorTTY, EAknIndicatorStateOff ); |
|
1026 SetIndicatorStateL( EAknIndicatorHeadsetUnavailable, EAknIndicatorStateOff ); |
|
1027 SetIndicatorStateL( EAknIndicatorCarkit, EAknIndicatorStateOff ); |
|
1028 SetIndicatorStateL( EAknIndicatorTvOut, EAknIndicatorStateOff); |
|
1029 SetIndicatorStateL( EAknIndicatorHDMI, EAknIndicatorStateOn ); |
|
1030 } |
|
1031 else // all indicators off |
|
1032 { |
|
1033 SetIndicatorStateL( EAknIndicatorHeadset, EAknIndicatorStateOff ); |
|
1034 SetIndicatorStateL( EAknIndicatorLoopset, EAknIndicatorStateOff ); |
|
1035 SetIndicatorStateL( EAknIndicatorTTY, EAknIndicatorStateOff ); |
|
1036 SetIndicatorStateL( EAknIndicatorHeadsetUnavailable, EAknIndicatorStateOff ); |
|
1037 SetIndicatorStateL( EAknIndicatorCarkit, EAknIndicatorStateOff ); |
|
1038 SetIndicatorStateL( EAknIndicatorTvOut, EAknIndicatorStateOff ); |
|
1039 SetIndicatorStateL( EAknIndicatorHDMI, EAknIndicatorStateOff ); |
|
1040 } |
|
1041 |
|
1042 TRACES( RDebug::Print( _L("CSysApAppUi::InitializeStatusPaneAreaL(): msg") ) ); |
|
1043 state = StateOfProperty( KUidSystemCategory, KUidOutboxStatusValue ); |
|
1044 if( state == ESADocumentsInOutbox ) |
|
1045 { |
|
1046 SetIndicatorStateL( EAknIndicatorOutbox, EAknIndicatorStateOn ); |
|
1047 } |
|
1048 else |
|
1049 { |
|
1050 SetIndicatorStateL( EAknIndicatorOutbox, EAknIndicatorStateOff ); |
|
1051 } |
|
1052 |
|
1053 state = StateOfProperty( KAlarmServerPubSubCategory, KWakeupAlarmPubSubKey ); |
|
1054 |
|
1055 if( state == EActiveWakeupAlarmSet ) |
|
1056 { |
|
1057 TRACES( RDebug::Print(_L("CSysApAppUi::InitializeStatusPaneAreaL called the SetIndicatorStateL with EActiveWakeupAlarmSet "))); |
|
1058 SetIndicatorStateL( EAknIndicatorAlarmClock, EAknIndicatorStateOn ); |
|
1059 } |
|
1060 else |
|
1061 { |
|
1062 TRACES( RDebug::Print(_L("CSysApAppUi::InitializeStatusPaneAreaL called the SetIndicatorStateL with EActiveNoWakeupAlarmsSet "))); |
|
1063 SetIndicatorStateL( EAknIndicatorAlarmClock, EAknIndicatorStateOff ); |
|
1064 } |
|
1065 |
|
1066 state = StateOfProperty( KIrdaPropertyCategory, KIrdaStatus ); |
|
1067 if( state == TIrdaStatusCodes::EIrLoaded || state == TIrdaStatusCodes::EIrDisconnected || state == TIrdaStatusCodes::EIrBlocked ) |
|
1068 { |
|
1069 SetIndicatorStateL( EAknIndicatorIrActive, EAknIndicatorStateAnimate ); |
|
1070 } |
|
1071 else if( state == TIrdaStatusCodes::EIrConnected ) |
|
1072 { |
|
1073 SetIndicatorStateL( EAknIndicatorIrActive, EAknIndicatorStateOn ); |
|
1074 } |
|
1075 else |
|
1076 { |
|
1077 SetIndicatorStateL( EAknIndicatorIrActive, EAknIndicatorStateOff ); |
|
1078 } |
|
1079 |
|
1080 iSysApCenRepCallForwardingObserver->UpdateCallForwardingIndicatorsL(); |
|
1081 |
|
1082 iSysApCenRepMsgWaitingObserver->UpdateMessageWaitingIndicatorsL(); |
|
1083 |
|
1084 state = StateOfProperty( KPSUidNetworkInfo, KNWHomeZoneStatus ); |
|
1085 if( state == ENWNone || state == ENWCityZone ) |
|
1086 { |
|
1087 SetIndicatorStateL( EAknIndicatorHomeZone, EAknIndicatorStateOff ); |
|
1088 } |
|
1089 else if( state == ENWHomeZone ) |
|
1090 { |
|
1091 SetIndicatorStateL( EAknIndicatorHomeZone, EAknIndicatorStateOn ); |
|
1092 } |
|
1093 |
|
1094 // Initialize WLan state |
|
1095 state = StateOfProperty( KPSUidWlan, KPSWlanIndicator ); |
|
1096 HandleWlanIndicatorL(state); |
|
1097 |
|
1098 // Initialize Tarm state |
|
1099 state = StateOfProperty( KPSUidCoreApplicationUIs, KCoreAppUIsTarmIndicator ); |
|
1100 HandleTarmIndicatorL(state); |
|
1101 |
|
1102 TRACES( RDebug::Print( _L("CSysApAppUi::InitializeStatusPaneAreaL(): END") ) ); |
|
1103 } |
|
1104 |
|
1105 // ---------------------------------------------------------------------------- |
|
1106 // CSysApAppUi::HandleWlanIndicator() |
|
1107 // ---------------------------------------------------------------------------- |
|
1108 void CSysApAppUi::HandleWlanIndicatorL( TInt aValue ) |
|
1109 { |
|
1110 if ( aValue == EPSWlanIndicatorAvailable ) |
|
1111 { |
|
1112 SetIndicatorStateL( EAknIndicatorWlanActive, EAknIndicatorStateOff ); |
|
1113 SetIndicatorStateL( EAknIndicatorWlanActiveSecure, EAknIndicatorStateOff ); |
|
1114 SetIndicatorStateL( EAknIndicatorWlanAvailable, EAknIndicatorStateOn ); |
|
1115 } |
|
1116 else if ( aValue == EPSWlanIndicatorActive ) |
|
1117 { |
|
1118 SetIndicatorStateL( EAknIndicatorWlanAvailable, EAknIndicatorStateOff ); |
|
1119 SetIndicatorStateL( EAknIndicatorWlanActiveSecure, EAknIndicatorStateOff ); |
|
1120 SetIndicatorStateL( EAknIndicatorWlanActive, EAknIndicatorStateOn ); |
|
1121 } |
|
1122 else if ( aValue == EPSWlanIndicatorActiveSecure ) |
|
1123 { |
|
1124 SetIndicatorStateL( EAknIndicatorWlanAvailable, EAknIndicatorStateOff ); |
|
1125 SetIndicatorStateL( EAknIndicatorWlanActive, EAknIndicatorStateOff ); |
|
1126 SetIndicatorStateL( EAknIndicatorWlanActiveSecure, EAknIndicatorStateOn ); |
|
1127 } |
|
1128 else // No indication required |
|
1129 { |
|
1130 SetIndicatorStateL( EAknIndicatorWlanAvailable, EAknIndicatorStateOff ); |
|
1131 SetIndicatorStateL( EAknIndicatorWlanActive, EAknIndicatorStateOff ); |
|
1132 SetIndicatorStateL( EAknIndicatorWlanActiveSecure, EAknIndicatorStateOff ); |
|
1133 } |
|
1134 } |
|
1135 |
|
1136 // ---------------------------------------------------------------------------- |
|
1137 // CSysApAppUi::HandleTarmIndicatorL() |
|
1138 // ---------------------------------------------------------------------------- |
|
1139 |
|
1140 void CSysApAppUi::HandleTarmIndicatorL( TInt aValue ) |
|
1141 { |
|
1142 if ( aValue == ECoreAppUIsTarmTerminalSecurityOnIndicatorOn ) |
|
1143 { |
|
1144 SetIndicatorStateL( EAknIndicatorTARM, EAknIndicatorStateOff ); |
|
1145 SetIndicatorStateL( EAknIndicatorTARMModuleOn, EAknIndicatorStateOn ); |
|
1146 } |
|
1147 else if ( aValue == ECoreAppUIsTarmMngActiveIndicatorOn ) |
|
1148 { |
|
1149 SetIndicatorStateL( EAknIndicatorTARMModuleOn, EAknIndicatorStateOff ); |
|
1150 SetIndicatorStateL( EAknIndicatorTARM, EAknIndicatorStateOn ); |
|
1151 } |
|
1152 else |
|
1153 { |
|
1154 SetIndicatorStateL( EAknIndicatorTARM, EAknIndicatorStateOff ); |
|
1155 SetIndicatorStateL( EAknIndicatorTARMModuleOn, EAknIndicatorStateOff ); |
|
1156 } |
|
1157 } |
|
1158 |
|
1159 // ---------------------------------------------------------------------------- |
|
1160 // CSysApAppUi::HandleShortPowerKeyPressedL() |
|
1161 // ---------------------------------------------------------------------------- |
|
1162 |
|
1163 void CSysApAppUi::HandleShortPowerKeyPressedL() |
|
1164 { |
|
1165 TInt callState( StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ) ); |
|
1166 |
|
1167 TRACES ( |
|
1168 RDebug::Print( |
|
1169 _L("CSysApAppUi::HandleShortPowerKeyPressedL() callState:%d, iDeviceLockEnabled:%d" ), |
|
1170 callState, |
|
1171 iDeviceLockEnabled ); |
|
1172 ); |
|
1173 iSysApLightsController->PowerKeyPressedL(); |
|
1174 |
|
1175 RProperty::Set( KPSUidCoreApplicationUIs, KCoreAppUIsHideAlarm, ECoreAppUIsHideAlarm ); |
|
1176 |
|
1177 |
|
1178 if( UiReady() && !iDeviceLockEnabled ) |
|
1179 { |
|
1180 if ( iPowerKeyPopupMenuActive ) |
|
1181 { |
|
1182 //Do nothing here. EEventKeyUp moves selection in the list! |
|
1183 } |
|
1184 else if ( !iKeyLockEnabled |
|
1185 && callState != EPSCTsyCallStateAlerting |
|
1186 && callState != EPSCTsyCallStateRinging |
|
1187 && callState != EPSCTsyCallStateDialling ) |
|
1188 //Show power key menu |
|
1189 { |
|
1190 ShowPowerKeyPopUpMenuL(); |
|
1191 } |
|
1192 } |
|
1193 else |
|
1194 { |
|
1195 TInt swState( StateOfProperty( KPSUidStartup, KPSGlobalSystemState ) ); |
|
1196 |
|
1197 if( swState == ESwStateAlarm ) |
|
1198 //From Alarm state even a short press causes shutdown but charger state need to be checked |
|
1199 { |
|
1200 TInt chargerState( StateOfProperty( KPSUidHWRMPowerState, KHWRMChargingStatus ) ); |
|
1201 if( chargerState == EChargingStatusNotConnected ) |
|
1202 //shutdown |
|
1203 { |
|
1204 StartShutDownTimerOnAlarmAndChargingStates(); |
|
1205 } |
|
1206 else |
|
1207 //to charging state |
|
1208 { |
|
1209 SetStarterState( RStarterSession::ECharging ); |
|
1210 } |
|
1211 } |
|
1212 } |
|
1213 } |
|
1214 |
|
1215 // ---------------------------------------------------------------------------- |
|
1216 // CSysApAppUi::HandleLongPowerKeyPressedL() |
|
1217 // ---------------------------------------------------------------------------- |
|
1218 |
|
1219 void CSysApAppUi::HandleLongPowerKeyPressedL() |
|
1220 { |
|
1221 TRACES( RDebug::Print( _L("CSysApAppUi::HandleLongPowerKeyPressedL()") ) ); |
|
1222 |
|
1223 TInt swState; |
|
1224 RProperty::Get( KPSUidStartup, KPSGlobalSystemState, swState ); |
|
1225 |
|
1226 iSysApLightsController->PowerKeyPressedL(); |
|
1227 |
|
1228 if( swState == ESwStateStartingCriticalApps || |
|
1229 swState == ESwStateSelfTestOK || |
|
1230 swState == ESwStateSecurityCheck || |
|
1231 swState == ESwStateCriticalPhaseOK || |
|
1232 swState == ESwStateEmergencyCallsOnly || |
|
1233 swState == ESwStateNormalRfOn || |
|
1234 swState == ESwStateNormalRfOff || |
|
1235 swState == ESwStateNormalBTSap || |
|
1236 swState == ESwStateFatalStartupError ) |
|
1237 { |
|
1238 if( !iDeviceLockEnabled ) |
|
1239 { |
|
1240 if( iPowerKeyPopupMenuActive ) |
|
1241 { |
|
1242 if ( iGlobalListQuery ) |
|
1243 { |
|
1244 iGlobalListQuery->SelectItem(); |
|
1245 } |
|
1246 } |
|
1247 else if( !iIgnoreNextPowerKeyRepeats ) |
|
1248 { |
|
1249 if( !iKeyLockEnabled && !IsEncryptionOperationOngoingL() ) |
|
1250 { |
|
1251 DoShutdownL( EFalse, KDummyReason ); |
|
1252 } |
|
1253 } |
|
1254 iIgnoreNextPowerKeyRepeats = ETrue; |
|
1255 } |
|
1256 } |
|
1257 else if( swState == ESwStateAlarm ) |
|
1258 { |
|
1259 //Just comment here to highlight that this is not possible since |
|
1260 //from alarm state already a short press always shuts the device down. |
|
1261 } |
|
1262 else if( swState == ESwStateCharging ) |
|
1263 //Startup to Normal state |
|
1264 { |
|
1265 if( !iIgnoreNextPowerKeyRepeats ) |
|
1266 { |
|
1267 iIgnoreNextPowerKeyRepeats = ETrue; |
|
1268 |
|
1269 SetStarterState( RStarterSession::ENormal ); |
|
1270 } |
|
1271 } |
|
1272 } |
|
1273 |
|
1274 // ---------------------------------------------------------------------------- |
|
1275 // CSysApAppUi::FreeResources() |
|
1276 // ---------------------------------------------------------------------------- |
|
1277 |
|
1278 void CSysApAppUi::FreeResources() |
|
1279 { |
|
1280 TRACES( RDebug::Print( _L("CSysApAppUi::FreeResources") ) ); |
|
1281 |
|
1282 delete iSysApBatteryInfoController; |
|
1283 delete iSysApPsmController; |
|
1284 |
|
1285 delete iSysApAudioRoutingObserver; |
|
1286 |
|
1287 delete iProfileNamesArray; |
|
1288 iProfileNamesArray = NULL; |
|
1289 |
|
1290 if ( iTimer ) |
|
1291 { |
|
1292 iTimer->Cancel(); |
|
1293 delete iTimer; |
|
1294 } |
|
1295 |
|
1296 if ( iSapTimer ) |
|
1297 { |
|
1298 iSapTimer->Cancel(); |
|
1299 delete iSapTimer; |
|
1300 } |
|
1301 |
|
1302 if ( iSysApTimer ) |
|
1303 { |
|
1304 iSysApTimer->Cancel(); |
|
1305 delete iSysApTimer; |
|
1306 } |
|
1307 |
|
1308 delete iGlobalListQuery; |
|
1309 |
|
1310 RWindowGroup groupWin = iCoeEnv->RootWin(); |
|
1311 groupWin.CancelCaptureKey( iCapturedEKeyPowerOff ); |
|
1312 groupWin.CancelCaptureKeyUpAndDowns( iCapturedEKeyPowerOffUpAndDowns ); |
|
1313 |
|
1314 delete iSysApDefaultKeyHandler; |
|
1315 |
|
1316 if ( iProfileEngine ) |
|
1317 { |
|
1318 iProfileEngine->Release(); |
|
1319 } |
|
1320 |
|
1321 delete iSysApSsSettingsObserver; |
|
1322 delete iSysApEtelConnector; |
|
1323 |
|
1324 delete iSysApProfileObserver; |
|
1325 delete iSysApNspsHandler; |
|
1326 delete iSysApKeySndHandler; |
|
1327 delete iSysApCenRepMsgWaitingObserver; |
|
1328 delete iSysApCenRepCallForwardingObserver; |
|
1329 delete iSysApConnectionMonitorObserver; |
|
1330 delete iSysApCenRepLightSettingsObserver; |
|
1331 delete iSysApCenRepLogsObserver; |
|
1332 delete iSysApCenRepBtObserver; |
|
1333 delete iSysApCenRepFmTxObserver; |
|
1334 delete iSysApCenRepHacSettingObserver; |
|
1335 delete iSysApCenRepController; |
|
1336 |
|
1337 delete iSysApPubSubObserver; |
|
1338 |
|
1339 delete iSysApMMCObserver; |
|
1340 delete iSysApMsgSimMemLowQuery; |
|
1341 delete iSysApWaitNote; |
|
1342 delete iSysApConfirmationQuery; |
|
1343 delete iSysApConfirmationQueryForRestart; |
|
1344 delete iSysApOfflineModeController; |
|
1345 delete iSysApUsbIndicatorController; |
|
1346 delete iSysApBtController; |
|
1347 delete iSysApBtSapController; |
|
1348 delete iSignalNotify; |
|
1349 delete iBatteryNotify; |
|
1350 delete iSysApSystemLock; |
|
1351 delete iSysApLocationPrivacyIndicator; |
|
1352 delete iSysApAccessoryObserver; |
|
1353 delete iSysApMediatorObserver; |
|
1354 |
|
1355 delete iSysApKeyManagement; |
|
1356 iSysApKeyManagement = NULL; |
|
1357 delete iSysApLightsController; |
|
1358 iKeyLock.Close(); |
|
1359 delete iSysApFeatureManager; |
|
1360 |
|
1361 // Cleanup ECom, used by key management and light control |
|
1362 REComSession::FinalClose(); |
|
1363 |
|
1364 iResourcesFreed = ETrue; |
|
1365 TRACES( RDebug::Print( _L("CSysApAppUi::FreeResources:END") ) ); |
|
1366 } |
|
1367 |
|
1368 // ---------------------------------------------------------------------------- |
|
1369 // CSysApAppUi::ShowUiNoteL( const TSysApNoteIds aNote ) const |
|
1370 // ---------------------------------------------------------------------------- |
|
1371 |
|
1372 void CSysApAppUi::ShowUiNoteL( const TSysApNoteIds aNote ) const |
|
1373 { |
|
1374 TRACES( RDebug::Print( _L("CSysApAppUi::ShowUiNoteL aNote: %d"), aNote ) ); |
|
1375 TInt tone( EAvkonSIDNoSound ); |
|
1376 TAknGlobalNoteType noteType( EAknGlobalBatteryLowNote ); |
|
1377 CAknGlobalNote* note = CAknGlobalNote::NewLC(); |
|
1378 TInt secondaryDisplayId(SecondaryDisplay::ECmdNoNote); |
|
1379 |
|
1380 switch ( aNote ) |
|
1381 { |
|
1382 case EBatteryLowNote: |
|
1383 noteType = EAknGlobalBatteryLowNote; |
|
1384 tone = EAvkonSIDBatteryLowTone; |
|
1385 break; |
|
1386 case EBatteryFullNote: |
|
1387 noteType = EAknGlobalBatteryFullNote; |
|
1388 tone = EAvkonSIDInformationTone; |
|
1389 break; |
|
1390 case ERechargeBatteryNote: |
|
1391 iSysApLightsController->BatteryEmptyL( ETrue ); |
|
1392 noteType = EAknGlobalRechargeBatteryNote; |
|
1393 tone = EAvkonSIDRechargeBatteryTone; |
|
1394 break; |
|
1395 case ENotChargingNote: |
|
1396 noteType = EAknGlobalNotChargingNote; |
|
1397 tone = EAvkonSIDWrongCharger; |
|
1398 break; |
|
1399 case EInsertSimNote: |
|
1400 noteType = EAknGlobalInformationNote; |
|
1401 tone = EAvkonSIDInformationTone; |
|
1402 secondaryDisplayId = SecondaryDisplay::ECmdShowInsertSimNote; |
|
1403 break; |
|
1404 case EMemoryCardRemovedWithoutEjectNote: |
|
1405 noteType = EAknGlobalInformationNote; |
|
1406 tone = EAvkonSIDInformationTone; |
|
1407 secondaryDisplayId = SecondaryDisplay::ECmdShowMemoryCardRemovedWithoutEjectNote; |
|
1408 break; |
|
1409 case EGprsSuspendedNote: |
|
1410 noteType = EAknGlobalInformationNote; |
|
1411 tone = EAvkonSIDInformationTone; |
|
1412 secondaryDisplayId = SecondaryDisplay::ECmdShowGprsSuspendedNote; |
|
1413 break; |
|
1414 case EGprsResumedNote: |
|
1415 noteType = EAknGlobalInformationNote; |
|
1416 tone = EAvkonSIDInformationTone; |
|
1417 secondaryDisplayId = SecondaryDisplay::ECmdShowGprsResumedNote; |
|
1418 break; |
|
1419 case EShutdownNote: |
|
1420 noteType = EAknGlobalInformationNote; |
|
1421 tone = EAvkonSIDInformationTone; |
|
1422 secondaryDisplayId = SecondaryDisplay::ECmdShowShutdownNote; |
|
1423 break; |
|
1424 case ECannotActivateOfflineModeNote: |
|
1425 noteType = EAknGlobalErrorNote; |
|
1426 tone = EAvkonSIDErrorTone; |
|
1427 secondaryDisplayId = SecondaryDisplay::ECmdShowCannotActivateOfflineModeNote; |
|
1428 break; |
|
1429 case ECannotDeactivateOfflineModeNote: |
|
1430 noteType = EAknGlobalErrorNote; |
|
1431 tone = EAvkonSIDErrorTone; |
|
1432 secondaryDisplayId = SecondaryDisplay::ECmdShowCannotDeactivateOfflineModeNote; |
|
1433 break; |
|
1434 case EKeypadActiveNote: |
|
1435 noteType = EAknGlobalInformationNote; |
|
1436 tone = EAvkonSIDInformationTone; |
|
1437 secondaryDisplayId = SecondaryDisplay::ECmdShowKeypadActiveNote; |
|
1438 break; |
|
1439 case EFmTxAccessoryStandbyNote: |
|
1440 noteType = EAknGlobalInformationNote; |
|
1441 tone = EAvkonSIDInformationTone; |
|
1442 secondaryDisplayId = SecondaryDisplay::ECmdShowFmTxStandbyInAccessoryConnectionNote; |
|
1443 break; |
|
1444 case EFmTxAccessoryForbidsNote: |
|
1445 noteType = EAknGlobalInformationNote; |
|
1446 tone = EAvkonSIDInformationTone; |
|
1447 secondaryDisplayId = SecondaryDisplay::ECmdShowFmTxCannotEnableWhileAccessoryConnectedNote; |
|
1448 break; |
|
1449 case EFmTxVolumeDisabledNote: |
|
1450 noteType = EAknGlobalInformationNote; |
|
1451 tone = EAvkonSIDInformationTone; |
|
1452 secondaryDisplayId = SecondaryDisplay::ECmdShowFmTxVolumeDisabledNote; |
|
1453 break; |
|
1454 case EFmTxOnNote: |
|
1455 noteType = EAknGlobalInformationNote; |
|
1456 tone = EAvkonSIDInformationTone; |
|
1457 secondaryDisplayId = SecondaryDisplay::ECmdShowFmTxTuneRadioToFrequencyNote; |
|
1458 break; |
|
1459 case EFmTxOffNote: |
|
1460 noteType = EAknGlobalInformationNote; |
|
1461 tone = EAvkonSIDInformationTone; |
|
1462 secondaryDisplayId = SecondaryDisplay::ECmdShowFmTxDisabledNote; |
|
1463 break; |
|
1464 case EBatteryFullUnplugChargerNote: |
|
1465 noteType = EAknGlobalBatteryFullUnplugNote; |
|
1466 tone = EAvkonSIDInformationTone; |
|
1467 break; |
|
1468 case EUnplugChargerNote: |
|
1469 noteType = EAknGlobalUnplugChargerNote; |
|
1470 tone = EAvkonSIDInformationTone; |
|
1471 break; |
|
1472 case EPowerSaveModeActivated: |
|
1473 noteType = EAknGlobalConfirmationNote; |
|
1474 tone = EAvkonSIDConfirmationTone; |
|
1475 secondaryDisplayId = SecondaryDisplay::ECmdShowPowerSavingActivatedNote; |
|
1476 break; |
|
1477 case EPowerSaveModeDeactivated: |
|
1478 noteType = EAknGlobalConfirmationNote; |
|
1479 tone = EAvkonSIDConfirmationTone; |
|
1480 secondaryDisplayId = SecondaryDisplay::ECmdShowPowerSavingDeactivatedNote; |
|
1481 break; |
|
1482 case ECannotActivatePowerSaveMode: |
|
1483 noteType = EAknGlobalWarningNote; |
|
1484 tone = EAvkonSIDWarningTone; |
|
1485 secondaryDisplayId = SecondaryDisplay::ECmdShowCannotActivatePowerSavingNote; |
|
1486 break; |
|
1487 case ECannotDeactivatePowerSaveMode: |
|
1488 noteType = EAknGlobalWarningNote; |
|
1489 tone = EAvkonSIDWarningTone; |
|
1490 secondaryDisplayId = SecondaryDisplay::ECmdShowCannotDeactivatePowerSavingNote; |
|
1491 break; |
|
1492 default: |
|
1493 break; |
|
1494 |
|
1495 } |
|
1496 |
|
1497 TInt swState( StateOfProperty( KPSUidStartup, KPSGlobalSystemState ) ); |
|
1498 |
|
1499 if( UiReady() || swState == ESwStateSecurityCheck) |
|
1500 { |
|
1501 HBufC* noteStringBuf = NULL; |
|
1502 |
|
1503 switch ( aNote ) |
|
1504 { |
|
1505 case EInsertSimNote: |
|
1506 noteStringBuf = StringLoader::LoadLC( R_QTN_SU_NOTE_INSERT_SIM, iEikonEnv ); |
|
1507 break; |
|
1508 case EMemoryCardRemovedWithoutEjectNote: |
|
1509 noteStringBuf = StringLoader::LoadLC( R_QTN_MEMS_EJECT_ERROR, iEikonEnv ); |
|
1510 note->SetSoftkeys( R_AVKON_SOFTKEYS_OK_EMPTY ); |
|
1511 break; |
|
1512 case EGprsSuspendedNote: |
|
1513 noteStringBuf = StringLoader::LoadLC( R_QTN_GPRS_CONF_GPRS_SUSPENDED, iEikonEnv ); |
|
1514 break; |
|
1515 case EGprsResumedNote: |
|
1516 noteStringBuf = StringLoader::LoadLC( R_QTN_GPRS_CONF_GPRS_RESUMED, iEikonEnv ); |
|
1517 break; |
|
1518 case EShutdownNote: |
|
1519 noteStringBuf = StringLoader::LoadLC( R_QTN_PWRC_INFO_GOODBYE, iEikonEnv); |
|
1520 break; |
|
1521 case ECannotActivateOfflineModeNote: |
|
1522 noteStringBuf = StringLoader::LoadLC( R_QTN_ERR_OFFLINE_UNABLE, iEikonEnv ); |
|
1523 break; |
|
1524 case ECannotDeactivateOfflineModeNote: |
|
1525 noteStringBuf = StringLoader::LoadLC( R_QTN_ERR_OFFLINE_UNABLE_PROFILE, iEikonEnv ); |
|
1526 break; |
|
1527 case EKeypadActiveNote: |
|
1528 if ( iSysApFeatureManager->PenEnabled() ) |
|
1529 { |
|
1530 noteStringBuf = StringLoader::LoadLC( R_QTN_KEYG_CONF_DISPLAY_KEYS_ACTIVE, |
|
1531 iEikonEnv ); |
|
1532 } |
|
1533 else |
|
1534 { |
|
1535 noteStringBuf = StringLoader::LoadLC( R_QTN_KEYG_CONF_KEYPAD_ACTIVE, |
|
1536 iEikonEnv ); |
|
1537 } |
|
1538 note->SetAnimation( R_QGN_NOTE_KEYGUARD_OPEN_ANIM ); |
|
1539 break; |
|
1540 case EFmTxOnNote: |
|
1541 { |
|
1542 const TInt KFrequencyMaxLength(7); |
|
1543 // read frequency |
|
1544 TInt frequencykHz = iSysApCenRepFmTxObserver->Frequency(); |
|
1545 TReal frequencyMHz = static_cast<TReal>( frequencykHz ) / KCoefficientKhzToMhz; // kHz to Mhz |
|
1546 TBuf<KFrequencyMaxLength> frequencyAsString; |
|
1547 frequencyAsString.AppendNum( frequencyMHz, TRealFormat( KFrequencyMaxLength, KDecimalsInMhzFrequency ) ); |
|
1548 AknTextUtils::LanguageSpecificNumberConversion( frequencyAsString ); |
|
1549 noteStringBuf |
|
1550 = StringLoader::LoadLC( R_QTN_FMTX_SYSAP_INFO_NOTE_CHANGE_FREQ, |
|
1551 frequencyAsString, |
|
1552 iEikonEnv ); |
|
1553 break; |
|
1554 } |
|
1555 case EFmTxAccessoryForbidsNote: |
|
1556 { |
|
1557 noteStringBuf = StringLoader::LoadLC( R_QTN_FMTX_SYSAP_INFO_NOTE_ACCESSORY_FORBIDS, |
|
1558 iEikonEnv ); |
|
1559 break; |
|
1560 } |
|
1561 case EFmTxAccessoryStandbyNote: |
|
1562 { |
|
1563 noteStringBuf = StringLoader::LoadLC( R_QTN_FMTX_SYSAP_INFO_NOTE_ACCESSORY_STANDBY, |
|
1564 iEikonEnv ); |
|
1565 break; |
|
1566 } |
|
1567 case EFmTxVolumeDisabledNote: |
|
1568 { |
|
1569 noteStringBuf = StringLoader::LoadLC( R_QTN_FMTX_SYSAP_INFO_NOTE_VOLUME_DISABLED, |
|
1570 iEikonEnv ); |
|
1571 break; |
|
1572 } |
|
1573 case EFmTxOffNote: |
|
1574 { |
|
1575 noteStringBuf = StringLoader::LoadLC( R_QTN_FMTX_SYSAP_INFO_NOTE_DISABLED, |
|
1576 iEikonEnv ); |
|
1577 break; |
|
1578 } |
|
1579 case EPowerSaveModeActivated: |
|
1580 noteStringBuf = StringLoader::LoadLC( R_QTN_POWER_SAVING_ACTIVATED_CONF_NOTE, iEikonEnv ); |
|
1581 break; |
|
1582 case EPowerSaveModeDeactivated: |
|
1583 noteStringBuf = StringLoader::LoadLC( R_QTN_POWER_SAVING_DEACTIVATED_CONF_NOTE, iEikonEnv ); |
|
1584 break; |
|
1585 case ECannotActivatePowerSaveMode: |
|
1586 noteStringBuf = StringLoader::LoadLC( R_QTN_POWER_SAVING_FAILED_WARNING_NOTE, iEikonEnv ); |
|
1587 break; |
|
1588 case ECannotDeactivatePowerSaveMode: |
|
1589 noteStringBuf = StringLoader::LoadLC( R_QTN_POWER_SAVING_DEACTIVATION_FAILED_WARNING_NOTE, iEikonEnv ); |
|
1590 break; |
|
1591 default: |
|
1592 break; |
|
1593 } |
|
1594 |
|
1595 note->SetTone( tone ); |
|
1596 |
|
1597 // Set secondary display data if necessary |
|
1598 if ( iSysApFeatureManager->CoverDisplaySupported() && secondaryDisplayId != SecondaryDisplay::ECmdNoNote) |
|
1599 { |
|
1600 TRACES( RDebug::Print( _L("CSysApAppUi::ShowUiNoteL - Notifying secondary display") ) ); |
|
1601 CAknSDData* sd; |
|
1602 |
|
1603 if ( aNote == EFmTxOnNote ) // frequency information is passed to secondary display |
|
1604 { |
|
1605 SecondaryDisplay::TFmTxFrequencyInKhzPckg pckg( iSysApCenRepFmTxObserver->Frequency() ); |
|
1606 sd = CAknSDData::NewL( SecondaryDisplay::KCatSysAp, secondaryDisplayId, pckg ); |
|
1607 } |
|
1608 else |
|
1609 { |
|
1610 sd = CAknSDData::NewL(SecondaryDisplay::KCatSysAp, secondaryDisplayId, KNullDesC8); |
|
1611 } |
|
1612 |
|
1613 note->SetSecondaryDisplayData(sd); // ownership to notifier client |
|
1614 } |
|
1615 |
|
1616 if ( noteStringBuf ) |
|
1617 { |
|
1618 TPtr textBuffer = noteStringBuf->Des(); |
|
1619 TRACES( RDebug::Print( _L("CSysApAppUi::ShowUiNoteL Next:note->ShowNoteL" ) ) ); |
|
1620 note->ShowNoteL( noteType, textBuffer ); |
|
1621 CleanupStack::PopAndDestroy( ); // noteStringbuf |
|
1622 } |
|
1623 else |
|
1624 { |
|
1625 TRACES( RDebug::Print( _L("CSysApAppUi::ShowUiNoteL Next:note->ShowNoteL" ) ) ); |
|
1626 note->ShowNoteL( noteType, KNullDesC ); |
|
1627 } |
|
1628 } |
|
1629 else if( swState == ESwStateAlarm || swState == ESwStateCharging ) |
|
1630 { |
|
1631 if ( aNote != EUnplugChargerNote ) // don't play tone when charger is disconnected in charging state |
|
1632 { |
|
1633 static_cast<CAknAppUi*>(iEikonEnv->EikAppUi())->KeySounds()->PlaySound( tone ); |
|
1634 } |
|
1635 } |
|
1636 |
|
1637 CleanupStack::PopAndDestroy(); // note |
|
1638 } |
|
1639 |
|
1640 // ---------------------------------------------------------------------------- |
|
1641 // CSysApAppUi::ShowChargingNoteL() |
|
1642 // ---------------------------------------------------------------------------- |
|
1643 |
|
1644 void CSysApAppUi::ShowChargingNoteL() |
|
1645 { |
|
1646 TRACES( RDebug::Print( _L("CSysApAppUi::ShowChargingNoteL") ) ); |
|
1647 TBool showNote( ETrue ); |
|
1648 |
|
1649 TInt swState( StateOfProperty( KPSUidStartup, KPSGlobalSystemState ) ); |
|
1650 TRACES( RDebug::Print( _L("CSysApAppUi::ShowChargingNoteL: swState: %d"), swState ) ); |
|
1651 |
|
1652 if( UiReady() || swState == ESwStateSecurityCheck ) |
|
1653 { |
|
1654 if ( StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ) == EPSCTsyCallStateRinging ) |
|
1655 { |
|
1656 showNote = EFalse; |
|
1657 } |
|
1658 TRACES( RDebug::Print( _L("CSysApAppUi::ShowChargingNoteL KCTsyCallState=%d"), StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ) ) ); |
|
1659 if ( showNote ) // Power Mgmt UI spec defines that no Charging note is shown while the phone is ringing/alerting |
|
1660 { |
|
1661 CAknGlobalNote* chargingNote = CAknGlobalNote::NewLC(); |
|
1662 chargingNote->SetTone( EAvkonSIDChargingBatteryTone ); |
|
1663 chargingNote->ShowNoteL( EAknGlobalChargingNote, KNullDesC ); |
|
1664 CleanupStack::PopAndDestroy( chargingNote ); |
|
1665 } |
|
1666 } |
|
1667 else if( swState == ESwStateAlarm || swState == ESwStateCharging ) |
|
1668 { |
|
1669 TRACES( RDebug::Print( _L("CSysApAppUi::ShowChargingNoteL - Just play tone") ) ); |
|
1670 static_cast<CAknAppUi*>(iEikonEnv->EikAppUi())->KeySounds()->PlaySound( EAvkonSIDChargingBatteryTone ); |
|
1671 } |
|
1672 else |
|
1673 { |
|
1674 TRACES( RDebug::Print( _L("CSysApAppUi::ShowChargingNoteL - No note shown") ) ); |
|
1675 } |
|
1676 } |
|
1677 |
|
1678 // ---------------------------------------------------------------------------- |
|
1679 // CSysApAppUi::HandleChargerNotesL() |
|
1680 // ---------------------------------------------------------------------------- |
|
1681 void CSysApAppUi::HandleChargerNotesL( const TInt aValue ) |
|
1682 { |
|
1683 TBool showNote(StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ) != EPSCTsyCallStateRinging); |
|
1684 if ( aValue == EChargingStatusCharging ) |
|
1685 { |
|
1686 iSysApLightsController->BatteryEmptyL( EFalse ); |
|
1687 TRACES( RDebug::Print( _L("SysAp: charger connected") ) ); |
|
1688 iSysApLightsController->ChargerConnectedL( ETrue ); |
|
1689 ShowChargingNoteL(); |
|
1690 } |
|
1691 //Display Not Charging note |
|
1692 else if ( aValue == EChargingStatusError ) |
|
1693 { |
|
1694 if(showNote) |
|
1695 { |
|
1696 ShowUiNoteL( ENotChargingNote ); |
|
1697 } |
|
1698 } |
|
1699 else if ( aValue == EChargingStatusChargingComplete ) |
|
1700 { |
|
1701 iSysApLightsController->ChargingCompleteL(); |
|
1702 |
|
1703 TSysApNoteIds note( EBatteryFullNote ); |
|
1704 |
|
1705 if ( !iSysApUsbChargerDetector.HostOnlyUsbChargingUsed() && |
|
1706 iSysApFeatureManager->Supported( KSysApFeatureIdChargerReminderNotes ) ) |
|
1707 { |
|
1708 note = EBatteryFullUnplugChargerNote; |
|
1709 } |
|
1710 iSysApUsbChargerDetector.Reset(); |
|
1711 if(showNote) |
|
1712 { |
|
1713 ShowUiNoteL( note ); |
|
1714 } |
|
1715 } |
|
1716 else if ( aValue == EChargingStatusNotConnected ) |
|
1717 { |
|
1718 TRACES( RDebug::Print( _L("SysAp: charger removed") ) ); |
|
1719 iSysApLightsController->ChargerConnectedL( EFalse ); |
|
1720 |
|
1721 if ( !iSysApUsbChargerDetector.HostOnlyUsbChargingUsed() && |
|
1722 iSysApFeatureManager->Supported( KSysApFeatureIdChargerReminderNotes ) ) |
|
1723 { |
|
1724 if(showNote) |
|
1725 { |
|
1726 ShowUiNoteL( EUnplugChargerNote ); |
|
1727 } |
|
1728 } |
|
1729 iSysApUsbChargerDetector.Reset(); |
|
1730 } |
|
1731 else if ( aValue == EChargingStatusNotCharging ) |
|
1732 { |
|
1733 TRACES( RDebug::Print( _L("SysAp: Not charging") ) ); |
|
1734 } |
|
1735 else if ( aValue == EChargingStatusAlmostComplete ) |
|
1736 { |
|
1737 TRACES( RDebug::Print( _L("SysAp: Charging almost complete") ) ); |
|
1738 } |
|
1739 else if ( aValue == EChargingStatusChargingContinued ) |
|
1740 { |
|
1741 //in this case we simply want to scroll the battery bars and not turn light on or show ui note |
|
1742 // set lights controller iBatteryEmpty to EFalse |
|
1743 iSysApLightsController->BatteryEmptyL( EFalse ); |
|
1744 TRACES( RDebug::Print( _L("SysAp: charging continues") ) ); |
|
1745 } |
|
1746 } |
|
1747 |
|
1748 // ---------------------------------------------------------------------------- |
|
1749 // CSysApAppUi::ShowProfileNoteL() |
|
1750 // ---------------------------------------------------------------------------- |
|
1751 |
|
1752 void CSysApAppUi::ShowProfileNoteL() |
|
1753 { |
|
1754 TRACES( RDebug::Print( _L("CSysApAppUi::ShowProfileNoteL") ) ); |
|
1755 |
|
1756 if ( UiReady() ) |
|
1757 { |
|
1758 |
|
1759 TBufC<KMaxProfileNameLength> profileName; |
|
1760 HBufC* noteStringBuf = NULL; |
|
1761 ActiveProfileNameL( profileName.Des() ); |
|
1762 noteStringBuf = StringLoader::LoadLC( R_TEXT_MODE_SELECTED, profileName, iEikonEnv ); |
|
1763 TPtr textBuffer = noteStringBuf->Des(); |
|
1764 AknTextUtils::DisplayTextLanguageSpecificNumberConversion( textBuffer ); |
|
1765 |
|
1766 |
|
1767 // Set secondary display data if necessary |
|
1768 if ( iSysApFeatureManager->CoverDisplaySupported() ) |
|
1769 { |
|
1770 TRACES( RDebug::Print( _L("CSysApAppUi::ShowProfileNoteL - Notifying secondary display") ) ); |
|
1771 SecondaryDisplay::TProfileName sdProfileName; |
|
1772 sdProfileName.Append(profileName.Left(SecondaryDisplay::KProfileNameMaxLen)); |
|
1773 SecondaryDisplay::TProfileNotePckg pckg(sdProfileName); |
|
1774 CAknSDData* sd = CAknSDData::NewL(SecondaryDisplay::KCatSysAp, SecondaryDisplay::ECmdShowProfileNote, pckg); |
|
1775 |
|
1776 } |
|
1777 |
|
1778 |
|
1779 CAknDiscreetPopup::ShowGlobalPopupL(textBuffer,KNullDesC, KAknsIIDNone, KNullDesC); |
|
1780 |
|
1781 CleanupStack::PopAndDestroy(); // noteStringbuf |
|
1782 |
|
1783 iSysApLightsController->ProfileChangedL(); // All notes should always turn lights on. |
|
1784 } |
|
1785 } |
|
1786 |
|
1787 // ---------------------------------------------------------------------------- |
|
1788 // CSysApAppUi::ShowQueryL() |
|
1789 // ---------------------------------------------------------------------------- |
|
1790 |
|
1791 void CSysApAppUi::ShowQueryL( const TSysApConfirmationQueryIds aQueryId, const TDesC& aValue ) |
|
1792 { |
|
1793 CancelGlobalListQuery(); |
|
1794 |
|
1795 if ( aQueryId == ESysApRestartPhoneQuery ) |
|
1796 { |
|
1797 iDisablePowerkeyMenu = ETrue; |
|
1798 // Cancel any other query that might be outstanding (i.e. ESysApRemoveMmcNote), |
|
1799 // to avoid multiple overlapping queries causing problems |
|
1800 if ( iSysApConfirmationQuery ) |
|
1801 { |
|
1802 iSysApConfirmationQuery->Cancel(); |
|
1803 } |
|
1804 |
|
1805 if ( !iSysApConfirmationQueryForRestart ) |
|
1806 { |
|
1807 TRACES( RDebug::Print( _L("CSysApAppUi::ShowQueryL: trying CSysApConfirmationQuery::NewL() for restart") ) ); |
|
1808 iSysApConfirmationQueryForRestart = CSysApConfirmationQuery::NewL( *this ); |
|
1809 } |
|
1810 |
|
1811 iSysApConfirmationQueryForRestart->ShowQueryL( aQueryId, iEikonEnv ); |
|
1812 } |
|
1813 else |
|
1814 { |
|
1815 if ( !iSysApConfirmationQuery ) |
|
1816 { |
|
1817 TRACES( RDebug::Print( _L("CSysApAppUi::ShowQueryL: trying CSysApConfirmationQuery::NewL()") ) ); |
|
1818 iSysApConfirmationQuery = CSysApConfirmationQuery::NewL( *this ); |
|
1819 } |
|
1820 |
|
1821 iSysApConfirmationQuery->ShowQueryL( aQueryId, aValue, iEikonEnv ); |
|
1822 } |
|
1823 } |
|
1824 |
|
1825 // ---------------------------------------------------------------------------- |
|
1826 // CSysApAppUi::UpdateBatteryBarsL( const TInt aState ) |
|
1827 // ---------------------------------------------------------------------------- |
|
1828 |
|
1829 void CSysApAppUi::UpdateBatteryBarsL( const TInt aState ) |
|
1830 { |
|
1831 TInt state( StateOfProperty( KPSUidHWRMPowerState, KHWRMChargingStatus ) ); |
|
1832 TRACES( RDebug::Print( _L("CSysApAppUi::UpdateBatteryBarsL aState: %d, chargerState:%d"), aState, state ) ); |
|
1833 HandleUsbCharger( state ); |
|
1834 if( state == EChargingStatusCharging || |
|
1835 state == EChargingStatusChargingContinued || |
|
1836 state == EChargingStatusAlmostComplete ) |
|
1837 { |
|
1838 if ( !iCharging ) |
|
1839 { |
|
1840 TRACES( RDebug::Print( _L("CSysApAppUi::UpdateBatteryBarsL: Starting Charging") ) ); |
|
1841 iBatteryNotify->StartChargingL(); |
|
1842 iCharging = ETrue; |
|
1843 } |
|
1844 |
|
1845 // When Avkon supports battery state sending while charging, |
|
1846 // add setting battery level here also. |
|
1847 } |
|
1848 else |
|
1849 { |
|
1850 if ( iCharging ) |
|
1851 { |
|
1852 TRACES( RDebug::Print( _L("CSysApAppUi::UpdateBatteryBarsL: Stopping Charging") ) ); |
|
1853 iBatteryNotify->StopChargingL(); |
|
1854 iCharging = EFalse; |
|
1855 } |
|
1856 |
|
1857 if( state == KErrUnknown || aState == KErrUnknown ) |
|
1858 { |
|
1859 TRACES( RDebug::Print( _L("CSysApAppUi::UpdateBatteryBarsL: CAknBatteryNotify::SetBatteryLevelL(0)") ) ); |
|
1860 iBatteryNotify->SetBatteryLevelL( 0 ); |
|
1861 } |
|
1862 else |
|
1863 { |
|
1864 TRACES( RDebug::Print( _L("CSysApAppUi::UpdateBatteryBarsL: CAknBatteryNotify::SetBatteryLevelL(%d)"), aState - EBatteryLevelLevel0 ) ); |
|
1865 iBatteryNotify->SetBatteryLevelL( aState - EBatteryLevelLevel0 ); |
|
1866 } |
|
1867 } |
|
1868 |
|
1869 if ( !iSysApPsmController ) // created here if first state change has not occurred yet |
|
1870 { |
|
1871 iSysApPsmController = CSysApPsmController::NewL( *this ); |
|
1872 } |
|
1873 |
|
1874 if ( iSysApPsmController ) |
|
1875 { |
|
1876 if ( iSysApPsmController->FullPsmEnabled() ) |
|
1877 { |
|
1878 iBatteryNotify->SetBatteryStateL( EAknBatteryIndicatorPowerSave ); |
|
1879 } |
|
1880 else |
|
1881 { |
|
1882 iBatteryNotify->SetBatteryStateL( EAknBatteryIndicatorNormal ); |
|
1883 } |
|
1884 } |
|
1885 |
|
1886 if ( iSysApBatteryInfoController ) |
|
1887 { |
|
1888 iSysApBatteryInfoController->BatteryLevelUpdatedL(); |
|
1889 } |
|
1890 } |
|
1891 |
|
1892 // ---------------------------------------------------------------------------- |
|
1893 // CSysApAppUi::UpdateSignalBarsL() |
|
1894 // ---------------------------------------------------------------------------- |
|
1895 |
|
1896 void CSysApAppUi::UpdateSignalBarsL() |
|
1897 { |
|
1898 UpdateSignalBarsL(iSysApEtelConnector->GetSignalBars()); |
|
1899 } |
|
1900 |
|
1901 // ---------------------------------------------------------------------------- |
|
1902 // CSysApAppUi::UpdateSignalBarsL( const TInt aState ) |
|
1903 // ---------------------------------------------------------------------------- |
|
1904 |
|
1905 void CSysApAppUi::UpdateSignalBarsL( const TInt aState ) |
|
1906 { |
|
1907 TRACES( RDebug::Print( _L("CSysApAppUi::UpdateSignalBarsL aState: %d"), aState ) ); |
|
1908 if( iSysApGanHandler && iSysApGanHandler->IsInGanMode() ) |
|
1909 { |
|
1910 iSignalNotify->SetSignalLevelL( iSysApGanHandler->GanSignalLevel() ); |
|
1911 } |
|
1912 else if( aState == KAknSignalOffLineMode || (iSysApOfflineModeController->OfflineModeActive() && !iEmergencyCallActive) ) |
|
1913 { |
|
1914 iSignalNotify->SetSignalLevelL( KAknSignalOffLineMode ); |
|
1915 } |
|
1916 else if( aState <= 0 ) |
|
1917 { |
|
1918 // Do not update indicator show zero bars if we should be showing X over bars |
|
1919 // This is required for indicator to work correctly in BT SAP mode. |
|
1920 // Cannot use check for BT SAP enabled status, as zero bars notify comes before enabled status changes. |
|
1921 if ( !iIgnoreZeroNetworkBarNotifications ) |
|
1922 { |
|
1923 iSignalNotify->SetSignalLevelL( 0 ); |
|
1924 } |
|
1925 } |
|
1926 else |
|
1927 { |
|
1928 iSignalNotify->SetSignalLevelL( aState ); |
|
1929 } |
|
1930 } |
|
1931 |
|
1932 // ---------------------------------------------------------------------------- |
|
1933 // CSysApAppUi::SetSignalIndicatorL() |
|
1934 // ---------------------------------------------------------------------------- |
|
1935 |
|
1936 void CSysApAppUi::SetSignalIndicatorL() |
|
1937 { |
|
1938 TSysApNetworkMode networkMode( ESysApGSM ); |
|
1939 |
|
1940 TInt networkModeFromNetworkInfo( StateOfProperty( KPSUidNetworkInfo, KNWTelephonyNetworkMode ) ); |
|
1941 if ( networkModeFromNetworkInfo == ENWNetworkModeWcdma ) |
|
1942 { |
|
1943 networkMode = ESysApWCDMA; |
|
1944 } |
|
1945 else |
|
1946 { |
|
1947 networkMode = ESysApGSM; |
|
1948 } |
|
1949 |
|
1950 TRACES( RDebug::Print( _L("CSysApAppUi::SetSignalIndicatorL: networkMode = %d" ), networkMode ) ); |
|
1951 |
|
1952 if( iSysApOfflineModeController->OfflineModeActive() && !iEmergencyCallActive ) |
|
1953 { |
|
1954 // The device is in Offline Mode |
|
1955 if ( iSysApFeatureManager->Supported( KSysApFeatureIdGprs_G_Icon ) ) |
|
1956 { |
|
1957 iSignalNotify->SetGprsStateL( EAknSignalGprsIndicatorOff ); |
|
1958 } |
|
1959 else |
|
1960 { |
|
1961 iSignalNotify->SetCommonPacketDataStateL( EAknSignalCommonPacketDataIndicatorOff ); |
|
1962 } |
|
1963 iSignalNotify->SetWcdmaStateL( EAknSignalWcdmaIndicatorOff ); |
|
1964 iSignalNotify->SetHsdpaStateL( EAknSignalHsdpaIndicatorOff); |
|
1965 TRACES( RDebug::Print(_L("CSysApAppUi::SetSignalIndicatorL: gan off" ) ) ); |
|
1966 iSignalNotify->SetUmaStateL( EAknSignalUmaIndicatorOff ); |
|
1967 } |
|
1968 else |
|
1969 { |
|
1970 if( iSysApGanHandler && iSysApGanHandler->IsInGanMode() ) |
|
1971 { |
|
1972 // Enter GAN: set GAN signal bar |
|
1973 SetSignalIndicatorGanL(); |
|
1974 iGanEnabled = ETrue; |
|
1975 } |
|
1976 else |
|
1977 { |
|
1978 if( iGanEnabled ) |
|
1979 { |
|
1980 UpdateSignalBarsL(); |
|
1981 iGanEnabled = EFalse; |
|
1982 } |
|
1983 |
|
1984 // The device is in Online Mode |
|
1985 switch ( networkMode ) |
|
1986 { |
|
1987 case ESysApGSM: |
|
1988 SetSignalIndicatorGsmL(); |
|
1989 break; |
|
1990 |
|
1991 case ESysApWCDMA: |
|
1992 SetSignalIndicatorWcdmaL(); |
|
1993 break; |
|
1994 |
|
1995 default: |
|
1996 break; |
|
1997 } |
|
1998 } |
|
1999 } |
|
2000 } |
|
2001 |
|
2002 // ---------------------------------------------------------------------------- |
|
2003 // CSysApAppUi::SetSignalIndicatorGsmL() |
|
2004 // ---------------------------------------------------------------------------- |
|
2005 void CSysApAppUi::SetSignalIndicatorGsmL() |
|
2006 { |
|
2007 TInt signalGprsIndicatorState( 0 ); |
|
2008 TInt signalIndicatorState( 0 ); |
|
2009 TInt bearerValue = EBearerUnknown; |
|
2010 |
|
2011 if(iSysApConnectionMonitorObserver) |
|
2012 { |
|
2013 bearerValue = iSysApConnectionMonitorObserver->GetBearerValue(); |
|
2014 } |
|
2015 |
|
2016 if(bearerValue == EBearerEdgeGPRS) |
|
2017 { |
|
2018 TInt egprsStatus = StateOfProperty( KUidSystemCategory, KPSUidGprsStatusValue ); |
|
2019 TRACES( RDebug::Print( _L("CSysApAppUi::SetSignalIndicatorGsmL gprsStatus: %d" ), egprsStatus ) ); |
|
2020 iSignalNotify->SetWcdmaStateL( EAknSignalWcdmaIndicatorOff ); |
|
2021 iSignalNotify->SetHsdpaStateL( EAknSignalHsdpaIndicatorOff ); |
|
2022 switch ( egprsStatus ) |
|
2023 { |
|
2024 case EPSGprsContextActive: |
|
2025 signalGprsIndicatorState = EAknSignalEdgeIndicatorContext; |
|
2026 signalIndicatorState = EAknSignalCommonPacketDataIndicatorContext; |
|
2027 iGprsActivated = ETrue; |
|
2028 iGprsSuspended = EFalse; |
|
2029 HandleGprsNotesL(); |
|
2030 break; |
|
2031 |
|
2032 case EPSGprsContextActivating: |
|
2033 signalGprsIndicatorState = EAknSignalEdgeIndicatorEstablishingContext; |
|
2034 signalIndicatorState = EAknSignalCommonPacketDataIndicatorEstablishingContext; |
|
2035 iGprsActivated = EFalse; |
|
2036 iGprsSuspended = EFalse; |
|
2037 break; |
|
2038 |
|
2039 case EPSGprsSuspend: |
|
2040 signalGprsIndicatorState = EAknSignalEdgeIndicatorSuspended; |
|
2041 signalIndicatorState = EAknSignalCommonPacketDataIndicatorSuspended; |
|
2042 iGprsSuspended = ETrue; |
|
2043 HandleGprsNotesL(); |
|
2044 break; |
|
2045 |
|
2046 case EPSGprsAttach: |
|
2047 signalGprsIndicatorState = EAknSignalEdgeIndicatorAttached; |
|
2048 signalIndicatorState = EAknSignalCommonPacketDataIndicatorAttached; |
|
2049 iGprsActivated = EFalse; |
|
2050 iGprsSuspended = EFalse; |
|
2051 break; |
|
2052 |
|
2053 case EPSGprsMultibleContextActive: |
|
2054 signalGprsIndicatorState = EAknSignalEdgeIndicatorMultipdp; |
|
2055 signalIndicatorState = EAknSignalCommonPacketDataIndicatorMultipdp; |
|
2056 iGprsActivated = ETrue; |
|
2057 iGprsSuspended = EFalse; |
|
2058 HandleGprsNotesL(); |
|
2059 break; |
|
2060 |
|
2061 case EPSGprsUnattached: |
|
2062 default: |
|
2063 if ( iTDEnable ) |
|
2064 { |
|
2065 signalGprsIndicatorState = EAknSignalEdgeIndicatorAvailable; |
|
2066 signalIndicatorState = EAknSignalCommonPacketDataIndicatorAvailable; |
|
2067 } |
|
2068 else |
|
2069 { |
|
2070 signalGprsIndicatorState = EAknSignalEdgeIndicatorOff; |
|
2071 signalIndicatorState = EAknSignalCommonPacketDataIndicatorOff; |
|
2072 } |
|
2073 iGprsSuspendedNoteShown = EFalse; |
|
2074 iGprsActivated = EFalse; |
|
2075 iGprsSuspended = EFalse; |
|
2076 iCallActivated = EFalse; |
|
2077 break; |
|
2078 } |
|
2079 } |
|
2080 else |
|
2081 { |
|
2082 |
|
2083 TInt gprsStatus = StateOfProperty( KUidSystemCategory, KPSUidGprsStatusValue ); |
|
2084 TRACES( RDebug::Print( _L("CSysApAppUi::SetSignalIndicatorGsmL gprsStatus: %d" ), gprsStatus ) ); |
|
2085 iSignalNotify->SetWcdmaStateL( EAknSignalWcdmaIndicatorOff ); |
|
2086 iSignalNotify->SetHsdpaStateL( EAknSignalHsdpaIndicatorOff ); |
|
2087 switch ( gprsStatus ) |
|
2088 { |
|
2089 case EPSGprsContextActive: |
|
2090 signalGprsIndicatorState = EAknSignalGprsIndicatorContext; |
|
2091 signalIndicatorState = EAknSignalCommonPacketDataIndicatorContext; |
|
2092 iGprsActivated = ETrue; |
|
2093 iGprsSuspended = EFalse; |
|
2094 HandleGprsNotesL(); |
|
2095 break; |
|
2096 |
|
2097 case EPSGprsContextActivating: |
|
2098 signalGprsIndicatorState = EAknSignalGprsIndicatorEstablishingContext; |
|
2099 signalIndicatorState = EAknSignalCommonPacketDataIndicatorEstablishingContext; |
|
2100 iGprsActivated = EFalse; |
|
2101 iGprsSuspended = EFalse; |
|
2102 break; |
|
2103 |
|
2104 case EPSGprsSuspend: |
|
2105 signalGprsIndicatorState = EAknSignalGprsIndicatorSuspended; |
|
2106 signalIndicatorState = EAknSignalCommonPacketDataIndicatorSuspended; |
|
2107 iGprsSuspended = ETrue; |
|
2108 HandleGprsNotesL(); |
|
2109 break; |
|
2110 |
|
2111 case EPSGprsAttach: |
|
2112 signalGprsIndicatorState = EAknSignalGprsIndicatorAttached; |
|
2113 signalIndicatorState = EAknSignalCommonPacketDataIndicatorAttached; |
|
2114 iGprsActivated = EFalse; |
|
2115 iGprsSuspended = EFalse; |
|
2116 break; |
|
2117 |
|
2118 case EPSGprsMultibleContextActive: |
|
2119 signalGprsIndicatorState = EAknSignalGprsIndicatorMultipdp; |
|
2120 signalIndicatorState = EAknSignalCommonPacketDataIndicatorMultipdp; |
|
2121 iGprsActivated = ETrue; |
|
2122 iGprsSuspended = EFalse; |
|
2123 HandleGprsNotesL(); |
|
2124 break; |
|
2125 |
|
2126 case EPSGprsUnattached: |
|
2127 default: |
|
2128 if ( iTDEnable ) |
|
2129 { |
|
2130 signalGprsIndicatorState = EAknSignalGprsIndicatorAvailable; |
|
2131 signalIndicatorState = EAknSignalCommonPacketDataIndicatorAvailable; |
|
2132 } |
|
2133 else |
|
2134 { |
|
2135 signalGprsIndicatorState = EAknSignalGprsIndicatorOff; |
|
2136 signalIndicatorState = EAknSignalCommonPacketDataIndicatorOff; |
|
2137 } |
|
2138 |
|
2139 iGprsSuspendedNoteShown = EFalse; |
|
2140 iGprsActivated = EFalse; |
|
2141 iGprsSuspended = EFalse; |
|
2142 iCallActivated = EFalse; |
|
2143 break; |
|
2144 } |
|
2145 } |
|
2146 |
|
2147 if(bearerValue == EBearerEdgeGPRS) //EdgeGPRS connection |
|
2148 { |
|
2149 if( iSysApFeatureManager->Supported( KSysApFeatureIdUseEdgeGPRSIcon ) ) |
|
2150 { |
|
2151 iSignalNotify->SetEdgeStateL( signalGprsIndicatorState ); |
|
2152 } |
|
2153 else |
|
2154 { |
|
2155 iSignalNotify->SetCommonPacketDataStateL( signalIndicatorState ); |
|
2156 } |
|
2157 } |
|
2158 else |
|
2159 { |
|
2160 |
|
2161 if ( iSysApFeatureManager->Supported( KSysApFeatureIdGprs_G_Icon ) ) |
|
2162 { |
|
2163 iSignalNotify->SetGprsStateL( signalGprsIndicatorState ); |
|
2164 } |
|
2165 else |
|
2166 { |
|
2167 TRACES( RDebug::Print( _L("CSysApAppUi::SetSignalIndicatorGsmL SetCommonPacketDataStateL( %d )" ), signalIndicatorState ) ); |
|
2168 iSignalNotify->SetCommonPacketDataStateL( signalIndicatorState ); |
|
2169 } |
|
2170 } |
|
2171 } |
|
2172 |
|
2173 // ---------------------------------------------------------------------------- |
|
2174 // CSysApAppUi::SetSignalIndicatorWcdmaL() |
|
2175 // ---------------------------------------------------------------------------- |
|
2176 void CSysApAppUi::SetSignalIndicatorWcdmaL() |
|
2177 { |
|
2178 TInt wcdmaStatus; |
|
2179 wcdmaStatus = StateOfProperty( KUidSystemCategory, KPSUidWcdmaStatusValue ); |
|
2180 TRACES( RDebug::Print( _L("CSysApAppUi::SetSignalIndicatorWcdmaL: wcdmaStatus: %d" ), wcdmaStatus ) ); |
|
2181 |
|
2182 if ( iSysApFeatureManager->Supported( KSysApFeatureIdGprs_G_Icon ) ) |
|
2183 { |
|
2184 iSignalNotify->SetGprsStateL( EAknSignalGprsIndicatorOff ); |
|
2185 } |
|
2186 else |
|
2187 { |
|
2188 iSignalNotify->SetCommonPacketDataStateL( EAknSignalCommonPacketDataIndicatorOff ); |
|
2189 } |
|
2190 |
|
2191 TInt signalWcdmaIndicatorState; |
|
2192 TInt signalHsdpaIndicatorState; |
|
2193 |
|
2194 switch ( wcdmaStatus ) |
|
2195 { |
|
2196 case EPSWcdmaContextActive: |
|
2197 signalWcdmaIndicatorState = EAknSignalWcdmaIndicatorContext; |
|
2198 signalHsdpaIndicatorState = EAknSignalHsdpaIndicatorContext; |
|
2199 break; |
|
2200 case EPSWcdmaContextActivating: |
|
2201 signalWcdmaIndicatorState = EAknSignalWcdmaIndicatorEstablishingContext; |
|
2202 signalHsdpaIndicatorState = EAknSignalHsdpaIndicatorEstablishingContext; |
|
2203 break; |
|
2204 case EPSWcdmaSuspend: |
|
2205 signalWcdmaIndicatorState = EAknSignalWcdmaIndicatorSuspended; |
|
2206 signalHsdpaIndicatorState = EAknSignalHsdpaIndicatorSuspended; |
|
2207 break; |
|
2208 case EPSWcdmaAttach: |
|
2209 signalWcdmaIndicatorState = EAknSignalWcdmaIndicatorAttached; |
|
2210 signalHsdpaIndicatorState = EAknSignalHsdpaIndicatorAttached; |
|
2211 break; |
|
2212 case EPSWcdmaMultipleContextActive: |
|
2213 signalWcdmaIndicatorState = EAknSignalWcdmaIndicatorMultipdp; |
|
2214 signalHsdpaIndicatorState = EAknSignalHsdpaIndicatorMultipdp; |
|
2215 break; |
|
2216 case EPSWcdmaUnattached: |
|
2217 default: |
|
2218 signalWcdmaIndicatorState = EAknSignalWcdmaIndicatorAvailable; |
|
2219 signalHsdpaIndicatorState = EAknSignalHsdpaIndicatorAvailable; |
|
2220 break; |
|
2221 } |
|
2222 |
|
2223 TBool showHsdpaAvailable = EFalse; |
|
2224 |
|
2225 if ( iSysApFeatureManager->Supported( KSysApFeatureIdUseHsdpaAvailableIcon ) ) |
|
2226 { |
|
2227 // HSDPA Resource Availability information is a configurable feature. |
|
2228 showHsdpaAvailable = iSysApEtelConnector->HsdpaAvailable(); |
|
2229 } |
|
2230 |
|
2231 TBool isHsdpaBearer = iSysApEtelConnector->IsBearerHsdpa(); |
|
2232 |
|
2233 TRACES( RDebug::Print( _L("CSysApAppUi::SetSignalIndicatorWcdmaL: isHdpaBearer=%d, showHsdpaAvailable=%d" ), |
|
2234 isHsdpaBearer, showHsdpaAvailable ) ); |
|
2235 |
|
2236 if ( isHsdpaBearer || showHsdpaAvailable ) |
|
2237 { |
|
2238 iSignalNotify->SetWcdmaStateL( EAknSignalWcdmaIndicatorOff ); |
|
2239 iSignalNotify->SetHsdpaStateL( signalHsdpaIndicatorState ); |
|
2240 } |
|
2241 else |
|
2242 { |
|
2243 iSignalNotify->SetHsdpaStateL( EAknSignalHsdpaIndicatorOff ); |
|
2244 iSignalNotify->SetWcdmaStateL( signalWcdmaIndicatorState ); |
|
2245 } |
|
2246 } |
|
2247 |
|
2248 // ---------------------------------------------------------------------------- |
|
2249 // CSysApAppUi::SetSignalIndicatorGanL() |
|
2250 // ---------------------------------------------------------------------------- |
|
2251 void CSysApAppUi::SetSignalIndicatorGanL() |
|
2252 { |
|
2253 TRACES( RDebug::Print(_L("CSysApAppUi::SetSignalIndicatorGanL: available" ) ) ); |
|
2254 |
|
2255 TInt gprsStatus( 0 ); |
|
2256 gprsStatus = StateOfProperty( KUidSystemCategory, KPSUidGprsStatusValue ); |
|
2257 |
|
2258 TRACES( RDebug::Print( _L("CSysApAppUi::SetSignalIndicatorGanL gprsStatus: %d" ), gprsStatus ) ); |
|
2259 |
|
2260 switch ( gprsStatus ) |
|
2261 { |
|
2262 case EPSGprsContextActive: |
|
2263 iSignalNotify->SetUmaStateL( EAknSignalUmaIndicatorContext ); |
|
2264 break; |
|
2265 |
|
2266 case EPSGprsContextActivating: |
|
2267 iSignalNotify->SetUmaStateL( EAknSignalUmaIndicatorEstablishingContext ); |
|
2268 break; |
|
2269 |
|
2270 case EPSGprsSuspend: |
|
2271 iSignalNotify->SetUmaStateL( EAknSignalUmaIndicatorSuspended ); |
|
2272 break; |
|
2273 |
|
2274 case EPSGprsAttach: |
|
2275 iSignalNotify->SetUmaStateL( EAknSignalUmaIndicatorAttached ); |
|
2276 break; |
|
2277 |
|
2278 case EPSGprsMultibleContextActive: |
|
2279 iSignalNotify->SetUmaStateL( EAknSignalUmaIndicatorMultipdp ); |
|
2280 break; |
|
2281 |
|
2282 case EPSGprsUnattached: |
|
2283 default: |
|
2284 iSignalNotify->SetUmaStateL( EAknSignalUmaIndicatorAvailable ); |
|
2285 break; |
|
2286 } |
|
2287 } |
|
2288 |
|
2289 // ---------------------------------------------------------------------------- |
|
2290 // CSysApAppUi::HandleGprsNotesL() |
|
2291 // ---------------------------------------------------------------------------- |
|
2292 |
|
2293 void CSysApAppUi::HandleGprsNotesL() |
|
2294 { |
|
2295 TRACES( RDebug::Print( _L("CSysApAppUi::HandleGprsNotesL" ) ) ); |
|
2296 if ( iSysApFeatureManager->Supported( KSysApFeatureIdGPRSNotes ) ) |
|
2297 { |
|
2298 // In WCDMA system, receiving or making calls has no effect to the possibly |
|
2299 // existing PDP contexts i.e. GPRS notes are not needed. |
|
2300 TInt networkMode = StateOfProperty( KPSUidNetworkInfo, KNWTelephonyNetworkMode ); |
|
2301 TRACES( RDebug::Print( _L("CSysApAppUi::HandleGprsNotesL: networkMode %d" ), networkMode ) ); |
|
2302 if ( networkMode != ENWNetworkModeWcdma ) |
|
2303 { |
|
2304 if ( iGprsActivated && iGprsSuspended && iCallActivated && !iGprsSuspendedNoteShown ) |
|
2305 { |
|
2306 StartGprsSuspendedTimer(); |
|
2307 } |
|
2308 else if ( iGprsSuspendedNoteShown && !iGprsSuspended ) |
|
2309 { |
|
2310 iGprsSuspendedNoteShown = EFalse; |
|
2311 iGprsSuspended = EFalse; |
|
2312 iCallActivated = EFalse; |
|
2313 } |
|
2314 } |
|
2315 } |
|
2316 } |
|
2317 |
|
2318 // ---------------------------------------------------------------------------- |
|
2319 // CSysApAppUi::SetIndicatorStateL( TInt aIndicator, TInt aState ) |
|
2320 // ---------------------------------------------------------------------------- |
|
2321 |
|
2322 void CSysApAppUi::SetIndicatorStateL( const TInt aIndicator, const TInt aState ) const |
|
2323 { |
|
2324 CAknSmallIndicator* theIndicator = CAknSmallIndicator::NewLC( TUid::Uid( aIndicator ) ); |
|
2325 theIndicator->SetIndicatorStateL( aState ); |
|
2326 CleanupStack::PopAndDestroy(); //theIndicator |
|
2327 } |
|
2328 |
|
2329 // ---------------------------------------------------------------------------- |
|
2330 // CSysApAppUi::GoOnlineL() |
|
2331 // ---------------------------------------------------------------------------- |
|
2332 |
|
2333 void CSysApAppUi::GoOnlineL( TBool aDoProfileChange ) |
|
2334 { |
|
2335 if ( iSysApFeatureManager->OfflineModeSupported() ) |
|
2336 { |
|
2337 TRACES( RDebug::Print( _L("CSysApAppUi::GoOnlineL: going from off-line into on-line: aDoProfileChange=%d" ), aDoProfileChange ) ); |
|
2338 // in case profile change is not needed, event handling for subsequent profile changes are must be allowed |
|
2339 iHandleNextProfileEvent = !aDoProfileChange; |
|
2340 iActivateBt = iSysApOfflineModeController->MustBtBeActivated(); |
|
2341 |
|
2342 if ( aDoProfileChange ) |
|
2343 { |
|
2344 TRAPD( err, ActivateProfileL( iSysApCenRepController->GetInt( KCRUidCoreApplicationUIsSysAp, KSysApProfileBeforeOfflineMode ) ) ); |
|
2345 if ( err == KErrNotFound ) |
|
2346 { |
|
2347 // Activate general profile instead, if previously used profile was not found |
|
2348 TRACES( RDebug::Print( _L("CSysApAppUi::GoOnlineL: Previously used profile was not found, restoring to general profile" ) ) ); |
|
2349 ActivateProfileL(KGeneralProfileId); |
|
2350 } |
|
2351 } |
|
2352 |
|
2353 iSysApOfflineModeController->SwitchFromOfflineToOnlineModeL(); |
|
2354 TRACES( RDebug::Print( _L("CSysApAppUi::GoOnlineL: iActivateBt = %d" ), iActivateBt ) ); |
|
2355 } |
|
2356 } |
|
2357 |
|
2358 // ---------------------------------------------------------------------------- |
|
2359 // CSysApAppUi::GoOfflineL() |
|
2360 // ---------------------------------------------------------------------------- |
|
2361 |
|
2362 void CSysApAppUi::GoOfflineL() |
|
2363 { |
|
2364 if ( iSysApFeatureManager->OfflineModeSupported() ) |
|
2365 { |
|
2366 TRACES( RDebug::Print( _L("CSysApAppUi::GoOfflineL" ) ) ); |
|
2367 iHandleNextProfileEvent = EFalse; |
|
2368 iDeactivateBt = ETrue; |
|
2369 ActivateProfileL( KOfflineModeProfileId ); |
|
2370 iSysApOfflineModeController->SwitchFromOnlineToOfflineModeL(); |
|
2371 } |
|
2372 } |
|
2373 |
|
2374 // ---------------------------------------------------------------------------- |
|
2375 // CSysApAppUi::SwitchFromOnlineToOfflineModeL() |
|
2376 // ---------------------------------------------------------------------------- |
|
2377 void CSysApAppUi::SwitchFromOnlineToOfflineModeL() |
|
2378 { |
|
2379 if ( iSysApFeatureManager->FmTxSupported() ) |
|
2380 { |
|
2381 TFmTxState state = static_cast<TFmTxState>(StateOfProperty( KPSUidHWRMFmTx, KHWRMFmTxStatus )); |
|
2382 switch ( state ) |
|
2383 { |
|
2384 case EFmTxStateActive: |
|
2385 case EFmTxStateInactive: |
|
2386 case EFmTxStateScanning: |
|
2387 ShowQueryL( ESysApUseFmTxInOfflineQuery ); // show "use fm tx in offline?" if FM TX is on |
|
2388 break; |
|
2389 |
|
2390 default: |
|
2391 // do nothing |
|
2392 break; |
|
2393 } |
|
2394 } |
|
2395 iSysApOfflineModeController->SwitchFromOnlineToOfflineModeL(); |
|
2396 } |
|
2397 |
|
2398 // ---------------------------------------------------------------------------- |
|
2399 // CSysApAppUi::OfflineModeChangedL() |
|
2400 // ---------------------------------------------------------------------------- |
|
2401 void CSysApAppUi::OfflineModeChangedL() |
|
2402 { |
|
2403 #ifdef SYSAP_USE_STARTUP_UI_PHASE |
|
2404 // if UI is not ready, don't update indicators |
|
2405 if ( !UiReady() ) |
|
2406 { |
|
2407 return; |
|
2408 } |
|
2409 #endif // SYSAP_USE_STARTUP_UI_PHASE |
|
2410 |
|
2411 // Update network bar indicator |
|
2412 if ( OfflineModeActive() ) |
|
2413 { |
|
2414 UpdateSignalBarsL( KAknSignalOffLineMode ); |
|
2415 } |
|
2416 else |
|
2417 { |
|
2418 UpdateSignalBarsL(); |
|
2419 } |
|
2420 |
|
2421 // Update network mode indicator |
|
2422 SetSignalIndicatorL(); |
|
2423 |
|
2424 // Update HAC indicator |
|
2425 SetHacIndicatorL(); |
|
2426 } |
|
2427 |
|
2428 // ---------------------------------------------------------------------------- |
|
2429 // CSysApAppUi::OfflineModeActive() |
|
2430 // ---------------------------------------------------------------------------- |
|
2431 TBool CSysApAppUi::OfflineModeActive() |
|
2432 { |
|
2433 return iSysApOfflineModeController->OfflineModeActive(); |
|
2434 } |
|
2435 |
|
2436 // ---------------------------------------------------------------------------- |
|
2437 // CSysApAppUi::DoNotActivateBt() |
|
2438 // ---------------------------------------------------------------------------- |
|
2439 void CSysApAppUi::DoNotActivateBt() |
|
2440 { |
|
2441 iSysApOfflineModeController->DoNotActivateBt(); |
|
2442 } |
|
2443 |
|
2444 // ---------------------------------------------------------------------------- |
|
2445 // CSysApAppUi::SetBtPowerState() |
|
2446 // ---------------------------------------------------------------------------- |
|
2447 TInt CSysApAppUi::SetBtPowerState( TBool aBtState ) |
|
2448 { |
|
2449 if ( iSysApBtController ) |
|
2450 { |
|
2451 return iSysApBtController->SetPowerState( aBtState ); |
|
2452 } |
|
2453 else |
|
2454 { |
|
2455 return KErrNotReady; |
|
2456 } |
|
2457 } |
|
2458 |
|
2459 // ---------------------------------------------------------------------------- |
|
2460 // CSysApAppUi::KeyLockState() const |
|
2461 // ---------------------------------------------------------------------------- |
|
2462 |
|
2463 TBool CSysApAppUi::KeyLockState() const |
|
2464 { |
|
2465 return iKeyLockEnabled; |
|
2466 } |
|
2467 |
|
2468 // ---------------------------------------------------------------------------- |
|
2469 // CSysApAppUi::DeviceLockState() const |
|
2470 // ---------------------------------------------------------------------------- |
|
2471 |
|
2472 TBool CSysApAppUi::DeviceLockState() const |
|
2473 { |
|
2474 return iDeviceLockEnabled; |
|
2475 } |
|
2476 |
|
2477 // ---------------------------------------------------------------------------- |
|
2478 // CSysApAppUi::ChangeFmTxStateL() |
|
2479 // ---------------------------------------------------------------------------- |
|
2480 void CSysApAppUi::ChangeFmTxStateL( TBool aEnable ) |
|
2481 { |
|
2482 // disable fm transmission |
|
2483 CHWRMFmTx* fmtx = CHWRMFmTx::NewLC(); |
|
2484 if ( aEnable ) |
|
2485 { |
|
2486 fmtx->EnableL(); |
|
2487 } |
|
2488 else |
|
2489 { |
|
2490 fmtx->DisableL(); |
|
2491 } |
|
2492 CleanupStack::PopAndDestroy( fmtx ); |
|
2493 } |
|
2494 |
|
2495 // ---------------------------------------------------------------------------- |
|
2496 // CSysApAppUi::SetIhfIndicatorL() |
|
2497 // ---------------------------------------------------------------------------- |
|
2498 void CSysApAppUi::SetIhfIndicatorL() |
|
2499 { |
|
2500 TBool accessoryConnected ( EFalse ); |
|
2501 |
|
2502 TInt callState( StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ) ); |
|
2503 |
|
2504 TAccMode accMode(EAccModeHandPortable); |
|
2505 |
|
2506 if ( iSysApAccessoryObserver ) |
|
2507 { |
|
2508 accMode = iSysApAccessoryObserver->GetAccessoryMode(); |
|
2509 |
|
2510 if ( accMode != EAccModeHandPortable ) |
|
2511 { |
|
2512 accessoryConnected = ETrue; |
|
2513 } |
|
2514 } |
|
2515 |
|
2516 if( (callState != EPSCTsyCallStateNone && IhfEnabledL() && !accessoryConnected) |
|
2517 || accMode == EAccModeMusicStand ) // Music stand always shows IHF indicator |
|
2518 { |
|
2519 SetIndicatorStateL( EAknIndicatorIHFActive, EAknIndicatorStateOn ); |
|
2520 |
|
2521 if ( accMode == EAccModeMusicStand ) |
|
2522 { |
|
2523 // hide other accessory indicators to prevent displaying of duplicate icons in some cases |
|
2524 // e.g. when wireless hf is connected |
|
2525 SetIndicatorStateL( EAknIndicatorLoopset, EAknIndicatorStateOff ); |
|
2526 SetIndicatorStateL( EAknIndicatorTTY, EAknIndicatorStateOff ); |
|
2527 SetIndicatorStateL( EAknIndicatorHeadset, EAknIndicatorStateOff ); |
|
2528 SetIndicatorStateL( EAknIndicatorHeadsetUnavailable, EAknIndicatorStateOff ); |
|
2529 SetIndicatorStateL( EAknIndicatorCarkit, EAknIndicatorStateOff ); |
|
2530 SetIndicatorStateL( EAknIndicatorTvOut, EAknIndicatorStateOff ); |
|
2531 SetIndicatorStateL( EAknIndicatorHDMI, EAknIndicatorStateOff ); |
|
2532 } |
|
2533 } |
|
2534 else |
|
2535 { |
|
2536 SetIndicatorStateL( EAknIndicatorIHFActive, EAknIndicatorStateOff ); |
|
2537 } |
|
2538 } |
|
2539 |
|
2540 // ---------------------------------------------------------------------------- |
|
2541 // CSysApAppUi::HandleSmsStorageNotificationL( TBool aSimStoreFull ) |
|
2542 // ---------------------------------------------------------------------------- |
|
2543 |
|
2544 void CSysApAppUi::HandleSmsStorageNotificationL( TBool aSimStoreFull ) |
|
2545 { |
|
2546 TRACES( RDebug::Print( _L("CSysApAppUi::HandleSmsStorageNotificationL: aSimStoreFull: %d "), aSimStoreFull ) ); |
|
2547 |
|
2548 if ( aSimStoreFull ) |
|
2549 { |
|
2550 HBufC* noteStringBuf; |
|
2551 noteStringBuf = StringLoader::LoadLC( R_QTN_MEMLO_MEMORY_LOW_SIM_MES, iEikonEnv ); |
|
2552 TPtr textBuffer = noteStringBuf->Des(); |
|
2553 iSysApMsgSimMemLowQuery->StartL( textBuffer ); |
|
2554 CleanupStack::PopAndDestroy(); |
|
2555 } |
|
2556 |
|
2557 SetEnvelopeIndicatorL(); |
|
2558 } |
|
2559 |
|
2560 // ---------------------------------------------------------------------------- |
|
2561 // CSysApAppUi::HandleNspsRawKeyEventL() |
|
2562 // ---------------------------------------------------------------------------- |
|
2563 |
|
2564 void CSysApAppUi::HandleNspsRawKeyEventL() |
|
2565 { |
|
2566 #ifdef __SYSAP_MODULE_TEST |
|
2567 ModuleTestShowUiNoteL( _L("Network wakeup from NSPS") ); |
|
2568 #endif |
|
2569 |
|
2570 if ( iSysApEtelConnector ) |
|
2571 { |
|
2572 iSysApEtelConnector->CommandNetCsWakeupOnNsps(); |
|
2573 } |
|
2574 } |
|
2575 |
|
2576 // ---------------------------------------------------------------------------- |
|
2577 // CSysApAppUi::HandleNetworkNspsNotification( RMmCustomAPI::TNspsStatus aNspsStatus ) |
|
2578 // ---------------------------------------------------------------------------- |
|
2579 |
|
2580 void CSysApAppUi::HandleNetworkNspsNotification( RMmCustomAPI::TNspsStatus aNspsStatus ) |
|
2581 { |
|
2582 TRACES( RDebug::Print( _L("CSysApAppUi::HandleNetworkNspsNotification aNspsStatus:%d, iNsps:%d )" ), aNspsStatus, iNsps ) ); |
|
2583 if( iSysApNspsHandler ) |
|
2584 { |
|
2585 if( aNspsStatus == RMmCustomAPI::ENspsOn ) |
|
2586 { |
|
2587 if( !iNsps ) |
|
2588 { |
|
2589 #ifdef __SYSAP_MODULE_TEST |
|
2590 TRAPD( err, ModuleTestShowUiNoteL( _L("Setting NSPS on") ) ); |
|
2591 #endif |
|
2592 iSysApNspsHandler->SetNspsOn(); |
|
2593 iNsps = ETrue; |
|
2594 } |
|
2595 } |
|
2596 else if( aNspsStatus == RMmCustomAPI::ENspsOff ) |
|
2597 { |
|
2598 if( iNsps ) |
|
2599 { |
|
2600 #ifdef __SYSAP_MODULE_TEST |
|
2601 TRAPD( err, ModuleTestShowUiNoteL( _L("Setting NSPS off") ) ); |
|
2602 #endif |
|
2603 iSysApNspsHandler->SetNspsOff(); |
|
2604 iNsps = EFalse; |
|
2605 } |
|
2606 } |
|
2607 } |
|
2608 } |
|
2609 |
|
2610 // ---------------------------------------------------------------------------- |
|
2611 // CSysApAppUi::HandleMessageTonePlayingQuitability( TInt aTonePlayingStatus ) |
|
2612 // ---------------------------------------------------------------------------- |
|
2613 |
|
2614 void CSysApAppUi::HandleMessageTonePlayingQuitability( TInt aTonePlayingStatus ) |
|
2615 { |
|
2616 if( iSysApNspsHandler ) |
|
2617 { |
|
2618 if( aTonePlayingStatus == ECoreAppUIsStopTonePlaying ) |
|
2619 { |
|
2620 iSysApNspsHandler->SetMessageToneNotPlaying(); |
|
2621 } |
|
2622 else if( aTonePlayingStatus == ECoreAppUIsTonePlaying ) |
|
2623 { |
|
2624 iSysApNspsHandler->SetMessageTonePlaying(); |
|
2625 } |
|
2626 } |
|
2627 } |
|
2628 |
|
2629 // ---------------------------------------------------------------------------- |
|
2630 // CSysApAppUi::ActivateKeyeventForwardingForLights() |
|
2631 // ---------------------------------------------------------------------------- |
|
2632 |
|
2633 void CSysApAppUi::ActivateKeyeventForwardingForLights(TBool aActivate) |
|
2634 { |
|
2635 if( iSysApNspsHandler ) |
|
2636 { |
|
2637 if ( aActivate ) |
|
2638 { |
|
2639 iSysApNspsHandler->ActivateKeyeventForwardingForLights(); |
|
2640 } |
|
2641 else |
|
2642 { |
|
2643 iSysApNspsHandler->DeActivateKeyeventForwardingForLights(); |
|
2644 } |
|
2645 } |
|
2646 } |
|
2647 |
|
2648 // ---------------------------------------------------------------------------- |
|
2649 // CSysApAppUi::StartShutDownTimerOnAlarmAndChargingStates() |
|
2650 // ---------------------------------------------------------------------------- |
|
2651 |
|
2652 void CSysApAppUi::StartShutDownTimerOnAlarmAndChargingStates() |
|
2653 { |
|
2654 if( !iAlarmOrChargingStateShutdownStarted ) |
|
2655 { |
|
2656 if ( !iTimer ) |
|
2657 { |
|
2658 TRAPD( err, iTimer = CPeriodic::NewL( EPriorityNormal ) ); |
|
2659 |
|
2660 if ( err != KErrNone ) |
|
2661 { |
|
2662 TRACES( RDebug::Print( _L("CSysApAppUi::StartShutDownTimerOnAlarmAndChargingStates: CPeriodic::NewL failed: %d"), err ) ); |
|
2663 return; |
|
2664 } |
|
2665 } |
|
2666 iTimer->Cancel(); |
|
2667 iTimer->Start( KDelayBeforeShuttingDownInAlarmAndChargingStates, |
|
2668 KDelayBeforeShuttingDownInAlarmAndChargingStates, |
|
2669 TCallBack( DoShutdownOnAlarmStateAfterCallBack, this ) ); |
|
2670 iAlarmOrChargingStateShutdownStarted = ETrue; |
|
2671 } |
|
2672 } |
|
2673 |
|
2674 // ---------------------------------------------------------------------------- |
|
2675 // CSysApAppUi::DoShutdownOnAlarmStateAfterCallBack( TAny* aObject ) |
|
2676 // ---------------------------------------------------------------------------- |
|
2677 |
|
2678 TInt CSysApAppUi::DoShutdownOnAlarmStateAfterCallBack( TAny* aObject ) |
|
2679 { |
|
2680 CSysApAppUi* appUi = STATIC_CAST( CSysApAppUi*, aObject ); |
|
2681 |
|
2682 if ( appUi->iTimer ) |
|
2683 { |
|
2684 appUi->iTimer->Cancel(); |
|
2685 } |
|
2686 |
|
2687 TRAP_IGNORE( appUi->DoShutdownL( EFalse, KDummyReason ) ); |
|
2688 |
|
2689 return KErrNone; |
|
2690 } |
|
2691 |
|
2692 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
2693 // ---------------------------------------------------------------------------- |
|
2694 // CSysApAppUi::StartAnimTiming() |
|
2695 // ---------------------------------------------------------------------------- |
|
2696 void CSysApAppUi::StartAnimTiming() |
|
2697 { |
|
2698 TRACES( RDebug::Print( _L("CSysApAppUi::StartAnimTiming() Start animation timer, time %d ms" ), iAnimationShowingTime ) ); |
|
2699 |
|
2700 if ( !iAnimTimer ) |
|
2701 { |
|
2702 TRAPD( err, iAnimTimer = CPeriodic::NewL( EPriorityNormal ) ); |
|
2703 |
|
2704 if ( err != KErrNone ) |
|
2705 { |
|
2706 TRACES( RDebug::Print( _L("CSysApAppUi::StartAnimTiming() CPeriodic::NewL failed %d " ), err ) ); |
|
2707 return; |
|
2708 } |
|
2709 } |
|
2710 |
|
2711 iAnimTimer->Start( |
|
2712 iAnimationShowingTime*KCoefficientToMakeMicroToMilliSeconds, |
|
2713 iAnimationShowingTime*KCoefficientToMakeMicroToMilliSeconds, |
|
2714 TCallBack( DoStopAnimTiming, this ) ); |
|
2715 } |
|
2716 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
2717 |
|
2718 // ---------------------------------------------------------------------------- |
|
2719 // CSysApAppUi::DoStopAnimTiming( TAny* aObject ) |
|
2720 // ---------------------------------------------------------------------------- |
|
2721 |
|
2722 TInt CSysApAppUi::DoStopAnimTiming( TAny* aObject ) |
|
2723 { |
|
2724 TInt err(KErrNone); |
|
2725 CSysApAppUi* appUi = STATIC_CAST( CSysApAppUi*, aObject ); |
|
2726 |
|
2727 // This method could theoretically be called by two timers (iAnimTimer and one in CSysApShutdownAnimation), |
|
2728 // so a check is needed to prevent multiple executions. |
|
2729 if ( !(appUi->iShutdownContinued) ) |
|
2730 { |
|
2731 appUi->iShutdownContinued = ETrue; |
|
2732 |
|
2733 TRACES( RDebug::Print( _L("CSysApAppUi::DoStopAnimTiming() Animation timer completed or animation skipped" ) ) ); |
|
2734 |
|
2735 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
2736 if ( appUi->iAnimTimer ) |
|
2737 { |
|
2738 appUi->iAnimTimer->Cancel(); |
|
2739 } |
|
2740 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
2741 |
|
2742 if ( appUi->iTimer ) |
|
2743 { |
|
2744 appUi->iTimer->Cancel(); |
|
2745 } |
|
2746 |
|
2747 TRACES( RDebug::Print( _L("CSysApAppUi::DoStopAnimTiming() Call ContinueShutdown(...)" ) ) ); |
|
2748 appUi->ContinueShutdown(); |
|
2749 TRACES( RDebug::Print( _L("CSysApAppUi::DoStopAnimTiming() end") ) ); |
|
2750 } |
|
2751 |
|
2752 return err; |
|
2753 } |
|
2754 |
|
2755 |
|
2756 // ---------------------------------------------------------------------------- |
|
2757 // CSysApAppUi::StartGprsSuspendedTimer() |
|
2758 // ---------------------------------------------------------------------------- |
|
2759 |
|
2760 void CSysApAppUi::StartGprsSuspendedTimer() |
|
2761 { |
|
2762 TRACES( RDebug::Print( _L("CSysApAppUi::StartGprsSuspendedTimer()") ) ); |
|
2763 if( !iAlarmOrChargingStateShutdownStarted ) // not relevant if shutting down |
|
2764 { |
|
2765 if ( !iTimer ) |
|
2766 { |
|
2767 TRAPD( err, iTimer = CPeriodic::NewL( EPriorityNormal ) ); |
|
2768 |
|
2769 if ( err != KErrNone ) |
|
2770 { |
|
2771 TRACES( RDebug::Print( _L("CSysApAppUi::StartGprsSuspendedTimer: CPeriodic::NewL failed: %d"), err ) ); |
|
2772 return; |
|
2773 } |
|
2774 } |
|
2775 |
|
2776 iTimer->Cancel(); |
|
2777 iTimer->Start( KDelayBeforeShowingGprsSuspendedNote, |
|
2778 KDelayBeforeShowingGprsSuspendedNote, |
|
2779 TCallBack( ShowGprsSuspendedNoteAfterCallBack, this ) ); |
|
2780 } |
|
2781 } |
|
2782 |
|
2783 // ---------------------------------------------------------------------------- |
|
2784 // CSysApAppUi::ShowGprsSuspendedNoteAfterCallBack( TAny* aObject ) |
|
2785 // ---------------------------------------------------------------------------- |
|
2786 |
|
2787 TInt CSysApAppUi::ShowGprsSuspendedNoteAfterCallBack( TAny* aObject ) |
|
2788 { |
|
2789 TRACES( RDebug::Print( _L("CSysApAppUi::ShowGprsSuspendedNoteAfterCallBack") ) ); |
|
2790 |
|
2791 CSysApAppUi* appUi = STATIC_CAST( CSysApAppUi*, aObject ); |
|
2792 |
|
2793 if ( appUi->iTimer ) |
|
2794 { |
|
2795 appUi->iTimer->Cancel(); |
|
2796 } |
|
2797 |
|
2798 // Note is needed if call is still active and used network is not WCDMA |
|
2799 TInt callType = appUi->StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallType ); |
|
2800 TInt networkMode = appUi->StateOfProperty( KPSUidNetworkInfo, KNWTelephonyNetworkMode ); |
|
2801 TRACES( RDebug::Print( |
|
2802 _L("CSysApAppUi::ShowGprsSuspendedNoteAfterCallBack: callType %d networkMode %d"), |
|
2803 callType, networkMode ) ); |
|
2804 if ( EPSCTsyCallTypeCSVoice == callType && ENWNetworkModeWcdma != networkMode ) |
|
2805 { |
|
2806 appUi->iGprsSuspendedNoteShown = ETrue; |
|
2807 } |
|
2808 return KErrNone; |
|
2809 } |
|
2810 |
|
2811 // ---------------------------------------------------------------------------- |
|
2812 // CSysApAppUi::HandleAccessoryConnectedL() |
|
2813 // ---------------------------------------------------------------------------- |
|
2814 |
|
2815 void CSysApAppUi::HandleAccessoryConnectedL( TAccMode aAccessoryState ) |
|
2816 { |
|
2817 TRACES( RDebug::Print( _L("CSysApAppUi::HandleAccessoryConnectedL( aAccessoryState: %d ) "), aAccessoryState ) ); |
|
2818 |
|
2819 if ( aAccessoryState == EAccModeWirelessHeadset || |
|
2820 aAccessoryState == EAccModeWiredHeadset || |
|
2821 aAccessoryState == EAccModeHeadphones ) |
|
2822 { |
|
2823 SetIndicatorStateL( EAknIndicatorLoopset, EAknIndicatorStateOff ); |
|
2824 SetIndicatorStateL( EAknIndicatorTTY, EAknIndicatorStateOff ); |
|
2825 SetIndicatorStateL( EAknIndicatorHeadset, EAknIndicatorStateOn ); |
|
2826 SetIndicatorStateL( EAknIndicatorHeadsetUnavailable, EAknIndicatorStateOff ); |
|
2827 SetIndicatorStateL( EAknIndicatorCarkit, EAknIndicatorStateOff ); |
|
2828 SetIndicatorStateL( EAknIndicatorTvOut, EAknIndicatorStateOff ); |
|
2829 SetIndicatorStateL( EAknIndicatorHDMI, EAknIndicatorStateOff ); |
|
2830 } |
|
2831 else if ( aAccessoryState == EAccModeLoopset ) |
|
2832 { |
|
2833 SetIndicatorStateL( EAknIndicatorHeadset, EAknIndicatorStateOff ); |
|
2834 SetIndicatorStateL( EAknIndicatorTTY, EAknIndicatorStateOff ); |
|
2835 SetIndicatorStateL( EAknIndicatorLoopset, EAknIndicatorStateOn ); |
|
2836 SetIndicatorStateL( EAknIndicatorHeadsetUnavailable, EAknIndicatorStateOff ); |
|
2837 SetIndicatorStateL( EAknIndicatorCarkit, EAknIndicatorStateOff ); |
|
2838 SetIndicatorStateL( EAknIndicatorTvOut, EAknIndicatorStateOff ); |
|
2839 SetIndicatorStateL( EAknIndicatorHDMI, EAknIndicatorStateOff ); |
|
2840 } |
|
2841 else if ( aAccessoryState == EAccModeTextDevice ) |
|
2842 { |
|
2843 SetIndicatorStateL( EAknIndicatorHeadset, EAknIndicatorStateOff ); |
|
2844 SetIndicatorStateL( EAknIndicatorLoopset, EAknIndicatorStateOff ); |
|
2845 SetIndicatorStateL( EAknIndicatorTTY, EAknIndicatorStateOn ); |
|
2846 SetIndicatorStateL( EAknIndicatorHeadsetUnavailable, EAknIndicatorStateOff ); |
|
2847 SetIndicatorStateL( EAknIndicatorCarkit, EAknIndicatorStateOff ); |
|
2848 SetIndicatorStateL( EAknIndicatorTvOut, EAknIndicatorStateOff ); |
|
2849 SetIndicatorStateL( EAknIndicatorHDMI, EAknIndicatorStateOff ); |
|
2850 } |
|
2851 else if ( aAccessoryState == EAccModeWirelessCarKit || aAccessoryState == EAccModeWiredCarKit ) |
|
2852 { |
|
2853 SetIndicatorStateL( EAknIndicatorHeadset, EAknIndicatorStateOff ); |
|
2854 SetIndicatorStateL( EAknIndicatorLoopset, EAknIndicatorStateOff ); |
|
2855 SetIndicatorStateL( EAknIndicatorTTY, EAknIndicatorStateOff ); |
|
2856 SetIndicatorStateL( EAknIndicatorHeadsetUnavailable, EAknIndicatorStateOff ); |
|
2857 SetIndicatorStateL( EAknIndicatorCarkit, EAknIndicatorStateOn ); |
|
2858 SetIndicatorStateL( EAknIndicatorTvOut, EAknIndicatorStateOff ); |
|
2859 SetIndicatorStateL( EAknIndicatorHDMI, EAknIndicatorStateOff ); |
|
2860 } |
|
2861 else if ( aAccessoryState == EAccModeTVOut ) |
|
2862 { |
|
2863 SetIndicatorStateL( EAknIndicatorHeadset, EAknIndicatorStateOff ); |
|
2864 SetIndicatorStateL( EAknIndicatorLoopset, EAknIndicatorStateOff ); |
|
2865 SetIndicatorStateL( EAknIndicatorTTY, EAknIndicatorStateOff ); |
|
2866 SetIndicatorStateL( EAknIndicatorHeadsetUnavailable, EAknIndicatorStateOff ); |
|
2867 SetIndicatorStateL( EAknIndicatorCarkit, EAknIndicatorStateOff ); |
|
2868 SetIndicatorStateL( EAknIndicatorTvOut, EAknIndicatorStateOn ); |
|
2869 SetIndicatorStateL( EAknIndicatorHDMI, EAknIndicatorStateOff ); |
|
2870 } |
|
2871 else if (aAccessoryState == EAccModeHDMI ) |
|
2872 { |
|
2873 SetIndicatorStateL( EAknIndicatorHeadset, EAknIndicatorStateOff ); |
|
2874 SetIndicatorStateL( EAknIndicatorLoopset, EAknIndicatorStateOff ); |
|
2875 SetIndicatorStateL( EAknIndicatorTTY, EAknIndicatorStateOff ); |
|
2876 SetIndicatorStateL( EAknIndicatorHeadsetUnavailable, EAknIndicatorStateOff ); |
|
2877 SetIndicatorStateL( EAknIndicatorCarkit, EAknIndicatorStateOff ); |
|
2878 SetIndicatorStateL( EAknIndicatorTvOut, EAknIndicatorStateOff); |
|
2879 SetIndicatorStateL( EAknIndicatorHDMI, EAknIndicatorStateOn ); |
|
2880 } |
|
2881 |
|
2882 TInt swState( StateOfProperty( KPSUidStartup, KPSGlobalSystemState ) ); |
|
2883 TRACES( RDebug::Print( _L("CSysApAppUi::HandleAccessoryConnectedL: swState: %d"), swState ) ); |
|
2884 |
|
2885 if( UiReady() || swState == ESwStateSecurityCheck ) |
|
2886 { |
|
2887 iSysApLightsController->AccessoryConnectedL( ETrue ); |
|
2888 } |
|
2889 |
|
2890 if ( ( ! iIgnoreAccessorySpecificProfileChanges ) && ( ! iSysApOfflineModeController->OfflineModeActive() ) ) |
|
2891 { |
|
2892 TInt profileId( 0 ); |
|
2893 TInt currentProfile( 0 ); |
|
2894 currentProfile = ActiveProfileId(); |
|
2895 |
|
2896 if ( iSysApCenRepController->GetInt( KCRUidCoreApplicationUIsSysAp, KSysApAccessoryConnected ) < 1 ) |
|
2897 // accessory not connected already |
|
2898 { |
|
2899 iSysApCenRepController->SetInt( KCRUidCoreApplicationUIsSysAp, KSysApAccessoryConnected, 1 ); |
|
2900 iSysApCenRepController->SetInt( KCRUidCoreApplicationUIsSysAp, KSysApActiveProfileBeforeAccessoryConnected, currentProfile ); |
|
2901 } |
|
2902 |
|
2903 if ( aAccessoryState == EAccModeWirelessCarKit ) |
|
2904 { |
|
2905 profileId = iSysApCenRepController->ProfileIdForSelectedAccessory( ESysApWirelessCarkit ); |
|
2906 } |
|
2907 else if( aAccessoryState == EAccModeWiredHeadset || |
|
2908 aAccessoryState == EAccModeWirelessHeadset ) |
|
2909 { |
|
2910 profileId = iSysApCenRepController->ProfileIdForSelectedAccessory( ESysApHeadset ); |
|
2911 } |
|
2912 else if( aAccessoryState == EAccModeLoopset ) |
|
2913 { |
|
2914 profileId = iSysApCenRepController->ProfileIdForSelectedAccessory( ESysApLoopset ); |
|
2915 } |
|
2916 else if( aAccessoryState == EAccModeTextDevice ) |
|
2917 { |
|
2918 profileId = iSysApCenRepController->ProfileIdForSelectedAccessory( ESysApTty ); |
|
2919 } |
|
2920 else if( aAccessoryState == EAccModeTVOut || aAccessoryState == EAccModeHDMI ) |
|
2921 { |
|
2922 profileId = iSysApCenRepController->ProfileIdForSelectedAccessory( ESysApTvOut ); |
|
2923 } |
|
2924 else if( aAccessoryState == EAccModeHeadphones ) |
|
2925 { |
|
2926 profileId = iSysApCenRepController->ProfileIdForSelectedAccessory( ESysApHeadphones ); |
|
2927 } |
|
2928 else if ( aAccessoryState == EAccModeWiredCarKit ) |
|
2929 { |
|
2930 profileId = iSysApCenRepController->ProfileIdForSelectedAccessory( ESysApCarkit ); |
|
2931 } |
|
2932 else if ( aAccessoryState == EAccModeMusicStand ) |
|
2933 { |
|
2934 profileId = iSysApCenRepController->ProfileIdForSelectedAccessory( ESysApMusicStand ); |
|
2935 } |
|
2936 |
|
2937 // Carkit and music stand have also light on permanently option that needs to be checked |
|
2938 if( aAccessoryState == EAccModeWiredCarKit || aAccessoryState == EAccModeMusicStand ) |
|
2939 { |
|
2940 // When device is placed on a handsfree cradle, keyguard must be disabled (unless device is locked) |
|
2941 // Note: It is assumed that if carkit/music stand is connected, the phone is in the cradle. |
|
2942 if ( iKeyLockEnabled || iDeviceLockEnabled || iKeyLockOnBeforeCall || iKeyLockOnBeforeAlarm ) |
|
2943 { |
|
2944 iKeyLockOnBeforeCradle = ETrue; |
|
2945 |
|
2946 if ( iKeyLockEnabled && !iDeviceLockEnabled ) |
|
2947 { |
|
2948 KeyLock().DisableWithoutNote(); |
|
2949 } |
|
2950 } |
|
2951 } |
|
2952 |
|
2953 if( profileId != KActiveProfile ) |
|
2954 { |
|
2955 /*-1 because the first item in Accessory default profiles shared data values |
|
2956 is KActiveProfile and that must be subtracted from the index of profile to be activated*/ |
|
2957 |
|
2958 profileId -= 1; |
|
2959 |
|
2960 TRACES( RDebug::Print( _L("CSysApAppUi::HandleAccessoryConnectedL: current profile: %d, accessory profile: %d" ), |
|
2961 currentProfile, profileId ) ); |
|
2962 |
|
2963 if ( profileId != currentProfile ) |
|
2964 { |
|
2965 iAccessoryJustConnected = ETrue; |
|
2966 iSysApCenRepController->SetInt( KCRUidCoreApplicationUIsSysAp, KSysApProfileUpdateRequired, 1 ); |
|
2967 ActivateProfileL( profileId ); |
|
2968 } |
|
2969 } |
|
2970 } |
|
2971 SetIhfIndicatorL(); |
|
2972 SetHacIndicatorL(); |
|
2973 } |
|
2974 |
|
2975 // ---------------------------------------------------------------------------- |
|
2976 // CSysApAppUi::HandleAccessoryDisconnectedL() |
|
2977 // ---------------------------------------------------------------------------- |
|
2978 |
|
2979 void CSysApAppUi::HandleAccessoryDisconnectedL() |
|
2980 { |
|
2981 TRACES( RDebug::Print( _L("CSysApAppUi::HandleAccessoryDisconnectedL()" ) ) ); |
|
2982 |
|
2983 |
|
2984 TAccMode accessoryState(EAccModeHandPortable); |
|
2985 if ( iSysApAccessoryObserver ) |
|
2986 { |
|
2987 accessoryState = iSysApAccessoryObserver->GetAccessoryMode(); |
|
2988 } |
|
2989 |
|
2990 if ( accessoryState == EAccModeHandPortable ) |
|
2991 { |
|
2992 SetIndicatorStateL( EAknIndicatorTvOut, EAknIndicatorStateOff ); |
|
2993 SetIndicatorStateL( EAknIndicatorLoopset, EAknIndicatorStateOff ); |
|
2994 SetIndicatorStateL( EAknIndicatorHeadset, EAknIndicatorStateOff ); |
|
2995 SetIndicatorStateL( EAknIndicatorTTY, EAknIndicatorStateOff ); |
|
2996 SetIndicatorStateL( EAknIndicatorHeadsetUnavailable, EAknIndicatorStateOff ); |
|
2997 SetIndicatorStateL( EAknIndicatorCarkit, EAknIndicatorStateOff ); |
|
2998 SetIndicatorStateL( EAknIndicatorHDMI, EAknIndicatorStateOff ); |
|
2999 |
|
3000 iSysApLightsController->AccessoryConnectedL( EFalse ); |
|
3001 |
|
3002 if ( ! iIgnoreAccessorySpecificProfileChanges ) |
|
3003 { |
|
3004 TInt activeProfile ( ActiveProfileId() ); |
|
3005 |
|
3006 TInt activeProfileBeforeConnectingAccessory( |
|
3007 iSysApCenRepController->GetInt( KCRUidCoreApplicationUIsSysAp, KSysApActiveProfileBeforeAccessoryConnected ) |
|
3008 ); |
|
3009 if ( activeProfileBeforeConnectingAccessory < 0 ) // error |
|
3010 { |
|
3011 activeProfileBeforeConnectingAccessory = 0; // General Profile |
|
3012 } |
|
3013 TRACES( RDebug::Print( _L("CSysApAppUi::HandleAccessoryDisconnectedL: active profile now: %d, active profile before: %d," ), |
|
3014 activeProfile, activeProfileBeforeConnectingAccessory ) ); |
|
3015 |
|
3016 if ( iSysApCenRepController->GetInt( KCRUidCoreApplicationUIsSysAp, KSysApProfileUpdateRequired ) == 1 ) |
|
3017 { |
|
3018 iSysApCenRepController->SetInt( KCRUidCoreApplicationUIsSysAp, KSysApProfileUpdateRequired, 0 ); |
|
3019 if ( activeProfile != activeProfileBeforeConnectingAccessory && ! iSysApOfflineModeController->OfflineModeActive() ) |
|
3020 { |
|
3021 ActivateProfileL( activeProfileBeforeConnectingAccessory ); |
|
3022 } |
|
3023 } |
|
3024 iSysApCenRepController->SetInt( KCRUidCoreApplicationUIsSysAp, KSysApAccessoryConnected, 0 ); |
|
3025 } |
|
3026 } |
|
3027 |
|
3028 SetIhfIndicatorL(); |
|
3029 SetHacIndicatorL(); |
|
3030 |
|
3031 // If lock disabled because of accessory, reactivate it, unless phone call or alarm is ongoing |
|
3032 if ( iKeyLockOnBeforeCradle ) |
|
3033 { |
|
3034 iKeyLockOnBeforeCradle = EFalse; |
|
3035 if ( !iKeyLockOnBeforeCall && !iKeyLockOnBeforeAlarm ) |
|
3036 { |
|
3037 if ( !iDeviceLockEnabled ) |
|
3038 { |
|
3039 KeyLock().EnableKeyLock(); |
|
3040 } |
|
3041 else |
|
3042 { |
|
3043 KeyLock().EnableAutoLockEmulation(); |
|
3044 } |
|
3045 } |
|
3046 } |
|
3047 } |
|
3048 |
|
3049 // ---------------------------------------------------------------------------- |
|
3050 // CSysApAppUi::HandleAccessoryProfileInStartupL() |
|
3051 // ---------------------------------------------------------------------------- |
|
3052 |
|
3053 void CSysApAppUi::HandleAccessoryProfileInStartupL() |
|
3054 { |
|
3055 TRACES( RDebug::Print( _L( "CSysApAppUi::HandleAccessoryProfileInStartupL" ) ) ); |
|
3056 |
|
3057 if ( !iSysApOfflineModeController->OfflineModeActive() ) |
|
3058 { |
|
3059 iIgnoreAccessorySpecificProfileChanges = EFalse; |
|
3060 TBool accessoryConnectedInShutdown( EFalse ); |
|
3061 TInt accessoryTemp( iSysApCenRepController->GetInt( KCRUidCoreApplicationUIsSysAp, KSysApAccessoryConnected ) ); |
|
3062 if ( accessoryTemp == 1 ) |
|
3063 { |
|
3064 accessoryConnectedInShutdown = ETrue; |
|
3065 } |
|
3066 |
|
3067 TBool accessoryConnectedNow ( EFalse ); |
|
3068 |
|
3069 TAccMode accessoryState(EAccModeHandPortable); |
|
3070 if ( iSysApAccessoryObserver ) |
|
3071 { |
|
3072 accessoryState = iSysApAccessoryObserver->GetAccessoryMode(); |
|
3073 } |
|
3074 |
|
3075 if ( accessoryState != EAccModeHandPortable ) |
|
3076 { |
|
3077 accessoryConnectedNow = ETrue; |
|
3078 } |
|
3079 TRACES( RDebug::Print( _L( "CSysApAppUi::HandleAccessoryProfileInStartupL: accessoryConnectedInShutdown: %d, accessoryConnectedNow: %d" ), |
|
3080 accessoryConnectedInShutdown, accessoryConnectedNow ) ); |
|
3081 |
|
3082 if ( accessoryConnectedInShutdown && !accessoryConnectedNow ) |
|
3083 { |
|
3084 HandleAccessoryDisconnectedL(); |
|
3085 } |
|
3086 else if ( !accessoryConnectedInShutdown && accessoryConnectedNow ) |
|
3087 { |
|
3088 HandleAccessoryConnectedL( accessoryState ); |
|
3089 } |
|
3090 else if ( !accessoryConnectedNow ) |
|
3091 { |
|
3092 TInt activeProfile ( ActiveProfileId() ); |
|
3093 iSysApCenRepController->SetInt( KCRUidCoreApplicationUIsSysAp, KSysApActiveProfileBeforeAccessoryConnected, activeProfile ); |
|
3094 } |
|
3095 } |
|
3096 } |
|
3097 |
|
3098 #ifndef RD_MULTIPLE_DRIVE |
|
3099 |
|
3100 // ---------------------------------------------------------------------------- |
|
3101 // CSysApAppUi::ResolveUidFromThread() |
|
3102 // ---------------------------------------------------------------------------- |
|
3103 TInt32 CSysApAppUi::ResolveUidFromThread( TUint aThreadId ) const |
|
3104 { |
|
3105 TInt resolvedUid = 0; |
|
3106 |
|
3107 RThread appThread; |
|
3108 TInt err = appThread.Open( aThreadId ); |
|
3109 |
|
3110 if ( err == KErrNone ) |
|
3111 { |
|
3112 resolvedUid = appThread.SecureId().iId; |
|
3113 } |
|
3114 |
|
3115 appThread.Close(); |
|
3116 |
|
3117 TRACES( RDebug::Print( _L("CSysApAppUi::ResolveUidFromThread: err=%d, aThreadId=%d, resolvedUid=0x%x"), |
|
3118 err, aThreadId, resolvedUid ) ); |
|
3119 |
|
3120 return resolvedUid; |
|
3121 } |
|
3122 |
|
3123 // ---------------------------------------------------------------------------- |
|
3124 // CSysApAppUi::CloseUIAppsInHotSwapL() |
|
3125 // ---------------------------------------------------------------------------- |
|
3126 void CSysApAppUi::CloseUIAppsInHotSwapL() |
|
3127 { |
|
3128 TRACES( RDebug::Print( _L("CSysApAppUi::CloseUIAppsInHotSwapL") ) ); |
|
3129 |
|
3130 CArrayFixFlat<TInt>* wgIds=new(ELeave) CArrayFixFlat<TInt>(4); |
|
3131 CleanupStack::PushL(wgIds); |
|
3132 User::LeaveIfError(iCoeEnv->WsSession().WindowGroupList(0, wgIds)); |
|
3133 TInt lastEntry=wgIds->Count()-1; |
|
3134 TRACES( RDebug::Print( _L( "CSysApAppUi::CloseUIAppsInHotSwapL: Found %d UI applications running." ), lastEntry + 1 ) ); |
|
3135 TInt numberOfApplicationsToShutDown( 0 ); |
|
3136 iApplicationScanningRoundNumber++; |
|
3137 |
|
3138 for ( TInt i=lastEntry; i>=0; i--) |
|
3139 { |
|
3140 CApaWindowGroupName* doomedApp = CApaWindowGroupName::NewLC(iCoeEnv->WsSession(),wgIds->At(i)); |
|
3141 |
|
3142 TBool systemApp = doomedApp->IsSystem(); |
|
3143 TBool hiddenApp = doomedApp->Hidden(); |
|
3144 |
|
3145 if ( systemApp || hiddenApp ) |
|
3146 { |
|
3147 TRACES ( |
|
3148 TPtrC caption=doomedApp->Caption(); |
|
3149 RDebug::Print( _L("CSysApAppUi::CloseUIAppsInHotSwapL: Privileged app \"%S\" UID 0x%x will not be closed, system: %d, hidden: %d" ), |
|
3150 &caption, |
|
3151 doomedApp->AppUid().iUid, |
|
3152 systemApp, |
|
3153 hiddenApp); |
|
3154 ); |
|
3155 } |
|
3156 else if ( ( iFileManagerCloseDisabled && doomedApp->AppUid().iUid == KFileManagerAppUid ) || |
|
3157 doomedApp->AppUid().iUid == KAutolockAppUid ) |
|
3158 { |
|
3159 // An additional failure protection: Autolock must not be closed in any circumstances |
|
3160 TRACES ( |
|
3161 TPtrC caption=doomedApp->Caption(); |
|
3162 RDebug::Print( _L("CSysApAppUi::CloseUIAppsInHotSwapL: Privileged app \"%S\" will not be closed, UID 0x%x"), |
|
3163 &caption, |
|
3164 doomedApp->AppUid().iUid ); |
|
3165 ); |
|
3166 } |
|
3167 else if ( doomedApp->AppUid().iUid == 0 && !iTimeToKill ) |
|
3168 { |
|
3169 #ifdef _DEBUG |
|
3170 TApaTask task(iCoeEnv->WsSession()); |
|
3171 task.SetWgId(wgIds->At(i)); |
|
3172 TUint threadId = (TUint)(task.ThreadId()); |
|
3173 TInt32 uid = ResolveUidFromThread( threadId ); |
|
3174 // CApaWindowGroupName stores the application UID, and in early application startup state AppUid()-method returns 0 |
|
3175 // In order not to accidentally close application that hasn't yet its window group properly set up, decicision whether |
|
3176 // to close the application is postponed, in maximum to the end of the waiting period. |
|
3177 TRACES ( RDebug::Print( _L("CSysApAppUi::CloseUIAppsInHotSwapL: Unknown app will not be closed yet, threadId=%d, UID 0x%x, size=%d"), |
|
3178 threadId, uid, sizeof(TApaTask) ) ); |
|
3179 #endif // _DEBUG |
|
3180 numberOfApplicationsToShutDown++; // wait note must be displayed |
|
3181 } |
|
3182 else |
|
3183 { |
|
3184 numberOfApplicationsToShutDown++; |
|
3185 TApaTask* task = new (ELeave) TApaTask(iCoeEnv->WsSession()); |
|
3186 CleanupDeletePushL(task); |
|
3187 task->SetWgId(wgIds->At(i)); |
|
3188 |
|
3189 TRACES ( |
|
3190 const TDesC& caption = doomedApp->Caption(); |
|
3191 const TDesC& docname = doomedApp->DocName(); |
|
3192 const TDesC& wgname = doomedApp->WindowGroupName(); |
|
3193 TUid uid = doomedApp->AppUid(); |
|
3194 RDebug::Print( _L("CSysApAppUi::CloseUIAppsInHotSwapL: Closing app \"%S\" (ThreadId %d, WgId %d, UID 0x%X); Docname: %S, WGName : %S"), |
|
3195 &caption, |
|
3196 (TUint)(task->ThreadId()), |
|
3197 wgIds->At(i), |
|
3198 uid.iUid, |
|
3199 &docname, |
|
3200 &wgname); |
|
3201 ); |
|
3202 |
|
3203 ResolveUidFromThread( (TUint)(task->ThreadId()) ); |
|
3204 |
|
3205 if ( iApplicationScanningRoundNumber == 1 ) |
|
3206 { |
|
3207 task->EndTask(); // applications are kindly requested to close themselves on the first round |
|
3208 } |
|
3209 else if ( iTimeToKill ) |
|
3210 { |
|
3211 TBool doKill = ETrue; |
|
3212 |
|
3213 // final check, window group may still be uninitialized so use thread id for checking UID |
|
3214 if ( doomedApp->AppUid().iUid == 0 ) |
|
3215 { |
|
3216 if ( ResolveUidFromThread( (TUint)(task->ThreadId()) ) == KAutolockAppUid ) |
|
3217 { |
|
3218 doKill = EFalse; |
|
3219 } |
|
3220 } |
|
3221 |
|
3222 if ( doKill ) |
|
3223 { |
|
3224 TRACES( RDebug::Print( _L("CSysApAppUi::CloseUIAppsInHotSwapL: Killing app \"%S\""), &caption ) ); |
|
3225 task->KillTask(); // used after timeout on the last round |
|
3226 } |
|
3227 } |
|
3228 |
|
3229 CleanupStack::PopAndDestroy(); // task |
|
3230 } |
|
3231 CleanupStack::PopAndDestroy(); // doomedApp |
|
3232 } |
|
3233 CleanupStack::PopAndDestroy(); // wgIds |
|
3234 |
|
3235 if ( numberOfApplicationsToShutDown > 0 && iApplicationScanningRoundNumber <= KMaxExitTimeInHotSwap ) |
|
3236 { |
|
3237 TRACES( RDebug::Print( _L("CSysApAppUi::CloseUIAppsInHotSwapL: Show wait note, unless already showing") ) ); |
|
3238 if ( !iSysApWaitNote ) |
|
3239 { |
|
3240 HBufC* noteStringBuf = StringLoader::LoadLC( R_QTN_MEMC_WAIT_EJECT, iEikonEnv ); |
|
3241 iSysApWaitNote = CSysApWaitNote::NewL( iSysApFeatureManager->CoverDisplaySupported() ); |
|
3242 iSysApWaitNote->ShowNoteL( EClosingApplicationsNote, noteStringBuf ); |
|
3243 CleanupStack::PopAndDestroy(); |
|
3244 } |
|
3245 |
|
3246 if ( iApplicationScanningRoundNumber >= KMaxExitTimeInHotSwap ) |
|
3247 { |
|
3248 iTimeToKill = ETrue; |
|
3249 } |
|
3250 |
|
3251 if ( !iSysApTimer ) |
|
3252 { |
|
3253 iSysApTimer = new ( ELeave ) CSysApTimer( *this ); |
|
3254 } |
|
3255 |
|
3256 iSysApTimer->ActivateTimerL( KApplicationScanningInterval ); |
|
3257 } |
|
3258 else |
|
3259 { |
|
3260 iFileManagerCloseDisabled = EFalse; |
|
3261 CompleteAppsShuttingInHotSwapL(); |
|
3262 } |
|
3263 } |
|
3264 |
|
3265 #endif // RD_MULTIPLE_DRIVE |
|
3266 |
|
3267 // ---------------------------------------------------------------------------- |
|
3268 // CSysApAppUi::TimerExpiredL() |
|
3269 // ---------------------------------------------------------------------------- |
|
3270 void CSysApAppUi::TimerExpiredL() |
|
3271 { |
|
3272 #ifndef RD_MULTIPLE_DRIVE |
|
3273 CloseUIAppsInHotSwapL(); |
|
3274 #endif // RD_MULTIPLE_DRIVE |
|
3275 } |
|
3276 |
|
3277 #ifndef RD_MULTIPLE_DRIVE |
|
3278 // ---------------------------------------------------------------------------- |
|
3279 // CSysApAppUi::CompleteAppsShuttingInHotSwapL() |
|
3280 // ---------------------------------------------------------------------------- |
|
3281 void CSysApAppUi::CompleteAppsShuttingInHotSwapL() |
|
3282 { |
|
3283 TRACES( RDebug::Print( _L("CSysApAppUi::CompleteAppsShuttingInHotSwapL iMMCEjectUsed=%d, iMMCInserted=%d"), iMMCEjectUsed, iMMCInserted ) ); |
|
3284 CancelWaitNote(); |
|
3285 |
|
3286 if ( iMMCEjectUsed ) // From Powerkey Menu |
|
3287 { |
|
3288 DismountMMC(); |
|
3289 TRACES( RDebug::Print( _L( "CSysApAppUi::CompleteAppsShuttingInHotSwapL: Show note: Remove MMC and press OK...." ) ) ); |
|
3290 ShowQueryL( ESysApRemoveMmcNote ); |
|
3291 } |
|
3292 else if ( !iMMCInserted ) // The MMC might have been already re-mounted, that's why !iMMCInserted |
|
3293 { |
|
3294 ShowMMCDismountedDialogL(); |
|
3295 } |
|
3296 } |
|
3297 #endif // RD_MULTIPLE_DRIVE |
|
3298 |
|
3299 // ---------------------------------------------------------------------------- |
|
3300 // CSysApAppUi::InitCloseSimApplicationsL() |
|
3301 // ---------------------------------------------------------------------------- |
|
3302 void CSysApAppUi::InitCloseSimApplicationsL() |
|
3303 { |
|
3304 iApplicationScanningRoundNumberInBtSap = 0; |
|
3305 iTimeToKillInBtSap = EFalse; |
|
3306 CloseSimApplicationsL(); |
|
3307 } |
|
3308 |
|
3309 // ---------------------------------------------------------------------------- |
|
3310 // CSysApAppUi::CloseSimApplicationsL() |
|
3311 // ---------------------------------------------------------------------------- |
|
3312 void CSysApAppUi::CloseSimApplicationsL() |
|
3313 { |
|
3314 iApplicationScanningRoundNumberInBtSap++; |
|
3315 TRACES( RDebug::Print( _L("CSysApAppUi::CloseSimApplicationsL: scanning round = %d"), |
|
3316 iApplicationScanningRoundNumberInBtSap ) ); |
|
3317 |
|
3318 if ( iApplicationScanningRoundNumberInBtSap == KMaxExitTimeInBtSap ) |
|
3319 { |
|
3320 iTimeToKillInBtSap = ETrue; |
|
3321 } |
|
3322 |
|
3323 const TInt KNumberOfSimDependantApps( 7 ); |
|
3324 TUid simDependantAppUid[ KNumberOfSimDependantApps ]; |
|
3325 simDependantAppUid[ 0 ] = KSysApGSUid; |
|
3326 simDependantAppUid[ 1 ] = KSysApSATUid; |
|
3327 simDependantAppUid[ 2 ] = KSysApMailboxUid; |
|
3328 simDependantAppUid[ 3 ] = KSysApSpeedDialingUid; |
|
3329 simDependantAppUid[ 4 ] = KSysApSimDirectoryUid; |
|
3330 simDependantAppUid[ 5 ] = KSysApMCEUid; |
|
3331 simDependantAppUid[ 6 ] = KSysApCellBroadcastMessagesUid; |
|
3332 |
|
3333 TBool appsExiting( EFalse ); |
|
3334 TApaTaskList apaTaskList( CCoeEnv::Static()->WsSession() ); |
|
3335 |
|
3336 for ( TInt i = 0; i < KNumberOfSimDependantApps; i++ ) |
|
3337 { |
|
3338 TApaTask apaTask = apaTaskList.FindApp( simDependantAppUid[ i ] ); |
|
3339 if ( apaTask.Exists() ) |
|
3340 { |
|
3341 appsExiting = ETrue; |
|
3342 if ( iApplicationScanningRoundNumberInBtSap == 1 ) |
|
3343 { |
|
3344 apaTask.EndTask(); // applications are kindly requested to close themselves on the first round |
|
3345 } |
|
3346 else if ( iTimeToKillInBtSap ) |
|
3347 { |
|
3348 apaTask.KillTask(); // used after timeout on the last round |
|
3349 } |
|
3350 } |
|
3351 } |
|
3352 |
|
3353 if ( !appsExiting || iTimeToKillInBtSap ) |
|
3354 { |
|
3355 iSysApBtSapController->SimApplicationsClosed(); |
|
3356 } |
|
3357 else |
|
3358 { |
|
3359 if ( !iSapTimer ) |
|
3360 { |
|
3361 iSapTimer = CPeriodic::NewL( EPriorityNormal ); |
|
3362 } |
|
3363 iSapTimer->Cancel(); |
|
3364 iSapTimer->Start( KDelayBeforeNextScanningRound, |
|
3365 KDelayBeforeNextScanningRound, |
|
3366 TCallBack( DoCloseSimApplicationsAfterCallBack, this ) ); |
|
3367 } |
|
3368 } |
|
3369 |
|
3370 // ---------------------------------------------------------------------------- |
|
3371 // CSysApAppUi::DoCloseSimApplicationsAfterCallBack |
|
3372 // ---------------------------------------------------------------------------- |
|
3373 TInt CSysApAppUi::DoCloseSimApplicationsAfterCallBack( TAny* aObject ) |
|
3374 { |
|
3375 CSysApAppUi* appUi = STATIC_CAST( CSysApAppUi*, aObject ); |
|
3376 |
|
3377 if ( appUi->iSapTimer ) |
|
3378 { |
|
3379 appUi->iSapTimer->Cancel(); |
|
3380 } |
|
3381 |
|
3382 TRAP_IGNORE( appUi->CloseSimApplicationsL() ); |
|
3383 |
|
3384 return KErrNone; |
|
3385 } |
|
3386 |
|
3387 // ---------------------------------------------------------------------------- |
|
3388 // CSysApAppUi::AlertUiAlertingL( const TBool aAlerting ) |
|
3389 // ---------------------------------------------------------------------------- |
|
3390 void CSysApAppUi::AlertUiAlertingL( const TBool aAlerting ) |
|
3391 { |
|
3392 TRACES( RDebug::Print( _L("CSysApAppUi::AlertUiAlerting aAlerting:%d"), aAlerting ) ); |
|
3393 |
|
3394 if ( aAlerting ) |
|
3395 { |
|
3396 TInt swState; |
|
3397 RProperty::Get( KPSUidStartup, KPSGlobalSystemState, swState ); |
|
3398 |
|
3399 if( swState == ESwStateCharging ) |
|
3400 { |
|
3401 SetStarterState( RStarterSession::EAlarm ); |
|
3402 } |
|
3403 } |
|
3404 |
|
3405 iSysApLightsController->AlarmOccuredL( aAlerting ); |
|
3406 } |
|
3407 |
|
3408 // ---------------------------------------------------------------------------- |
|
3409 // CSysApAppUi::AlertUiKeyLockOff( const TBool aKeyLockOff ) |
|
3410 // ---------------------------------------------------------------------------- |
|
3411 |
|
3412 void CSysApAppUi::AlertUiKeyLockOff( const TBool aKeyLockOff ) |
|
3413 { |
|
3414 TRACES( RDebug::Print( _L("CSysApAppUi::AlertUiKeyLockOff aKeyLockOff:%d, devicelock:%d"), |
|
3415 aKeyLockOff, iDeviceLockEnabled ) ); |
|
3416 |
|
3417 if( aKeyLockOff ) |
|
3418 { |
|
3419 // Notification to release keypad might come several times if e.g. calls are received |
|
3420 if ( !iKeyLockOnBeforeAlarm ) |
|
3421 { |
|
3422 if ( iKeyLockEnabled || iKeyLockOnBeforeCradle || iKeyLockOnBeforeCall ) |
|
3423 { |
|
3424 iKeyLockOnBeforeAlarm = ETrue; |
|
3425 } |
|
3426 } |
|
3427 KeyLock().DisableWithoutNote(); |
|
3428 } |
|
3429 else |
|
3430 { |
|
3431 if (iDeviceLockEnabled) |
|
3432 { |
|
3433 // Re-enable keylock in devicelock case only if phone call is not ongoing or is |
|
3434 // connected. Otherwise e.g. messages can be read using softkeys during ongoing call. |
|
3435 TInt callState( StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ) ); |
|
3436 if ( callState == EPSCTsyCallStateNone || callState == EPSCTsyCallStateConnected ) |
|
3437 { |
|
3438 KeyLock().EnableAutoLockEmulation(); |
|
3439 } |
|
3440 } |
|
3441 else if ( iKeyLockOnBeforeAlarm && !iKeyLockOnBeforeCradle && !iKeyLockOnBeforeCall ) |
|
3442 { |
|
3443 KeyLock().EnableKeyLock(); |
|
3444 } |
|
3445 iKeyLockOnBeforeAlarm = EFalse; |
|
3446 } |
|
3447 } |
|
3448 |
|
3449 // ---------------------------------------------------------------------------- |
|
3450 // CSysApAppUi::HandleLightsRequireL() |
|
3451 // ---------------------------------------------------------------------------- |
|
3452 |
|
3453 void CSysApAppUi::HandleLightsRequireL() const |
|
3454 { |
|
3455 iSysApLightsController->HandleLightsRequireL(); |
|
3456 } |
|
3457 |
|
3458 // ---------------------------------------------------------------------------- |
|
3459 // CSysApAppUi::HandleRawKeyEventLightsRequireL() |
|
3460 // ---------------------------------------------------------------------------- |
|
3461 |
|
3462 void CSysApAppUi::HandleRawKeyEventLightsRequireL() const |
|
3463 { |
|
3464 iSysApLightsController->HandleRawKeyEventLightsRequireL(); |
|
3465 } |
|
3466 |
|
3467 // ---------------------------------------------------------------------------- |
|
3468 // CSysApAppUi::HandleForcedLightsVTRequireL( const TInt aLightParameter ) |
|
3469 // ---------------------------------------------------------------------------- |
|
3470 |
|
3471 void CSysApAppUi::HandleForcedLightsVTRequireL( const TInt aLightsParameter ) const |
|
3472 { |
|
3473 iSysApLightsController->HandleForcedLightsVTRequireL( aLightsParameter ); |
|
3474 } |
|
3475 |
|
3476 // ---------------------------------------------------------------------------- |
|
3477 // CSysApAppUi::HandleForcedLightsSSRequireL( const TInt aLightParameter ) |
|
3478 // ---------------------------------------------------------------------------- |
|
3479 |
|
3480 void CSysApAppUi::HandleForcedLightsSSRequireL( const TInt aLightsParameter ) const |
|
3481 { |
|
3482 iSysApLightsController->HandleForcedLightsSSRequireL( aLightsParameter ); |
|
3483 } |
|
3484 |
|
3485 // ---------------------------------------------------------------------------- |
|
3486 // CSysApAppUi::HandleForcedLightsATCRequireL( const TInt aLightParameter ) |
|
3487 // ---------------------------------------------------------------------------- |
|
3488 void CSysApAppUi::HandleForcedLightsATCRequireL( const TInt aLightsParameter ) const |
|
3489 { |
|
3490 iSysApLightsController->HandleForcedLightsATCRequireL( aLightsParameter ); |
|
3491 } |
|
3492 |
|
3493 // ---------------------------------------------------------------------------- |
|
3494 // CSysApAppUi::SwitchLightsOnSoftRejectL() |
|
3495 // ---------------------------------------------------------------------------- |
|
3496 void CSysApAppUi::SwitchLightsOnSoftRejectL() |
|
3497 { |
|
3498 iSysApLightsController->SwitchLightsOnSoftRejectL(); |
|
3499 } |
|
3500 |
|
3501 // ---------------------------------------------------------------------------- |
|
3502 // CSysApAppUi::StateOfProperty() |
|
3503 // ---------------------------------------------------------------------------- |
|
3504 TInt CSysApAppUi::StateOfProperty( const TUid& aCategory, const TUint aKey ) const |
|
3505 { |
|
3506 TInt err( KErrNone ); |
|
3507 TInt value( 0 ); |
|
3508 err = RProperty::Get( aCategory, aKey, value ); |
|
3509 if ( err ) |
|
3510 { |
|
3511 TRACES( RDebug::Print( _L("CSysApAppUi::StateOfProperty. RProperty::Get: err=%d"), err ) ); |
|
3512 return err; |
|
3513 } |
|
3514 return value; |
|
3515 } |
|
3516 |
|
3517 // ---------------------------------------------------------------------------- |
|
3518 // CSysApAppUi::BluetoothPowerMode() |
|
3519 // ---------------------------------------------------------------------------- |
|
3520 TInt CSysApAppUi::BluetoothPowerMode() const |
|
3521 { |
|
3522 return iSysApCenRepBtObserver->BluetoothPowerMode(); |
|
3523 } |
|
3524 |
|
3525 // ---------------------------------------------------------------------------- |
|
3526 // CSysApAppUi::ActivateProfileL( const TInt aProfileId ) const |
|
3527 // ---------------------------------------------------------------------------- |
|
3528 |
|
3529 void CSysApAppUi::ActivateProfileL( const TInt aProfileId ) const |
|
3530 { |
|
3531 TRACES( RDebug::Print( _L("CSysApAppUi::ActivateProfile aProfileId: %d"), aProfileId ) ); |
|
3532 //No use of returning the Profile error code since it only tells if the activation was succesfull or not. |
|
3533 iProfileEngine->SetActiveProfileL( aProfileId ); |
|
3534 } |
|
3535 |
|
3536 // ---------------------------------------------------------------------------- |
|
3537 // CSysApAppUi::ActivateOnlineProfileL() const |
|
3538 // ---------------------------------------------------------------------------- |
|
3539 |
|
3540 void CSysApAppUi::ActivateOnlineProfileL() const |
|
3541 { |
|
3542 ActivateProfileL( iProfileToBeActivated ); |
|
3543 } |
|
3544 |
|
3545 // ---------------------------------------------------------------------------- |
|
3546 // CSysApAppUi::ActiveProfileNameL( TPtr aProfileName ) const |
|
3547 // ---------------------------------------------------------------------------- |
|
3548 |
|
3549 void CSysApAppUi::ActiveProfileNameL( TPtr aProfileName ) |
|
3550 { |
|
3551 TRACES( RDebug::Print( _L("CSysApAppUi::ActiveProfileNameL START") ) ); |
|
3552 MProfile* profile = iProfileEngine->ActiveProfileL(); |
|
3553 const MProfileName& mProfileName = profile->ProfileName(); |
|
3554 aProfileName = mProfileName.Name(); |
|
3555 profile->Release(); |
|
3556 TRACES( RDebug::Print( _L("CSysApAppUi::ActiveProfileNameL END") ) ); |
|
3557 } |
|
3558 |
|
3559 // ---------------------------------------------------------------------------- |
|
3560 // CSysApAppUi::CheckSilentModeL() |
|
3561 // ---------------------------------------------------------------------------- |
|
3562 void CSysApAppUi::CheckSilentModeL() |
|
3563 { |
|
3564 TBool isSilent( EFalse ); |
|
3565 MProfile* profile = iProfileEngine->ActiveProfileL(); |
|
3566 isSilent = profile->IsSilent(); |
|
3567 profile->Release(); |
|
3568 if ( isSilent ) |
|
3569 { |
|
3570 TRACES( RDebug::Print( _L("CSysApAppUi::CheckSilentModeL: active profile is SILENT") ) ); |
|
3571 iSysApLightsController->SetSilentModeOn( ETrue ); |
|
3572 } |
|
3573 else |
|
3574 { |
|
3575 TRACES( RDebug::Print( _L("CSysApAppUi::CheckSilentModeL: active profile is NOT SILENT") ) ); |
|
3576 iSysApLightsController->SetSilentModeOn( EFalse ); |
|
3577 } |
|
3578 } |
|
3579 |
|
3580 // ---------------------------------------------------------------------------- |
|
3581 // CSysApAppUi::HandleProfileChangedL( const TInt aValue ) |
|
3582 // ---------------------------------------------------------------------------- |
|
3583 void CSysApAppUi::HandleProfileChangedL( const TInt aNewProfileId ) |
|
3584 { |
|
3585 TRACES( RDebug::Print( _L("CSysApAppUi::HandleProfileChangedL: aNewProfileId=%d"), aNewProfileId ) ); |
|
3586 CheckSilentModeL(); |
|
3587 if ( iHandleNextProfileEvent ) |
|
3588 { |
|
3589 if ( iAccessoryJustConnected ) |
|
3590 { |
|
3591 iAccessoryJustConnected = EFalse; |
|
3592 } |
|
3593 else |
|
3594 { |
|
3595 // if the user delibarately changes profiles, the selected profile will |
|
3596 // remain active after disconnecting an accessory. |
|
3597 iSysApCenRepController->SetInt( KCRUidCoreApplicationUIsSysAp, KSysApProfileUpdateRequired, 0 ); |
|
3598 } |
|
3599 |
|
3600 // Added as a part of REQ 415-6750 : Conditional UI-note for "Activated profile" |
|
3601 TInt noNeedToShowTheNote = 0; // if True, then note should not be shown |
|
3602 TInt err = KErrNone; |
|
3603 |
|
3604 err = RProperty::Get( KPSUidCoreApplicationUIs, KCoreAppUIsProfileActivatedNote, |
|
3605 noNeedToShowTheNote ); |
|
3606 /* |
|
3607 If there occured an error, it is likely caused by the non-existing property. |
|
3608 So trying to set it only if no error occured for maintaining the default behavior. |
|
3609 */ |
|
3610 if( KErrNone == err ) |
|
3611 { |
|
3612 TInt error = RProperty::Set( KPSUidCoreApplicationUIs, KCoreAppUIsProfileActivatedNote, |
|
3613 ECoreAppUIsProfileActivatedNoteNotShown ); |
|
3614 } |
|
3615 |
|
3616 if(!noNeedToShowTheNote) // The value doesn't deny the showing, then... |
|
3617 { |
|
3618 ShowProfileNoteL(); |
|
3619 } |
|
3620 } |
|
3621 |
|
3622 if ( aNewProfileId != KOfflineModeProfileId ) |
|
3623 { |
|
3624 iActiveProfileBeforeOfflineMode = aNewProfileId; |
|
3625 iSysApCenRepController->SetInt( KCRUidCoreApplicationUIsSysAp, KSysApProfileBeforeOfflineMode, aNewProfileId ); |
|
3626 } |
|
3627 |
|
3628 if ( aNewProfileId == KOfflineModeProfileId && ! iSysApOfflineModeController->OfflineModeActive() ) |
|
3629 { |
|
3630 if ( BtSapEnabled() ) |
|
3631 { |
|
3632 // Choosing "Offline Mode" will disconnect BT SAP |
|
3633 // SwitchFromOnlineToOfflineModeL() will be called from CSysApBtSapController |
|
3634 iSysApBtSapController->SwitchingToOffline(); |
|
3635 iSysApBtSapController->Disconnect(); |
|
3636 } |
|
3637 else |
|
3638 { |
|
3639 SwitchFromOnlineToOfflineModeL(); |
|
3640 } |
|
3641 } |
|
3642 else if ( aNewProfileId != KOfflineModeProfileId && iSysApOfflineModeController->OfflineModeActive() ) |
|
3643 { |
|
3644 if ( BtSapEnabled() ) |
|
3645 { |
|
3646 iSysApOfflineModeController->DoNotActivateRF(); // Will be activated after BT SAP disconnection |
|
3647 } |
|
3648 iSysApOfflineModeController->SwitchFromOfflineToOnlineModeL(); |
|
3649 } |
|
3650 iHandleNextProfileEvent = ETrue; |
|
3651 } |
|
3652 |
|
3653 |
|
3654 // ---------------------------------------------------------------------------- |
|
3655 // CSysApAppUi::RestoreProfileL() |
|
3656 // ---------------------------------------------------------------------------- |
|
3657 |
|
3658 void CSysApAppUi::RestoreProfileL( const TBool aOffline ) |
|
3659 { |
|
3660 iHandleNextProfileEvent = EFalse; |
|
3661 if ( aOffline ) |
|
3662 { |
|
3663 ActivateProfileL( KOfflineModeProfileId ); |
|
3664 } |
|
3665 else |
|
3666 { |
|
3667 ActivateProfileL( iActiveProfileBeforeOfflineMode ); |
|
3668 } |
|
3669 } |
|
3670 |
|
3671 // ---------------------------------------------------------------------------- |
|
3672 // CSysApAppUi::ActiveProfileId() |
|
3673 // ---------------------------------------------------------------------------- |
|
3674 |
|
3675 TInt CSysApAppUi::ActiveProfileId() |
|
3676 { |
|
3677 return iProfileEngine->ActiveProfileId(); |
|
3678 } |
|
3679 |
|
3680 |
|
3681 // ---------------------------------------------------------------------------- |
|
3682 // CSysApAppUi::AddMmcMenuItemsL() |
|
3683 // ---------------------------------------------------------------------------- |
|
3684 // |
|
3685 void CSysApAppUi::AddMmcMenuItemsL( CDesCArray*& aProfileNameCDesCArray, RArray<TInt>& aItemIdArray, |
|
3686 TInt& aPowerMenuItemIndex ) |
|
3687 { |
|
3688 TInt propertyValue( StateOfProperty( KPSUidUsbWatcher, |
|
3689 KUsbWatcherSelectedPersonality ) ); |
|
3690 |
|
3691 HBufC* itemStringBuf; |
|
3692 #ifndef RD_MULTIPLE_DRIVE |
|
3693 iPowerkeyMenuEjectSelection = KErrAccessDenied; |
|
3694 if ( !IsEncryptionOperationOngoingL() ) |
|
3695 { |
|
3696 if ( iSysApFeatureManager->MmcHotSwapSupported() && |
|
3697 iMMCInserted && |
|
3698 iSysApFeatureManager->EjectRequiredInPowerMenu() && |
|
3699 propertyValue != KUsbPersonalityIdMS ) |
|
3700 { |
|
3701 iPowerkeyMenuEjectShown = ETrue; |
|
3702 TRACES( RDebug::Print(_L("CSysApAppUi::AddMmcMenuItemsL: adding \"Eject\"" ) ) ); |
|
3703 itemStringBuf = StringLoader::LoadLC( R_QTN_PWRC_EJECT_MMC, iEikonEnv ); |
|
3704 aProfileNameCDesCArray->AppendL( itemStringBuf->Des() ); |
|
3705 CleanupStack::PopAndDestroy(); // itemStringBuf |
|
3706 if ( iSysApFeatureManager->CoverDisplaySupported() ) |
|
3707 { |
|
3708 aItemIdArray.AppendL(SecondaryDisplay::EPwrMenuItemEjectMMC); |
|
3709 } |
|
3710 iPowerkeyMenuEjectShown = ETrue; |
|
3711 iPowerkeyMenuEjectSelection = aPowerMenuItemIndex; |
|
3712 aPowerMenuItemIndex++; |
|
3713 } |
|
3714 } |
|
3715 |
|
3716 #else // RD_MULTIPLE_DRIVE |
|
3717 iPowerkeyMenuEjectSelectionBase = KErrAccessDenied; |
|
3718 if ( !IsEncryptionOperationOngoingL() ) |
|
3719 { |
|
3720 if ( iSysApFeatureManager->MmcHotSwapSupported() |
|
3721 && iSysApFeatureManager->EjectRequiredInPowerMenu() |
|
3722 && propertyValue != KUsbPersonalityIdMS ) |
|
3723 { |
|
3724 // Reset old eject status and dialog |
|
3725 iSysApDriveList->ResetDrivesToEject(); |
|
3726 if ( iSysApConfirmationQuery ) |
|
3727 { |
|
3728 if ( iSysApConfirmationQuery->CurrentQuery() == ESysApEjectMmcQuery ) |
|
3729 { |
|
3730 iSysApConfirmationQuery->Cancel(); |
|
3731 } |
|
3732 } |
|
3733 |
|
3734 // Append memory cards for eject selection |
|
3735 TInt count( iInsertedMemoryCards.Count() ); |
|
3736 TInt corruptedMedia = 0; |
|
3737 for ( TInt i( 0 ); i < count; ++i ) |
|
3738 { |
|
3739 TVolumeInfo info; |
|
3740 TInt err = iEikonEnv->FsSession().Volume(info, iInsertedMemoryCards[ i ].iDrive); |
|
3741 TRACES( RDebug::Print(_L("CSysApAppUi::AddMmcMenuItemsL: corrupted media, iDrive (%d) Error: %d" ),iInsertedMemoryCards[ i ].iDrive, err ) ); |
|
3742 if(err != KErrNone) |
|
3743 { |
|
3744 corruptedMedia++; |
|
3745 continue; |
|
3746 } |
|
3747 itemStringBuf = iSysApDriveList->GetFormattedDriveNameLC( |
|
3748 iInsertedMemoryCards[ i ].iDrive, |
|
3749 R_QTN_PWRC_EJECT_MEMORY_STORAGE ); |
|
3750 aProfileNameCDesCArray->AppendL( *itemStringBuf ); |
|
3751 CleanupStack::PopAndDestroy( itemStringBuf ); |
|
3752 |
|
3753 if ( iSysApFeatureManager->CoverDisplaySupported() ) |
|
3754 { |
|
3755 aItemIdArray.AppendL( |
|
3756 SecondaryDisplay::EPwrMenuItemEjectItemBase + i ); |
|
3757 } |
|
3758 } |
|
3759 if ( (count-corruptedMedia) > 0 ) |
|
3760 { |
|
3761 TRACES( RDebug::Print(_L("CSysApAppUi::AddMmcMenuItemsL: added \"Eject\"" ) ) ); |
|
3762 iPowerkeyMenuEjectShown = ETrue; |
|
3763 iPowerkeyMenuEjectSelectionBase = aPowerMenuItemIndex; |
|
3764 aPowerMenuItemIndex += (count-corruptedMedia); |
|
3765 } |
|
3766 } |
|
3767 } |
|
3768 #endif // RD_MULTIPLE_DRIVE |
|
3769 } |
|
3770 |
|
3771 |
|
3772 // ---------------------------------------------------------------------------- |
|
3773 // CSysApAppUi::ShowPowerKeyPopUpMenuL() |
|
3774 // ---------------------------------------------------------------------------- |
|
3775 |
|
3776 void CSysApAppUi::ShowPowerKeyPopUpMenuL() |
|
3777 { |
|
3778 TRACES( RDebug::Print(_L("CSysApAppUi::ShowPowerKeyPopUpMenuL iPowerKeyPopupMenuActive: %d" ), |
|
3779 iPowerKeyPopupMenuActive ) ); |
|
3780 |
|
3781 if ( !iPowerKeyPopupMenuActive && !iDisablePowerkeyMenu |
|
3782 && iSysApPowerKeyMenuObserver ) // normal state construction has been executed |
|
3783 { |
|
3784 iPowerKeyPopupMenuDismissed = EFalse; |
|
3785 iPowerkeyMenuPowerOffShown = EFalse; |
|
3786 CancelGlobalListQuery(); |
|
3787 |
|
3788 iGlobalListQuery = CAknGlobalListQuery::NewL(); |
|
3789 |
|
3790 iSysApPowerKeyMenuObserver->Cancel(); |
|
3791 |
|
3792 CDesCArray* profileNameCDesCArray; // Array for Powerkey Menu items |
|
3793 |
|
3794 RArray<TInt> itemIdArray; // needed for cover UI |
|
3795 CleanupClosePushL(itemIdArray); |
|
3796 |
|
3797 // make sure old profile names array is clean |
|
3798 delete iProfileNamesArray; |
|
3799 iProfileNamesArray = NULL; |
|
3800 |
|
3801 // Must pop iProfileNamesArray here as cannot leave trap harness with uneven push/pop count. |
|
3802 // This is because profileEngine doesn't provide non-LC version of ProfilesNamesArrayLC |
|
3803 TRAPD( err, |
|
3804 iProfileNamesArray = iProfileEngine->ProfilesNamesArrayLC(); |
|
3805 CleanupStack::Pop(); |
|
3806 ); |
|
3807 |
|
3808 if ( err != KErrNone ) |
|
3809 { |
|
3810 // creating menu failed, return (i.e. just don't show the menu) |
|
3811 TRACES( RDebug::Print(_L("CSysApAppUi::ShowPowerKeyPopUpMenuL iProfileEngine->ProfilesNamesArrayLC() ERROR: %d" ), err ) ); |
|
3812 iNumberOfProfileNamesInPowerKeyMenu = 0; |
|
3813 } |
|
3814 else |
|
3815 { |
|
3816 iNumberOfProfileNamesInPowerKeyMenu = iProfileNamesArray->MdcaCount(); |
|
3817 TRACES( RDebug::Print(_L("CSysApAppUi::ShowPowerKeyPopUpMenuL iNumberOfProfileNamesInPowerKeyMenu: %d" ), |
|
3818 iNumberOfProfileNamesInPowerKeyMenu ) ); |
|
3819 } |
|
3820 |
|
3821 if ( BtSapEnabled() ) |
|
3822 { |
|
3823 profileNameCDesCArray = new( ELeave ) CDesCArrayFlat( iNumberOfProfileNamesInPowerKeyMenu + 4 ); |
|
3824 } |
|
3825 else |
|
3826 { |
|
3827 profileNameCDesCArray = new( ELeave ) CDesCArrayFlat( iNumberOfProfileNamesInPowerKeyMenu + 3 ); |
|
3828 } |
|
3829 |
|
3830 CleanupStack::PushL( profileNameCDesCArray ); |
|
3831 profileNameCDesCArray->Reset(); |
|
3832 HBufC* itemStringBuf; |
|
3833 |
|
3834 TInt powerMenuItemIndex = 0; |
|
3835 |
|
3836 // "Switch off" menu item |
|
3837 if ( !IsEncryptionOperationOngoingL() ) |
|
3838 { |
|
3839 itemStringBuf = StringLoader::LoadLC( R_QTN_PWRC_SWITCH_OFF, iEikonEnv ); |
|
3840 profileNameCDesCArray->InsertL( 0, itemStringBuf->Des() ); |
|
3841 CleanupStack::PopAndDestroy(); // itemStringBuf |
|
3842 if ( iSysApFeatureManager->CoverDisplaySupported() ) |
|
3843 { |
|
3844 itemIdArray.AppendL(SecondaryDisplay::EPwrMenuItemSwitchOff); |
|
3845 } |
|
3846 iPowerkeyMenuPowerOffShown = ETrue; |
|
3847 powerMenuItemIndex++; |
|
3848 } |
|
3849 |
|
3850 iPowerkeyMenuLockKeypadShown = EFalse; |
|
3851 iPowerkeyMenuExitSapShown = EFalse; |
|
3852 iPowerkeyMenuLockSystemShown = EFalse; |
|
3853 iPowerkeyMenuEjectShown = EFalse; |
|
3854 |
|
3855 iPowerkeyMenuLockKeypadSelection = KErrAccessDenied; |
|
3856 iPowerkeyMenuExitSapSelection = KErrAccessDenied; |
|
3857 iPowerkeyMenuLockSystemSelection = KErrAccessDenied; |
|
3858 |
|
3859 #ifndef RD_MULTIPLE_DRIVE |
|
3860 iPowerkeyMenuEjectSelection = KErrAccessDenied; |
|
3861 #else // RD_MULTIPLE_DRIVE |
|
3862 iPowerkeyMenuEjectSelectionBase = KErrAccessDenied; |
|
3863 #endif // RD_MULTIPLE_DRIVE |
|
3864 |
|
3865 // "Lock keypad" menu item |
|
3866 |
|
3867 TInt callState ( StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ) ); |
|
3868 TInt callType ( StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallType ) ); |
|
3869 if ( !( callState == EPSCTsyCallStateConnected && callType == EPSCTsyCallTypeH324Multimedia ) ) |
|
3870 { |
|
3871 if ( ( iSysApFeatureManager->GripNotSupported() && !iSysApFeatureManager->SlideSupported() ) || |
|
3872 ( (!iSysApFeatureManager->GripNotSupported() || iSysApFeatureManager->SlideSupported() ) && |
|
3873 ( StateOfProperty( KPSUidHWRM, KHWRMGripStatus ) == EPSHWRMGripClosed ) ) ) |
|
3874 // "Lock keypad" command is shown always when there is no grip, and if there |
|
3875 // there is no grip, only when the grip is closed. |
|
3876 { |
|
3877 if ( CKeyLockPolicyApi::KeyguardAllowed() ) |
|
3878 { |
|
3879 if ( iSysApFeatureManager->PenEnabled() ) |
|
3880 { |
|
3881 itemStringBuf = StringLoader::LoadLC( R_QTN_PWRC_LOCK_DISPLAY, iEikonEnv ); |
|
3882 } |
|
3883 else |
|
3884 { |
|
3885 itemStringBuf = StringLoader::LoadLC( R_QTN_PWRC_LOCK_KEYS, iEikonEnv ); |
|
3886 } |
|
3887 profileNameCDesCArray->AppendL( itemStringBuf->Des() ); |
|
3888 CleanupStack::PopAndDestroy(); // itemStringBuf |
|
3889 if ( iSysApFeatureManager->CoverDisplaySupported() ) |
|
3890 { |
|
3891 itemIdArray.AppendL(SecondaryDisplay::EPwrMenuItemLockKeypad); |
|
3892 } |
|
3893 iPowerkeyMenuLockKeypadShown = ETrue; |
|
3894 iPowerkeyMenuLockKeypadSelection = powerMenuItemIndex; |
|
3895 powerMenuItemIndex++; |
|
3896 } |
|
3897 } |
|
3898 } |
|
3899 if ( iSysApFeatureManager->PowerKeyIsLockKey() ) |
|
3900 { |
|
3901 AddMmcMenuItemsL( profileNameCDesCArray, |
|
3902 itemIdArray, powerMenuItemIndex ); |
|
3903 } |
|
3904 // "Exit SIM access profile" menu item |
|
3905 if ( BtSapEnabled() ) |
|
3906 { |
|
3907 TRACES( RDebug::Print(_L( "CSysApAppUi::ShowPowerKeyPopUpMenuL: show \"Exit SIM access profile\" item" ) ) ); |
|
3908 itemStringBuf = StringLoader::LoadLC( R_QTN_PWRC_EXIT_SIM_ACCESS, iEikonEnv ); |
|
3909 profileNameCDesCArray->AppendL( itemStringBuf->Des() ); |
|
3910 CleanupStack::PopAndDestroy(); // itemStringBuf |
|
3911 if ( iSysApFeatureManager->CoverDisplaySupported() ) |
|
3912 { |
|
3913 itemIdArray.AppendL(SecondaryDisplay::EPwrMenuItemExitBtSap); |
|
3914 } |
|
3915 iPowerkeyMenuExitSapShown = ETrue; |
|
3916 iPowerkeyMenuExitSapSelection = powerMenuItemIndex; |
|
3917 powerMenuItemIndex++; |
|
3918 } |
|
3919 |
|
3920 // Profile menu items |
|
3921 iProfileItemsOffset = powerMenuItemIndex; |
|
3922 TInt arrayIndex( 0 ); |
|
3923 TBufC<KMaxProfileNameLength> profileName; |
|
3924 |
|
3925 for ( arrayIndex = 0; arrayIndex < iNumberOfProfileNamesInPowerKeyMenu; arrayIndex++ ) |
|
3926 { |
|
3927 profileName = iProfileNamesArray->MdcaPoint( arrayIndex ); |
|
3928 TPtr profileNamePtr = profileName.Des(); |
|
3929 AknTextUtils::DisplayTextLanguageSpecificNumberConversion( profileNamePtr ); |
|
3930 profileNameCDesCArray->AppendL( profileNamePtr ); |
|
3931 |
|
3932 if ( iSysApFeatureManager->CoverDisplaySupported() ) |
|
3933 { |
|
3934 TInt profileId = ( iProfileNamesArray->ProfileName( arrayIndex ) )->Id(); |
|
3935 itemIdArray.AppendL(SecondaryDisplay::EPwrMenuItemProfileItemBase+profileId); |
|
3936 } |
|
3937 powerMenuItemIndex++; |
|
3938 } |
|
3939 |
|
3940 // "Lock device" menu item |
|
3941 |
|
3942 callState = StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ); |
|
3943 |
|
3944 TInt devLockStatus( EAutolockStatusUninitialized ); |
|
3945 devLockStatus = StateOfProperty( KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus ); // check whether Autolock has been started |
|
3946 |
|
3947 |
|
3948 if ( callState == EPSCTsyCallStateNone && devLockStatus != EAutolockStatusUninitialized ) |
|
3949 { |
|
3950 TRACES( RDebug::Print(_L("CSysApAppUi::ShowPowerKeyPopUpMenuL: adding \"Lock device\", devLockStatus=%d" ), devLockStatus ) ); |
|
3951 iPowerkeyMenuLockSystemShown = ETrue; |
|
3952 itemStringBuf = StringLoader::LoadLC( R_QTN_SET_SEC_LOCK_SYSTEM, iEikonEnv ); |
|
3953 profileNameCDesCArray->AppendL( itemStringBuf->Des() ); |
|
3954 CleanupStack::PopAndDestroy(); // itemStringBuf |
|
3955 if ( iSysApFeatureManager->CoverDisplaySupported() ) |
|
3956 { |
|
3957 itemIdArray.AppendL(SecondaryDisplay::EPwrMenuItemLockDevice); |
|
3958 } |
|
3959 iPowerkeyMenuLockSystemShown = ETrue; |
|
3960 iPowerkeyMenuLockSystemSelection = powerMenuItemIndex; |
|
3961 powerMenuItemIndex++; |
|
3962 } |
|
3963 if ( !iSysApFeatureManager->PowerKeyIsLockKey() ) |
|
3964 { |
|
3965 AddMmcMenuItemsL( profileNameCDesCArray, itemIdArray, powerMenuItemIndex ); |
|
3966 } |
|
3967 |
|
3968 // Activate/deactive power save mode |
|
3969 if ( iSysApPsmController ) // variable feature, not create if power save is not used |
|
3970 { |
|
3971 TBool showActivate = !(iSysApPsmController->FullPsmEnabled()); |
|
3972 |
|
3973 TInt textId = ( showActivate ? R_QTN_PWRC_ACTIVATE_POWER_SAVING : R_QTN_PWRC_DEACTIVATE_POWER_SAVING ); |
|
3974 |
|
3975 itemStringBuf = StringLoader::LoadLC( textId, iEikonEnv ); |
|
3976 iSysApPsmController->SetNextUiOperation( showActivate ); |
|
3977 |
|
3978 if ( iSysApFeatureManager->CoverDisplaySupported() ) |
|
3979 { |
|
3980 itemIdArray.AppendL( showActivate ? |
|
3981 SecondaryDisplay::EPwrMenuItemActivatePowerSaving : |
|
3982 SecondaryDisplay::EPwrMenuItemDeactivatePowerSaving ); |
|
3983 } |
|
3984 |
|
3985 profileNameCDesCArray->AppendL( itemStringBuf->Des() ); |
|
3986 CleanupStack::PopAndDestroy( itemStringBuf ); |
|
3987 |
|
3988 iSysApPsmController->SetUiItemId( powerMenuItemIndex ); |
|
3989 powerMenuItemIndex++; |
|
3990 } |
|
3991 |
|
3992 TRACES( RDebug::Print(_L("CSysApAppUi::ShowPowerKeyPopUpMenuL NumberOfAllItemsInPowerKeyMenu: %d" ), |
|
3993 profileNameCDesCArray->Count() ) ); |
|
3994 |
|
3995 iSysApPowerKeyMenuObserver->Start(); |
|
3996 |
|
3997 // Set secondary display data if necessary |
|
3998 if ( iSysApFeatureManager->CoverDisplaySupported() ) |
|
3999 { |
|
4000 CAknSDData* sd = CAknSDData::NewL(SecondaryDisplay::KCatSysAp, SecondaryDisplay::ECmdShowPowerKeyListQuery, KNullDesC8); |
|
4001 sd->InsertGlobalListQueryItemIdsL(itemIdArray); |
|
4002 iGlobalListQuery->SetSecondaryDisplayData(sd); // ownership to notifier client |
|
4003 } |
|
4004 |
|
4005 iGlobalListQuery->ShowListQueryL( (MDesCArray*) profileNameCDesCArray, |
|
4006 iSysApPowerKeyMenuObserver->iStatus, |
|
4007 KProfileListInitialIndex ); |
|
4008 |
|
4009 TRACES( RDebug::Print(_L("CSysApAppUi::ShowPowerKeyPopUpMenuL: list query shown" ) ) ); |
|
4010 |
|
4011 CleanupStack::PopAndDestroy( profileNameCDesCArray ); // profileNameCDesCArray |
|
4012 TRACES( RDebug::Print(_L("CSysApAppUi::ShowPowerKeyPopUpMenuL: profileNameCDesCArray popped" ) ) ); |
|
4013 |
|
4014 CleanupStack::Pop(&itemIdArray); |
|
4015 itemIdArray.Close(); |
|
4016 |
|
4017 // Without following variable set ETrue powerkey up event would change the hightlighted item to be |
|
4018 // the second one instead of the wanted first one. |
|
4019 iIgnoreNextPowerKeyUpEvent = ETrue; |
|
4020 |
|
4021 if ( iSysApBatteryInfoController ) |
|
4022 { |
|
4023 iSysApBatteryInfoController->PowerMenuShownL(); |
|
4024 } |
|
4025 |
|
4026 TRACES( RDebug::Print(_L("CSysApAppUi::ShowPowerKeyPopUpMenuL:end" ) ) ); |
|
4027 } |
|
4028 } |
|
4029 |
|
4030 // ---------------------------------------------------------------------------- |
|
4031 // CSysApAppUi::PowerKeyPopUpMenuSelectionDoneL( TInt aSelection ) |
|
4032 // ---------------------------------------------------------------------------- |
|
4033 |
|
4034 void CSysApAppUi::PowerKeyPopUpMenuSelectionDoneL( TInt aSelection ) |
|
4035 { |
|
4036 iPowerKeyPopupMenuDismissed = ETrue; |
|
4037 iPowerKeyPopupMenuActive = EFalse; |
|
4038 TRACES( RDebug::Print(_L("CSysApAppUi::PowerKeyPopUpMenuSelectionDoneL: START aSelection:%d" ), aSelection ) ); |
|
4039 if ( aSelection == KPowerKeyMenuSelectionCancelled ) |
|
4040 { |
|
4041 TRACES( RDebug::Print(_L("CSysApAppUi::PowerKeyPopUpMenuSelectionDoneL: Powerkey menu cancelled" ) ) ); |
|
4042 } |
|
4043 else if( aSelection < KPowerKeyMenuSelectionCancelled ) |
|
4044 { |
|
4045 iIgnoreNextPowerKeyUpEvent = EFalse; |
|
4046 } |
|
4047 else |
|
4048 { |
|
4049 // first menu item <=> Switch off |
|
4050 if ( aSelection == KPowerKeyMenuSelectionSwitchOff ) |
|
4051 { |
|
4052 TRACES( RDebug::Print(_L("CSysApAppUi::PowerKeyPopUpMenuSelectionDoneL: \"Switch off\" selected" ) ) ); |
|
4053 DoShutdownL( EFalse, KDummyReason ); |
|
4054 } |
|
4055 // 2nd menu item: lock display & keys |
|
4056 else if ( iPowerkeyMenuLockKeypadShown && aSelection == iPowerkeyMenuLockKeypadSelection ) |
|
4057 { |
|
4058 TRACES( RDebug::Print(_L("CSysApAppUi::PowerKeyPopUpMenuSelectionDoneL: \"Lock keypad\" selected" ) ) ); |
|
4059 KeyLock().EnableKeyLock(); |
|
4060 } |
|
4061 // BT |
|
4062 else if ( iPowerkeyMenuExitSapShown && aSelection == iPowerkeyMenuExitSapSelection ) |
|
4063 { |
|
4064 TRACES( RDebug::Print(_L("CSysApAppUi::PowerKeyPopUpMenuSelectionDoneL: \"Exit SAP\" selected" ) ) ); |
|
4065 ShowQueryL( ESysApBtSapDisconnectQuery ); |
|
4066 } |
|
4067 // Profile Items |
|
4068 else if ( ( aSelection >= iProfileItemsOffset ) && ( aSelection < iProfileItemsOffset + iNumberOfProfileNamesInPowerKeyMenu ) ) |
|
4069 { |
|
4070 __ASSERT_DEBUG( iProfileNamesArray, User::Invariant() ); |
|
4071 |
|
4072 if ( iProfileNamesArray ) |
|
4073 { |
|
4074 iProfileToBeActivated = ( iProfileNamesArray->ProfileName( aSelection - iProfileItemsOffset ) )->Id(); |
|
4075 |
|
4076 TRACES( RDebug::Print(_L("CSysApAppUi::PowerKeyPopUpMenuSelectionDoneL: profile id: %d selected" ), iProfileToBeActivated ) ); |
|
4077 if ( ! iSysApOfflineModeController->OfflineModeActive() || |
|
4078 ( iProfileToBeActivated ) == KOfflineModeProfileId ) |
|
4079 { |
|
4080 ActivateProfileL( iProfileToBeActivated ); |
|
4081 } |
|
4082 else |
|
4083 { |
|
4084 // iProfileToBeActivated profile will be activated from iSysApOfflineModeController if ok |
|
4085 iSysApOfflineModeController->GoOnlineIfOkL(); |
|
4086 } |
|
4087 } |
|
4088 } |
|
4089 // device lock |
|
4090 else if ( iPowerkeyMenuLockSystemShown && aSelection == iPowerkeyMenuLockSystemSelection ) |
|
4091 { |
|
4092 TRACES( RDebug::Print(_L("CSysApAppUi::PowerKeyPopUpMenuSelectionDoneL: \"Lock system\" selected" ) ) ); |
|
4093 iSysApSystemLock->SetLockedL(); |
|
4094 } |
|
4095 #ifndef RD_MULTIPLE_DRIVE |
|
4096 //eject single MMC |
|
4097 else if ( iPowerkeyMenuEjectShown && aSelection == iPowerkeyMenuEjectSelection ) |
|
4098 { |
|
4099 TRACES( RDebug::Print(_L("CSysApAppUi::PowerKeyPopUpMenuSelectionDoneL: \"Eject\" selected" ) ) ); |
|
4100 ShowQueryL( ESysApEjectMmcQuery ); |
|
4101 } |
|
4102 #else // RD_MULTIPLE_DRIVE |
|
4103 //eject nth MMC |
|
4104 else if ( iPowerkeyMenuEjectShown && |
|
4105 aSelection >= iPowerkeyMenuEjectSelectionBase && |
|
4106 aSelection < iPowerkeyMenuEjectSelectionBase + iInsertedMemoryCards.Count() ) |
|
4107 { |
|
4108 iDriveToEject = |
|
4109 iInsertedMemoryCards[ aSelection - iPowerkeyMenuEjectSelectionBase ].iDrive; |
|
4110 TRACES( RDebug::Print( |
|
4111 _L( "CSysApAppUi::PowerKeyPopUpMenuSelectionDoneL: \"Eject\" selected, drive=%d" ), |
|
4112 iDriveToEject ) ); |
|
4113 iSysApDriveList->ResetDrivesToEject(); |
|
4114 RProperty::Set( KPSUidUikon, KUikMMCInserted, 0 ); |
|
4115 EjectMMCL(); |
|
4116 } |
|
4117 #endif // RD_MULTIPLE_DRIVE |
|
4118 else if ( iSysApPsmController && aSelection == iSysApPsmController->UiItemId() ) |
|
4119 { |
|
4120 TRACES( RDebug::Print(_L("CSysApAppUi::PowerKeyPopUpMenuSelectionDoneL: \"Activate|Deactivate power save\" selected" ) ) ); |
|
4121 iSysApPsmController->DoEnableFullPsm( iSysApPsmController->NextUiOperation() ); |
|
4122 } |
|
4123 |
|
4124 } |
|
4125 |
|
4126 delete iProfileNamesArray; |
|
4127 iProfileNamesArray = NULL; |
|
4128 delete iGlobalListQuery; |
|
4129 iGlobalListQuery = NULL; |
|
4130 |
|
4131 TRACES( RDebug::Print(_L("CSysApAppUi::PowerKeyPopUpMenuSelectionDoneL: END" ) ) ); |
|
4132 } |
|
4133 |
|
4134 // ---------------------------------------------------------------------------- |
|
4135 // CSysApAppUi::SetDeviceLockEnabledL( const TBool aLockEnabled ) |
|
4136 // ---------------------------------------------------------------------------- |
|
4137 |
|
4138 void CSysApAppUi::SetDeviceLockEnabledL( const TBool aLockEnabled ) |
|
4139 { |
|
4140 TRACES( RDebug::Print(_L("CSysApAppUi::SetDeviceLockEnabledL aLockEnabled:%d" ), aLockEnabled ) ); |
|
4141 TBool currentState( iDeviceLockEnabled ); |
|
4142 |
|
4143 iDeviceLockEnabled = aLockEnabled; |
|
4144 |
|
4145 if ( currentState != iDeviceLockEnabled ) // filter out unnecessary light status modifications |
|
4146 { |
|
4147 iSysApLightsController->DeviceLockStateChangedL( iDeviceLockEnabled ); |
|
4148 } |
|
4149 |
|
4150 /* if( iDeviceLockEnabled ) |
|
4151 { |
|
4152 if( iKeyLockEnabled ) |
|
4153 { |
|
4154 KeyLock().DisableWithoutNote(); |
|
4155 } |
|
4156 }*/ |
|
4157 if(! iDeviceLockEnabled ) |
|
4158 { |
|
4159 // let's not activate keylock in case device lock was disabled during call or in cradle |
|
4160 iKeyLockOnBeforeCall = EFalse; |
|
4161 iKeyLockOnBeforeCradle = EFalse; |
|
4162 |
|
4163 // Memory card needs to be unlocked when device is unlocked |
|
4164 if ( iSysApFeatureManager->MmcHotSwapSupported() ) |
|
4165 { |
|
4166 RunUnlockNotifierL(); |
|
4167 } |
|
4168 } |
|
4169 } |
|
4170 |
|
4171 // ---------------------------------------------------------------------------- |
|
4172 // CSysApAppUi::DoNotEnableKeylock() |
|
4173 // ---------------------------------------------------------------------------- |
|
4174 |
|
4175 void CSysApAppUi::DoNotEnableKeylock() |
|
4176 { |
|
4177 if ( !iKeyLockOnBeforeCradle ) |
|
4178 { |
|
4179 iShowkeypadActivatedNoteAfterSoftReject = iKeyLockOnBeforeCall; |
|
4180 } |
|
4181 |
|
4182 iKeyLockOnBeforeCall = EFalse; |
|
4183 } |
|
4184 |
|
4185 // ---------------------------------------------------------------------------- |
|
4186 // CSysApAppUi::DoShutdownL( const TBool aReset, const TSWStartupReason aSWStartupReason ) |
|
4187 // ---------------------------------------------------------------------------- |
|
4188 |
|
4189 void CSysApAppUi::DoShutdownL( const TBool aReset, const TInt aResetReason ) |
|
4190 { |
|
4191 TRACES( RDebug::Print(_L("CSysApAppUi::DoShutdownL: aResetReason:%d, aReset:%d" ), |
|
4192 aResetReason, aReset ) ); |
|
4193 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
4194 TBool animationenabled( EFalse ); |
|
4195 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
4196 |
|
4197 if( OkToInitiateShutdown() ) |
|
4198 { |
|
4199 TRACES( RDebug::Print(_L("CSysApAppUi::DoShutdownL: Was OkToToInitiateShutdown" ) ) ); |
|
4200 |
|
4201 |
|
4202 if ( !aReset && iSysApFeatureManager->Supported(KSysApFeatureIdGoodbyeNote) ) |
|
4203 { |
|
4204 TRAPD( ignore, ShowShutdownNoteL() ); |
|
4205 if ( ignore ) ignore = 0; // hide compiler warning about not using variable |
|
4206 } |
|
4207 |
|
4208 if( !aReset ) |
|
4209 { |
|
4210 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
4211 TRAPD( err, ShowAnimationL() ); |
|
4212 if ( err ) |
|
4213 { |
|
4214 TRACES( RDebug::Print(_L("CSysApAppUi::DoShutdownL ShowAnimationL() leaved: %d" ), err ) ); |
|
4215 CompleteShutdown(aReset, aResetReason); |
|
4216 } |
|
4217 } |
|
4218 else // aReset |
|
4219 { |
|
4220 CompleteShutdown(aReset, aResetReason); |
|
4221 } |
|
4222 #else // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
4223 TRAPD( err, animationenabled = ShowAnimationL() ); |
|
4224 if ( err ) |
|
4225 { |
|
4226 TRACES( RDebug::Print(_L("CSysApAppUi::DoShutdownL ShowAnimationL() leaved: %d" ), err ) ); |
|
4227 } |
|
4228 } |
|
4229 |
|
4230 if ( !animationenabled ) |
|
4231 { |
|
4232 CompleteShutdown(aReset, aResetReason); |
|
4233 } |
|
4234 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
4235 } |
|
4236 else |
|
4237 { |
|
4238 TRACES( RDebug::Print(_L("CSysApAppUi::DoShutdownL: Was not OkToToInitiateShutdown" ) ) ); |
|
4239 } |
|
4240 TRACES( RDebug::Print(_L("CSysApAppUi::DoShutdownL: END" ) ) ); |
|
4241 } |
|
4242 |
|
4243 // ---------------------------------------------------------------------------- |
|
4244 // CSysApAppUi::ContinueShutdown() |
|
4245 // ---------------------------------------------------------------------------- |
|
4246 |
|
4247 void CSysApAppUi::ContinueShutdown() |
|
4248 { |
|
4249 TRACES( RDebug::Print(_L("CSysApAppUi::ContinueShutdown() started" ) ) ); |
|
4250 CompleteShutdown(); |
|
4251 TRACES( RDebug::Print(_L("CSysApAppUi::ContinueShutdown() completed" ) ) ); |
|
4252 } |
2937 } |
4253 |
2938 |
4254 // ---------------------------------------------------------------------------- |
2939 // ---------------------------------------------------------------------------- |
4255 // CSysApAppUi::ShowAnimationL() |
2940 // CSysApAppUi::ShowAnimationL() |
4256 // ---------------------------------------------------------------------------- |
2941 // ---------------------------------------------------------------------------- |
5854 // Try remount to check if drive was put back |
3914 // Try remount to check if drive was put back |
5855 iSysApDriveList->MountDrive( iDriveToDismount ); |
3915 iSysApDriveList->MountDrive( iDriveToDismount ); |
5856 if ( !iSysApDriveEjectHandler->CompleteDismount( iDriveToDismount ) ) |
3916 if ( !iSysApDriveEjectHandler->CompleteDismount( iDriveToDismount ) ) |
5857 { |
3917 { |
5858 // When ready, check for locked memory cards and update indicators |
3918 // When ready, check for locked memory cards and update indicators |
5859 TRAP_IGNORE( SetMemoryCardIndicatorL() ); |
3919 // TRAP_IGNORE( SetMemoryCardIndicatorL() ); |
5860 TRAP_IGNORE( RunUnlockNotifierL() ); |
3920 TRAP_IGNORE( RunUnlockNotifierL() ); |
5861 } |
3921 } |
5862 } |
3922 } |
5863 |
3923 |
5864 #endif // RD_MULTIPLE_DRIVE |
3924 #endif // RD_MULTIPLE_DRIVE |
5865 |
3925 |
5866 // ---------------------------------------------------------------------------- |
3926 |
5867 // CSysApAppUi::EjectStarted() |
3927 // ---------------------------------------------------------------------------- |
5868 // ---------------------------------------------------------------------------- |
3928 // CSysApAppUi::HandleApplicationSpecificEventL(TInt aType,const TWsEvent& aEvent) |
5869 |
3929 // ---------------------------------------------------------------------------- |
5870 void CSysApAppUi::EjectStarted( TBool ejectStarted ) |
3930 |
5871 { |
3931 void CSysApAppUi::HandleApplicationSpecificEventL(TInt aType,const TWsEvent& aEvent) |
5872 TRACES( RDebug::Print( _L( "CSysApAppUi::EjectStarted" ) ) ); |
3932 { |
5873 iMMCEjectUsed = ejectStarted; |
3933 TRACES( RDebug::Print( _L("CSysApAppUi::HandleApplicationSpecificEventL: aType:%d"), aType ) ); |
5874 |
3934 |
5875 #ifndef RD_MULTIPLE_DRIVE |
3935 CEikAppUi::HandleApplicationSpecificEventL(aType, aEvent); |
5876 iFileManagerCloseDisabled = ejectStarted; |
3936 |
5877 #endif // RD_MULTIPLE_DRIVE |
3937 if ( ResourcesFreed() ) |
5878 } |
3938 { |
5879 |
3939 TRACES( RDebug::Print( _L("CSysApAppUi::HandleApplicationSpecificEventL: discarded, shutting down") ) ); |
5880 // ---------------------------------------------------------------------------- |
3940 return; |
5881 // CSysApAppUi::DoLightsTimeoutChangedL |
3941 } |
5882 // ---------------------------------------------------------------------------- |
3942 |
5883 void CSysApAppUi::DoLightsTimeoutChangedL( const TInt aTimeout ) |
3943 switch( aType ) |
5884 { |
3944 { |
5885 iSysApLightsController->DoLightsTimeoutChangedL( aTimeout ); |
3945 case EEikKeyLockEnabled: |
5886 } |
3946 iKeyLockEnabled = ETrue; |
5887 |
3947 iSysApCenRepController->SetInt( KCRUidCoreApplicationUIsSysAp, KSysApKeyguardActive, 1 ); |
|
3948 // SetIndicatorStateL( EAknIndicatorKeyguard, EAknIndicatorStateOn ); |
|
3949 iSysApLightsController->KeylockStateChangedL( ETrue ); |
|
3950 break; |
|
3951 case EEikKeyLockDisabled: |
|
3952 iKeyLockEnabled = EFalse; |
|
3953 iSysApCenRepController->SetInt( KCRUidCoreApplicationUIsSysAp, KSysApKeyguardActive, 0 ); |
|
3954 // SetIndicatorStateL( EAknIndicatorKeyguard, EAknIndicatorStateOff ); |
|
3955 if (! iDeviceLockEnabled ) |
|
3956 { |
|
3957 iSysApLightsController->KeylockStateChangedL( EFalse ); |
|
3958 if ( iSysApFeatureManager->MmcHotSwapSupported() ) |
|
3959 { |
|
3960 if ( StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ) != EPSCTsyCallStateRinging && StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ) != EPSCTsyCallStateAlerting ) |
|
3961 { |
|
3962 RunUnlockNotifierL(); |
|
3963 } |
|
3964 } |
|
3965 } |
|
3966 break; |
|
3967 case EEikKeyLockPowerKeyPressed: //sent when power key is captured by keylockserver |
|
3968 // HandleShortPowerKeyPressedL(); |
|
3969 break; |
|
3970 |
|
3971 case EEikKeyLockLightsOnRequest: |
|
3972 iSysApLightsController->SetLightsOnUnlockNoteL(); |
|
3973 break; |
|
3974 |
|
3975 case EEikEcsQueryLights: // emergency note is shown |
|
3976 iSysApLightsController->SetLightsOnEcsQueryL(); |
|
3977 break; |
|
3978 |
|
3979 case EEikSecurityQueryLights: // for device lock security query |
|
3980 iSysApLightsController->SetLightsOnSecurityQueryL(); |
|
3981 break; |
|
3982 |
|
3983 default: |
|
3984 break; |
|
3985 } |
|
3986 } |
|
3987 |
|
3988 |
|
3989 |
|
3990 // ---------------------------------------------------------------------------- |
|
3991 // CSysApAppUi::HandleNspsRawKeyEventL() |
|
3992 // ---------------------------------------------------------------------------- |
|
3993 |
|
3994 void CSysApAppUi::HandleNspsRawKeyEventL() |
|
3995 { |
5888 #ifdef __SYSAP_MODULE_TEST |
3996 #ifdef __SYSAP_MODULE_TEST |
5889 |
3997 ModuleTestShowUiNoteL( _L("Network wakeup from NSPS") ); |
5890 // ---------------------------------------------------------------------------- |
|
5891 // CSysApAppUi::ModuleTestShowUiNoteL() |
|
5892 // ---------------------------------------------------------------------------- |
|
5893 |
|
5894 void CSysApAppUi::ModuleTestShowUiNoteL( const TDesC& noteText ) const |
|
5895 { |
|
5896 CAknGlobalNote* note = CAknGlobalNote::NewLC(); |
|
5897 note->SetTone( EAvkonSIDNoSound ); |
|
5898 note->ShowNoteL( EAknGlobalInformationNote, noteText ); |
|
5899 CleanupStack::PopAndDestroy(); // note |
|
5900 } |
|
5901 |
|
5902 #endif |
3998 #endif |
5903 |
3999 |
5904 // ---------------------------------------------------------------------------- |
|
5905 // CSysApAppUi::ShowShutdownNoteL() |
|
5906 // ---------------------------------------------------------------------------- |
|
5907 void CSysApAppUi::ShowShutdownNoteL() |
|
5908 { |
|
5909 TRACES( RDebug::Print( _L( "CSysApAppUi::ShowShutdownNoteL") ) ); |
|
5910 ShowUiNoteL( EShutdownNote ); |
|
5911 User::After( KTimeToShowShutdownNote ); |
|
5912 } |
|
5913 |
|
5914 // ---------------------------------------------------------------------------- |
|
5915 // CSysApAppUi::Beep() |
|
5916 // ---------------------------------------------------------------------------- |
|
5917 void CSysApAppUi::Beep() |
|
5918 { |
|
5919 static_cast<CAknAppUi*>(iEikonEnv->EikAppUi())->KeySounds()->PlaySound( EAvkonSIDInformationTone ); |
|
5920 } |
|
5921 |
|
5922 // ---------------------------------------------------------------------------- |
|
5923 // CSysApAppUi::SimSupported() |
|
5924 // ---------------------------------------------------------------------------- |
|
5925 TBool CSysApAppUi::SimSupported() |
|
5926 { |
|
5927 return iSysApFeatureManager->SimSupported(); |
|
5928 } |
|
5929 |
|
5930 // ---------------------------------------------------------------------------- |
|
5931 // CSysApAppUi::IsStateNormal() |
|
5932 // |
|
5933 // ---------------------------------------------------------------------------- |
|
5934 TBool CSysApAppUi::IsStateNormal() const |
|
5935 { |
|
5936 TInt state; |
|
5937 TInt errorCode = |
|
5938 RProperty::Get( KPSUidStartup, KPSGlobalSystemState, state ); |
|
5939 if ( errorCode == KErrNone ) |
|
5940 { |
|
5941 return state == ESwStateNormalRfOn || |
|
5942 state == ESwStateNormalRfOff || |
|
5943 state == ESwStateNormalBTSap; |
|
5944 } |
|
5945 else |
|
5946 { |
|
5947 TRACES( RDebug::Print( _L( "CSysApAppUi::IsStateNormal: Failed to read global system state, error code %d." ), errorCode ) ); |
|
5948 return EFalse; |
|
5949 } |
|
5950 } |
|
5951 |
|
5952 // ---------------------------------------------------------------------------- |
|
5953 // CSysApAppUi::BatteryEmptyL() |
|
5954 // ---------------------------------------------------------------------------- |
|
5955 |
|
5956 void CSysApAppUi::BatteryEmptyL() |
|
5957 { |
|
5958 iSysApLightsController->BatteryEmptyL( ETrue ); |
|
5959 // Do not reactivate keyguard in the next startup |
|
5960 iSysApCenRepController->SetInt( KCRUidCoreApplicationUIsSysAp, KSysApKeyguardActive, 0 ); |
|
5961 } |
|
5962 |
|
5963 // ---------------------------------------------------------------------------- |
|
5964 // CSysApAppUi::Max() |
|
5965 // ---------------------------------------------------------------------------- |
|
5966 |
|
5967 TInt CSysApAppUi::Max( const TInt aA, const TInt aB, const TInt aC ) |
|
5968 { |
|
5969 TInt max( aA ); |
|
5970 if ( aB > max ) |
|
5971 { |
|
5972 max = aB; |
|
5973 } |
|
5974 if ( aC > max ) |
|
5975 { |
|
5976 max = aC; |
|
5977 } |
|
5978 return max; |
|
5979 } |
|
5980 |
|
5981 // ---------------------------------------------------------------------------- |
|
5982 // CSysApAppUi::SetStarterState() |
|
5983 // ---------------------------------------------------------------------------- |
|
5984 |
|
5985 TInt CSysApAppUi::SetStarterState( const RStarterSession::TGlobalState aState ) |
|
5986 { |
|
5987 if ( iSysApStartupController->GlobalStateChangeAllowed( aState ) ) |
|
5988 { |
|
5989 TRACES( RDebug::Print( _L("CSysApAppUi::SetStarterState: aState=%d" ), aState ) ); |
|
5990 return StarterSession().SetState( aState ); |
|
5991 } |
|
5992 else |
|
5993 { |
|
5994 TRACES( RDebug::Print( _L("CSysApAppUi::SetStarterState: aState=%d - not allowed" ), aState ) ); |
|
5995 return KErrNone; |
|
5996 } |
|
5997 } |
|
5998 |
|
5999 // ---------------------------------------------------------------------------- |
|
6000 // CSysApAppUi::GetBtSapDeviceNameL() |
|
6001 // ---------------------------------------------------------------------------- |
|
6002 |
|
6003 HBufC* CSysApAppUi::GetBtSapDeviceNameL() |
|
6004 { |
|
6005 return iSysApBtSapController->GetBtSapDeviceNameL(); |
|
6006 } |
|
6007 |
|
6008 // ---------------------------------------------------------------------------- |
|
6009 // CSysApAppUi::ShowAlarmIndicatorL() |
|
6010 // ---------------------------------------------------------------------------- |
|
6011 |
|
6012 void CSysApAppUi::ShowAlarmIndicatorL( TBool aShowIndicator ) |
|
6013 { |
|
6014 if ( aShowIndicator) |
|
6015 { |
|
6016 SetIndicatorStateL( EAknIndicatorAlarmClock, EAknIndicatorStateOn ); |
|
6017 } |
|
6018 else |
|
6019 { |
|
6020 SetIndicatorStateL( EAknIndicatorAlarmClock, EAknIndicatorStateOff ); |
|
6021 } |
|
6022 } |
|
6023 |
|
6024 // ---------------------------------------------------------------------------- |
|
6025 // CSysApAppUi::SimulateFlipKeyEventL() |
|
6026 // ---------------------------------------------------------------------------- |
|
6027 |
|
6028 void CSysApAppUi::SimulateFlipKeyEventL( TBool aFlipOpen ) |
|
6029 { |
|
6030 TRACES( RDebug::Print( _L("CSysApAppUi::SimulateFlipKeyEventL: aFlipOpen: %d" ), aFlipOpen ) ); |
|
6031 |
|
6032 /* |
|
6033 Flip key is constructed when a flip notification via Pub&Sub is received. The reason behind |
|
6034 providing this as a key event is to enable unified handling of keys also with flip, and because |
|
6035 flip is captured&consumed by Avkon it is not possible to capture flip key events directly |
|
6036 from default handler/plugins. |
|
6037 */ |
|
6038 |
|
6039 TKeyEvent flipEvent; |
|
6040 flipEvent.iCode = aFlipOpen ? EKeyFlipOpen : EKeyFlipClose; |
|
6041 flipEvent.iScanCode = 0; |
|
6042 flipEvent.iModifiers = 0; |
|
6043 flipEvent.iRepeats = 0; |
|
6044 |
|
6045 HandleKeyEventL( flipEvent, EEventKey ); |
|
6046 } |
|
6047 |
|
6048 // ---------------------------------------------------------------------------- |
|
6049 // CSysApAppUi::SetFlipOpenL() |
|
6050 // ---------------------------------------------------------------------------- |
|
6051 |
|
6052 void CSysApAppUi::SetFlipOpenL( TBool aFlipOpen ) |
|
6053 { |
|
6054 iSysApLightsController->SetFlipOpenL( aFlipOpen ); |
|
6055 } |
|
6056 |
|
6057 // ---------------------------------------------------------------------------- |
|
6058 // CSysApAppUi::SetGripOpenL() |
|
6059 // ---------------------------------------------------------------------------- |
|
6060 void CSysApAppUi::SetGripOpenL( TBool aGripOpen ) |
|
6061 { |
|
6062 iSysApLightsController->SetGripOpenL( aGripOpen ); |
|
6063 } |
|
6064 |
|
6065 // ---------------------------------------------------------------------------- |
|
6066 // CSysApAppUi::SetNetworkConnectionAllowed() |
|
6067 // ---------------------------------------------------------------------------- |
|
6068 |
|
6069 void CSysApAppUi::SetNetworkConnectionAllowed( TCoreAppUIsNetworkConnectionAllowed aNetworkConnectionAllowed ) |
|
6070 { |
|
6071 TRACES( RDebug::Print( _L("CSysApAppUi::SetNetworkConnectionAllowed: status: %d" ), aNetworkConnectionAllowed ) ); |
|
6072 |
|
6073 iSysApCenRepController->SetInt( KCRUidCoreApplicationUIs, KCoreAppUIsNetworkConnectionAllowed, (TInt) aNetworkConnectionAllowed ); |
|
6074 |
|
6075 // Also set the Symbian PS key used for the same purpose: |
|
6076 RProperty::Set(KUidSystemCategory, KUidPhonePwr.iUid, aNetworkConnectionAllowed ? ESAPhoneOn : ESAPhoneOff); |
|
6077 } |
|
6078 |
|
6079 // ---------------------------------------------------------------------------- |
|
6080 // CSysApAppUi::GetTelServerL() |
|
6081 // ---------------------------------------------------------------------------- |
|
6082 |
|
6083 RTelServer* CSysApAppUi::GetTelServer() |
|
6084 { |
|
6085 if ( iSysApEtelConnector ) |
4000 if ( iSysApEtelConnector ) |
6086 { |
4001 { |
6087 return iSysApEtelConnector->GetTelServer(); |
4002 iSysApEtelConnector->CommandNetCsWakeupOnNsps(); |
6088 } |
4003 } |
6089 else |
4004 } |
6090 { |
4005 |
6091 return NULL; |
4006 // ---------------------------------------------------------------------------- |
6092 } |
4007 // CSysApAppUi::UpdateSignalBarsL() |
6093 } |
4008 // ---------------------------------------------------------------------------- |
6094 |
4009 |
6095 // ---------------------------------------------------------------------------- |
4010 void CSysApAppUi::UpdateSignalBarsL() |
6096 // CSysApAppUi::CoverDisplaySupported() |
4011 { |
6097 // ---------------------------------------------------------------------------- |
4012 // UpdateSignalBarsL(iSysApEtelConnector->GetSignalBars()); |
6098 |
4013 } |
6099 TBool CSysApAppUi::CoverDisplaySupported() |
4014 |
6100 { |
4015 // ---------------------------------------------------------------------------- |
6101 return iSysApFeatureManager->CoverDisplaySupported(); |
4016 // CSysApAppUi::HandleSmsStorageNotificationL( TBool aSimStoreFull ) |
6102 } |
4017 // ---------------------------------------------------------------------------- |
6103 |
4018 |
6104 // ---------------------------------------------------------------------------- |
4019 void CSysApAppUi::HandleSmsStorageNotificationL( TBool aSimStoreFull ) |
6105 // CSysApAppUi::StarterSession() |
4020 { |
6106 // ---------------------------------------------------------------------------- |
4021 TRACES( RDebug::Print( _L("CSysApAppUi::HandleSmsStorageNotificationL: aSimStoreFull: %d "), aSimStoreFull ) ); |
6107 |
4022 |
6108 RStarterSession& CSysApAppUi::StarterSession() |
4023 if ( aSimStoreFull ) |
6109 { |
4024 { |
6110 if ( !iStarterSession.Handle() ) |
4025 /* HBufC* noteStringBuf; |
6111 { |
4026 noteStringBuf = StringLoader::LoadLC( R_QTN_MEMLO_MEMORY_LOW_SIM_MES, iEikonEnv ); |
6112 // All server connections are tried to be made KTriesToConnectServer times because occasional |
4027 TPtr textBuffer = noteStringBuf->Des(); |
6113 // fails on connections are possible at least on some servers |
4028 iSysApMsgSimMemLowQuery->StartL( textBuffer ); |
6114 TRACES( RDebug::Print( _L("CSysApAppUi::StarterSession: trying RStarterSession::Connect()") ) ); |
4029 CleanupStack::PopAndDestroy(); |
6115 TInt thisTry = 0; |
4030 */ } |
6116 TInt err; |
4031 |
6117 while ( ( err = iStarterSession.Connect() ) != KErrNone && ( thisTry++ ) <= KTriesToConnectServer ) |
4032 // SetEnvelopeIndicatorL(); |
6118 { |
4033 } |
6119 User::After( KTimeBeforeRetryingServerConnection ); |
4034 |
6120 } |
4035 // ---------------------------------------------------------------------------- |
6121 |
4036 // CSysApAppUi::HandleNetworkNspsNotification( RMmCustomAPI::TNspsStatus aNspsStatus ) |
6122 if ( err != KErrNone ) |
4037 // ---------------------------------------------------------------------------- |
6123 { |
4038 |
6124 // What do in error case? |
4039 void CSysApAppUi::HandleNetworkNspsNotification( RMmCustomAPI::TNspsStatus aNspsStatus ) |
6125 TRACES( RDebug::Print( _L("CSysApAppUi::StarterSession: RStarterSession::Connect() failed with %d"), err ) ); |
4040 { |
6126 } |
4041 TRACES( RDebug::Print( _L("CSysApAppUi::HandleNetworkNspsNotification aNspsStatus:%d, iNsps:%d )" ), aNspsStatus, iNsps ) ); |
6127 } |
4042 if( iSysApNspsHandler ) |
6128 |
4043 { |
6129 return iStarterSession; |
4044 if( aNspsStatus == RMmCustomAPI::ENspsOn ) |
6130 } |
4045 { |
6131 |
4046 if( !iNsps ) |
6132 // ---------------------------------------------------------------------------- |
4047 { |
6133 // CSysApAppUi::KeyLock() |
4048 #ifdef __SYSAP_MODULE_TEST |
6134 // ---------------------------------------------------------------------------- |
4049 TRAPD( err, ModuleTestShowUiNoteL( _L("Setting NSPS on") ) ); |
6135 |
4050 #endif |
6136 RAknKeylock2& CSysApAppUi::KeyLock() |
4051 iSysApNspsHandler->SetNspsOn(); |
6137 { |
4052 iNsps = ETrue; |
6138 if ( !iKeyLock.Handle() ) |
4053 } |
6139 { |
4054 } |
6140 // All server connections are tried to be made KTriesToConnectServer times because occasional |
4055 else if( aNspsStatus == RMmCustomAPI::ENspsOff ) |
6141 // fails on connections are possible at least on some servers |
4056 { |
6142 TInt thisTry = 0; |
4057 if( iNsps ) |
6143 TInt err; |
4058 { |
6144 |
4059 #ifdef __SYSAP_MODULE_TEST |
6145 TRACES( RDebug::Print( _L("CSysApAppUi::KeyLock: trying RAknKeylock2::Connect()") ) ); |
4060 TRAPD( err, ModuleTestShowUiNoteL( _L("Setting NSPS off") ) ); |
6146 thisTry = 0; |
4061 #endif |
6147 while ( ( err = iKeyLock.Connect() ) != KErrNone && ( thisTry++ ) <= KTriesToConnectServer ) |
4062 iSysApNspsHandler->SetNspsOff(); |
6148 { |
4063 iNsps = EFalse; |
6149 User::After( KTimeBeforeRetryingServerConnection ); |
4064 } |
6150 } |
4065 } |
6151 |
4066 } |
6152 if ( err != KErrNone ) |
4067 } |
6153 { |
4068 |
6154 // What do in error case? |
4069 |
6155 TRACES( RDebug::Print( _L("CSysApAppUi::KeyLock: RAknKeylock2::Connect() failed with %d"), err ) ); |
4070 |
6156 } |
4071 //end of file |
6157 } |
|
6158 |
|
6159 return iKeyLock; |
|
6160 } |
|
6161 |
|
6162 // ---------------------------------------------------------------------------- |
|
6163 // CSysApAppUi::CenRepController() |
|
6164 // ---------------------------------------------------------------------------- |
|
6165 |
|
6166 CSysApCenRepController& CSysApAppUi::CenRepController() |
|
6167 { |
|
6168 __ASSERT_ALWAYS( iSysApCenRepController, User::Panic( _L("CSysApAppUi::CenRepController"), KErrBadHandle ) ); |
|
6169 |
|
6170 return *iSysApCenRepController; |
|
6171 } |
|
6172 |
|
6173 // ---------------------------------------------------------------------------- |
|
6174 // CSysApAppUi::ExecCommandL |
|
6175 // ---------------------------------------------------------------------------- |
|
6176 // |
|
6177 void CSysApAppUi::ExecCommandL( TSysapCommand aCommand ) |
|
6178 { |
|
6179 ExecCommandL( aCommand, KNullDesC8 ); |
|
6180 } |
|
6181 |
|
6182 // ---------------------------------------------------------------------------- |
|
6183 // CSysApAppUi::ExecCommandL |
|
6184 // ---------------------------------------------------------------------------- |
|
6185 // |
|
6186 void CSysApAppUi::ExecCommandL( TSysapCommand aCommand, const TDesC8& aParam ) |
|
6187 { |
|
6188 TRACES( RDebug::Print(_L("CSysApAppUi::ExecCommandL: aCommand=%d"), aCommand ) ); |
|
6189 |
|
6190 switch ( aCommand ) |
|
6191 { |
|
6192 case EResetKeyguardState: // reset the internal keyguard flags of the SysAp, except for iKeyLockOnBeforeCradle |
|
6193 iKeyLockOnBeforeCall = EFalse; |
|
6194 iKeyLockOnBeforeAlarm = EFalse; |
|
6195 break; |
|
6196 |
|
6197 case ECancelPowermenu: // hide power menu if it is visible |
|
6198 if( iPowerKeyPopupMenuActive ) |
|
6199 { |
|
6200 CancelGlobalListQuery(); |
|
6201 } |
|
6202 break; |
|
6203 |
|
6204 case EUpdateLights: // apply key specific light handling |
|
6205 { |
|
6206 TUpdateLightsBuf lightBuf; |
|
6207 lightBuf.Copy( aParam ); |
|
6208 |
|
6209 switch ( lightBuf() ) |
|
6210 { |
|
6211 case EKeyGripClose: |
|
6212 SetGripOpenL( EFalse ); |
|
6213 break; |
|
6214 |
|
6215 case EKeyGripOpen: |
|
6216 SetGripOpenL( ETrue ); |
|
6217 break; |
|
6218 |
|
6219 case EKeyFlipClose: |
|
6220 SetFlipOpenL( EFalse ); |
|
6221 break; |
|
6222 |
|
6223 case EKeyFlipOpen: |
|
6224 SetFlipOpenL( ETrue ); |
|
6225 break; |
|
6226 |
|
6227 default: |
|
6228 // No specific light handling for other keys. |
|
6229 break; |
|
6230 } |
|
6231 } |
|
6232 break; |
|
6233 |
|
6234 default: |
|
6235 // do nothing in release builds since no harm is done |
|
6236 __ASSERT_DEBUG( EFalse, User::Panic( _L("CSysApAppUi::ExecCommandL: Invalid command"), KErrArgument ) ); |
|
6237 break; |
|
6238 } |
|
6239 } |
|
6240 |
|
6241 // ---------------------------------------------------------------------------- |
|
6242 // CSysApAppUi::ExecQueryL |
|
6243 // ---------------------------------------------------------------------------- |
|
6244 // |
|
6245 void CSysApAppUi::ExecQueryL( TSysapQuery aQuery, TDes8& aReturn ) |
|
6246 { |
|
6247 ExecQueryL( aQuery, aReturn, KNullDesC8 ); |
|
6248 } |
|
6249 |
|
6250 // ---------------------------------------------------------------------------- |
|
6251 // CSysApAppUi::ExecQueryL |
|
6252 // ---------------------------------------------------------------------------- |
|
6253 // |
|
6254 void CSysApAppUi::ExecQueryL( TSysapQuery aQuery, TDes8& aReturn, const TDesC8& /*aParam*/ ) |
|
6255 { |
|
6256 TRACES( RDebug::Print(_L("CSysApAppUi::ExecQueryL: aQuery=%d"), aQuery ) ); |
|
6257 |
|
6258 switch ( aQuery ) |
|
6259 { |
|
6260 case EGetHwrmLight: // get handle to HWRM client session. Returns CHWRMLight*. |
|
6261 { |
|
6262 THwrmLightBuf retBuf( iSysApLightsController->GetHwrmLight() ); |
|
6263 aReturn.Copy( retBuf ); |
|
6264 } |
|
6265 break; |
|
6266 |
|
6267 case EGetKeylock: // get handle to keylock client session. Returns RAknKeylock2*. |
|
6268 { |
|
6269 TKeyLockBuf retBuf( &(KeyLock()) ); |
|
6270 aReturn.Copy( retBuf ); |
|
6271 } |
|
6272 break; |
|
6273 |
|
6274 default: |
|
6275 __ASSERT_DEBUG( EFalse, User::Panic( _L("CSysApAppUi::ExecQueryL: Invalid query"), KErrArgument ) ); |
|
6276 User::Leave( KErrArgument ); |
|
6277 break; |
|
6278 } |
|
6279 } |
|
6280 |
|
6281 // ---------------------------------------------------------------------------- |
|
6282 // CSysApAppUi::ShowShutdownImage |
|
6283 // ---------------------------------------------------------------------------- |
|
6284 // |
|
6285 TInt CSysApAppUi::ShowShutdownImage( TInt aBitmapId ) |
|
6286 { |
|
6287 TRACES( RDebug::Print(_L("CSysApAppUi::ShowShutdownImage") ) ); |
|
6288 |
|
6289 TRAPD( err, ShowShutdownImageL( aBitmapId ) ); |
|
6290 |
|
6291 if ( err != KErrNone ) |
|
6292 { |
|
6293 TRACES( RDebug::Print(_L("CSysApAppUi::ShowShutdownImageL failed, err=%d"), err ) ); |
|
6294 } |
|
6295 |
|
6296 return err; |
|
6297 } |
|
6298 |
|
6299 // ---------------------------------------------------------------------------- |
|
6300 // CSysApAppUi::ShowShutdownImageL |
|
6301 // ---------------------------------------------------------------------------- |
|
6302 // |
|
6303 void CSysApAppUi::ShowShutdownImageL( TInt aBitmapId ) |
|
6304 { |
|
6305 TRACES( RDebug::Print(_L("CSysApAppUi::ShowShutdownImageL") ) ); |
|
6306 |
|
6307 if ( !iSysApShutdownImage ) // Shutdown image may be shown without entering normal state (e.g. charging), so construct here |
|
6308 { |
|
6309 TRACES( RDebug::Print( _L("CSysApAppUi::ShowShutdownImageL: trying CSysApShutdownImage::NewL()") ) ); |
|
6310 iSysApShutdownImage = CSysApShutdownImage::NewL(); |
|
6311 } |
|
6312 |
|
6313 TRACES( RDebug::Print( _L("CSysApAppUi::ShowShutdownImageL: trying CSysApShutdownImage::ShowShutdownImageL()") ) ); |
|
6314 iSysApShutdownImage->ShowShutdownImageL( aBitmapId ); |
|
6315 } |
|
6316 |
|
6317 // ---------------------------------------------------------------------------- |
|
6318 // CSysApAppUi::IgnoreZeroNetworkBarNotifications |
|
6319 // ---------------------------------------------------------------------------- |
|
6320 // |
|
6321 void CSysApAppUi::IgnoreZeroNetworkBarNotifications(TBool aIgnore) |
|
6322 { |
|
6323 iIgnoreZeroNetworkBarNotifications = aIgnore; |
|
6324 } |
|
6325 |
|
6326 // ---------------------------------------------------------------------------- |
|
6327 // CSysApAppUi::BtSapEnabled() |
|
6328 // ---------------------------------------------------------------------------- |
|
6329 |
|
6330 TBool CSysApAppUi::BtSapEnabled() |
|
6331 { |
|
6332 if ( iSysApBtSapController ) |
|
6333 { |
|
6334 return iSysApBtSapController->BtSapEnabled(); |
|
6335 } |
|
6336 |
|
6337 return EFalse; |
|
6338 } |
|
6339 |
|
6340 // ---------------------------------------------------------------------------- |
|
6341 // CSysApAppUi::DeactivateBT |
|
6342 // ---------------------------------------------------------------------------- |
|
6343 // |
|
6344 void CSysApAppUi::DeactivateBT() |
|
6345 { |
|
6346 // Will deactivate BT when changing to normal mode |
|
6347 iDeactivateBt = ETrue; |
|
6348 } |
|
6349 |
|
6350 // ---------------------------------------------------------------------------- |
|
6351 // CSysApAppUi::SetHacIndicatorL() |
|
6352 // ---------------------------------------------------------------------------- |
|
6353 void CSysApAppUi::SetHacIndicatorL() |
|
6354 { |
|
6355 |
|
6356 if ( !iSysApCenRepHacSettingObserver ) |
|
6357 { |
|
6358 // Do nothing if HAC setting observer has not been created yet |
|
6359 // This occurs in case some party is trying to set HAC indicator during |
|
6360 // ConstructL(), e.g. when switching from offline to online during startup |
|
6361 TRACES( RDebug::Print( _L("CSysApAppUi::SetHacIndicatorL: do nothing, HAC observer does not exist yet") ) ); |
|
6362 return; |
|
6363 } |
|
6364 |
|
6365 if ( iSysApCenRepHacSettingObserver->HacMode() ) |
|
6366 { |
|
6367 TBool accessoryConnected ( EFalse ); |
|
6368 |
|
6369 TAccMode accMode(EAccModeHandPortable); |
|
6370 |
|
6371 if ( iSysApAccessoryObserver ) |
|
6372 { |
|
6373 accMode = iSysApAccessoryObserver->GetAccessoryMode(); |
|
6374 |
|
6375 if ( accMode != EAccModeHandPortable ) |
|
6376 { |
|
6377 accessoryConnected = ETrue; |
|
6378 } |
|
6379 } |
|
6380 |
|
6381 TInt indicatorState = EAknIndicatorStateOn; |
|
6382 |
|
6383 if ( !accessoryConnected ) // When accessory is not connected, check offline and call state |
|
6384 { |
|
6385 if ( OfflineModeActive() ) // HAC indicator is not shown in offline mode |
|
6386 { |
|
6387 indicatorState = EAknIndicatorStateOff; |
|
6388 } |
|
6389 else |
|
6390 { |
|
6391 // during active call with IHF activated HAC indicator is not shown |
|
6392 TInt callState( StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ) ); |
|
6393 if ( callState < KErrNone ) |
|
6394 { |
|
6395 callState = EPSCTsyCallStateNone; |
|
6396 } |
|
6397 |
|
6398 if ( callState != EPSCTsyCallStateNone && IhfEnabledL() ) |
|
6399 { |
|
6400 indicatorState = EAknIndicatorStateOff; |
|
6401 } |
|
6402 } |
|
6403 |
|
6404 } |
|
6405 else |
|
6406 { |
|
6407 // If an accessory is connected, HAC indicator should not be shown |
|
6408 indicatorState = EAknIndicatorStateOff; |
|
6409 } |
|
6410 |
|
6411 SetIndicatorStateL( EAknIndicatorHAC, indicatorState ); |
|
6412 |
|
6413 } |
|
6414 else |
|
6415 { |
|
6416 // If HAC is not active, always disable indicator regardless of accessory state |
|
6417 SetIndicatorStateL( EAknIndicatorHAC, EAknIndicatorStateOff ); |
|
6418 } |
|
6419 |
|
6420 |
|
6421 } |
|
6422 |
|
6423 // ---------------------------------------------------------------------------- |
|
6424 // CSysApAppUi::HandleResourceChangeL() |
|
6425 // ---------------------------------------------------------------------------- |
|
6426 |
|
6427 void CSysApAppUi::HandleResourceChangeL( TInt aType ) |
|
6428 { |
|
6429 TRACES( RDebug::Print( _L("CSysApAppUi::HandleResourceChangeL aType: %d"), aType ) ); |
|
6430 CAknAppUi::HandleResourceChangeL(aType); |
|
6431 |
|
6432 if ( aType == KEikDynamicLayoutVariantSwitch ) |
|
6433 { |
|
6434 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
6435 iSysApShutdownImage->SetRect( ApplicationRect() ); |
|
6436 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
6437 |
|
6438 TInt mode; |
|
6439 User::LeaveIfError( RProperty::Get( KPSUidStartup, KPSGlobalStartupMode, mode ) ); |
|
6440 |
|
6441 if ( mode == EStartupModeAlarm ) |
|
6442 { |
|
6443 SetStatusPaneLayoutL( ESysApAlarm ); |
|
6444 } |
|
6445 } |
|
6446 } |
|
6447 |
|
6448 // ---------------------------------------------------------------------------- |
|
6449 // CSysApAppUi::SetMemoryCardIndicatorL |
|
6450 // ---------------------------------------------------------------------------- |
|
6451 |
|
6452 void CSysApAppUi::SetMemoryCardIndicatorL() |
|
6453 { |
|
6454 if ( iSysApFeatureManager->Supported( KSysApFeatureIdMemoryCardIcon ) ) |
|
6455 { |
|
6456 #ifndef RD_MULTIPLE_DRIVE |
|
6457 TSysApMemoryCardStatus memoryCardStatus = iSysApMMCObserver->MemoryCardStatus(); |
|
6458 |
|
6459 TRACES( RDebug::Print( _L("CSysApAppUi::SetMemoryCardIndicatorL: memoryCardStatus=%d"), memoryCardStatus ) ); |
|
6460 |
|
6461 if ( memoryCardStatus == ESysApMemoryCardInserted || memoryCardStatus == ESysApMemoryCardLocked ) |
|
6462 #else // RD_MULTIPLE_DRIVE |
|
6463 TInt insertedCount( CSysApDriveList::NonUsbDriveCount( iInsertedMemoryCards ) ); |
|
6464 |
|
6465 TRACES( RDebug::Print( _L("CSysApAppUi::SetMemoryCardIndicatorL: insertedCount=%d"), insertedCount ) ); |
|
6466 |
|
6467 if ( insertedCount > 0 ) |
|
6468 #endif // RD_MULTIPLE_DRIVE |
|
6469 { |
|
6470 SetIndicatorStateL( EAknIndicatorMemoryCard, EAknIndicatorStateOn ); |
|
6471 } |
|
6472 else |
|
6473 { |
|
6474 SetIndicatorStateL( EAknIndicatorMemoryCard, EAknIndicatorStateOff ); |
|
6475 } |
|
6476 } |
|
6477 } |
|
6478 |
|
6479 // ---------------------------------------------------------------------------- |
|
6480 // CSysApAppUi::SysApFeatureManager |
|
6481 // ---------------------------------------------------------------------------- |
|
6482 |
|
6483 CSysApFeatureManager& CSysApAppUi::SysApFeatureManager() |
|
6484 { |
|
6485 __ASSERT_DEBUG( iSysApFeatureManager, User::Panic( _L("iSysApFeatureManager == NULL"), KErrBadHandle ) ); |
|
6486 |
|
6487 return *iSysApFeatureManager; |
|
6488 } |
|
6489 |
|
6490 // ---------------------------------------------------------------------------- |
|
6491 // CSysApAppUi::SetUsbAttachStatus |
|
6492 // ---------------------------------------------------------------------------- |
|
6493 #ifndef RD_MULTIPLE_DRIVE |
|
6494 void CSysApAppUi::SetUsbAttachStatus( const TBool aUsbAttached ) |
|
6495 { |
|
6496 // Prevent double beep when USB file transfer gets activated but |
|
6497 // allow MMC inserted beep when: |
|
6498 // a) USB file transfer is active |
|
6499 // b) MMC is not inserted when USB cable is attached |
|
6500 iHideNextBeep = ( iMMCInserted && aUsbAttached ); |
|
6501 } |
|
6502 #else // RD_MULTIPLE_DRIVE |
|
6503 void CSysApAppUi::SetUsbAttachStatus( const TBool aUsbAttached ) |
|
6504 { |
|
6505 TRACES( RDebug::Print( |
|
6506 _L( "CSysApAppUi::SetUsbAttachStatus: aUsbAttached: %d" ), |
|
6507 aUsbAttached ) ); |
|
6508 |
|
6509 if ( aUsbAttached ) |
|
6510 { |
|
6511 // For ignoring extra beeps caused by USB file transfer |
|
6512 iSysApDriveList->ResetDrivesInsertBeepIgnored(); |
|
6513 iSysApDriveList->MarkDrivesInsertBeepIgnored( iInsertedMemoryCards ); |
|
6514 } |
|
6515 } |
|
6516 #endif // RD_MULTIPLE_DRIVE |
|
6517 |
|
6518 // ---------------------------------------------------------------------------- |
|
6519 // CSysApAppUi::IhfEnabledL |
|
6520 // ---------------------------------------------------------------------------- |
|
6521 |
|
6522 TBool CSysApAppUi::IhfEnabledL() |
|
6523 { |
|
6524 TRACES( RDebug::Print( _L("CSysApAppUi::IhfEnabledL(): iSysApAudioRoutingObserver=0x%x"), iSysApAudioRoutingObserver ) ); |
|
6525 |
|
6526 if ( !iSysApAudioRoutingObserver ) // create observer if needed |
|
6527 { |
|
6528 iSysApAudioRoutingObserver = CSysApAudioRoutingObserver::NewL( *this ); |
|
6529 } |
|
6530 |
|
6531 return iSysApAudioRoutingObserver->IhfEnabled(); |
|
6532 } |
|
6533 |
|
6534 // ---------------------------------------------------------------------------- |
|
6535 // CSysApAppUi::IsDeviceModeKey |
|
6536 // ---------------------------------------------------------------------------- |
|
6537 |
|
6538 TBool CSysApAppUi::IsDeviceModeKey( const TKeyEvent& aKeyEvent ) const |
|
6539 { |
|
6540 return CSysApDefaultKeyHandler::IsDeviceModeKey( aKeyEvent ); |
|
6541 } |
|
6542 |
|
6543 // ---------------------------------------------------------------------------- |
|
6544 // CSysApAppUi::ResourcesFreed |
|
6545 // ---------------------------------------------------------------------------- |
|
6546 |
|
6547 TBool CSysApAppUi::ResourcesFreed() const |
|
6548 { |
|
6549 return iResourcesFreed; |
|
6550 } |
|
6551 |
|
6552 /* |
|
6553 ---------------------------------------------------------------------------- |
|
6554 CSysApAppUi::IsEncryptionOperationOngoingL() |
|
6555 Introduced the code as a part of Sub : 405-3362 - Power Management SUB for ES |
|
6556 recapture functionalities in platform which support multidrive as well. |
|
6557 ------------------------------------------------------------------------------- |
|
6558 */ |
|
6559 TBool CSysApAppUi::IsEncryptionOperationOngoingL() const |
|
6560 { |
|
6561 TBool deFeatureSupported(EFalse); |
|
6562 FeatureManager::InitializeLibL(); |
|
6563 deFeatureSupported = FeatureManager::FeatureSupported( KFeatureIdFfDeviceEncryptionFeature); |
|
6564 FeatureManager::UnInitializeLib(); |
|
6565 |
|
6566 if(deFeatureSupported) |
|
6567 { |
|
6568 /** |
|
6569 * Store the last memory status changed |
|
6570 * 0: Idle. It can be Encrypted or Decrypted |
|
6571 * 1: Encrypting |
|
6572 * 2: Decrypting |
|
6573 **/ |
|
6574 |
|
6575 RProperty deProperty; |
|
6576 User::LeaveIfError(deProperty.Attach(KDevEncProtectedUid, KDevEncOperationKey,EOwnerThread)); |
|
6577 TInt deValue = 0; |
|
6578 if((deProperty.Get(deValue)== KErrNone)&&( deValue == EOpEncrypting || deValue == EOpDecrypting)) |
|
6579 { |
|
6580 deProperty.Close(); |
|
6581 return ETrue; |
|
6582 } |
|
6583 else |
|
6584 { |
|
6585 deProperty.Close(); |
|
6586 return EFalse; |
|
6587 } |
|
6588 } |
|
6589 else |
|
6590 { |
|
6591 return EFalse; |
|
6592 } |
|
6593 } |
|
6594 // ---------------------------------------------------------------------------- |
|
6595 // CSysApAppUi::EtelConnector |
|
6596 // ---------------------------------------------------------------------------- |
|
6597 |
|
6598 CSysApEtelConnector* CSysApAppUi::EtelConnector() const |
|
6599 { |
|
6600 return iSysApEtelConnector; |
|
6601 } |
|
6602 |
|
6603 #ifndef RD_MULTIPLE_DRIVE |
|
6604 |
|
6605 // ---------------------------------------------------------------------------- |
|
6606 // CSysApAppUi::EjectUsed |
|
6607 // ---------------------------------------------------------------------------- |
|
6608 |
|
6609 void CSysApAppUi::EjectUsed( TInt /*aDrive*/ ) |
|
6610 { |
|
6611 } |
|
6612 |
|
6613 #else // RD_MULTIPLE_DRIVE |
|
6614 |
|
6615 // ---------------------------------------------------------------------------- |
|
6616 // CSysApAppUi::ShowEjectWaitNoteL |
|
6617 // ---------------------------------------------------------------------------- |
|
6618 |
|
6619 void CSysApAppUi::ShowEjectWaitNoteL( TInt aDriveToEject ) |
|
6620 { |
|
6621 if ( iSysApWaitNote ) |
|
6622 { |
|
6623 return; |
|
6624 } |
|
6625 HBufC* text = iSysApDriveList->GetFormattedDriveNameLC( |
|
6626 aDriveToEject, |
|
6627 0, // Not used |
|
6628 R_QTN_EJECTING_MEMORY_NAME_WAIT ); |
|
6629 iSysApWaitNote = CSysApWaitNote::NewL( |
|
6630 iSysApFeatureManager->CoverDisplaySupported() ); |
|
6631 iSysApWaitNote->ShowNoteL( EClosingApplicationsNote, text ); |
|
6632 CleanupStack::PopAndDestroy( text ); |
|
6633 } |
|
6634 |
|
6635 // ---------------------------------------------------------------------------- |
|
6636 // CSysApAppUi::IsEjectQueryVisible |
|
6637 // ---------------------------------------------------------------------------- |
|
6638 |
|
6639 TBool CSysApAppUi::IsEjectQueryVisible() |
|
6640 { |
|
6641 if ( !iSysApConfirmationQuery ) |
|
6642 { |
|
6643 return EFalse; |
|
6644 } |
|
6645 TInt queryId( iSysApConfirmationQuery->CurrentQuery() ); |
|
6646 return ( queryId == ESysApEjectMmcQuery || queryId == ESysApRemoveMmcNote ); |
|
6647 } |
|
6648 |
|
6649 // ---------------------------------------------------------------------------- |
|
6650 // CSysApAppUi::UpdateInsertedMemoryCardsL |
|
6651 // ---------------------------------------------------------------------------- |
|
6652 |
|
6653 void CSysApAppUi::UpdateInsertedMemoryCardsL() |
|
6654 { |
|
6655 // Update inserted memory cards |
|
6656 iSysApDriveList->GetMemoryCardsL( |
|
6657 iInsertedMemoryCards, CSysApDriveList::EIncludeInserted ); |
|
6658 |
|
6659 // Update memory card indicator status |
|
6660 SetMemoryCardIndicatorL(); |
|
6661 |
|
6662 // Handle unlock |
|
6663 RunUnlockNotifierL(); |
|
6664 } |
|
6665 |
|
6666 // ---------------------------------------------------------------------------- |
|
6667 // CSysApAppUi::EjectUsed |
|
6668 // ---------------------------------------------------------------------------- |
|
6669 |
|
6670 void CSysApAppUi::EjectUsed( TInt aDrive ) |
|
6671 { |
|
6672 // Check drive inserted before starting eject confirm query |
|
6673 TInt insertedIndex( CSysApDriveList::Find( iInsertedMemoryCards, aDrive ) ); |
|
6674 |
|
6675 TRACES( RDebug::Print( |
|
6676 _L( "CSysApAppUi::EjectUsed: drive: %d, index: %d" ), |
|
6677 aDrive, insertedIndex ) ); |
|
6678 |
|
6679 if ( insertedIndex == KErrNotFound ) |
|
6680 { |
|
6681 return; |
|
6682 } |
|
6683 |
|
6684 iMMCEjectUsed = ETrue; |
|
6685 iDriveToEject = aDrive; |
|
6686 iSysApDriveList->ResetDrivesToEject(); |
|
6687 TRAPD( err, EjectMMCL() ); |
|
6688 if ( err != KErrNone ) |
|
6689 { |
|
6690 TRACES( RDebug::Print( |
|
6691 _L( "CSysApAppUi::EjectUsed: err: %d" ), err ) ); |
|
6692 iMMCEjectUsed = EFalse; |
|
6693 } |
|
6694 } |
|
6695 |
|
6696 #endif // RD_MULTIPLE_DRIVE |
|
6697 |
|
6698 // ---------------------------------------------------------------------------- |
|
6699 // CSysApAppUi::EjectMMCCanceled |
|
6700 // ---------------------------------------------------------------------------- |
|
6701 |
|
6702 void CSysApAppUi::EjectMMCCanceled() |
|
6703 { |
|
6704 // Called from eject confirm query, reset eject status |
|
6705 #ifdef RD_MULTIPLE_DRIVE |
|
6706 iMMCEjectUsed = EFalse; |
|
6707 #endif // RD_MULTIPLE_DRIVE |
|
6708 } |
|
6709 |
|
6710 // ---------------------------------------------------------------------------- |
|
6711 // CSysApAppUi::UsbChargerDetector |
|
6712 // ---------------------------------------------------------------------------- |
|
6713 // |
|
6714 TSysApUsbChargerDetector& CSysApAppUi::UsbChargerDetector() |
|
6715 { |
|
6716 return iSysApUsbChargerDetector; |
|
6717 } |
|
6718 |
|
6719 // ---------------------------------------------------------------------------- |
|
6720 // CSysApAppUi::HandleUsbCharger |
|
6721 // ---------------------------------------------------------------------------- |
|
6722 // |
|
6723 void CSysApAppUi::HandleUsbCharger( const TInt aValue ) |
|
6724 { |
|
6725 if ( aValue == EChargingStatusCharging || |
|
6726 aValue == EChargingStatusChargingContinued || |
|
6727 aValue == EChargingStatusAlmostComplete ) |
|
6728 { |
|
6729 iSysApUsbChargerDetector.SetChargingUsed( ETrue ); |
|
6730 if ( !iSysApUsbIndicatorController && |
|
6731 iSysApFeatureManager->Supported( KSysApFeatureIdChargerReminderNotes ) && |
|
6732 iSysApFeatureManager->Supported( KSysApFeatureIdUsbChargingWithoutReminderNotes ) ) |
|
6733 { |
|
6734 // Start observing USB state for the reminder note |
|
6735 TRAPD ( usbErr, iSysApUsbIndicatorController = CreateSysApUsbIndicatorL( *this ) ); |
|
6736 if ( usbErr ) |
|
6737 { |
|
6738 TRACES( RDebug::Print( |
|
6739 _L("CSysApAppUi::HandleUsbCharger: error in constructing USB ind. controller %d" ), |
|
6740 usbErr ) ); |
|
6741 } |
|
6742 } |
|
6743 } |
|
6744 } |
|
6745 |
|
6746 // ---------------------------------------------------------------------------- |
|
6747 // CSysApAppUi::SetEnvelopeIndicatorL |
|
6748 // ---------------------------------------------------------------------------- |
|
6749 // |
|
6750 void CSysApAppUi::SetEnvelopeIndicatorL() |
|
6751 { |
|
6752 TInt phoneStoreStatus( StateOfProperty( KUidPSSMSStackCategory, KUidPSSMSStackDiskSpaceMonitorKey ) ); |
|
6753 TInt inboxStatus( StateOfProperty( KUidSystemCategory, KUidInboxStatusValue ) ); |
|
6754 TBool simStoreFull( iSysApEtelConnector && iSysApEtelConnector->IsSimSmsStoreFull() ); |
|
6755 |
|
6756 TRACES( RDebug::Print( |
|
6757 _L("CSysApAppUi::SetEnvelopeIndicatorL() phoneStoreStatus %d, simStoreFull %d, inboxStatus %d"), |
|
6758 phoneStoreStatus, simStoreFull, inboxStatus ) ); |
|
6759 |
|
6760 if ( phoneStoreStatus == ESmsDiskSpaceFull || simStoreFull ) |
|
6761 { |
|
6762 // Blink the Envelope indicator |
|
6763 SetIndicatorStateL( EAknIndicatorEnvelope, EAknIndicatorStateAnimate ); |
|
6764 } |
|
6765 else if ( inboxStatus == ESADocumentsInInbox ) |
|
6766 { |
|
6767 // Show the Envelope indicator. |
|
6768 SetIndicatorStateL( EAknIndicatorEnvelope, EAknIndicatorStateOn ); |
|
6769 } |
|
6770 else |
|
6771 { |
|
6772 // Hide the Envelope indicator. |
|
6773 SetIndicatorStateL( EAknIndicatorEnvelope, EAknIndicatorStateOff ); |
|
6774 } |
|
6775 } |
|
6776 |
|
6777 // ---------------------------------------------------------------------------- |
|
6778 // CSysApAppUi::LogsObserverL |
|
6779 // ---------------------------------------------------------------------------- |
|
6780 // |
|
6781 CSysApCenRepLogsObserver& CSysApAppUi::LogsObserverL() |
|
6782 { |
|
6783 TRACES( RDebug::Print( _L("CSysApAppUi::LogsObserverL()") ) ); |
|
6784 |
|
6785 // Create Logs observer when it is needed for the first time |
|
6786 if ( !iSysApCenRepLogsObserver ) |
|
6787 { |
|
6788 iSysApCenRepLogsObserver = CSysApCenRepLogsObserver::NewL( *this ); |
|
6789 } |
|
6790 |
|
6791 return *iSysApCenRepLogsObserver; |
|
6792 } |
|
6793 |
|
6794 // ---------------------------------------------------------------------------- |
|
6795 // CSysApAppUi::NotifyPowerSaveModeL |
|
6796 // ---------------------------------------------------------------------------- |
|
6797 // |
|
6798 void CSysApAppUi::NotifyPowerSaveModeL( TSysApPsmStatus aStatus ) |
|
6799 { |
|
6800 TRACES( RDebug::Print( _L("CSysApAppUi::NotifyPowerSaveModeL aStatus: %d"), aStatus ) ); |
|
6801 |
|
6802 // cancel any active power saving query because user has changed the state manually |
|
6803 CancelQuery( ESysApBattChargingPowerSavingQuery ); |
|
6804 CancelQuery( ESysApBattLowPowerSavingQuery ); |
|
6805 |
|
6806 switch ( aStatus ) |
|
6807 { |
|
6808 case MSysApPsmControllerNotifyCallback::EPsmActivationComplete: |
|
6809 UpdateBatteryBarsL( StateOfProperty( KPSUidHWRMPowerState, KHWRMBatteryLevel ) ); |
|
6810 ShowUiNoteL( EPowerSaveModeActivated ); |
|
6811 break; |
|
6812 |
|
6813 case MSysApPsmControllerNotifyCallback::EPsmDeactivationComplete: |
|
6814 UpdateBatteryBarsL( StateOfProperty( KPSUidHWRMPowerState, KHWRMBatteryLevel ) ); |
|
6815 ShowUiNoteL( EPowerSaveModeDeactivated ); |
|
6816 break; |
|
6817 |
|
6818 case MSysApPsmControllerNotifyCallback::EPsmActivationFailed: |
|
6819 ShowUiNoteL( ECannotActivatePowerSaveMode ); |
|
6820 break; |
|
6821 |
|
6822 case MSysApPsmControllerNotifyCallback::EPsmDeactivationFailed: |
|
6823 ShowUiNoteL( ECannotDeactivatePowerSaveMode ); |
|
6824 break; |
|
6825 |
|
6826 default: |
|
6827 break; |
|
6828 } |
|
6829 } |
|
6830 |
|
6831 // ---------------------------------------------------------------------------- |
|
6832 // CSysApAppUi::HandleBatteryStatusL |
|
6833 // ---------------------------------------------------------------------------- |
|
6834 // |
|
6835 void CSysApAppUi::HandleBatteryStatusL( const TInt aValue ) |
|
6836 { |
|
6837 TRACES( RDebug::Print( _L("CSysApAppUi::HandleBatteryStatusL aValue: %d"), aValue ) ); |
|
6838 |
|
6839 if ( aValue == EBatteryStatusEmpty ) |
|
6840 { |
|
6841 //Display Recharge Battery note |
|
6842 ShowUiNoteL( ERechargeBatteryNote ); |
|
6843 BatteryEmptyL(); |
|
6844 } |
|
6845 else if ( aValue == EBatteryStatusLow ) |
|
6846 { |
|
6847 if ( iSysApPsmController && UiReady() ) |
|
6848 { |
|
6849 iSysApPsmController->BatteryLow( ETrue ); |
|
6850 |
|
6851 if ( iSysApPsmController->ShowActivateQuery()) |
|
6852 { |
|
6853 // show activation query, replaces the first battery low query |
|
6854 ShowQueryL( ESysApBattLowPowerSavingQuery ); |
|
6855 } |
|
6856 else // default low warning note must be shown |
|
6857 { |
|
6858 // activate partial power save mode on first low warning |
|
6859 iSysApPsmController->DoEnablePartialPsm( ETrue ); // activated on first warning note |
|
6860 //Display Battery Low note. |
|
6861 ShowUiNoteL( EBatteryLowNote ); |
|
6862 } |
|
6863 } |
|
6864 else |
|
6865 { |
|
6866 //Display Battery Low note. |
|
6867 ShowUiNoteL( EBatteryLowNote ); |
|
6868 } |
|
6869 } |
|
6870 |
|
6871 if ( iSysApBatteryInfoController ) |
|
6872 { |
|
6873 iSysApBatteryInfoController->BatteryStatusUpdated( aValue ); |
|
6874 } |
|
6875 |
|
6876 } |
|
6877 |
|
6878 // ---------------------------------------------------------------------------- |
|
6879 // CSysApAppUi::HandleChargingStatusL |
|
6880 // ---------------------------------------------------------------------------- |
|
6881 // |
|
6882 void CSysApAppUi::HandleChargingStatusL( const TInt aValue ) |
|
6883 { |
|
6884 TRACES( RDebug::Print( _L("CSysApAppUi::HandleChargingStatusL aValue: %d"), aValue ) ); |
|
6885 |
|
6886 TBool showNote( ETrue ); |
|
6887 |
|
6888 UpdateBatteryBarsL( StateOfProperty( KPSUidHWRMPowerState, KHWRMBatteryLevel ) ); |
|
6889 |
|
6890 if ( iSysApPsmController && UiReady() ) |
|
6891 { |
|
6892 if ( iCharging ) // iCharging updated in UpdateBatteryBarsL |
|
6893 { |
|
6894 // cancel activation query if charger is connected while query is on display |
|
6895 CancelQuery( ESysApBattLowPowerSavingQuery ); |
|
6896 } |
|
6897 |
|
6898 if ( iCharging && !iSysApPsmController->ChargerConnected() ) // first time after charger connection |
|
6899 { |
|
6900 iSysApPsmController->ConnectCharger( ETrue ); |
|
6901 |
|
6902 if ( iSysApPsmController->ShowDeactivateQuery() ) |
|
6903 { |
|
6904 ShowQueryL( ESysApBattChargingPowerSavingQuery ); |
|
6905 // Query is on the display. Don't show the note. |
|
6906 showNote = EFalse; |
|
6907 } |
|
6908 else |
|
6909 { |
|
6910 iSysApPsmController->DoEnablePartialPsm( EFalse ); |
|
6911 } |
|
6912 } |
|
6913 else if ( aValue == EChargingStatusNotConnected ) |
|
6914 { |
|
6915 iSysApPsmController->ConnectCharger( EFalse ); |
|
6916 |
|
6917 // cancel deactivation query if charger is disconnected while query is on display |
|
6918 CancelQuery( ESysApBattChargingPowerSavingQuery ); |
|
6919 } |
|
6920 } |
|
6921 if( showNote ) |
|
6922 { |
|
6923 HandleChargerNotesL( aValue ); |
|
6924 } |
|
6925 } |
|
6926 |
|
6927 // ---------------------------------------------------------------------------- |
|
6928 // CSysApAppUi::HandleActivatePsmQueryResponse |
|
6929 // ---------------------------------------------------------------------------- |
|
6930 // |
|
6931 void CSysApAppUi::HandleActivatePsmQueryResponse( TBool aEnable ) |
|
6932 { |
|
6933 TRACES( RDebug::Print( _L("CSysApAppUi::HandleActivatePsmQueryResponse aEnable: %d"), |
|
6934 aEnable ) ); |
|
6935 |
|
6936 __ASSERT_DEBUG( iSysApPsmController, User::Invariant() ); |
|
6937 |
|
6938 if ( aEnable ) |
|
6939 { |
|
6940 iSysApPsmController->DoEnableFullPsm( ETrue ); |
|
6941 } |
|
6942 else |
|
6943 { |
|
6944 iSysApPsmController->DoEnablePartialPsm( ETrue ); |
|
6945 } |
|
6946 } |
|
6947 |
|
6948 // ---------------------------------------------------------------------------- |
|
6949 // CSysApAppUi::HandleDeactivatePsmQueryResponse |
|
6950 // ---------------------------------------------------------------------------- |
|
6951 // |
|
6952 void CSysApAppUi::HandleDeactivatePsmQueryResponse( TBool aDisable ) |
|
6953 { |
|
6954 TRACES( RDebug::Print( _L("CSysApAppUi::HandleDeactivatePsmQueryResponse aDisable: %d"), |
|
6955 aDisable ) ); |
|
6956 |
|
6957 __ASSERT_DEBUG( iSysApPsmController, User::Invariant() ); |
|
6958 |
|
6959 if ( aDisable ) |
|
6960 { |
|
6961 iSysApPsmController->DoEnableFullPsm( EFalse ); |
|
6962 } |
|
6963 } |
|
6964 |
|
6965 // ---------------------------------------------------------------------------- |
|
6966 // CSysApAppUi::CancelQuery |
|
6967 // ---------------------------------------------------------------------------- |
|
6968 // |
|
6969 void CSysApAppUi::CancelQuery( TSysApConfirmationQueryIds aQueryId ) |
|
6970 { |
|
6971 TRACES( RDebug::Print( _L("CSysApAppUi::CancelQuery aQueryId: %d"), aQueryId ) ); |
|
6972 |
|
6973 if ( iSysApConfirmationQuery ) |
|
6974 { |
|
6975 if ( aQueryId == iSysApConfirmationQuery->CurrentQuery() || aQueryId == ESysApNoQuery ) |
|
6976 { |
|
6977 iSysApConfirmationQuery->Cancel(); |
|
6978 } |
|
6979 } |
|
6980 } |
|
6981 |
|
6982 TBool CSysApAppUi::IsDefaultPowerKeyBehavior() |
|
6983 { |
|
6984 TRACES( RDebug::Print( _L("CSysApAppUi::IsDefaultPowerKeyBehavior" ) ) ); |
|
6985 TBool powerKeyIsLockKey = iSysApFeatureManager->PowerKeyIsLockKey(); |
|
6986 if ( !powerKeyIsLockKey ) |
|
6987 return ETrue; //no need for further processing |
|
6988 TInt securityDialogStatus = StateOfProperty( KPSUidStartup, KStartupSecurityCodeQueryStatus ); |
|
6989 TRACES( RDebug::Printf( "CSysApAppUi::IsDefaultPowerKeyBehavior: securityDialogStatus = %d", securityDialogStatus ) ); |
|
6990 if ( securityDialogStatus == ESecurityQueryActive ) |
|
6991 { |
|
6992 // handle the exception from the exception. Currently used only when a long power key press is detected |
|
6993 return ETrue; |
|
6994 } |
|
6995 //make sure we can turn off device when 'sim invalid' dlg is displayed |
|
6996 TInt simStatus = StateOfProperty( KPSUidStartup, KStartupSimSecurityStatus ); |
|
6997 TBool simBogus = ( simStatus == ESimRejected ) || ( simStatus == ESimUnaccepted ) || (simStatus == ESimInvalid ); |
|
6998 |
|
6999 // check if the phone has fully booted into idle |
|
7000 TInt startupPhase = StateOfProperty ( KPSUidStartup, KPSStartupUiPhase ); |
|
7001 TBool bootCompleted = (EStartupUiPhaseAllDone == startupPhase); |
|
7002 |
|
7003 // Another exception from the exception: |
|
7004 // check if we're in charging or alert mode (only then we have a status pane instance) |
|
7005 TBool haveStatusPane = ( StatusPane()== NULL ) ? EFalse : StatusPane()->IsVisible(); |
|
7006 TBool defaultPowerKeyBehaviour = !bootCompleted || simBogus || haveStatusPane || iPowerKeyPopupMenuActive || !powerKeyIsLockKey; |
|
7007 |
|
7008 TRACES( RDebug::Printf( "CSysApAppUi::IsDefaultPowerKeyBehavior: Sim Status = %d, haveStatusPane = %d, power key menu active? %d" , simStatus, haveStatusPane, iPowerKeyPopupMenuActive ) ); |
|
7009 TRACES( RDebug::Printf( "CSysApAppUi::IsDefaultPowerKeyBehavior returns %d", defaultPowerKeyBehaviour ) ); |
|
7010 TRACES( RDebug::Printf( "CSysApAppUi::IsDefaultPowerKeyBehavior: startupPhase = %d", startupPhase ) ); |
|
7011 return defaultPowerKeyBehaviour; |
|
7012 } |
|
7013 |
|
7014 // ---------------------------------------------------------------------------- |
|
7015 // CSysApAppUi::StartChargingBatteryL |
|
7016 // ---------------------------------------------------------------------------- |
|
7017 // |
|
7018 void CSysApAppUi::StartChargingBatteryL() |
|
7019 { |
|
7020 TRACES( RDebug::Print( _L("CSysApAppUi::StartChargingBatteryL") ) ); |
|
7021 iBatteryNotify->StartChargingL(); |
|
7022 } |
|
7023 |
|
7024 // ---------------------------------------------------------------------------- |
|
7025 // CSysApAppUi::StopChargingBatteryL |
|
7026 // ---------------------------------------------------------------------------- |
|
7027 // |
|
7028 void CSysApAppUi::StopChargingBatteryL() |
|
7029 { |
|
7030 TRACES( RDebug::Print( _L("CSysApAppUi::StopChargingBatteryL") ) ); |
|
7031 iBatteryNotify->StopChargingL(); |
|
7032 } |
|
7033 |
|
7034 // End of File |
|