Merge "[ElmSharp] Fix typo AnimatorMotionMapper.Calculate" preview1-00327
authorWonYoung Choi <wy80.choi@samsung.com>
Mon, 23 Oct 2017 03:01:11 +0000 (03:01 +0000)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Mon, 23 Oct 2017 03:01:11 +0000 (03:01 +0000)
src/Tizen.NUI/src/public/FilterModeType.cs [changed mode: 0755->0644]
test/SampleTelephony/CallPage.cs [new file with mode: 0755]
test/SampleTelephony/MainPage.cs [new file with mode: 0755]
test/SampleTelephony/ModemPage.cs [new file with mode: 0755]
test/SampleTelephony/NetworkPage.cs [new file with mode: 0755]
test/SampleTelephony/Program.cs [new file with mode: 0755]
test/SampleTelephony/SampleTelephony.csproj [new file with mode: 0755]
test/SampleTelephony/SampleTelephony.sln [new file with mode: 0755]
test/SampleTelephony/SimPage.cs [new file with mode: 0755]
test/SampleTelephony/shared/res/Tizen.Telephony.Test.png [new file with mode: 0755]
test/SampleTelephony/tizen-manifest.xml [new file with mode: 0755]

old mode 100755 (executable)
new mode 100644 (file)
index 9a36257..6dd8490
@@ -44,32 +44,22 @@ namespace Tizen.NUI
         /// <since_tizen> 3 </since_tizen>
         LINEAR,
         /// <summary>
-        /// Chooses the mipmap that most closely matches the size of the pixel being
-        /// textured and uses the GL_NEAREST criterion (the texture element closest to
-        /// the specified texture coordinates) to produce a texture value.
+        /// Filter nearest mipmap nearest.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         NEAREST_MIPMAP_NEAREST,
         /// <summary>
-        /// Chooses the mipmap that most closely matches the size of the pixel being textured
-        /// and uses the GL_LINEAR criterion (a weighted average of the four texture elements
-        /// that are closest to the specified texture coordinates) to produce a texture value.
+        /// Filter linear mipmap nearest.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         LINEAR_MIPMAP_NEAREST,
         /// <summary>
-        /// Chooses the two mipmaps that most closely match the size of the pixel being textured
-        /// and uses the GL_NEAREST criterion (the texture element closest to the specified texture
-        /// coordinates ) to produce a texture value from each mipmap. The final texture value is a
-        /// weighted average of those two values.
+        /// Filter nearest mipmap linear.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         NEAREST_MIPMAP_LINEAR,
         /// <summary>
-        /// Chooses the two mipmaps that most closely match the size of the pixel being textured and
-        /// uses the GL_LINEAR criterion (a weighted average of the texture elements that are closest
-        /// to the specified texture coordinates) to produce a texture value from each mipmap. The final
-        /// texture value is a weighted average of those two values.
+        /// Filter linear mipmap linear.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         LINEAR_MIPMAP_LINEAR
diff --git a/test/SampleTelephony/CallPage.cs b/test/SampleTelephony/CallPage.cs
new file mode 100755 (executable)
index 0000000..195665c
--- /dev/null
@@ -0,0 +1,117 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Xamarin.Forms;
+using Tizen;
+using Tizen.Telephony;
+
+namespace XamarinForTizen.Tizen
+{
+    public class CallPage : ContentPage
+    {
+        private static Call _call = null;
+        private ChangeNotificationEventArgs.Notification[] notiArr = { ChangeNotificationEventArgs.Notification.CallPreferredVoiceSubscription,
+                                                                       ChangeNotificationEventArgs.Notification.VoiceCallStatusDialing,
+                                                                       ChangeNotificationEventArgs.Notification.VoiceCallStatusIncoming };
+        public CallPage()
+        {
+            var subsBtn = new Button
+            {
+                Text = "Get preferred voice subscription",
+                VerticalOptions = LayoutOptions.Start,
+                HorizontalOptions = LayoutOptions.FillAndExpand
+            };
+            subsBtn.Clicked += subsBtn_Clicked;
+
+            var callListBtn = new Button
+            {
+                Text = "Get call list",
+                VerticalOptions = LayoutOptions.Start,
+                HorizontalOptions = LayoutOptions.FillAndExpand
+            };
+            callListBtn.Clicked += callListBtn_Clicked;
+
+            Content = new StackLayout
+            {
+                VerticalOptions = LayoutOptions.Center,
+                Children = {
+                        subsBtn, callListBtn
+                    }
+            };
+
+            try
+            {
+                if (Globals.slotHandle == null)
+                {
+                    Log.Debug(Globals.LogTag, "Telephony is not initialized/there are no sim slot handles");
+                    return;
+                }
+
+                Globals.slotHandle.ChangeNotification += SlotHandle_ChangeNotification;
+                List<ChangeNotificationEventArgs.Notification> notiList = new List<ChangeNotificationEventArgs.Notification>();
+                foreach (ChangeNotificationEventArgs.Notification noti in notiArr)
+                {
+                    notiList.Add(noti);
+                }
+
+                Globals.slotHandle.SetNotificationId(notiList);
+                _call = new Call(Globals.slotHandle);
+            }
+
+            catch (Exception ex)
+            {
+                Log.Debug(Globals.LogTag, "Exception in call constructor: " + ex.ToString());
+            }
+        }
+
+        private void SlotHandle_ChangeNotification(object sender, ChangeNotificationEventArgs e)
+        {
+            Log.Debug(Globals.LogTag, "Change notification: " + e.NotificationType);
+        }
+
+        private void callListBtn_Clicked(object sender, EventArgs e)
+        {
+            try
+            {
+                if (_call == null)
+                {
+                    Log.Debug(Globals.LogTag, "Telephony is not initialized/there are no sim slot handles");
+                    return;
+                }
+
+                List<CallHandle> handleList = _call.GetCallHandleList().ToList();
+                if (handleList.Count == 0)
+                {
+                    Log.Debug(Globals.LogTag, "Call handle list is empty");
+                    return;
+                }
+
+                foreach (CallHandle handle in handleList)
+                {
+                    Log.Debug(Globals.LogTag, "HandleId: " + handle.HandleId);
+                    Log.Debug(Globals.LogTag, "Number: " + handle.Number);
+                    Log.Debug(Globals.LogTag, "Type: " + handle.Type);
+                    Log.Debug(Globals.LogTag, "Status: " + handle.Status);
+                    Log.Debug(Globals.LogTag, "Direction: " + handle.Direction);
+                    Log.Debug(Globals.LogTag, "ConferenceStatus: " + handle.ConferenceStatus);
+                }
+            }
+
+            catch(Exception ex)
+            {
+                Log.Debug(Globals.LogTag, "Exception caught in getting call list: " + ex.ToString());
+            }
+        }
+
+        private void subsBtn_Clicked(object sender, EventArgs e)
+        {
+            if (_call == null)
+            {
+                Log.Debug(Globals.LogTag, "Telephony is not initialized/there are no sim slot handles");
+                return;
+            }
+
+            Log.Debug(Globals.LogTag, "Preferred voice subscription: " + _call.PreferredVoiceSubscription);
+        }
+    }
+}
diff --git a/test/SampleTelephony/MainPage.cs b/test/SampleTelephony/MainPage.cs
new file mode 100755 (executable)
index 0000000..b6601dd
--- /dev/null
@@ -0,0 +1,143 @@
+using System;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using System.Linq;
+using Xamarin.Forms;
+using Tizen;
+using Tizen.Telephony;
+
+namespace XamarinForTizen.Tizen
+{
+    public class MainPage : ContentPage
+    {
+        public MainPage()
+        {
+            var initBtn = new Button
+            {
+                Text = "Initialize",
+                VerticalOptions = LayoutOptions.Start,
+                HorizontalOptions = LayoutOptions.FillAndExpand
+            };
+            initBtn.Clicked += initBtn_Clicked;
+
+            var callBtn = new Button
+            {
+                Text = "Call",
+                VerticalOptions = LayoutOptions.Start,
+                HorizontalOptions = LayoutOptions.FillAndExpand
+            };
+            callBtn.Clicked += callBtn_Clicked;
+
+            var ModemBtn = new Button
+            {
+                Text = "Modem",
+                VerticalOptions = LayoutOptions.Start,
+                HorizontalOptions = LayoutOptions.FillAndExpand
+            };
+            ModemBtn.Clicked += ModemBtn_Clicked;
+
+            var NetworkBtn = new Button
+            {
+                Text = "Network",
+                VerticalOptions = LayoutOptions.Start,
+                HorizontalOptions = LayoutOptions.FillAndExpand
+            };
+            NetworkBtn.Clicked += NetworkBtn_Clicked;
+
+            var simBtn = new Button
+            {
+                Text = "Sim",
+                VerticalOptions = LayoutOptions.Start,
+                HorizontalOptions = LayoutOptions.FillAndExpand
+            };
+            simBtn.Clicked += simBtn_Clicked;
+
+            var deinitBtn = new Button
+            {
+                Text = "Deinitialize",
+                VerticalOptions = LayoutOptions.Start,
+                HorizontalOptions = LayoutOptions.FillAndExpand
+            };
+            deinitBtn.Clicked += deinitBtn_Clicked;
+
+            Content = new StackLayout
+            {
+                VerticalOptions = LayoutOptions.Center,
+                Children = {
+                        initBtn, callBtn, ModemBtn, NetworkBtn, simBtn, deinitBtn
+                    }
+            };
+
+            try
+            {
+                Manager.StateChanged += Manager_StateChanged;
+            }
+
+            catch(Exception ex)
+            {
+                Log.Debug(Globals.LogTag, "Exception in registering for state changed event: " + ex.ToString());
+            }
+        }
+
+        private void Manager_StateChanged(object sender, StateEventArgs e)
+        {
+            Log.Debug(Globals.LogTag, "Telephony state changed: " + e.CurrentState);
+        }
+
+        private void deinitBtn_Clicked(object sender, EventArgs e)
+        {
+            try
+            {
+                Manager.Deinit();
+                Globals.slotHandle = null;
+                Log.Debug(Globals.LogTag, "Deinit successful");
+            }
+
+            catch(Exception ex)
+            {
+                Log.Debug(Globals.LogTag, "Telephony deinit exception: " + ex.ToString());
+            }
+        }
+
+        private async void callBtn_Clicked(object sender, EventArgs e)
+        {
+            await Navigation.PushAsync(new CallPage());
+        }
+
+        private async void ModemBtn_Clicked(object sender, EventArgs e)
+        {
+            await Navigation.PushAsync(new ModemPage());
+        }
+
+        private async void NetworkBtn_Clicked(object sender, EventArgs e)
+        {
+            await Navigation.PushAsync(new NetworkPage());
+        }
+
+        private async void simBtn_Clicked(object sender, EventArgs e)
+        {
+            await Navigation.PushAsync(new SimPage());
+        }
+
+        private void initBtn_Clicked(object sender, EventArgs e)
+        {
+            try
+            {
+                List<SlotHandle> simList = Manager.Init().ToList();
+                if (simList.Count == 0)
+                {
+                    Log.Debug(Globals.LogTag, "SimList count is zero");
+                    return;
+                }
+
+                Log.Debug(Globals.LogTag, "Telephony initialized successfully");
+                Globals.slotHandle = simList.ElementAt(0);
+            }
+
+            catch(Exception ex)
+            {
+                Log.Debug(Globals.LogTag, "Telephony init exception: " + ex.ToString());
+            }
+        }
+    }
+}
diff --git a/test/SampleTelephony/ModemPage.cs b/test/SampleTelephony/ModemPage.cs
new file mode 100755 (executable)
index 0000000..e7c517d
--- /dev/null
@@ -0,0 +1,95 @@
+using System;
+using Xamarin.Forms;
+using Tizen;
+using Tizen.Telephony;
+
+namespace XamarinForTizen.Tizen
+{
+    public class ModemPage : ContentPage
+    {
+        private static Modem _modem = null;
+        public ModemPage()
+        {
+            var imeiBtn = new Button
+            {
+                Text = "Get IMEI",
+                VerticalOptions = LayoutOptions.Start,
+                HorizontalOptions = LayoutOptions.FillAndExpand
+            };
+            imeiBtn.Clicked += imeiBtn_Clicked;
+
+            var powerBtn = new Button
+            {
+                Text = "Get power status",
+                VerticalOptions = LayoutOptions.Start,
+                HorizontalOptions = LayoutOptions.FillAndExpand
+            };
+            powerBtn.Clicked += powerBtn_Clicked;
+
+            var meidBtn = new Button
+            {
+                Text = "Get MEID",
+                VerticalOptions = LayoutOptions.Start,
+                HorizontalOptions = LayoutOptions.FillAndExpand
+            };
+            meidBtn.Clicked += meidBtn_Clicked;
+
+            Content = new StackLayout
+            {
+                VerticalOptions = LayoutOptions.Center,
+                Children = {
+                        imeiBtn, powerBtn, meidBtn
+                    }
+            };
+
+            try
+            {
+                if (Globals.slotHandle == null)
+                {
+                    Log.Debug(Globals.LogTag, "Telephony is not initialized/there are no sim slot handles");
+                    return;
+                }
+
+                _modem = new Modem(Globals.slotHandle);
+            }
+
+            catch (Exception ex)
+            {
+                Log.Debug(Globals.LogTag, "Exception in modem constructor: " + ex.ToString());
+            }
+        }
+
+        private void meidBtn_Clicked(object sender, EventArgs e)
+        {
+            if (_modem == null)
+            {
+                Log.Debug(Globals.LogTag, "Telephony is not initialized/there are no sim slot handles");
+                return;
+            }
+
+            Log.Debug(Globals.LogTag, "MEID: " + _modem.Meid);
+        }
+
+        private void powerBtn_Clicked(object sender, EventArgs e)
+        {
+            if (_modem == null)
+            {
+                Log.Debug(Globals.LogTag, "Telephony is not initialized/there are no sim slot handles");
+                return;
+            }
+
+            Log.Debug(Globals.LogTag, "Power Status: " + _modem.CurrentPowerStatus);
+        }
+
+        private void imeiBtn_Clicked(object sender, EventArgs e)
+        {
+            if (_modem == null)
+            {
+                Log.Debug(Globals.LogTag, "Telephony is not initialized/there are no sim slot handles");
+                return;
+            }
+
+            Log.Debug(Globals.LogTag, "IMEI: " + _modem.Imei);
+        }
+    }
+}
diff --git a/test/SampleTelephony/NetworkPage.cs b/test/SampleTelephony/NetworkPage.cs
new file mode 100755 (executable)
index 0000000..aee48aa
--- /dev/null
@@ -0,0 +1,114 @@
+using System;
+using Xamarin.Forms;
+using Tizen;
+using Tizen.Telephony;
+
+namespace XamarinForTizen.Tizen
+{
+    public class NetworkPage : ContentPage
+    {
+        private static Network _network = null;
+        public NetworkPage()
+        {
+            var cellBtn = new Button
+            {
+                Text = "Get cell ID",
+                VerticalOptions = LayoutOptions.Start,
+                HorizontalOptions = LayoutOptions.FillAndExpand
+            };
+            cellBtn.Clicked += cellBtn_Clicked;
+
+            var lacBtn = new Button
+            {
+                Text = "Get LAC",
+                VerticalOptions = LayoutOptions.Start,
+                HorizontalOptions = LayoutOptions.FillAndExpand
+            };
+            lacBtn.Clicked += lacBtn_Clicked;
+
+            var mccBtn = new Button
+            {
+                Text = "Get Mcc",
+                VerticalOptions = LayoutOptions.Start,
+                HorizontalOptions = LayoutOptions.FillAndExpand
+            };
+            mccBtn.Clicked += mccBtn_Clicked;
+
+            var mncBtn = new Button
+            {
+                Text = "Get Mnc",
+                VerticalOptions = LayoutOptions.Start,
+                HorizontalOptions = LayoutOptions.FillAndExpand
+            };
+            mncBtn.Clicked += mncBtn_Clicked;
+
+            Content = new StackLayout
+            {
+                VerticalOptions = LayoutOptions.Center,
+                Children = {
+                        cellBtn, lacBtn, mccBtn, mncBtn
+                    }
+            };
+
+            try
+            {
+                if (Globals.slotHandle == null)
+                {
+                    Log.Debug(Globals.LogTag, "Telephony is not initialized/there are no sim slot handles");
+                    return;
+                }
+
+                _network = new Network(Globals.slotHandle);
+            }
+
+            catch (Exception ex)
+            {
+                Log.Debug(Globals.LogTag, "Exception in network constructor: " + ex.ToString());
+            }
+        }
+
+        private void mncBtn_Clicked(object sender, EventArgs e)
+        {
+            if (_network == null)
+            {
+                Log.Debug(Globals.LogTag, "Telephony is not initialized/there are no sim slot handles");
+                return;
+            }
+
+            Log.Debug(Globals.LogTag, "Mnc: " + _network.Mnc);
+        }
+
+        private void mccBtn_Clicked(object sender, EventArgs e)
+        {
+            if (_network == null)
+            {
+                Log.Debug(Globals.LogTag, "Telephony is not initialized/there are no sim slot handles");
+                return;
+            }
+
+            Log.Debug(Globals.LogTag, "Mcc: " + _network.Mcc);
+        }
+
+        private void lacBtn_Clicked(object sender, EventArgs e)
+        {
+            if (_network == null)
+            {
+                Log.Debug(Globals.LogTag, "Telephony is not initialized/there are no sim slot handles");
+                return;
+            }
+
+            Log.Debug(Globals.LogTag, "Lac: " + _network.Lac);
+        }
+
+        private void cellBtn_Clicked(object sender, EventArgs e)
+        {
+            if (_network == null)
+            {
+                Log.Debug(Globals.LogTag, "Telephony is not initialized/there are no sim slot handles");
+                return;
+            }
+
+            Log.Debug(Globals.LogTag, "Cell ID: " + _network.CellId);
+        }
+    }
+}
diff --git a/test/SampleTelephony/Program.cs b/test/SampleTelephony/Program.cs
new file mode 100755 (executable)
index 0000000..d050539
--- /dev/null
@@ -0,0 +1,86 @@
+/*
+ *  Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License
+ */
+
+using Xamarin.Forms;
+using Tizen;
+using Tizen.System;
+using Tizen.Telephony;
+
+namespace XamarinForTizen.Tizen
+{
+    internal static class Globals
+    {
+        internal static string LogTag = "TelephonyTest";
+        internal static SlotHandle slotHandle = null;
+    }
+    public class App : Application
+    {
+        private static bool s_isTelephonySupported = false;
+        public App()
+        {
+            SystemInfo.TryGetValue("http://tizen.org/feature/network.telephony", out s_isTelephonySupported);
+            if (s_isTelephonySupported)
+            {
+                Log.Debug(Globals.LogTag, "Telephony feature check = " + s_isTelephonySupported);
+                MainPage = new NavigationPage(new MainPage());
+            }
+
+            else
+            {
+                Log.Debug(Globals.LogTag, "Telephony feature is not supported");
+            }
+        }
+
+        protected override void OnStart()
+        {
+            // Handle when your app starts
+        }
+
+        protected override void OnSleep()
+        {
+            // Handle when your app sleeps
+        }
+
+        protected override void OnResume()
+        {
+            // Handle when your app resumes
+        }
+    }
+
+    class Program : global::Xamarin.Forms.Platform.Tizen.FormsApplication
+    {
+        private static App _app;
+        protected override void OnCreate()
+        {
+            base.OnCreate();
+
+            Log.Debug(Globals.LogTag, "OnCreate()");
+            _app = new App();
+            LoadApplication(_app);
+        }
+
+        public static App getApp()
+        {
+            return _app;
+        }
+        static void Main(string[] args)
+        {
+            var app = new Program();
+            global::Xamarin.Forms.Platform.Tizen.Forms.Init(app);
+            app.Run(args);
+        }
+    }
+}
\ No newline at end of file
diff --git a/test/SampleTelephony/SampleTelephony.csproj b/test/SampleTelephony/SampleTelephony.csproj
new file mode 100755 (executable)
index 0000000..466348a
--- /dev/null
@@ -0,0 +1,63 @@
+<Project>
+  <Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
+
+  <PropertyGroup Label="Globals">
+    <TizenProjectExtensionsPath>$(MSBuildExtensionsPath)\Tizen\VisualStudio\</TizenProjectExtensionsPath>
+  </PropertyGroup>
+
+  <Import Project="$(TizenProjectExtensionsPath)Tizen.NET.ProjectType.props" Condition="Exists('$(TizenProjectExtensionsPath)Tizen.NET.ProjectType.props')" />
+
+  <PropertyGroup>
+    <OutputType>Exe</OutputType>
+    <TargetFramework>netcoreapp1.1</TargetFramework>
+  </PropertyGroup>
+
+  <!-- Property Group for Tizen Project -->
+  <PropertyGroup>
+    <TizenCreateTpkOnBuild>true</TizenCreateTpkOnBuild>
+    <PackageTargetFallback>$(PackageTargetFallback);portable-net45+wp80+win81+wpa81</PackageTargetFallback>
+  </PropertyGroup>
+
+  <!--
+  This Property Group for msbuild command line.
+  If project build on Visual Studio, it would be set automatically through the certificate manager.
+  <PropertyGroup>
+    <AuthorPath>author_test.p12</AuthorPath>
+    <AuthorPass>author_test</AuthorPass>
+    <DistributorPath>tizen-distributor-signer.p12</DistributorPath>
+    <DistributorPass>tizenpkcs12passfordsigner</DistributorPass>
+  </PropertyGroup>
+  -->
+
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugType>portable</DebugType>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>None</DebugType>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <Folder Include="lib\" />
+    <Folder Include="res\" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <PackageReference Include="Tizen.NET.Sdk" Version="0.9.18-pre1" />
+    <PackageReference Include="Xamarin.Forms" Version="2.4.0.275-pre3" />
+    <PackageReference Include="Xamarin.Forms.Platform.Tizen" Version="2.3.5-r256-001" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <ProjectReference Include="..\..\src\Tizen.Telephony\Tizen.Telephony.csproj" />
+  </ItemGroup>
+
+  <Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
+  <Import Project="$(TizenProjectExtensionsPath)Tizen.NET.ProjectType.targets" Condition="Exists('$(TizenProjectExtensionsPath)Tizen.NET.ProjectType.targets')" />
+
+  <!-- Install Check 'Visual Studio for Tizen' for developing on Visual Studio -->
+  <Target Name="TizenVsixInstallCheck" BeforeTargets="CompileDesignTime">
+    <Warning Condition="!Exists('$(TizenProjectExtensionsPath)Tizen.NET.ProjectType.props')" Text="$(TizenProjectExtensionsPath)Tizen.NET.ProjectType.props is not exist.&#xA; you need to check if 'Visual Studio for Tizen' is installed" />
+    <Warning Condition="!Exists('$(TizenProjectExtensionsPath)Tizen.NET.ProjectType.targets')" Text="$(TizenProjectExtensionsPath)Tizen.NET.ProjectType.targets is not exist.\&#xA; you need to check if 'Visual Studio for Tizen' is installed" />
+  </Target>
+</Project>
+
diff --git a/test/SampleTelephony/SampleTelephony.sln b/test/SampleTelephony/SampleTelephony.sln
new file mode 100755 (executable)
index 0000000..e76324f
--- /dev/null
@@ -0,0 +1,28 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 15
+VisualStudioVersion = 15.0.26430.13
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SampleTelephony", "SampleTelephony.csproj", "{404DDD6F-0734-4F16-A70F-EB384C247669}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Telephony", "..\..\src\Tizen.Telephony\Tizen.Telephony.csproj", "{C5987A97-08BF-4143-BABD-2F044A75A52C}"
+EndProject
+Global
+       GlobalSection(SolutionConfigurationPlatforms) = preSolution
+               Debug|Any CPU = Debug|Any CPU
+               Release|Any CPU = Release|Any CPU
+       EndGlobalSection
+       GlobalSection(ProjectConfigurationPlatforms) = postSolution
+               {404DDD6F-0734-4F16-A70F-EB384C247669}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+               {404DDD6F-0734-4F16-A70F-EB384C247669}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {404DDD6F-0734-4F16-A70F-EB384C247669}.Release|Any CPU.ActiveCfg = Release|Any CPU
+               {404DDD6F-0734-4F16-A70F-EB384C247669}.Release|Any CPU.Build.0 = Release|Any CPU
+               {C5987A97-08BF-4143-BABD-2F044A75A52C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+               {C5987A97-08BF-4143-BABD-2F044A75A52C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {C5987A97-08BF-4143-BABD-2F044A75A52C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+               {C5987A97-08BF-4143-BABD-2F044A75A52C}.Release|Any CPU.Build.0 = Release|Any CPU
+       EndGlobalSection
+       GlobalSection(SolutionProperties) = preSolution
+               HideSolutionNode = FALSE
+       EndGlobalSection
+EndGlobal
diff --git a/test/SampleTelephony/SimPage.cs b/test/SampleTelephony/SimPage.cs
new file mode 100755 (executable)
index 0000000..b10d149
--- /dev/null
@@ -0,0 +1,117 @@
+using System;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using System.Linq;
+using Xamarin.Forms;
+using Tizen;
+using Tizen.Telephony;
+
+namespace XamarinForTizen.Tizen
+{
+    public class SimPage : ContentPage
+    {
+        private static Sim _sim = null;
+        public SimPage()
+        {
+            var changedBtn = new Button
+            {
+                Text = "Is sim changed",
+                VerticalOptions = LayoutOptions.Start,
+                HorizontalOptions = LayoutOptions.FillAndExpand
+            };
+            changedBtn.Clicked += changedBtn_Clicked;
+
+            var operatorBtn = new Button
+            {
+                Text = "Get operator",
+                VerticalOptions = LayoutOptions.Start,
+                HorizontalOptions = LayoutOptions.FillAndExpand
+            };
+            operatorBtn.Clicked += operatorBtn_Clicked;
+
+            var iccIdBtn = new Button
+            {
+                Text = "Get Icc id",
+                VerticalOptions = LayoutOptions.Start,
+                HorizontalOptions = LayoutOptions.FillAndExpand
+            };
+            iccIdBtn.Clicked += iccIdBtn_Clicked;
+
+            var msinBtn = new Button
+            {
+                Text = "Get Msin",
+                VerticalOptions = LayoutOptions.Start,
+                HorizontalOptions = LayoutOptions.FillAndExpand
+            };
+            msinBtn.Clicked += msinBtn_Clicked;
+
+            Content = new StackLayout
+            {
+                VerticalOptions = LayoutOptions.Center,
+                Children = {
+                        changedBtn, operatorBtn, iccIdBtn, msinBtn
+                    }
+            };
+
+            try
+            {
+                if (Globals.slotHandle == null)
+                {
+                    Log.Debug(Globals.LogTag, "Telephony is not initialized/there are no sim slot handles");
+                    return;
+                }
+
+                _sim = new Sim(Globals.slotHandle);
+            }
+
+            catch (Exception ex)
+            {
+                Log.Debug(Globals.LogTag, "Exception in Sim constructor: " + ex.ToString());
+            }
+        }
+
+        private void msinBtn_Clicked(object sender, EventArgs e)
+        {
+            if (_sim == null)
+            {
+                Log.Debug(Globals.LogTag, "Telephony is not initialized/there are no sim slot handles");
+                return;
+            }
+
+            Log.Debug(Globals.LogTag, "Msin: " + _sim.Msin);
+        }
+
+        private void iccIdBtn_Clicked(object sender, EventArgs e)
+        {
+            if (_sim == null)
+            {
+                Log.Debug(Globals.LogTag, "Telephony is not initialized/there are no sim slot handles");
+                return;
+            }
+
+            Log.Debug(Globals.LogTag, "Icc id: " + _sim.IccId);
+        }
+
+        private void operatorBtn_Clicked(object sender, EventArgs e)
+        {
+            if (_sim == null)
+            {
+                Log.Debug(Globals.LogTag, "Telephony is not initialized/there are no sim slot handles");
+                return;
+            }
+
+            Log.Debug(Globals.LogTag, "Operator: " + _sim.Operator);
+        }
+
+        private void changedBtn_Clicked(object sender, EventArgs e)
+        {
+            if (_sim == null)
+            {
+                Log.Debug(Globals.LogTag, "Telephony is not initialized/there are no sim slot handles");
+                return;
+            }
+
+            Log.Debug(Globals.LogTag, "Is sim changed: " + _sim.IsChanged);
+        }
+    }
+}
diff --git a/test/SampleTelephony/shared/res/Tizen.Telephony.Test.png b/test/SampleTelephony/shared/res/Tizen.Telephony.Test.png
new file mode 100755 (executable)
index 0000000..9f3cb98
Binary files /dev/null and b/test/SampleTelephony/shared/res/Tizen.Telephony.Test.png differ
diff --git a/test/SampleTelephony/tizen-manifest.xml b/test/SampleTelephony/tizen-manifest.xml
new file mode 100755 (executable)
index 0000000..48e557c
--- /dev/null
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest package="org.tizen.example.Telephony.Tizen.Mobile" version="1.0.0" api-version="4" xmlns="http://tizen.org/ns/packages">
+  <profile name="common" />
+  <ui-application appid="org.tizen.example.Tizen.Telephony.Test" exec="SampleTelephony.dll" multiple="false" nodisplay="false" taskmanage="true" splash-screen-display="true" type="dotnet" launch_mode="single">
+    <label>SampleTelephony</label>
+    <icon>Tizen.Telephony.Test.png</icon>
+  </ui-application>
+  <shortcut-list />
+  <privileges>
+    <privilege>http://tizen.org/privilege/telephony</privilege>
+    <privilege>http://tizen.org/privilege/location.coarse</privilege>
+  </privileges>
+</manifest>