Release 4.0.0-preview1-00201
[platform/core/csapi/tizenfx.git] / src / Tizen.System.Information / SystemInfo / SystemInfo.cs
index b551c1b..5c352f0 100755 (executable)
@@ -19,41 +19,36 @@ using System.ComponentModel;
 
 namespace Tizen.System
 {
-    /// <summary>
-    /// System Information class. This class has methods which can be used to obtain device information.
-    /// </summary>
-    public static class SystemInfo
+    [EditorBrowsable(EditorBrowsableState.Never)]
+    internal static class SystemInfo
     {
-        private const string LogTag = "Tizen.System";
-
         [EditorBrowsable(EditorBrowsableState.Never)]
         private static Interop.SystemInfo.SystemInfoType GetValueType(string key, out Interop.SystemInfo.SystemInfoValueType valueType)
         {
-            Interop.SystemInfo.ErrorCode err = Interop.SystemInfo.SystemInfoGetPlatformType(key, out valueType);
-            if (err == Interop.SystemInfo.ErrorCode.None)
+            InformationError err = Interop.SystemInfo.SystemInfoGetPlatformType(key, out valueType);
+            if (err == InformationError.None)
             {
                 return Interop.SystemInfo.SystemInfoType.platform;
             }
 
-            Log.Debug(LogTag, string.Format("Key {0} not in platform system info", key));
+            Log.Debug(InformationErrorFactory.LogTag, string.Format("Key {0} not in platform system info", key));
             err = Interop.SystemInfo.SystemInfoGetCustomType(key, out valueType);
-            if (err == Interop.SystemInfo.ErrorCode.None)
+            if (err == InformationError.None)
             {
                 return Interop.SystemInfo.SystemInfoType.Custom;
             }
 
-            Log.Debug(LogTag, string.Format("Key {0} not in custom system info", key));
+            Log.Debug(InformationErrorFactory.LogTag, string.Format("Key {0} not in custom system info", key));
             return Interop.SystemInfo.SystemInfoType.None;
         }
 
         /// <summary>
         /// Checks if the type of value for the given feature is T.
         /// </summary>
-        /// <since_tizen> 3 </since_tizen>
         /// <typeparam name="T">Type of value for the feature key.</typeparam>
         /// <param name="key">The name of the feature.</param>
         /// <returns>True if type of value for the given feature is T, otherwise false.</returns>
-        public static bool Is<T>(string key)
+        internal static bool Is<T>(string key)
         {
             Interop.SystemInfo.SystemInfoValueType valueType;
             Interop.SystemInfo.SystemInfoType keyType = GetValueType(key, out valueType);
@@ -79,10 +74,9 @@ namespace Tizen.System
         /// <summary>
         /// Checks if the given key is a valid feature.
         /// </summary>
-        /// <since_tizen> 3 </since_tizen>
         /// <param name="key">The name of the feature.</param>
         /// <returns>True if the key is valid, otherwise false.</returns>
-        public static bool IsValidKey(string key)
+        internal static bool IsValidKey(string key)
         {
             Interop.SystemInfo.SystemInfoValueType valueType;
             return GetValueType(key, out valueType) != Interop.SystemInfo.SystemInfoType.None;
@@ -91,12 +85,11 @@ namespace Tizen.System
         /// <summary>
         /// Gets the value of the feature.
         /// </summary>
-        /// <since_tizen> 3 </since_tizen>
         /// <typeparam name="T">Type of key value.</typeparam>
         /// <param name="key">The name of the feature.</param>
         /// <param name="value">The value of the given feature.</param>
         /// <returns>Returns true on success, otherwise false.</returns>
-        public static bool TryGetValue<T>(string key, out T value)
+        internal static bool TryGetValue<T>(string key, out T value)
         {
             bool res = false;
             if (typeof(T) == typeof(bool))
@@ -133,16 +126,15 @@ namespace Tizen.System
         /// <summary>
         /// Gets the bool value of the feature.
         /// </summary>
-        /// <since_tizen> 3 </since_tizen>
         /// <param name="key">The name of the feature.</param>
         /// <param name="value">The value of the given feature.</param>
         /// <returns>Returns true on success, otherwise false.</returns>
-        public static bool TryGetValue(string key, out bool value)
+        internal static bool TryGetValue(string key, out bool value)
         {
             Interop.SystemInfo.SystemInfoValueType valueType;
             Interop.SystemInfo.SystemInfoType keyType = GetValueType(key, out valueType);
 
-            Interop.SystemInfo.ErrorCode err = Interop.SystemInfo.ErrorCode.InvalidParameter;
+            InformationError err = InformationError.InvalidParameter;
             if (keyType == Interop.SystemInfo.SystemInfoType.platform)
             {
                 err = Interop.SystemInfo.SystemInfoGetPlatformBool(key, out value);
@@ -155,9 +147,9 @@ namespace Tizen.System
                 value = false;
             }
 
-            if (err != Interop.SystemInfo.ErrorCode.None)
+            if (err != InformationError.None)
             {
-                Log.Warn(LogTag, string.Format("Failed to get value for key: {0}. err = {1}", key, err));
+                Log.Warn(InformationErrorFactory.LogTag, string.Format("Failed to get value for key: {0}. err = {1}", key, err));
                 return false;
             }
 
@@ -167,16 +159,15 @@ namespace Tizen.System
         /// <summary>
         /// Gets the int value of the feature.
         /// </summary>
-        /// <since_tizen> 3 </since_tizen>
         /// <param name="key">The name of the feature.</param>
         /// <param name="value">The value of the given feature.</param>
         /// <returns>Returns true on success, otherwise false.</returns>
-        public static bool TryGetValue(string key, out int value)
+        internal static bool TryGetValue(string key, out int value)
         {
             Interop.SystemInfo.SystemInfoValueType valueType;
             Interop.SystemInfo.SystemInfoType keyType = GetValueType(key, out valueType);
 
-            Interop.SystemInfo.ErrorCode err = Interop.SystemInfo.ErrorCode.InvalidParameter;
+            InformationError err = InformationError.InvalidParameter;
             if (keyType == Interop.SystemInfo.SystemInfoType.platform)
             {
                 err = Interop.SystemInfo.SystemInfoGetPlatformInt(key, out value);
@@ -190,9 +181,9 @@ namespace Tizen.System
                 value = 0;
             }
 
-            if (err != Interop.SystemInfo.ErrorCode.None)
+            if (err != InformationError.None)
             {
-                Log.Warn(LogTag, string.Format("Failed to get value for key: {0}. err = {1}", key, err));
+                Log.Warn(InformationErrorFactory.LogTag, string.Format("Failed to get value for key: {0}. err = {1}", key, err));
                 return false;
             }
 
@@ -202,16 +193,15 @@ namespace Tizen.System
         /// <summary>
         /// Gets the double value of the feature.
         /// </summary>
-        /// <since_tizen> 3 </since_tizen>
         /// <param name="key">The name of the feature.</param>
         /// <param name="value">The value of the given feature.</param>
         /// <returns>Returns true on success, otherwise false.</returns>
-        public static bool TryGetValue(string key, out double value)
+        internal static bool TryGetValue(string key, out double value)
         {
             Interop.SystemInfo.SystemInfoValueType valueType;
             Interop.SystemInfo.SystemInfoType keyType = GetValueType(key, out valueType);
 
-            Interop.SystemInfo.ErrorCode err = Interop.SystemInfo.ErrorCode.InvalidParameter;
+            InformationError err = InformationError.InvalidParameter;
             if (keyType == Interop.SystemInfo.SystemInfoType.platform)
             {
                 err = Interop.SystemInfo.SystemInfoGetPlatformDouble(key, out value);
@@ -225,9 +215,9 @@ namespace Tizen.System
                 value = 0;
             }
 
-            if (err != Interop.SystemInfo.ErrorCode.None)
+            if (err != InformationError.None)
             {
-                Log.Warn(LogTag, string.Format("Failed to get value for key: {0}. err = {1}", key, err));
+                Log.Warn(InformationErrorFactory.LogTag, string.Format("Failed to get value for key: {0}. err = {1}", key, err));
                 return false;
             }
 
@@ -237,16 +227,15 @@ namespace Tizen.System
         /// <summary>
         /// Gets the string value of the feature.
         /// </summary>
-        /// <since_tizen> 3 </since_tizen>
         /// <param name="key">The name of the feature.</param>
         /// <param name="value">The value of the given feature.</param>
         /// <returns>Returns true on success, otherwise false.</returns>
-        public static bool TryGetValue(string key, out string value)
+        internal static bool TryGetValue(string key, out string value)
         {
             Interop.SystemInfo.SystemInfoValueType valueType;
             Interop.SystemInfo.SystemInfoType keyType = GetValueType(key, out valueType);
 
-            Interop.SystemInfo.ErrorCode err = Interop.SystemInfo.ErrorCode.InvalidParameter;
+            InformationError err = InformationError.InvalidParameter;
             if (keyType == Interop.SystemInfo.SystemInfoType.platform)
             {
                 err = Interop.SystemInfo.SystemInfoGetPlatformString(key, out value);
@@ -260,9 +249,9 @@ namespace Tizen.System
                 value = string.Empty;
             }
 
-            if (err != Interop.SystemInfo.ErrorCode.None)
+            if (err != InformationError.None)
             {
-                Log.Warn(LogTag, string.Format("Failed to get value for key: {0}. err = {1}", key, err));
+                Log.Warn(InformationErrorFactory.LogTag, string.Format("Failed to get value for key: {0}. err = {1}", key, err));
                 return false;
             }