osp-locations changed to replace log macros with secure log macros to avoid privacy...
authorp.karthik <p.karthik@samsung.com>
Fri, 19 Apr 2013 10:59:16 +0000 (16:29 +0530)
committerp.karthik <p.karthik@samsung.com>
Fri, 19 Apr 2013 12:28:01 +0000 (17:58 +0530)
Change-Id: I7ddb62937348b7d4129f2f7229fb2ea83de0a9e6
Signed-off-by: p.karthik <p.karthik@samsung.com>
src/FLocCoordinates.cpp
src/FLoc_LocationImpl.cpp
src/FLoc_LocationManager.cpp
src/FLoc_LocationProviderImpl.cpp
src/FLoc_MathUtils.cpp

index 226725a..5ec1284 100644 (file)
@@ -128,9 +128,10 @@ Coordinates::GetHashCode(void) const
 result
 Coordinates::Set(double latitude, double longitude, double altitude)
 {
-       SysTryReturn(NID_LOC, (MIN_LATITUDE <= latitude) && (latitude <= MAX_LATITUDE),
+       SysSecureTryReturn(NID_LOC, (MIN_LATITUDE <= latitude) && (latitude <= MAX_LATITUDE),
                                 E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The latitude(%lf) must be in the range [-90.0, 90.0].", latitude);
-       SysTryReturn(NID_LOC, (MIN_LONGITUDE <= longitude) && (longitude <= MAX_LONGITUDE),
+
+       SysSecureTryReturn(NID_LOC, (MIN_LONGITUDE <= longitude) && (longitude <= MAX_LONGITUDE),
                                 E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The longitude(%lf) must be in the range [-180.0, 180.0].", longitude);
 
        __latitude = latitude;
@@ -142,7 +143,7 @@ Coordinates::Set(double latitude, double longitude, double altitude)
 result
 Coordinates::SetLatitude(double latitude)
 {
-       SysTryReturn(NID_LOC, (MIN_LATITUDE <= latitude) && (latitude <= MAX_LATITUDE),
+       SysSecureTryReturn(NID_LOC, (MIN_LATITUDE <= latitude) && (latitude <= MAX_LATITUDE),
                                 E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The latitude(%lf) must be in the range [-90.0, 90.0].", latitude);
        __latitude = latitude;
        return E_SUCCESS;
@@ -151,7 +152,7 @@ Coordinates::SetLatitude(double latitude)
 result
 Coordinates::SetLongitude(double longitude)
 {
-       SysTryReturn(NID_LOC, (MIN_LONGITUDE <= longitude) && (longitude <= MAX_LONGITUDE),
+       SysSecureTryReturn(NID_LOC, (MIN_LONGITUDE <= longitude) && (longitude <= MAX_LONGITUDE),
                                 E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The longitude(%lf) must be in the range [-180.0, 180.0].", longitude);
        __longitude = longitude;
        return E_SUCCESS;
index c26cede..4fd8014 100644 (file)
@@ -99,7 +99,7 @@ _LocationImpl::GetTimestamp(void) const
 
        dateTime.SetValue(1970, 1, 1);
        dateTime.Add(timespan);
-       SysLog(NID_LOC, "The location timeStamp is (%ls)", dateTime.ToString().GetPointer());
+       SysSecureLog(NID_LOC, "The location timeStamp is (%ls)", dateTime.ToString().GetPointer());
        return dateTime;
 }
 
index e6dd98b..686aa4d 100644 (file)
@@ -580,7 +580,7 @@ NOTIFY:
 result
 _LocationManager::SetLocationInformation(double latitude, double longitude, double altitude, time_t timestamp, location_method_e locMethod, Location* pLocation)
 {
-       SysLog(NID_LOC, "Location Information is: Latitude (%lf), Longitude (%lf), Altitude (%lf), TimeStamp (%ld), Location method (%d)", latitude, longitude, altitude, timestamp, locMethod);
+       SysSecureLog(NID_LOC, "Location Information is: Latitude (%lf), Longitude (%lf), Altitude (%lf), TimeStamp (%ld), Location method (%d)", latitude, longitude, altitude, timestamp, locMethod);
 
        int res = -1;
        LocationAccuracy requiredAcc;
@@ -769,7 +769,7 @@ _LocationManager::GetLastKnownLocation(location_method_e nativeLocMethod)
 
                int res = location_manager_get_last_position(nativeHandle, &altitude, &latitude, &longitude, &timestampPosition);
                SysTryCatch(NID_LOC, res == 0, , E_SYSTEM, "[E_SYSTEM] Failed to fetch last position from nativeHandle(%x).", nativeHandle);
-               SysLog(NID_LOC, "Last position(latitude: %lf, longitude: %lf, altitude: %lf, timestamp: %ld",
+               SysSecureLog(NID_LOC, "Last position(latitude: %lf, longitude: %lf, altitude: %lf, timestamp: %ld",
                        latitude, longitude, altitude, timestampPosition);
 
                Coordinates coord;
index c365863..2bf3725 100644 (file)
@@ -225,7 +225,7 @@ _LocationProviderImpl::AddMonitoringRegion(const Coordinates& regionCenter, doub
        SysTryReturn(NID_LOC, radius >= 50.0 && radius <= 100000.00, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The radius is not within the specified limits.");
        SysTryReturn(NID_LOC, (!Double::IsNaN(radius) && !Double::IsNaN(regionCenter.GetLatitude()) && !Double::IsNaN(regionCenter.GetLongitude())),
                                 E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] One of the value is NaN.");
-       SysLog(NID_LOC, "Requested to add the monitoring region with center (Latitude: %lf, Longitude %lf) and radius (%lf).", regionCenter.GetLatitude(), regionCenter.GetLongitude(), radius);
+       SysSecureLog(NID_LOC, "Requested to add the monitoring region with center (Latitude: %lf, Longitude %lf) and radius (%lf).", regionCenter.GetLatitude(), regionCenter.GetLongitude(), radius);
 
        static int nextRegionId = 0;
 
@@ -810,9 +810,9 @@ _LocationProviderImpl::GetRegionCurrentState(const _RegionInfo& region, const Lo
 {
        TryReturn(location.GetHorizontalAccuracy() >= 0.0, REGION_STATE_UNKNOWN, "Location received with invalid accuracy");
 
-       SysLog(NID_LOC, "[RegionID %d] Region Information is (Center latitude: %lf, Center longitude: %lf, Region radius:%lf", region.GetRegionId(), region.GetCoordinate().GetLatitude(),
+       SysSecureLog(NID_LOC, "[RegionID %d] Region Information is (Center latitude: %lf, Center longitude: %lf, Region radius:%lf", region.GetRegionId(), region.GetCoordinate().GetLatitude(),
                   region.GetCoordinate().GetLongitude(), region.GetRadius());
-       SysLog(NID_LOC, "[RegionID %d] Location Information is (Latitude: %lf, Longitude: %lf, Horizontal accuracy:%lf", region.GetRegionId(), location.GetCoordinates().GetLatitude(),
+       SysSecureLog(NID_LOC, "[RegionID %d] Location Information is (Latitude: %lf, Longitude: %lf, Horizontal accuracy:%lf", region.GetRegionId(), location.GetCoordinates().GetLatitude(),
                   location.GetCoordinates().GetLongitude(), location.GetHorizontalAccuracy());
 
        _RegionState regionState = REGION_STATE_UNKNOWN;
index edee539..f7f1c54 100644 (file)
@@ -90,7 +90,7 @@ _MathUtils::GetShortestDistance(const Location& location, const Tizen::Base::Col
                }
        }
 
-       SysLog(NID_LOC, "Shortest distance from location (lat: %lf and lon: %lf) to the nearest region boundary is (%lf) meters", location.GetCoordinates().GetLatitude(), location.GetCoordinates().GetLongitude(), minDistance);
+       SysSecureLog(NID_LOC, "Shortest distance from location (lat: %lf and lon: %lf) to the nearest region boundary is (%lf) meters", location.GetCoordinates().GetLatitude(), location.GetCoordinates().GetLongitude(), minDistance);
        return minDistance;
 }
 } } // Tizen::Locations