2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 namespace Tizen.System
21 internal enum SystemSettingsError
23 None = Tizen.Internals.Errors.ErrorCode.None,
24 InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter,
25 OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory,
26 IoError = Tizen.Internals.Errors.ErrorCode.IoError,
27 PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied,
28 NotSupported = Tizen.Internals.Errors.ErrorCode.NotSupported,
29 LockScreenAppPasswordMode = -0x01140000 | 0x01
31 internal class SystemSettingsExceptionFactory
33 internal const string LogTag = "Tizen.System.SystemSettings";
35 internal static Exception CreateException(SystemSettingsError err, string msg)
40 case SystemSettingsError.InvalidParameter:
41 exp = new ArgumentException(msg);
43 case SystemSettingsError.NotSupported:
44 exp = new NotSupportedException(msg);
46 case SystemSettingsError.OutOfMemory:
48 case SystemSettingsError.IoError:
50 case SystemSettingsError.PermissionDenied:
51 exp = new UnauthorizedAccessException(msg);
53 case SystemSettingsError.LockScreenAppPasswordMode:
56 exp = new InvalidOperationException(msg);