[TCSACR-85] Add EnableType method 38/147538/3
authorkj7.sung <kj7.sung@samsung.com>
Tue, 5 Sep 2017 00:40:05 +0000 (09:40 +0900)
committerkj7.sung <kj7.sung@samsung.com>
Wed, 6 Sep 2017 00:15:02 +0000 (09:15 +0900)
Change-Id: I37667e7f8877a3cdcddce55e7ae979c0ff25de72
Signed-off-by: kj7.sung <kj7.sung@samsung.com>
src/Tizen.Location/Interop/Interop.Location.cs
src/Tizen.Location/Tizen.Location/Locator.cs
src/Tizen.Location/Tizen.Location/LocatorHelper.cs
src/Tizen.Location/Tizen.Location/ServiceStateChangedEventArgs.cs
src/Tizen.Location/Tizen.Location/ZoneChangedEventArgs.cs

index ad4466c4129506456bfdfdcca93fef34a3b16ceb..dd9e568ad50641a35dab14943adcc6073416d469 100755 (executable)
@@ -70,6 +70,9 @@ internal static partial class Interop
         [DllImport(Libraries.Location, EntryPoint = "location_manager_is_enabled_method")]
         internal static extern int IsEnabled(int locationMethod, out bool status);
 
+        [DllImport(Libraries.Location, EntryPoint = "location_manager_enable_method")]
+        internal static extern int EnableType(int locationMethod, bool status);
+
         [DllImport(Libraries.Location, EntryPoint = "location_manager_is_supported_method")]
         internal static extern bool IsSupported(int locationMethod);
     }
index 9bae3ae4521bd895277cad4ae41b22a5ebbeb290..137e1615a66b0c264e4fad94f0cdde57af6c71a3 100755 (executable)
@@ -28,7 +28,7 @@ namespace Tizen.Location
     }
 
     /// <summary>
-    /// This class contains the functionality for obtaining the geographical infomation and setting the boundary condition.
+    /// This class contains the functionality for obtaining the geographical information and setting the boundary condition.
     /// Notifications on events like service becoming enabled or disabled, new position data being available,
     /// and others can also be acquired.
     /// </summary>
@@ -68,7 +68,8 @@ namespace Tizen.Location
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         /// <param name="locationType"> The back-end positioning method to be used for LBS.</param>
-        /// <feature>http://tizen.org/feature/location</feature>
+        /// <feature>http://tizen.org/feature/location.gps</feature>
+        /// <feature>http://tizen.org/feature/location.wps</feature>
         /// <exception cref="InvalidOperationException">Thrown when the operation is invalid for the current state.</exception>
         /// <exception cref="ArgumentException">Thrown when an invalid argument is used.</exception>
         /// <exception cref="NotSupportedException">Thrown when the location is not supported.</exception>
@@ -488,7 +489,7 @@ namespace Tizen.Location
                 int ret = Interop.Locator.GetLocation(_handle, out altitude, out latitude, out longitude, out climb, out direction, out speed, out level, out accuracy, out vertical, out timestamp);
                 if (((LocationError)ret != LocationError.None))
                 {
-                    Log.Error(Globals.LogTag, "Error in get current location infomation," + (LocationError)ret);
+                    Log.Error(Globals.LogTag, "Error in get current location information," + (LocationError)ret);
                     throw LocationErrorFactory.ThrowLocationException(ret);
                 }
             }
index 37de8c9376ebde2f19dbf6aadacb3d02681a711a..4bb7a7f08263ca72c9c2dfc07a529339e10c3732 100755 (executable)
@@ -18,6 +18,10 @@ using System;
 
 namespace Tizen.Location
 {
+    /// <summary>
+    /// This class contains the functionality for obtaining the geographical positioning type.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
     public static class LocatorHelper
     {
         /// <summary>
@@ -25,7 +29,11 @@ namespace Tizen.Location
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         /// <param name="locationType">The back-end positioning method to be used for LBS.</param>
+        /// <feature>http://tizen.org/feature/location.gps</feature>
+        /// <feature>http://tizen.org/feature/location.wps</feature>
         /// <returns>Returns a boolean value indicating whether or not the specified method is supported.</returns>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used.</exception>
+        /// <exception cref="NotSupportedException">Thrown when the location is not supported.</exception>
         public static bool IsSupportedType(LocationType locationType)
         {
             bool status = Interop.LocatorHelper.IsSupported((int)locationType);
@@ -38,6 +46,8 @@ namespace Tizen.Location
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         /// <param name="locationType">The back-end positioning method to be used for LBS.</param>
+        /// <feature>http://tizen.org/feature/location.gps</feature>
+        /// <feature>http://tizen.org/feature/location.wps</feature>
         /// <returns>Returns a boolean value indicating whether or not the specified method is supported.</returns>
         /// <exception cref="InvalidOperationException">Thrown when the operation is invalid for the current state.</exception>
         /// <exception cref="ArgumentException">Thrown when an invalid argument is used.</exception>
@@ -54,5 +64,29 @@ namespace Tizen.Location
             }
             return status;
         }
+
+        /// <summary>
+        /// Sets the specified geographical positioning type.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        /// <privilege>http://tizen.org/privilege/location.enable</privilege>
+        /// <privlevel>platform</privlevel>
+        /// <param name="locationType">The back-end positioning method to be used for LBS.</param>
+        /// <param name="status">The location setting value.</param>
+        /// <feature>http://tizen.org/feature/location.gps</feature>
+        /// <feature>http://tizen.org/feature/location.wps</feature>
+        /// <exception cref="InvalidOperationException">Thrown when the operation is invalid for the current state.</exception>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used.</exception>
+        /// <exception cref="NotSupportedException">Thrown when the location is not supported.</exception>
+        public static void EnableType(LocationType locationType, bool status)
+        {
+            Log.Info(Globals.LogTag, "Sets the location setting status");
+            int ret = Interop.LocatorHelper.EnableType((int)locationType, status);
+            if (((LocationError)ret != LocationError.None))
+            {
+                Log.Error(Globals.LogTag, "Error Sets the Location type," + (LocationError)ret);
+                throw LocationErrorFactory.ThrowLocationException(ret);
+            }
+        }
     }
 }
index 5cfbff764220494470c27a3ff2cda655c05403d3..7059849bab7c35938f4fb12096564bdd79de0be2 100755 (executable)
@@ -27,7 +27,7 @@ namespace Tizen.Location
         /// The class constructor for the ServiceStateChangedEventArgs class.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
-        /// <param name="state"> An enumeration of type LocationServiceState.</param>
+        /// <param name="state">An enumeration of type LocationServiceState.</param>
         public ServiceStateChangedEventArgs(ServiceState state)
         {
             ServiceState = state;
index 7e4e91dc4e70f627d7fbd2c89f354b4919347d48..81a45d782d7e9613066cd3e29d4fc017c8efe8d3 100755 (executable)
@@ -27,8 +27,8 @@ namespace Tizen.Location
         /// <param name="state"> An enumeration of type BoundaryState.</param>
         /// <param name="latitude">The latitude value [-90.0 ~ 90.0] (degrees).</param>
         /// <param name="longitude">The longitude value [-180.0 ~ 180.0] (degrees).</param>
-        /// <param name="altitude"> The altitude value.</param>
-        /// <param name="timestamp"> The timestamp value.</param>
+        /// <param name="altitude">The altitude value.</param>
+        /// <param name="timestamp">The timestamp value.</param>
         public ZoneChangedEventArgs(BoundaryState state, double latitude, double longitude, double altitude, DateTime timestamp)
         {
             BoundState = state;