-// Copyright 2016 by Samsung Electronics, Inc.,
-//
-// This software is the confidential and proprietary information
-// of Samsung Electronics, Inc. ("Confidential Information"). You
-// shall not disclose such Confidential Information and shall use
-// it only in accordance with the terms of the license agreement
-// you entered into with Samsung.
-
+/*
+ * 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 System;
using Tizen.Internals.Errors;
}
/// <summary>
- /// Location Manager error codes
+ /// Location Manager error codes.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public enum LocationError
{
- None = ErrorCode.None,/**< Successful */
- OutOfMemoryError = ErrorCode.OutOfMemory,/**< Out of memory error */
- InvalidParameter = ErrorCode.InvalidParameter,/**< Invalid parameter */
- AcessibilityNotallowed = ErrorCode.PermissionDenied,/**< Permission denied */
- NotSupported = ErrorCode.NotSupported,/**< Address family not supported */
- IncorrectMethod = LocationManagerError.Base | 0x01,/**< Location manager contains incorrect method for a given call */
- NetworkFailed = LocationManagerError.Base | 0x02,/**< Network unavailable */
- ServiceNotAvailable = LocationManagerError.Base | 0x03,/**< Location service is not available */
- GPSSettingOff = LocationManagerError.Base | 0x04,/**< GPS/WPS, or MOCK setting is not enabled */
- SecuirtyRestricted = LocationManagerError.Base | 0x05,/**< Restricted by security system policy */
- SettingOff = GPSSettingOff/**< GPS/WPS, or MOCK setting is not enabled */
+ /// <summary>
+ /// Successful.
+ /// </summary>
+ None = ErrorCode.None,
+
+ /// <summary>
+ /// Out of memory error.
+ /// </summary>
+ OutOfMemory = ErrorCode.OutOfMemory,
+
+ /// <summary>
+ /// Invalid parameter.
+ /// </summary>
+ InvalidParameter = ErrorCode.InvalidParameter,
+
+ /// <summary>
+ /// Permission denied.
+ /// </summary>
+ AcessibilityNotallowed = ErrorCode.PermissionDenied,
+
+ /// <summary>
+ /// Address family not supported.
+ /// </summary>
+ NotSupported = ErrorCode.NotSupported,
+
+ /// <summary>
+ /// Location manager contains incorrect method for a given call.
+ /// </summary>
+ IncorrectMethod = LocationManagerError.Base | 0x01,
+
+ /// <summary>
+ /// Network unavailable.
+ /// </summary>
+ NetworkFailed = LocationManagerError.Base | 0x02,
+
+ /// <summary>
+ /// Location service is not available.
+ /// </summary>
+ ServiceNotAvailable = LocationManagerError.Base | 0x03,
+
+ /// <summary>
+ /// GPS/WPS, or MOCK setting is not enabled.
+ /// </summary>
+ SettingOff = LocationManagerError.Base | 0x04,
+
+ /// <summary>
+ /// Restricted by security system policy.
+ /// </summary>
+ SecuirtyRestricted = LocationManagerError.Base | 0x05,
}
/// <summary>
- /// Location Boundary error codes
+ /// Location Boundary error codes.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public enum LocationBoundError
{
- None = ErrorCode.None,/**< Successful */
- OutOfMemoryError = ErrorCode.OutOfMemory,/**< Out of memory error */
- InvalidParameter = ErrorCode.InvalidParameter,/**< Invalid parameter */
- NotSupported = ErrorCode.NotSupported,/**< Not supported */
- IncorrectType = LocationManagerError.BoundsBase | 0x01,/**< Incorrect bounds type for a given call */
- IsAdded = LocationManagerError.BoundsBase | 0x02/**< Cannot remove bounds handle from location manager */
+
+ /// <summary>
+ /// Successful.
+ /// </summary>
+ None = ErrorCode.None,
+
+ /// <summary>
+ /// Out of memory error.
+ /// </summary>
+ OutOfMemory = ErrorCode.OutOfMemory,
+
+ /// <summary>
+ /// Invalid parameter.
+ /// </summary>
+ InvalidParameter = ErrorCode.InvalidParameter,
+
+ /// <summary>
+ /// Not supported.
+ /// </summary>
+ NotSupported = ErrorCode.NotSupported,
+
+ /// <summary>
+ /// Incorrect bounds type for a given call.
+ /// </summary>
+ IncorrectType = LocationManagerError.BoundsBase | 0x01,
+
+ /// <summary>
+ /// Cannot remove bounds handle from location manager.
+ /// </summary>
+ IsAdded = LocationManagerError.BoundsBase | 0x02
}
internal static class LocationErrorFactory
{
internal static Exception ThrowLocationException(int errCode)
{
+ Log.Error(Globals.LogTag, "Throw Location Exception : " + errCode);
LocationError error = (LocationError)errCode;
switch (error)
{
+ case LocationError.OutOfMemory:
+ return new InvalidOperationException("Out of memory");
+ case LocationError.InvalidParameter:
+ return new ArgumentException("Invalid Parameter passed");
case LocationError.AcessibilityNotallowed:
- return new InvalidOperationException("Accesibility not allowed");
- case LocationError.SettingOff:
- return new InvalidOperationException("Current locationtype setting is off");
+ return new UnauthorizedAccessException("Accesibility not allowed");
+ case LocationError.NotSupported:
+ return new NotSupportedException("Not supported");
case LocationError.IncorrectMethod:
return new InvalidOperationException("Incorrect method used");
- case LocationError.InvalidParameter:
- return new ArgumentException("Invalid Parameter passed");
case LocationError.NetworkFailed:
return new InvalidOperationException("Network failed");
- case LocationError.NotSupported:
- return new InvalidOperationException("Operation not supported");
- case LocationError.OutOfMemoryError:
- return new InvalidOperationException("Out of memory error");
- case LocationError.SecuirtyRestricted:
- return new InvalidOperationException("Security Restricted");
case LocationError.ServiceNotAvailable:
return new InvalidOperationException("Service not available");
+ case LocationError.SettingOff:
+ return new InvalidOperationException("Current locationtype setting is off");
+ case LocationError.SecuirtyRestricted:
+ return new InvalidOperationException("Security Restricted");
default:
return new InvalidOperationException("Unknown Error");
}
LocationBoundError error = (LocationBoundError)errCode;
switch (error)
{
- case LocationBoundError.IncorrectType:
- return new InvalidOperationException("Incorrect type passed");
+ case LocationBoundError.OutOfMemory:
+ return new InvalidOperationException("Out of memory exception");
case LocationBoundError.InvalidParameter:
return new ArgumentException("Invalid parameter passed");
+ case LocationBoundError.NotSupported:
+ return new NotSupportedException("Not supported");
+ case LocationBoundError.IncorrectType:
+ return new InvalidOperationException("Incorrect type passed");
case LocationBoundError.IsAdded:
return new InvalidOperationException("Boundary is not addded");
- case LocationBoundError.NotSupported:
- return new InvalidOperationException("Operation Not supported");
- case LocationBoundError.OutOfMemoryError:
- return new InvalidOperationException("Out of memory exception");
default:
return new InvalidOperationException("Unknown Error");
}