2 using System.Collections.Generic;
8 namespace XamarinForTizen.Tizen
10 public class CallPage : ContentPage
12 private static Call _call = null;
13 private ChangeNotificationEventArgs.Notification[] notiArr = { ChangeNotificationEventArgs.Notification.CallPreferredVoiceSubscription,
14 ChangeNotificationEventArgs.Notification.VoiceCallStatusDialing,
15 ChangeNotificationEventArgs.Notification.VoiceCallStatusIncoming };
18 var subsBtn = new Button
20 Text = "Get preferred voice subscription",
21 VerticalOptions = LayoutOptions.Start,
22 HorizontalOptions = LayoutOptions.FillAndExpand
24 subsBtn.Clicked += subsBtn_Clicked;
26 var callListBtn = new Button
28 Text = "Get call list",
29 VerticalOptions = LayoutOptions.Start,
30 HorizontalOptions = LayoutOptions.FillAndExpand
32 callListBtn.Clicked += callListBtn_Clicked;
34 Content = new StackLayout
36 VerticalOptions = LayoutOptions.Center,
44 if (Globals.slotHandle == null)
46 Log.Debug(Globals.LogTag, "Telephony is not initialized/there are no sim slot handles");
50 Globals.slotHandle.ChangeNotification += SlotHandle_ChangeNotification;
51 List<ChangeNotificationEventArgs.Notification> notiList = new List<ChangeNotificationEventArgs.Notification>();
52 foreach (ChangeNotificationEventArgs.Notification noti in notiArr)
57 Globals.slotHandle.SetNotificationId(notiList);
58 _call = new Call(Globals.slotHandle);
63 Log.Debug(Globals.LogTag, "Exception in call constructor: " + ex.ToString());
67 private void SlotHandle_ChangeNotification(object sender, ChangeNotificationEventArgs e)
69 Log.Debug(Globals.LogTag, "Change notification: " + e.NotificationType);
72 private void callListBtn_Clicked(object sender, EventArgs e)
78 Log.Debug(Globals.LogTag, "Telephony is not initialized/there are no sim slot handles");
82 List<CallHandle> handleList = _call.GetCallHandleList().ToList();
83 if (handleList.Count == 0)
85 Log.Debug(Globals.LogTag, "Call handle list is empty");
89 foreach (CallHandle handle in handleList)
91 Log.Debug(Globals.LogTag, "HandleId: " + handle.HandleId);
92 Log.Debug(Globals.LogTag, "Number: " + handle.Number);
93 Log.Debug(Globals.LogTag, "Type: " + handle.Type);
94 Log.Debug(Globals.LogTag, "Status: " + handle.Status);
95 Log.Debug(Globals.LogTag, "Direction: " + handle.Direction);
96 Log.Debug(Globals.LogTag, "ConferenceStatus: " + handle.ConferenceStatus);
102 Log.Debug(Globals.LogTag, "Exception caught in getting call list: " + ex.ToString());
106 private void subsBtn_Clicked(object sender, EventArgs e)
110 Log.Debug(Globals.LogTag, "Telephony is not initialized/there are no sim slot handles");
114 Log.Debug(Globals.LogTag, "Preferred voice subscription: " + _call.PreferredVoiceSubscription);