equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of "Eclipse Public License v1.0" |
5 * under the terms of "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
16 */ |
16 */ |
17 |
17 |
18 |
18 |
19 |
19 |
20 // INCLUDE FILES |
20 // INCLUDE FILES |
|
21 |
|
22 #include "OstTraceDefinitions.h" |
|
23 #ifdef OST_TRACE_COMPILER_IN_USE |
|
24 #include "ChargingStatusObserverTraces.h" |
|
25 #endif |
|
26 |
21 #include "ChargingStatusObserver.h" |
27 #include "ChargingStatusObserver.h" |
22 #include <ctsy/tflogger.h> |
|
23 |
28 |
24 // ======== MEMBER FUNCTIONS ======== |
29 // ======== MEMBER FUNCTIONS ======== |
25 |
30 |
26 CChargingStatusObserver* CChargingStatusObserver::NewL( |
31 CChargingStatusObserver* CChargingStatusObserver::NewL( |
27 MChargingStatusNotifier& aChargingStatusNotifier ) |
32 MChargingStatusNotifier& aChargingStatusNotifier ) |
79 iChargingStatus.Subscribe( iStatus ); |
84 iChargingStatus.Subscribe( iStatus ); |
80 SetActive(); |
85 SetActive(); |
81 |
86 |
82 if ( KErrNone != errorStatus ) |
87 if ( KErrNone != errorStatus ) |
83 { |
88 { |
84 TFLOGSTRING2("TSY: CChargingStatusObserver::RunL - iStatus: %d", errorStatus ); |
89 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CCHARGINGSTATUSOBSERVER_RUNL_1, "TSY: CChargingStatusObserver::RunL - iStatus: %d", errorStatus ); |
85 iChargingStatusNotifier.NotifyChargingStatus( errorStatus, |
90 iChargingStatusNotifier.NotifyChargingStatus( errorStatus, |
86 batteryInfo ); |
91 batteryInfo ); |
87 return; |
92 return; |
88 } |
93 } |
89 |
94 |
90 // property updated, get new value |
95 // property updated, get new value |
91 TInt level( 0 ); |
96 TInt level( 0 ); |
92 TInt error = iChargingStatus.Get( level ); |
97 TInt error = iChargingStatus.Get( level ); |
93 TFLOGSTRING2("TSY: CChargingStatusObserver::RunL error: %d", error); |
98 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CCHARGINGSTATUSOBSERVER_RUNL_2, "TSY: CChargingStatusObserver::RunL error: %d", error); |
94 |
99 |
95 if ( KErrNone == error ) |
100 if ( KErrNone == error ) |
96 { |
101 { |
97 EPSHWRMChargingStatus chargingStatus = (EPSHWRMChargingStatus)level; |
102 EPSHWRMChargingStatus chargingStatus = (EPSHWRMChargingStatus)level; |
98 |
103 |