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);
/// <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;
/// <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))
/// <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);
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;
}
/// <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);
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;
}
/// <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);
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;
}
/// <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);
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;
}