97 cenrepValue = CenrepKeyValueOff; |
97 cenrepValue = CenrepKeyValueOff; |
98 } |
98 } |
99 return writeCenrepValue(KCRUidLogs.iUid, KLogsShowCallDuration, cenrepValue ); |
99 return writeCenrepValue(KCRUidLogs.iUid, KLogsShowCallDuration, cenrepValue ); |
100 } |
100 } |
101 |
101 |
102 int CpSettingsWrapper::readVtVideoSending() |
102 int SettingsWrapper::readVtVideoSending() |
103 { |
103 { |
104 DPRINT << ": IN"; |
104 DPRINT << ": IN"; |
105 return readCenrepValue(KCRUidTelephonySettings.iUid, KSettingsVTVideoSending).toInt(); |
105 return readCenrepValue(KCRUidTelephonySettings.iUid, KSettingsVTVideoSending).toInt(); |
106 } |
106 } |
107 |
107 |
108 int CpSettingsWrapper::writeVtVideoSending(int value) |
108 int SettingsWrapper::writeVtVideoSending(int value) |
109 { |
109 { |
110 DPRINT << ": IN"; |
110 DPRINT << ": IN"; |
111 return writeCenrepValue(KCRUidTelephonySettings.iUid, KSettingsVTVideoSending, value); |
111 return writeCenrepValue(KCRUidTelephonySettings.iUid, KSettingsVTVideoSending, value); |
112 } |
112 } |
113 |
113 |
114 void CpSettingsWrapper::readSoftRejectText(QString &text, bool &userDefined ) |
114 void SettingsWrapper::readSoftRejectText(QString &text, bool &userDefined ) |
115 { |
115 { |
116 if (SoftRejectTextDefault == |
116 if (SoftRejectTextDefault == |
117 readCenrepValue(KCRUidTelephonySettings.iUid, KSettingsSoftRejectDefaultInUse ).toInt()) { |
117 readCenrepValue(KCRUidTelephonySettings.iUid, KSettingsSoftRejectDefaultInUse ).toInt()) { |
118 userDefined = false; |
118 userDefined = false; |
119 } else { |
119 } else { |
136 err |= writeCenrepValue(KCRUidTelephonySettings.iUid, KSettingsSoftRejectDefaultInUse, cenrepValue); |
136 err |= writeCenrepValue(KCRUidTelephonySettings.iUid, KSettingsSoftRejectDefaultInUse, cenrepValue); |
137 DPRINT << "text:" << text << " ,userDefined:" << userDefined << " , err:" << err; |
137 DPRINT << "text:" << text << " ,userDefined:" << userDefined << " , err:" << err; |
138 return err; |
138 return err; |
139 } |
139 } |
140 |
140 |
141 bool CpSettingsWrapper::numberGroupingSupported() const |
141 bool SettingsWrapper::numberGroupingSupported() const |
142 { |
142 { |
143 return readCenrepValue(KCRUidNumberGrouping.iUid, KNumberGrouping).toBool(); |
143 return readCenrepValue(KCRUidNumberGrouping.iUid, KNumberGrouping).toBool(); |
144 } |
144 } |
145 |
145 |
146 bool CpSettingsWrapper::forbiddenIconSupported() const |
146 bool SettingsWrapper::forbiddenIconSupported() const |
147 { |
147 { |
148 int keyValue = readCenrepValue(KCRUidTelVariation.iUid, KTelVariationFlags).toInt(); |
148 int keyValue = readCenrepValue(KCRUidTelVariation.iUid, KTelVariationFlags).toInt(); |
149 return (KTelephonyLVFlagForbiddenIcon & keyValue); |
149 return (KTelephonyLVFlagForbiddenIcon & keyValue); |
150 } |
150 } |
151 |
151 |
152 QVariant CpSettingsWrapper::readCenrepValue( |
152 QVariant SettingsWrapper::readCenrepValue( |
153 const long int uid, const unsigned long int key) const |
153 const long int uid, const unsigned long int key) const |
154 { |
154 { |
155 XQSettingsKey settingsKey(XQSettingsKey::TargetCentralRepository, uid, key); |
155 XQSettingsKey settingsKey(XQSettingsKey::TargetCentralRepository, uid, key); |
156 QVariant ret = m_settings->readItemValue(settingsKey); |
156 QVariant ret = m_settings->readItemValue(settingsKey); |
157 DPRINT << "ret: " << ret; |
157 DPRINT << "ret: " << ret; |
158 return ret; |
158 return ret; |
159 } |
159 } |
160 |
160 |
161 QVariant CpSettingsWrapper::readPubSubValue( |
161 QVariant SettingsWrapper::readPubSubValue( |
162 const long int uid, const unsigned long int key) const |
162 const long int uid, const unsigned long int key) const |
163 { |
163 { |
164 XQSettingsKey settingsKey(XQSettingsKey::TargetPublishAndSubscribe, uid, key); |
164 XQSettingsKey settingsKey(XQSettingsKey::TargetPublishAndSubscribe, uid, key); |
165 QVariant ret = m_settings->readItemValue(settingsKey); |
165 QVariant ret = m_settings->readItemValue(settingsKey); |
166 DPRINT << "PubSub ret: " << ret; |
166 DPRINT << "PubSub ret: " << ret; |
167 return ret; |
167 return ret; |
168 } |
168 } |
169 |
169 |
170 QString CpSettingsWrapper::readCenrepString( |
170 QString SettingsWrapper::readCenrepString( |
171 const long int uid, const unsigned long int key) const |
171 const long int uid, const unsigned long int key) const |
172 { |
172 { |
173 XQSettingsKey settingsKey(XQSettingsKey::TargetCentralRepository, uid, key); |
173 XQSettingsKey settingsKey(XQSettingsKey::TargetCentralRepository, uid, key); |
174 QString text = m_settings->readItemValue(settingsKey, XQSettingsManager::TypeString).toString(); |
174 QString text = m_settings->readItemValue(settingsKey, XQSettingsManager::TypeString).toString(); |
175 DPRINT << "text: " << text; |
175 DPRINT << "text: " << text; |
176 return text; |
176 return text; |
177 } |
177 } |
178 |
178 |
179 int CpSettingsWrapper::writeCenrepValue( |
179 int SettingsWrapper::writeCenrepValue( |
180 const long int uid, const unsigned long int key, const QVariant &settingsKeyValue ) const |
180 const long int uid, const unsigned long int key, const QVariant &settingsKeyValue ) const |
181 { |
181 { |
182 DPRINT << "uid:" << uid << ", key:" << key << ", settingsKeyValue:" << settingsKeyValue; |
182 DPRINT << "uid:" << uid << ", key:" << key << ", settingsKeyValue:" << settingsKeyValue; |
183 XQSettingsKey settingsKey(XQSettingsKey::TargetCentralRepository, uid, key); |
183 XQSettingsKey settingsKey(XQSettingsKey::TargetCentralRepository, uid, key); |
184 int err = m_settings->writeItemValue(settingsKey, settingsKeyValue ); |
184 int err = m_settings->writeItemValue(settingsKey, settingsKeyValue ); |
185 DPRINT << "err: " << err; |
185 DPRINT << "err: " << err; |
186 return err; |
186 return err; |
187 } |
187 } |
188 |
188 |
189 bool CpSettingsWrapper::isFeatureCallWaitingDistiquishNotProvisionedEnabled() |
189 bool SettingsWrapper::isFeatureCallWaitingDistiquishNotProvisionedEnabled() |
190 { |
190 { |
191 bool enabled = readCenrepValue(KCRUidPhoneSettings.iUid, KPSetCallWaiting).toBool(); |
191 bool enabled = readCenrepValue(KCRUidPhoneSettings.iUid, KPSetCallWaiting).toBool(); |
192 DPRINT << "enabled: " << enabled; |
192 DPRINT << "enabled: " << enabled; |
193 return enabled; |
193 return enabled; |
194 } |
194 } |
195 |
195 |
196 bool CpSettingsWrapper::isPhoneOffline() const |
196 bool SettingsWrapper::isPhoneOffline() const |
197 { |
197 { |
198 bool networkConnectionAllowed = readCenrepValue(KCRUidCoreApplicationUIs.iUid, |
198 bool networkConnectionAllowed = readCenrepValue(KCRUidCoreApplicationUIs.iUid, |
199 KCoreAppUIsNetworkConnectionAllowed).toBool(); |
199 KCoreAppUIsNetworkConnectionAllowed).toBool(); |
200 // 0 = Offline Mode, 1 = Online Mode |
200 // 0 = Offline Mode, 1 = Online Mode |
201 DPRINT << "networkConnectionAllowed: " << networkConnectionAllowed; |
201 DPRINT << "networkConnectionAllowed: " << networkConnectionAllowed; |
202 return !networkConnectionAllowed; |
202 return !networkConnectionAllowed; |
203 } |
203 } |
204 |
204 |
205 bool CpSettingsWrapper::isOngoingCall() const |
205 bool SettingsWrapper::isOngoingCall() const |
206 { |
206 { |
207 bool callOngoing(false); |
207 bool callOngoing(false); |
208 if (EPSCTsyCallStateNone < |
208 if (EPSCTsyCallStateNone < |
209 readPubSubValue(KPSUidCtsyCallInformation.iUid, KCTsyCallState).toInt()) { |
209 readPubSubValue(KPSUidCtsyCallInformation.iUid, KCTsyCallState).toInt()) { |
210 callOngoing = true; |
210 callOngoing = true; |