1. Fix crash issue in destructor
authorkj7.sung <kj7.sung@samsung.com>
Thu, 10 Nov 2016 07:11:53 +0000 (16:11 +0900)
committerkj7.sung <kj7.sung@samsung.com>
Thu, 10 Nov 2016 10:37:54 +0000 (19:37 +0900)
2. Add exceptions for doxygen

Change-Id: I19820ccaea06feb1013e9a1e294c4c1097d1e052
Signed-off-by: kj7.sung <kj7.sung@samsung.com>
Tizen.Location/Tizen.Location/GpsSatellite.cs
Tizen.Location/Tizen.Location/Location.cs
Tizen.Location/Tizen.Location/LocationBoundary.cs
Tizen.Location/Tizen.Location/Locator.cs
Tizen.Location/Tizen.Location/LocatorHelper.cs
packaging/csapi-location.spec

index 97bb78f..ce2cf23 100755 (executable)
@@ -34,6 +34,7 @@ namespace Tizen.Location
         /// The time interval between callback updates.
         /// Should be in the range [1~120] seconds.
         /// </summary>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used</exception>
         public int Interval
         {
             get
@@ -63,6 +64,10 @@ namespace Tizen.Location
         /// <summary>
         /// The NMEAData from the Satellite.
         /// </summary>
+        /// <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="UnauthroizedAccessException">Thrown when the app has no privilege to use the location</exception>
+        /// <exception cref="NotSupportedException">Thrown when the location is not supported</exception>
         public string Nmea
         {
             get
@@ -89,6 +94,10 @@ namespace Tizen.Location
         /// <summary>
         /// The Count of Active satellites.
         /// </summary>
+        /// <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="UnauthroizedAccessException">Thrown when the app has no privilege to use the location</exception>
+        /// <exception cref="NotSupportedException">Thrown when the location is not supported</exception>
         public int ActiveCount
         {
             get
@@ -115,6 +124,10 @@ namespace Tizen.Location
         /// <summary>
         /// The Count of satellites in view.
         /// </summary>
+        /// <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="UnauthroizedAccessException">Thrown when the app has no privilege to use the location</exception>
+        /// <exception cref="NotSupportedException">Thrown when the location is not supported</exception>
         public int InViewCount
         {
             get
@@ -141,6 +154,10 @@ namespace Tizen.Location
         /// <summary>
         /// The list of satellites/last recorded satellites in view.
         /// </summary>
+        /// <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="UnauthroizedAccessException">Thrown when the app has no privilege to use the location</exception>
+        /// <exception cref="NotSupportedException">Thrown when the location is not supported</exception>
         public IList<SatelliteInformation> Satellites
         {
             get
@@ -172,6 +189,7 @@ namespace Tizen.Location
         /// The constructor of GpsSatellite class.
         /// <param name="locator"> Locator object initilized using Gps.</param>
         /// </summary>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used</exception>
         public GpsSatellite(Locator locator)
         {
             Log.Info(Globals.LogTag, "Calling GpsSatellite constructor");
@@ -192,6 +210,9 @@ namespace Tizen.Location
         /// (event) SatelliteStatusUpdated is raised whenever satellite information is updated.
         /// The callback will be invoked periodically (every Interval seconds).
         /// </summary>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used</exception>
+        /// <exception cref="UnauthroizedAccessException">Thrown when the app has no privilege to use the location</exception>
+        /// <exception cref="NotSupportedException">Thrown when the location is not supported</exception>
         public event EventHandler<SatelliteStatusChangedEventArgs> SatelliteStatusUpdated
         {
             add
index 15604be..2041895 100755 (executable)
@@ -175,6 +175,8 @@ namespace Tizen.Location
         /// <param name="endLatitude"> The latitude of the source location [-90.0 ~ 90.0] (degrees).</param>
         /// <param name="endLongitude"> The longitude of the source location[-180.0 ~ 180.0] (degrees).</param>
         /// <returns>Returns the distance between source and destination.</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 double GetDistanceBetween(double startLatitude, double startLongitude, double endLatitude, double endLongitude)
         {
             double result;
@@ -193,6 +195,8 @@ namespace Tizen.Location
         /// </summary>
         /// <param name="location"> The location object to which distance is to be calculated.</param>
         /// <returns>Returns the distance to the specified location.</returns>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used</exception>
+        /// <exception cref="NotSupportedException">Thrown when the location is not supported</exception>
         public double GetDistanceTo(Location location)
         {
             double result;
index d89e886..6d0a615 100755 (executable)
@@ -61,6 +61,8 @@ namespace Tizen.Location
         /// <summary>
         /// The overidden Dispose method of the IDisposable class.
         /// </summary>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used</exception>
+        /// <exception cref="NotSupportedException">Thrown when the location is not supported</exception>
         public void Dispose()
         {
             Log.Info(Globals.LogTag, "Dispose");
@@ -101,6 +103,9 @@ namespace Tizen.Location
         /// </summary>
         /// <param name="topLeft"> The coordinate which constitute the top left handside of the rectangular boundary.</param>
         /// <param name="bottomRight"> The coordinate which constitute the bottom right handside of the rectangular boundary.</param>
+        /// <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 RectangleBoundary(Coordinate topLeft, Coordinate bottomRight)
         {
             Log.Info(Globals.LogTag, "Calling RectangleBoundary constructor");
@@ -110,7 +115,7 @@ namespace Tizen.Location
             if ((LocationBoundError)ret != LocationBoundError.None)
             {
                 Log.Error(Globals.LogTag, "Error Creating Rectangular Boundary," + (LocationBoundError)ret);
-                LocationErrorFactory.ThrowLocationBoundaryException(ret);
+                throw LocationErrorFactory.ThrowLocationBoundaryException(ret);
             }
             handle = boundsHandle;
         }
@@ -168,6 +173,9 @@ namespace Tizen.Location
         /// </summary>
         /// <param name="coordinate"> The coordinates which constitute the center of the circular boundary.</param>
         /// <param name="radius"> The radius value of the circular boundary.</param>
+        /// <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 CircleBoundary(Coordinate coordinate, double radius)
         {
             Log.Info(Globals.LogTag, "Calling CircleBoundary constructor");
@@ -177,7 +185,7 @@ namespace Tizen.Location
             if ((LocationBoundError)ret != LocationBoundError.None)
             {
                 Log.Error(Globals.LogTag, "Error Creating Circular Boundary," + (LocationBoundError)ret);
-                LocationErrorFactory.ThrowLocationBoundaryException(ret);
+                throw LocationErrorFactory.ThrowLocationBoundaryException(ret);
             }
             handle = boundsHandle;
         }
@@ -185,6 +193,9 @@ namespace Tizen.Location
         /// <summary>
         /// Gets the coordinate of the center of a circular boundary.
         /// </summary>
+        /// <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 Coordinate Center
         {
             get
@@ -196,6 +207,9 @@ namespace Tizen.Location
         /// <summary>
         /// Gets the radius of a circular boundary.
         /// </summary>
+        /// <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 double Radius
         {
             get
@@ -209,7 +223,12 @@ namespace Tizen.Location
             Log.Info(Globals.LogTag, "Calling to get CoordinateItem Center");
             Coordinate center;
             double radius;
-            Interop.LocationBoundary.GetCircleCoordinates(handle, out center, out radius);
+            int ret = Interop.LocationBoundary.GetCircleCoordinates(handle, out center, out radius);
+            if ((LocationBoundError)ret != LocationBoundError.None)
+            {
+                Log.Error(Globals.LogTag, "Error Get Circle Center," + (LocationBoundError)ret);
+                throw LocationErrorFactory.ThrowLocationBoundaryException(ret);
+            }
             return center;
         }
 
@@ -217,7 +236,12 @@ namespace Tizen.Location
         {
             Coordinate center;
             double radius = 0;
-            Interop.LocationBoundary.GetCircleCoordinates(handle, out center, out radius);
+            int ret = Interop.LocationBoundary.GetCircleCoordinates(handle, out center, out radius);
+            if ((LocationBoundError)ret != LocationBoundError.None)
+            {
+                Log.Error(Globals.LogTag, "Error Get Radius," + (LocationBoundError)ret);
+                throw LocationErrorFactory.ThrowLocationBoundaryException(ret);
+            }
             return radius;
         }
     }
@@ -232,6 +256,9 @@ namespace Tizen.Location
         /// Constructor of the polygon boundary class.
         /// </summary>
         /// <param name="coordinates"> The coordinates which constitute the polgonal boundary.</param>
+        /// <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 PolygonBoundary(IList<Coordinate> coordinates)
         {
             Log.Info(Globals.LogTag, "Calling PolygonBoundary Constructor");
@@ -249,7 +276,7 @@ namespace Tizen.Location
             if ((LocationBoundError)ret != LocationBoundError.None)
             {
                 Log.Error(Globals.LogTag, "Error Creating Polygon Boundary," + (LocationBoundError)ret);
-                LocationErrorFactory.ThrowLocationBoundaryException(ret);
+                throw LocationErrorFactory.ThrowLocationBoundaryException(ret);
             }
             handle = boundsHandle;
         }
@@ -257,6 +284,9 @@ namespace Tizen.Location
         /// <summary>
         /// Gets the list of coordinates which constitute a polygonal boundary
         /// </summary>
+        /// <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 IList<Coordinate> Coordinates
         {
             get
@@ -278,7 +308,12 @@ namespace Tizen.Location
                 return true;
             };
 
-            Interop.LocationBoundary.GetForEachPolygonCoordinates(handle, callback, IntPtr.Zero);
+            int ret = Interop.LocationBoundary.GetForEachPolygonCoordinates(handle, callback, IntPtr.Zero);
+            if ((LocationBoundError)ret != LocationBoundError.None)
+            {
+                Log.Error(Globals.LogTag, "Error Get foreach Boundary," + (LocationBoundError)ret);
+                throw LocationErrorFactory.ThrowLocationBoundaryException(ret);
+            }
             return coordinateList;
         }
     }
index 0a21100..0d2f375 100755 (executable)
@@ -32,7 +32,7 @@ namespace Tizen.Location
     /// Notifications on events like service becoming enabled or disabled, new position data being available
     /// and others can also be acquired.
     /// </summary>
-    public class Locator:IDisposable
+    public class Locator : IDisposable
     {
         private int _interval = 1;
         private int _stayInterval = 120;
@@ -57,6 +57,9 @@ namespace Tizen.Location
         /// The constructor of Locator class.
         /// </summary>
         /// <param name="locationType"> The back-end positioning method to be used for LBS.</param>
+        /// <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 Locator(LocationType locationType)
         {
             Log.Info(Globals.LogTag, "Locator Constructor");
@@ -82,6 +85,8 @@ namespace Tizen.Location
         /// The time interval between callback updates.
         /// Should be in the range [1~120] seconds.
         /// </summary>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used</exception>
+        /// <exception cref="NotSupportedException">Thrown when the location is not supported</exception>
         public int Interval
         {
             get
@@ -112,6 +117,8 @@ namespace Tizen.Location
         /// The time interval between Distance based location callback updates.
         /// Should be in the range [1~120] seconds.
         /// </summary>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used</exception>
+        /// <exception cref="NotSupportedException">Thrown when the location is not supported</exception>
         public int StayInterval
         {
             get
@@ -142,6 +149,8 @@ namespace Tizen.Location
         /// The distance between callback updates.
         /// Should be in the range [1-120] meters.
         /// </summary>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used</exception>
+        /// <exception cref="NotSupportedException">Thrown when the location is not supported</exception>
         public double Distance
         {
             get
@@ -195,6 +204,8 @@ namespace Tizen.Location
         /// <summary>
         /// Gets the status whether mock location is enabled or not.
         /// </summary>
+        /// <exception cref="UnauthroizedAccessException">Thrown when the app has no privilege to use the location</exception>
+        /// <exception cref="NotSupportedException">Thrown when the location is not supported</exception>
         public bool EnableMock
         {
             get
@@ -227,6 +238,10 @@ namespace Tizen.Location
         /// <summary>
         /// Starts the Location Manager which has been created using the specified method.
         /// </summary>
+        /// <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="UnauthroizedAccessException">Thrown when the app has no privilege to use the location</exception>
+        /// <exception cref="NotSupportedException">Thrown when the location is not supported</exception>
         public void Start()
         {
             Log.Info(Globals.LogTag, "Starting Location Manager");
@@ -253,6 +268,9 @@ namespace Tizen.Location
         /// Stops the Location Manager which has been activated using the specified method.
         /// Does not destroy the manager.
         /// </summary>
+        /// <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 void Stop()
         {
             Log.Info(Globals.LogTag, "Stopping Location Manager");
@@ -270,6 +288,10 @@ namespace Tizen.Location
         /// Sets a mock location for the given location method.
         /// </summary>
         /// <param name="location"> The location object containing the mock location details.</param>
+        /// <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="UnauthroizedAccessException">Thrown when the app has no privilege to use the location</exception>
+        /// <exception cref="NotSupportedException">Thrown when the location is not supported</exception>
         public void SetMockLocation(Location location)
         {
             Log.Info(Globals.LogTag, "Setting mock location");
@@ -293,6 +315,10 @@ namespace Tizen.Location
         /// <summary>
         /// Clears a mock location for the given location method.
         /// </summary>
+        /// <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="UnauthroizedAccessException">Thrown when the app has no privilege to use the location</exception>
+        /// <exception cref="NotSupportedException">Thrown when the location is not supported</exception>
         public void ClearMock()
         {
             Log.Info(Globals.LogTag, "Clear mock location");
@@ -309,6 +335,10 @@ namespace Tizen.Location
         /// </summary>
         /// <param name="timeout"> Timeout to stop requesting single location after(seconds).</param>
         /// <returns> A task which contains the current location details</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>
+        /// <exception cref="UnauthroizedAccessException">Thrown when the app has no privilege to use the location</exception>
+        /// <exception cref="NotSupportedException">Thrown when the location is not supported</exception>
         public Task<Location> GetLocationAsync(int timeout)
         {
             var task = new TaskCompletionSource<Location>();
@@ -349,6 +379,10 @@ namespace Tizen.Location
         /// Gets the details of the location.
         /// </summary>
         /// <returns> which contains the current location details</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>
+        /// <exception cref="UnauthroizedAccessException">Thrown when the app has no privilege to use the location</exception>
+        /// <exception cref="NotSupportedException">Thrown when the location is not supported</exception>
         public Location GetLocation()
         {
             double altitude = 0;
@@ -394,6 +428,9 @@ namespace Tizen.Location
         /// Adds a bounds for a given locator.
         /// </summary>
         /// <param name="locationBoundary"> The boundary object to be added to the locator.</param>
+        /// <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 void AddBoundary(LocationBoundary locationBoundary)
         {
             Log.Info(Globals.LogTag, "AddBoundary called");
@@ -410,6 +447,9 @@ namespace Tizen.Location
         /// Deletes a bounds for a given locator.
         /// </summary>
         /// <param name="locationBoundary"> The boundary object to be removed from the locator.</param>
+        /// <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 void RemoveBoundary(LocationBoundary locationBoundary)
         {
             Log.Info(Globals.LogTag, "RemoveBoundary called");
@@ -424,6 +464,8 @@ namespace Tizen.Location
         /// <summary>
         /// The overidden Dispose method of the IDisposable class.
         /// </summary>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used</exception>
+        /// <exception cref="NotSupportedException">Thrown when the location is not supported</exception>
         public void Dispose()
         {
             Dispose(true);
@@ -435,7 +477,9 @@ namespace Tizen.Location
             if (_disposed)
                 return;
 
-            DestroyHandle();
+            if (disposing)
+                DestroyHandle();
+
             _disposed = true;
         }
 
@@ -444,7 +488,7 @@ namespace Tizen.Location
             int ret = Interop.Locator.Destroy(_handle);
             if (((LocationError)ret != LocationError.None))
             {
-                Log.Error(Globals.LogTag, "Error in Destroy handle" + (LocationError)ret);
+                Log.Error(Globals.LogTag, "Error in Destroy handle" + (LocationError)ret);
                 throw LocationErrorFactory.ThrowLocationException(ret);
             }
         }
@@ -452,6 +496,8 @@ namespace Tizen.Location
         /// <summary>
         /// (event) ServiceStateChanged Event is invoked when the location service state is changed.
         /// </summary>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used</exception>
+        /// <exception cref="NotSupportedException">Thrown when the location is not supported</exception>
         public event EventHandler<ServiceStateChangedEventArgs> ServiceStateChanged
         {
             add
@@ -508,6 +554,8 @@ namespace Tizen.Location
         /// <summary>
         /// (event) ZoneChanged is  invoked when the previously set boundary area is entered or left.
         /// </summary>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used</exception>
+        /// <exception cref="NotSupportedException">Thrown when the location is not supported</exception>
         public event EventHandler<ZoneChangedEventArgs> ZoneChanged
         {
             add
@@ -569,6 +617,9 @@ namespace Tizen.Location
         /// <summary>
         /// (event) SetttingChanged is raised when the location setting is changed.
         /// </summary>
+        /// <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 event EventHandler<SettingChangedEventArgs> SettingChanged
         {
             add
@@ -626,6 +677,8 @@ namespace Tizen.Location
         /// (event) DistanceBasedLocationChanged is raised with updated location information.
         /// The callback will be invoked at minimum interval or minimum distance with updated position information.
         /// </summary>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used</exception>
+        /// <exception cref="NotSupportedException">Thrown when the location is not supported</exception>
         public event EventHandler<LocationChangedEventArgs> DistanceBasedLocationChanged
         {
             add
@@ -684,6 +737,8 @@ namespace Tizen.Location
         /// (event)LocationUpdated is raised at defined intervals of time with updated location information.
         /// The callback will be invoked periodically.
         /// </summary>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is used</exception>
+        /// <exception cref="NotSupportedException">Thrown when the location is not supported</exception>
         public event EventHandler<LocationChangedEventArgs> LocationChanged
         {
             add
index d3e2479..7de13b3 100755 (executable)
@@ -37,6 +37,9 @@ namespace Tizen.Location
         /// </summary>
         /// <param name="locationType"> The back-end positioning method to be used for LBS.</param>
         /// <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>
+        /// <exception cref="NotSupportedException">Thrown when the location is not supported</exception>
         public static bool IsEnabledType(LocationType locationType)
         {
             Log.Info(Globals.LogTag, "Checking if the Location Manager type is Enabled");
index ff43c73..7a1301d 100755 (executable)
@@ -8,7 +8,7 @@
 
 Name:       csapi-location
 Summary:    Tizen Location API for C#
-Version:    1.0.1
+Version:    1.0.2
 Release:    1
 Group:      Development/Libraries
 License:    Apache-2.0