2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 using System.Collections.Generic;
19 using System.Runtime.InteropServices;
24 /// This class is used for managing event callbacks for notifications and properties.
26 /// <since_tizen> 4 </since_tizen>
27 public class TapiHandle
29 internal IntPtr _handle = IntPtr.Zero;
30 private event EventHandler<NotificationChangedEventArgs> _notificationChanged;
31 private event EventHandler<PropertyChangedEventArgs> _propertyChanged;
33 private List<Interop.Tapi.TapiNotificationCallback> _notificationChangedCbList = new List<Interop.Tapi.TapiNotificationCallback>();
34 private Interop.Tapi.TapiNotificationCallback _notificationChangedCb;
37 /// This event is called for the TAPI notification change.
39 /// <since_tizen> 4 </since_tizen>
40 public event EventHandler<NotificationChangedEventArgs> NotificationChanged
44 _notificationChanged += value;
49 _notificationChanged -= value;
54 /// This event is called for the TAPI property change.
56 /// <since_tizen> 4 </since_tizen>
57 public event EventHandler<PropertyChangedEventArgs> PropertyChanged
61 _propertyChanged += value;
66 _propertyChanged -= value;
70 internal TapiHandle(IntPtr handle)
76 /// Registers a notification callback for notification change events on DBus interface.
78 /// <since_tizen> 4 </since_tizen>
79 /// <param name="id">Notification id for which a callback has to be registered.</param>
80 /// <feature>http://tizen.org/feature/network.telephony</feature>
81 /// <exception cref="NotSupportedException">Thrown when telephony feature is not supported.</exception>
82 /// <exception cref="ArgumentException">Thrown when it is failed due to invalid parameter.</exception>
83 /// <exception cref="InvalidOperationException">Thrown when it is failed due to invalid operation.</exception>
84 public void RegisterNotiEvent(Notification id)
86 _notificationChangedCb = (IntPtr handle, IntPtr notiIdPtr, IntPtr data, IntPtr userData) =>
88 if (_notificationChanged != null)
91 object notiData = null;
92 Notification noti = default(Notification);
93 if (notiIdPtr != IntPtr.Zero)
95 notiId = Marshal.PtrToStringAnsi(notiIdPtr);
96 foreach (Notification n in Enum.GetValues(typeof(Notification)))
98 if (notiId == TapiUtility.ConvertNotiToString(n))
108 case Notification.IdleVoiceCall:
109 CallIdleStatusNotiStruct voiceIdleStatusNoti = Marshal.PtrToStructure<CallIdleStatusNotiStruct>(data);
110 notiData = CallStructConversions.ConvertCallIdleStatusNoti(voiceIdleStatusNoti);
112 case Notification.ActiveVoiceCall:
113 notiData = (uint)Marshal.ReadInt32(data);
115 case Notification.HeldVoiceCall:
116 notiData = (uint)Marshal.ReadInt32(data);
118 case Notification.DialingVoiceCall:
119 notiData = (uint)Marshal.ReadInt32(data);
121 case Notification.AlertVoiceCall:
122 notiData = (uint)Marshal.ReadInt32(data);
124 case Notification.IncomingVoiceCall:
125 CallIncomingInfoStruct callIncomingInfo = Marshal.PtrToStructure<CallIncomingInfoStruct>(data);
126 notiData = CallStructConversions.ConvertIncomingCallInfo(callIncomingInfo);
128 case Notification.IdleVideoCall:
129 CallIdleStatusNotiStruct videoIdleStatus = Marshal.PtrToStructure<CallIdleStatusNotiStruct>(data);
130 notiData = CallStructConversions.ConvertCallIdleStatusNoti(videoIdleStatus);
132 case Notification.ActiveVideoCall:
133 notiData = (uint)Marshal.ReadInt32(data);
135 case Notification.DialingVideoCall:
136 notiData = (uint)Marshal.ReadInt32(data);
138 case Notification.AlertVideoCall:
139 notiData = (uint)Marshal.ReadInt32(data);
141 case Notification.IncomingVideoCall:
142 CallIncomingInfoStruct videoIncomingInfo = Marshal.PtrToStructure<CallIncomingInfoStruct>(data);
143 notiData = CallStructConversions.ConvertIncomingCallInfo(videoIncomingInfo);
145 case Notification.WaitingCallInfo:
146 notiData = (uint)Marshal.ReadInt32(data);
148 case Notification.ForwardCallInfo:
149 notiData = (uint)Marshal.ReadInt32(data);
151 case Notification.BarredIncomingCallInfo:
152 notiData = (uint)Marshal.ReadInt32(data);
154 case Notification.BarredOutgoingCallInfo:
155 notiData = (uint)Marshal.ReadInt32(data);
157 case Notification.ForwardUnconditionalCallInfo:
158 notiData = (uint)Marshal.ReadInt32(data);
160 case Notification.ForwardConditionalCallInfo:
161 notiData = (uint)Marshal.ReadInt32(data);
163 case Notification.ForwardedCallInfo:
164 notiData = (uint)Marshal.ReadInt32(data);
166 case Notification.HeldCallInfo:
167 notiData = (uint)Marshal.ReadInt32(data);
169 case Notification.ActiveCallInfo:
170 notiData = (uint)Marshal.ReadInt32(data);
172 case Notification.JoinedCallInfo:
173 notiData = (uint)Marshal.ReadInt32(data);
175 case Notification.RecCallInfo:
176 CallRecordStruct recordStruct = Marshal.PtrToStructure<CallRecordStruct>(data);
177 notiData = CallStructConversions.ConvertCallRecordStruct(recordStruct);
179 case Notification.PrivacyModeCall:
180 notiData = (CallPrivacyMode)Marshal.ReadInt32(data);
182 case Notification.OtaspCall:
183 notiData = (CallOtaspStatus)Marshal.ReadInt32(data);
185 case Notification.OtapaCall:
186 notiData = (CallOtapaStatus)Marshal.ReadInt32(data);
188 case Notification.CallSignalInfo:
189 CallSignalInfoStruct signalInfoStruct = Marshal.PtrToStructure<CallSignalInfoStruct>(data);
190 notiData = CallStructConversions.ConvertCallSignalInfo(signalInfoStruct);
192 case Notification.CallSoundPath:
193 notiData = (SoundPath)Marshal.ReadInt32(data);
195 case Notification.CallSoundRingbackTone:
196 notiData = (CallSoundRingbackNoti)Marshal.ReadInt32(data);
198 case Notification.CallSoundWbamr:
199 notiData = (CallSoundWbamrNoti)Marshal.ReadInt32(data);
201 case Notification.CallSoundNoiceReduction:
202 notiData = (CallSoundNoiseReduction)Marshal.ReadInt32(data);
204 case Notification.CallSoundClock:
205 int status = Marshal.ReadInt32(data);
211 else if (status == 0)
217 case Notification.CallPreferredVoiceSubscription:
218 notiData = (CallPreferredVoiceSubscription)Marshal.ReadInt32(data);
220 case Notification.CallupgradeRequested:
221 CallUpgradeDowngradeNotiStruct upgradeNotiStruct = Marshal.PtrToStructure<CallUpgradeDowngradeNotiStruct>(data);
222 notiData = CallStructConversions.ConvertCallUpgradeNoti(upgradeNotiStruct);
224 case Notification.CallDowngraded:
225 CallUpgradeDowngradeNotiStruct downgradeNotiStruct = Marshal.PtrToStructure<CallUpgradeDowngradeNotiStruct>(data);
226 notiData = CallStructConversions.ConvertCallUpgradeNoti(downgradeNotiStruct);
228 case Notification.ModemPower:
229 notiData = (PhonePowerStatus)Marshal.ReadInt32(data);
231 case Notification.SimStatus:
232 notiData = (SimCardStatus)Marshal.ReadInt32(data);
234 case Notification.SimRefreshed:
235 notiData = (SatCmdQualiRefresh)Marshal.ReadInt32(data);
237 case Notification.SatSetupMenu:
238 SatMainMenuInfoStruct mainMenuStruct = Marshal.PtrToStructure<SatMainMenuInfoStruct>(data);
239 notiData = SatStructConversions.ConvertSatMainMenuInfoStruct(mainMenuStruct);
241 case Notification.SatDisplayText:
242 SatDisplayTextStruct textStruct = Marshal.PtrToStructure<SatDisplayTextStruct>(data);
243 notiData = SatStructConversions.ConvertSatDisplayTextStruct(textStruct);
245 case Notification.SatSelectItem:
246 SatSelectItemStruct itemStruct = Marshal.PtrToStructure<SatSelectItemStruct>(data);
247 notiData = SatStructConversions.ConvertSatSelectItemStruct(itemStruct);
249 case Notification.SatGetInKey:
250 SatGetInKeyStruct inKeyStruct = Marshal.PtrToStructure<SatGetInKeyStruct>(data);
251 notiData = SatStructConversions.ConvertSatGetInKeyStruct(inKeyStruct);
253 case Notification.SatGetInput:
254 SatGetInputStruct inputStruct = Marshal.PtrToStructure<SatGetInputStruct>(data);
255 notiData = SatStructConversions.ConvertSatGetInputStruct(inputStruct);
257 case Notification.SatRefresh:
258 SatRefreshStruct refreshStruct = Marshal.PtrToStructure<SatRefreshStruct>(data);
259 notiData = SatStructConversions.ConvertSatRefreshStruct(refreshStruct);
261 case Notification.SatSendSms:
262 SatSendSmsStruct smsStruct = Marshal.PtrToStructure<SatSendSmsStruct>(data);
263 notiData = SatStructConversions.ConvertSatSendSmsStruct(smsStruct);
265 case Notification.SatSetupEventList:
266 SatEventListDataStruct eventStruct = Marshal.PtrToStructure<SatEventListDataStruct>(data);
267 notiData = SatStructConversions.ConvertSatEventListStruct(eventStruct);
269 case Notification.SatSendDtmf:
270 SatSendDtmfDataStruct dtmfStruct = Marshal.PtrToStructure<SatSendDtmfDataStruct>(data);
271 notiData = SatStructConversions.ConvertSatSendDtmfStruct(dtmfStruct);
273 case Notification.SatEndProactiveSession:
274 notiData = (SatCommandType)Marshal.ReadInt32(data);
276 case Notification.SatCallControlResult:
277 SatCallCtrlIndDataStruct dataStruct = Marshal.PtrToStructure<SatCallCtrlIndDataStruct>(data);
278 notiData = SatStructConversions.ConvertSatCallCtrlIndDataStruct(dataStruct);
280 case Notification.SatMoSmControlResult:
281 SatMoSmsCtrlDataStruct moStruct = Marshal.PtrToStructure<SatMoSmsCtrlDataStruct>(data);
282 notiData = SatStructConversions.ConvertSatMoSmsCtrlDataStruct(moStruct);
284 case Notification.SatSetupCall:
285 SatSetupCallDataStruct callDataStruct = Marshal.PtrToStructure<SatSetupCallDataStruct>(data);
286 notiData = SatStructConversions.ConvertSatSetupCallDataStruct(callDataStruct);
288 case Notification.SatSendSs:
289 SatSendSsDataStruct ssStruct = Marshal.PtrToStructure<SatSendSsDataStruct>(data);
290 notiData = SatStructConversions.ConvertSatSendSsDataStruct(ssStruct);
292 case Notification.SatSetupUssd:
293 SatSetupUssdDataStruct ussdStruct = Marshal.PtrToStructure<SatSetupUssdDataStruct>(data);
294 notiData = SatStructConversions.ConvertSatSetupUssdDataStruct(ussdStruct);
296 case Notification.PhonebookStatus:
297 SimPhonebookStatusStruct statusStruct = Marshal.PtrToStructure<SimPhonebookStatusStruct>(data);
298 notiData = PhonebookStructConversions.ConvertSimPhonebookStatusStruct(statusStruct);
300 case Notification.PhonebookContactChange:
301 PhonebookContactChangeInfoStruct contactStruct = Marshal.PtrToStructure<PhonebookContactChangeInfoStruct>(data);
302 notiData = PhonebookStructConversions.ConvertPhonebookContactChangeStruct(contactStruct);
304 case Notification.NetworkRegistrationStatus:
305 NetworkRegistrationStatusStruct nwStruct = Marshal.PtrToStructure<NetworkRegistrationStatusStruct>(data);
306 notiData = NetworkStructConversions.ConvertNetworkRegistrationStruct(nwStruct);
308 case Notification.NetworkCellInfo:
309 NetworkCellNotiStruct notiStruct = Marshal.PtrToStructure<NetworkCellNotiStruct>(data);
310 notiData = NetworkStructConversions.ConvertNetworkCellNotiStruct(notiStruct);
312 case Notification.NetworkChange:
313 NetworkChangeNotiStruct changeStruct = Marshal.PtrToStructure<NetworkChangeNotiStruct>(data);
314 notiData = NetworkStructConversions.ConvertNetworkChangeStruct(changeStruct);
316 case Notification.NetworkTimeInfo:
317 NetworkTimeNotiStruct timeStruct = Marshal.PtrToStructure<NetworkTimeNotiStruct>(data);
318 notiData = NetworkStructConversions.ConvertNetworkTimeNotiStruct(timeStruct);
320 case Notification.NetworkIdentity:
321 NetworkIdentityNotiStruct idStruct = Marshal.PtrToStructure<NetworkIdentityNotiStruct>(data);
322 notiData = NetworkStructConversions.ConvertNetworkIdentityStruct(idStruct);
324 case Notification.NetworkSignalStrength:
325 notiData = Marshal.ReadInt32(data);
327 case Notification.NetworkEmergencyCallbackMode:
328 notiData = (NetworkEmergencyCallbackMode)Marshal.ReadInt32(data);
330 case Notification.NetworkDefaultDataSubscription:
331 notiData = (NetworkDefaultDataSubscription)Marshal.ReadInt32(data);
333 case Notification.NetworkDefaultSubscription:
334 notiData = (NetworkDefaultSubscription)Marshal.ReadInt32(data);
336 case Notification.NetworkCellId:
337 notiData = Marshal.ReadInt32(data);
339 case Notification.NetworkLac:
340 notiData = Marshal.ReadInt32(data);
342 case Notification.NetworkTac:
343 notiData = Marshal.ReadInt32(data);
345 case Notification.NetworkSystemId:
346 notiData = Marshal.ReadInt32(data);
348 case Notification.NetworkNetworkId:
349 notiData = Marshal.ReadInt32(data);
351 case Notification.NetworkBsId:
352 notiData = Marshal.ReadInt32(data);
354 case Notification.NetworkBsLatitude:
355 notiData = Marshal.ReadInt32(data);
357 case Notification.NetworkBsLongitude:
358 notiData = Marshal.ReadInt32(data);
360 case Notification.NetworkVolteStatus:
361 NetworkVolteStatusStruct volteStruct = Marshal.PtrToStructure<NetworkVolteStatusStruct>(data);
362 notiData = NetworkStructConversions.ConvertNetworkVolteStruct(volteStruct);
364 case Notification.NetworkEpdgStatus:
365 int epdgStatus = Marshal.ReadInt32(data);
371 else if (epdgStatus == 0)
377 case Notification.SsUssd:
378 SsUssdMsgInfoStruct ussdInfoStruct = Marshal.PtrToStructure<SsUssdMsgInfoStruct>(data);
379 notiData = SsStructConversions.ConvertSsMsgStruct(ussdInfoStruct);
381 case Notification.SsReleaseComplete:
382 SsReleaseCompleteMsgStruct msgStruct = Marshal.PtrToStructure<SsReleaseCompleteMsgStruct>(data);
383 notiData = SsStructConversions.ConvertReleaseMsgStruct(msgStruct);
385 case Notification.SsNotifyForwarding:
386 SsForwardResponseStruct responseStruct = Marshal.PtrToStructure<SsForwardResponseStruct>(data);
387 notiData = SsStructConversions.ConvertForwardRspStruct(responseStruct);
389 case Notification.SsNotifyBarring:
390 SsBarringResponseStruct barringStruct = Marshal.PtrToStructure<SsBarringResponseStruct>(data);
391 notiData = SsStructConversions.ConvertBarringRspStruct(barringStruct);
393 case Notification.SsNotifyWaiting:
394 SsWaitingResponseStruct waitingStruct = Marshal.PtrToStructure<SsWaitingResponseStruct>(data);
395 notiData = SsStructConversions.ConvertWaitingRspStruct(waitingStruct);
397 case Notification.SsNotifyInfo:
398 SsInfoStruct ssInfoStruct = Marshal.PtrToStructure<SsInfoStruct>(data);
399 notiData = SsStructConversions.ConvertInfoStruct(ssInfoStruct);
401 case Notification.SmsIncomingMsg:
402 SmsIncomingMsgNotiStruct smsNotiStruct = Marshal.PtrToStructure<SmsIncomingMsgNotiStruct>(data);
403 notiData = SmsStructConversions.ConvertSmsIncomingStruct(smsNotiStruct);
405 case Notification.SmsIncomingCbMsg:
406 SmsIncomingCbMsgNotiStruct smsCbStruct = Marshal.PtrToStructure<SmsIncomingCbMsgNotiStruct>(data);
407 notiData = SmsStructConversions.ConvertSmsIncomingCbStruct(smsCbStruct);
409 case Notification.SmsIncomingEtwsMsg:
410 SmsIncomingEtwsMsgNotiStruct etwsStruct = Marshal.PtrToStructure<SmsIncomingEtwsMsgNotiStruct>(data);
411 notiData = SmsStructConversions.ConvertSmsIncomingEtwsStruct(etwsStruct);
413 case Notification.SmsMemoryStatus:
414 notiData = (SmsMemoryStatus)Marshal.ReadInt32(data);
416 case Notification.SmsReady:
417 notiData = (SmsReadyStatus)Marshal.ReadInt32(data);
419 case Notification.OemData:
420 OemDataStruct oemStruct = Marshal.PtrToStructure<OemDataStruct>(data);
421 notiData = OemStructConversions.ConvertOemStruct(oemStruct);
425 _notificationChanged(null, new NotificationChangedEventArgs(noti, notiData));
429 _notificationChangedCbList.Add(_notificationChangedCb);
431 int ret = Interop.Tapi.RegisterNotiEvent(_handle, TapiUtility.ConvertNotiToString(id), _notificationChangedCb, IntPtr.Zero);
432 if (ret != (int)TapiError.Success)
434 Log.Error(TapiUtility.LogTag, "Failed to register notification event, Error: " + (TapiError)ret);
435 TapiUtility.ThrowTapiException(ret, _handle);
440 /// Registers a notification callback for property change events on DBus interface.
442 /// <since_tizen> 4 </since_tizen>
443 /// <param name="property">Property definition for which a callback has to be registered.</param>
444 /// <feature>http://tizen.org/feature/network.telephony</feature>
445 /// <exception cref="NotSupportedException">Thrown when telephony feature is not supported.</exception>
446 /// <exception cref="ArgumentException">Thrown when it is failed due to invalid parameter.</exception>
447 /// <exception cref="InvalidOperationException">Thrown when it is failed due to invalid operation.</exception>
448 public void RegisterPropEvent(Property property)
450 _notificationChangedCb = (IntPtr handle, IntPtr propPtr, IntPtr data, IntPtr userData) =>
452 if (_propertyChanged != null)
455 object propData = null;
456 Property propertyId = default(Property);
457 if (propPtr != IntPtr.Zero)
459 prop = Marshal.PtrToStringAnsi(propPtr);
460 foreach (Property p in Enum.GetValues(typeof(Property)))
462 if (prop == TapiUtility.ConvertPropToString(p))
472 case Property.ModemPower:
473 propData = (PhonePowerStatus)Marshal.ReadInt32(data);
475 case Property.ModemDongleStatus:
476 int dongleStatus = Marshal.ReadInt32(data);
477 if (dongleStatus == 1)
482 else if (dongleStatus == 0)
488 case Property.ModemDongleLogin:
489 int loginStatus = Marshal.ReadInt32(data);
490 if (loginStatus == 1)
495 else if (loginStatus == 0)
501 case Property.SimCallForwardState:
502 int forwardState = Marshal.ReadInt32(data);
503 if (forwardState == 1)
508 else if (forwardState == 0)
514 case Property.NetworkLac:
515 propData = (uint)Marshal.ReadInt32(data);
517 case Property.NetworkTac:
518 propData = (uint)Marshal.ReadInt32(data);
520 case Property.NetworkPlmn:
521 propData = Marshal.PtrToStringAnsi(data);
523 case Property.NetworkCellId:
524 propData = (uint)Marshal.ReadInt32(data);
526 case Property.NetworkPhysicalCellId:
527 propData = (uint)Marshal.ReadInt32(data);
529 case Property.NetworkServiceType:
530 propData = (NetworkServiceType)Marshal.ReadInt32(data);
532 case Property.NetworkAct:
533 propData = (NetworkSystemType)Marshal.ReadInt32(data);
535 case Property.NetworkPsType:
536 propData = (NetworkPsType)Marshal.ReadInt32(data);
538 case Property.NetworkCircuitStatus:
539 propData = (NetworkServiceLevel)Marshal.ReadInt32(data);
541 case Property.NetworkPacketStatus:
542 propData = (NetworkServiceLevel)Marshal.ReadInt32(data);
544 case Property.NetworkRoamingStatus:
545 int roamingStatus = Marshal.ReadInt32(data);
546 if (roamingStatus == 1)
551 else if (roamingStatus == 0)
557 case Property.NetworkNameOption:
558 propData = (NetworkNameDisplayCondition)Marshal.ReadInt32(data);
560 case Property.NetworkName:
561 propData = Marshal.PtrToStringAnsi(data);
563 case Property.NetworkSpnName:
564 propData = Marshal.PtrToStringAnsi(data);
566 case Property.NetworkSignalDbm:
567 propData = Marshal.ReadInt32(data);
569 case Property.NetworkSignalLevel:
570 propData = Marshal.ReadInt32(data);
572 case Property.NetworkImsVoiceStatus:
573 int imsStatus = Marshal.ReadInt32(data);
579 else if (imsStatus == 0)
585 case Property.NetworkVolteEnable:
586 propData = (VolteNetworkType)Marshal.ReadInt32(data);
588 case Property.NetworkLteBand:
589 propData = (NetworkLteBandType)Marshal.ReadInt32(data);
593 _propertyChanged(null, new PropertyChangedEventArgs(propertyId, propData));
597 _notificationChangedCbList.Add(_notificationChangedCb);
598 int ret = Interop.Tapi.RegisterNotiEvent(_handle, TapiUtility.ConvertPropToString(property), _notificationChangedCb, IntPtr.Zero);
599 if (ret != (int)TapiError.Success)
601 Log.Error(TapiUtility.LogTag, "Failed to register notification event for property change, Error: " + (TapiError)ret);
602 TapiUtility.ThrowTapiException(ret, _handle);
607 /// Deregisters notification callback for notification change events on DBus interface.
609 /// <since_tizen> 4 </since_tizen>
610 /// <param name="id">Notification id for which the callback has to be de-registered.</param>
611 /// <feature>http://tizen.org/feature/network.telephony</feature>
612 /// <exception cref="NotSupportedException">Thrown when telephony feature is not supported.</exception>
613 /// <exception cref="ArgumentException">Thrown when it is failed due to invalid parameter.</exception>
614 /// <exception cref="InvalidOperationException">Thrown when it is failed due to invalid operation.</exception>
615 public void DeregisterNotiEvent(Notification id)
617 int ret = Interop.Tapi.DeregisterNotiEvent(_handle, TapiUtility.ConvertNotiToString(id));
618 if (ret != (int)TapiError.Success)
620 Log.Error(TapiUtility.LogTag, "Failed to deregister notification event, Error: " + (TapiError)ret);
621 TapiUtility.ThrowTapiException(ret, _handle);
626 /// Deregisters notification callback for property change events on DBus interface.
628 /// <since_tizen> 4 </since_tizen>
629 /// <param name="property">Property definition for which the callback has to be de-registered.</param>
630 /// <feature>http://tizen.org/feature/network.telephony</feature>
631 /// <exception cref="NotSupportedException">Thrown when telephony feature is not supported.</exception>
632 /// <exception cref="ArgumentException">Thrown when it is failed due to invalid parameter.</exception>
633 /// <exception cref="InvalidOperationException">Thrown when it is failed due to invalid operation.</exception>
634 public void DeregisterPropEvent(Property property)
636 int ret = Interop.Tapi.DeregisterNotiEvent(_handle, TapiUtility.ConvertPropToString(property));
637 if (ret != (int)TapiError.Success)
639 Log.Error(TapiUtility.LogTag, "Failed to deregister notification event for property change, Error: " + (TapiError)ret);
640 TapiUtility.ThrowTapiException(ret, _handle);
645 /// Gets the property value in an integer format for the given property.
647 /// <since_tizen> 4 </since_tizen>
648 /// <param name="property">The property to be retrieved from Dbus.</param>
649 /// <returns>The property value in integer format.</returns>
650 /// <feature>http://tizen.org/feature/network.telephony</feature>
651 /// <privilege>http://tizen.org/privilege/telephony</privilege>
652 /// <exception cref="NotSupportedException">Thrown when telephony feature is not supported.</exception>
653 /// <exception cref="UnauthorizedAccessException">Thrown when permission is denied.</exception>
654 /// <exception cref="ArgumentException">Thrown when it is failed due to invalid parameter.</exception>
655 /// <exception cref="InvalidOperationException">Thrown when it is failed due to invalid operation.</exception>
656 public int GetIntProperty(Property property)
659 int ret = Interop.Tapi.GetIntProperty(_handle, TapiUtility.ConvertPropToString(property), out result);
660 if (ret != (int)TapiError.Success)
662 Log.Error(TapiUtility.LogTag, "Failed to get property in integer format, Error: " + (TapiError)ret);
663 TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony");
670 /// Gets the property value in a string format for the given property.
672 /// <since_tizen> 4 </since_tizen>
673 /// <param name="property">The property to be retrieved from Dbus.</param>
674 /// <returns>The property value in string format.</returns>
675 /// <feature>http://tizen.org/feature/network.telephony</feature>
676 /// <privilege>http://tizen.org/privilege/telephony</privilege>
677 /// <exception cref="NotSupportedException">Thrown when telephony feature is not supported.</exception>
678 /// <exception cref="UnauthorizedAccessException">Thrown when permission is denied.</exception>
679 /// <exception cref="ArgumentException">Thrown when it is failed due to invalid parameter.</exception>
680 /// <exception cref="InvalidOperationException">Thrown when it is failed due to invalid operation.</exception>
681 public string GetStringProperty(Property property)
684 int ret = Interop.Tapi.GetStringProperty(_handle, TapiUtility.ConvertPropToString(property), out result);
685 if (ret != (int)TapiError.Success)
687 Log.Error(TapiUtility.LogTag, "Failed to get property in string format, Error: " + (TapiError)ret);
688 TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony");