51 void CPSMNetworkPlugin::ConstructL() |
51 void CPSMNetworkPlugin::ConstructL() |
52 { |
52 { |
53 __GSLOGSTRING( "[GS]-->[CPSMNetworkPlugin::ConstructL]" ); |
53 __GSLOGSTRING( "[GS]-->[CPSMNetworkPlugin::ConstructL]" ); |
54 |
54 |
55 iModel = CGSNetworkPluginModel::NewL( NULL,NULL ); |
55 iModel = CGSNetworkPluginModel::NewL( NULL,NULL ); |
|
56 iPsmRepository = CRepository::NewL( KCRUidPowerSaveMode ); |
|
57 // Read from CenRep so iPsmMode gets correct init value |
|
58 TInt psmMode; |
|
59 iPsmRepository->Get( KPsmCurrentMode, psmMode ); |
|
60 iPsmMode = ( TPsmsrvMode )psmMode; |
56 |
61 |
57 __GSLOGSTRING( "[GS]<--[CPSMNetworkPlugin::ConstructL]" ); |
62 __GSLOGSTRING( "[GS]<--[CPSMNetworkPlugin::ConstructL]" ); |
58 } |
63 } |
59 |
64 |
60 // |
65 // |
82 CPSMNetworkPlugin::~CPSMNetworkPlugin() |
87 CPSMNetworkPlugin::~CPSMNetworkPlugin() |
83 { |
88 { |
84 __GSLOGSTRING( "[CPSMNetworkPlugin::~CPSMNetworkPlugin]" ); |
89 __GSLOGSTRING( "[CPSMNetworkPlugin::~CPSMNetworkPlugin]" ); |
85 delete iModel; |
90 delete iModel; |
86 iModel = NULL; |
91 iModel = NULL; |
|
92 delete iPsmRepository; |
|
93 iPsmRepository = NULL; |
87 } |
94 } |
88 |
95 |
89 // --------------------------------------------------------- |
96 // --------------------------------------------------------- |
90 // CPSMNetworkPlugin::IsPhoneOfflineL |
97 // CPSMNetworkPlugin::IsPhoneOfflineL |
91 // |
98 // |
128 // CPSMNetworkPlugin::NotifyModeChange() |
135 // CPSMNetworkPlugin::NotifyModeChange() |
129 // ---------------------------------------------------------------------------------- |
136 // ---------------------------------------------------------------------------------- |
130 // |
137 // |
131 void CPSMNetworkPlugin::DoModeChangeL( const TInt aMode ) |
138 void CPSMNetworkPlugin::DoModeChangeL( const TInt aMode ) |
132 { |
139 { |
|
140 TPsmsrvMode newMode = ( TPsmsrvMode )aMode; |
133 if ( !IsPhoneOfflineL() && |
141 if ( !IsPhoneOfflineL() && |
134 FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma ) && |
142 FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma ) && |
135 iModel->IsNetworkModeVisible() ) |
143 iModel->IsNetworkModeVisible() && IsChangeNetworkMode ( iPsmMode, newMode ) ) |
136 { |
144 { |
137 RConfigInfoArray infoArray; |
145 RConfigInfoArray infoArray; |
138 |
146 |
139 TPsmsrvConfigInfo info1; |
147 TPsmsrvConfigInfo info1; |
140 info1.iConfigId = ENetworkMode; |
148 info1.iConfigId = ENetworkMode; |
141 info1.iConfigType = EConfigTypeInt; |
149 info1.iConfigType = EConfigTypeInt; |
142 info1.iIntValue = iModel->GetNetworkMode(); |
150 info1.iIntValue = iModel->GetNetworkMode(); |
143 infoArray.Append( info1 ); |
151 infoArray.Append( info1 ); |
144 |
152 |
145 __GSLOGSTRING1( "[CPSMNetworkPlugin::NotifyModeChangeL] Switching to mode:%d", aMode ); |
153 __GSLOGSTRING1( "[CPSMNetworkPlugin::NotifyModeChangeL] Switching to mode:%d", aMode ); |
146 |
154 |
147 __GSLOGSTRING1( "[CPSMNetworkPlugin::NotifyModeChangeL]: oldValue info1: %d", infoArray[0].iIntValue ); |
155 __GSLOGSTRING1( "[CPSMNetworkPlugin::NotifyModeChangeL]: oldValue info1: %d", infoArray[0].iIntValue ); |
148 |
156 |
149 iSettingsProvider.BackupAndGetSettingsL( infoArray, KPSMNetworkPluginStorageId ); |
157 iSettingsProvider.BackupAndGetSettingsL( infoArray, KPSMNetworkPluginStorageId ); |