Merge "Deprecate FeedKeyEvent api, add FeedKey api instead" 5.0.0-preview1-00394
authordongsug song <dongsug.song@samsung.com>
Wed, 29 Nov 2017 11:27:05 +0000 (11:27 +0000)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Wed, 29 Nov 2017 11:27:05 +0000 (11:27 +0000)
packaging/csapi-tizenfx.spec
packaging/csapi-tizenfx.spec.in
src/Tizen.Location/Tizen.Location/Locator.cs

index a3772cd..0a4fcac 100644 (file)
@@ -25,7 +25,7 @@ ExcludeArch: aarch64
 AutoReqProv: no
 
 BuildRequires: dotnet-build-tools
-Requires(post): vconf
+Requires(post): /usr/bin/vconftool
 
 %description
 %{summary}
@@ -176,7 +176,7 @@ install -p -m 644 %{_tizenfx_bin_path}/bin/dummy/*.dll %{buildroot}%{DOTNET_ASSE
 install -p -m 644 %{_tizenfx_bin_path}/*.nupkg %{buildroot}%{DOTNET_NUGET_SOURCE}
 
 %post
-vconftool set -t int "db/dotnet/tizen_api_version" %{TIZEN_NET_API_VERSION} -f
+/usr/bin/vconftool set -t int db/dotnet/tizen_api_version %{TIZEN_NET_API_VERSION} -f
 
 
 %files
index 71e6585..7b9509d 100644 (file)
@@ -24,7 +24,7 @@ ExcludeArch: aarch64
 AutoReqProv: no
 
 BuildRequires: dotnet-build-tools
-Requires(post): vconf
+Requires(post): /usr/bin/vconftool
 
 %description
 %{summary}
@@ -175,7 +175,7 @@ install -p -m 644 %{_tizenfx_bin_path}/bin/dummy/*.dll %{buildroot}%{DOTNET_ASSE
 install -p -m 644 %{_tizenfx_bin_path}/*.nupkg %{buildroot}%{DOTNET_NUGET_SOURCE}
 
 %post
-vconftool set -t int "db/dotnet/tizen_api_version" %{TIZEN_NET_API_VERSION} -f
+/usr/bin/vconftool set -t int db/dotnet/tizen_api_version %{TIZEN_NET_API_VERSION} -f
 
 
 %files
index 39b3db3..8a0c764 100755 (executable)
@@ -43,7 +43,6 @@ namespace Tizen.Location
         private double _distance = 120.0;
         private bool _isEnableMock = false;
         private bool _disposed = false;
-        private bool _isStarted = false;
         private IntPtr _handle;
         private LocationType _locationType;
         private Location _location = null;
@@ -340,7 +339,6 @@ namespace Tizen.Location
                     throw LocationErrorFactory.ThrowLocationException(ret);
                 }
             }
-            _isStarted = true;
         }
 
         /// <summary>
@@ -360,7 +358,6 @@ namespace Tizen.Location
                 Log.Error(Globals.LogTag, "Error stopping Location Manager," + (LocationError)ret);
                 throw LocationErrorFactory.ThrowLocationException(ret);
             }
-            _isStarted = false;
        }
 
         /// <summary>
@@ -483,23 +480,31 @@ namespace Tizen.Location
             double vertical = 0;
             int timestamp = 0;
 
-            if (_isStarted)
+            Log.Info(Globals.LogTag, "Get current location information");
+            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.Info(Globals.LogTag, "Get current location information");
-                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))
+                if ((LocationError)ret == LocationError.ServiceNotAvailable)
                 {
-                    Log.Error(Globals.LogTag, "Error in get current location information," + (LocationError)ret);
-                    throw LocationErrorFactory.ThrowLocationException(ret);
+                    Log.Info(Globals.LogTag, "Get last location information");
+                    ret = Interop.Locator.GetLastLocation(_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 last location information," + (LocationError)ret);
+                        throw LocationErrorFactory.ThrowLocationException(ret);
+                    }
+                    else
+                    {
+                        if (latitude == 0.0 && longitude == 0.0)
+                        {
+                            Log.Error(Globals.LogTag, "Error fail to get last location information");
+                            throw LocationErrorFactory.ThrowLocationException((int)LocationError.ServiceNotAvailable);
+                        }
+                    }
                 }
-            }
-            else
-            {
-                Log.Info(Globals.LogTag, "Get last location information");
-                int ret = Interop.Locator.GetLastLocation(_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))
+                else
                 {
-                    Log.Error(Globals.LogTag, "Error in get last location information," + (LocationError)ret);
+                    Log.Error(Globals.LogTag, "Error in get current location information," + (LocationError)ret);
                     throw LocationErrorFactory.ThrowLocationException(ret);
                 }
             }