{
if (!s_keyTVkeyMapping.TryGetValue(key, out key_TV))
{
- RuntimeInfoErrorFactory.ThrowException((int)RuntimeInfoError.InvalidParameter);
+ InformationErrorFactory.ThrowException(InformationError.InvalidParameter);
}
return (RuntimeInformationKey)key_TV;
}
Type value;
if (!s_keyDataTypeMapping.TryGetValue(key, out value))
{
- RuntimeInfoErrorFactory.ThrowException((int)RuntimeInfoError.InvalidParameter);
+ InformationErrorFactory.ThrowException(InformationError.InvalidParameter);
}
if (s_keyDataTypeMapping[key] == typeof(int))
{
int status;
- int ret = Interop.RuntimeInfo.GetValue(ConvertKeyIfTvProduct(key), out status);
- if (ret != (int)RuntimeInfoError.None)
+ InformationError ret = Interop.RuntimeInfo.GetValue(ConvertKeyIfTvProduct(key), out status);
+ if (ret != InformationError.None)
{
- Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to get value for key {0}", key.ToString());
- RuntimeInfoErrorFactory.ThrowException(ret);
+ Log.Error(InformationErrorFactory.LogTag, "Interop failed to get value for key {0}", key.ToString());
+ InformationErrorFactory.ThrowException(ret);
}
return status;
else
{
bool status;
- int ret = Interop.RuntimeInfo.GetValue(ConvertKeyIfTvProduct(key), out status);
- if (ret != (int)RuntimeInfoError.None)
+ InformationError ret = Interop.RuntimeInfo.GetValue(ConvertKeyIfTvProduct(key), out status);
+ if (ret != InformationError.None)
{
- Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to get value for key {0}", key.ToString());
- RuntimeInfoErrorFactory.ThrowException(ret);
+ Log.Error(InformationErrorFactory.LogTag, "Interop failed to get value for key {0}", key.ToString());
+ InformationErrorFactory.ThrowException(ret);
}
return status;
{
if (!s_keyDataTypeMapping.ContainsKey(key))
{
- Log.Error(RuntimeInfoErrorFactory.LogTag, "Invalid data type");
+ Log.Error(InformationErrorFactory.LogTag, "Invalid data type");
throw new ArgumentException("Invalid parameter");
}
{
if (s_bluetoothEnabled == null)
{
- int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.Bluetooth), s_runtimeInfoChangedCallback, IntPtr.Zero);
- if (ret != (int)RuntimeInfoError.None)
+ InformationError ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.Bluetooth), s_runtimeInfoChangedCallback, IntPtr.Zero);
+ if (ret != InformationError.None)
{
- Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler");
- RuntimeInfoErrorFactory.ThrowException(ret);
+ Log.Error(InformationErrorFactory.LogTag, "Interop failed to add event handler");
+ InformationErrorFactory.ThrowException(ret);
}
}
s_bluetoothEnabled += value;
s_bluetoothEnabled -= value;
if (s_bluetoothEnabled == null)
{
- int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.Bluetooth));
- if (ret != (int)RuntimeInfoError.None)
+ InformationError ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.Bluetooth));
+ if (ret != InformationError.None)
{
- Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler");
- RuntimeInfoErrorFactory.ThrowException(ret);
+ Log.Error(InformationErrorFactory.LogTag, "Interop failed to add event handler");
+ InformationErrorFactory.ThrowException(ret);
}
}
}
{
if (s_wifiHotspotEnabled == null)
{
- int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.WifiHotspot), s_runtimeInfoChangedCallback, IntPtr.Zero);
- if (ret != (int)RuntimeInfoError.None)
+ InformationError ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.WifiHotspot), s_runtimeInfoChangedCallback, IntPtr.Zero);
+ if (ret != InformationError.None)
{
- Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler");
- RuntimeInfoErrorFactory.ThrowException(ret);
+ Log.Error(InformationErrorFactory.LogTag, "Interop failed to add event handler");
+ InformationErrorFactory.ThrowException(ret);
}
}
s_wifiHotspotEnabled += value;
s_wifiHotspotEnabled -= value;
if (s_wifiHotspotEnabled == null)
{
- int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.WifiHotspot));
- if (ret != (int)RuntimeInfoError.None)
+ InformationError ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.WifiHotspot));
+ if (ret != InformationError.None)
{
- Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler");
- RuntimeInfoErrorFactory.ThrowException(ret);
+ Log.Error(InformationErrorFactory.LogTag, "Interop failed to add event handler");
+ InformationErrorFactory.ThrowException(ret);
}
}
}
{
if (s_bluetoothTetheringEnabled == null)
{
- int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.BluetoothTethering), s_runtimeInfoChangedCallback, IntPtr.Zero);
- if (ret != (int)RuntimeInfoError.None)
+ InformationError ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.BluetoothTethering), s_runtimeInfoChangedCallback, IntPtr.Zero);
+ if (ret != InformationError.None)
{
- Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler");
- RuntimeInfoErrorFactory.ThrowException(ret);
+ Log.Error(InformationErrorFactory.LogTag, "Interop failed to add event handler");
+ InformationErrorFactory.ThrowException(ret);
}
}
s_bluetoothTetheringEnabled += value;
s_bluetoothTetheringEnabled -= value;
if (s_bluetoothTetheringEnabled == null)
{
- int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.BluetoothTethering));
- if (ret != (int)RuntimeInfoError.None)
+ InformationError ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.BluetoothTethering));
+ if (ret != InformationError.None)
{
- Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler");
- RuntimeInfoErrorFactory.ThrowException(ret);
+ Log.Error(InformationErrorFactory.LogTag, "Interop failed to add event handler");
+ InformationErrorFactory.ThrowException(ret);
}
}
}
{
if (s_usbTetheringEnabled == null)
{
- int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.UsbTethering), s_runtimeInfoChangedCallback, IntPtr.Zero);
- if (ret != (int)RuntimeInfoError.None)
+ InformationError ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.UsbTethering), s_runtimeInfoChangedCallback, IntPtr.Zero);
+ if (ret != InformationError.None)
{
- Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler");
- RuntimeInfoErrorFactory.ThrowException(ret);
+ Log.Error(InformationErrorFactory.LogTag, "Interop failed to add event handler");
+ InformationErrorFactory.ThrowException(ret);
}
}
s_usbTetheringEnabled += value;
s_usbTetheringEnabled -= value;
if (s_usbTetheringEnabled == null)
{
- int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.UsbTethering));
- if (ret != (int)RuntimeInfoError.None)
+ InformationError ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.UsbTethering));
+ if (ret != InformationError.None)
{
- Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler");
- RuntimeInfoErrorFactory.ThrowException(ret);
+ Log.Error(InformationErrorFactory.LogTag, "Interop failed to add event handler");
+ InformationErrorFactory.ThrowException(ret);
}
}
}
{
if (s_packetDataEnabled == null)
{
- int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.PacketData), s_runtimeInfoChangedCallback, IntPtr.Zero);
- if (ret != (int)RuntimeInfoError.None)
+ InformationError ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.PacketData), s_runtimeInfoChangedCallback, IntPtr.Zero);
+ if (ret != InformationError.None)
{
- Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler");
- RuntimeInfoErrorFactory.ThrowException(ret);
+ Log.Error(InformationErrorFactory.LogTag, "Interop failed to add event handler");
+ InformationErrorFactory.ThrowException(ret);
}
}
s_packetDataEnabled += value;
s_packetDataEnabled -= value;
if (s_packetDataEnabled == null)
{
- int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.PacketData));
- if (ret != (int)RuntimeInfoError.None)
+ InformationError ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.PacketData));
+ if (ret != InformationError.None)
{
- Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler");
- RuntimeInfoErrorFactory.ThrowException(ret);
+ Log.Error(InformationErrorFactory.LogTag, "Interop failed to add event handler");
+ InformationErrorFactory.ThrowException(ret);
}
}
}
{
if (s_dataRoamingEnabled == null)
{
- int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.DataRoaming), s_runtimeInfoChangedCallback, IntPtr.Zero);
- if (ret != (int)RuntimeInfoError.None)
+ InformationError ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.DataRoaming), s_runtimeInfoChangedCallback, IntPtr.Zero);
+ if (ret != InformationError.None)
{
- Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler");
- RuntimeInfoErrorFactory.ThrowException(ret);
+ Log.Error(InformationErrorFactory.LogTag, "Interop failed to add event handler");
+ InformationErrorFactory.ThrowException(ret);
}
}
s_dataRoamingEnabled += value;
s_dataRoamingEnabled -= value;
if (s_dataRoamingEnabled == null)
{
- int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.DataRoaming));
- if (ret != (int)RuntimeInfoError.None)
+ InformationError ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.DataRoaming));
+ if (ret != InformationError.None)
{
- Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler");
- RuntimeInfoErrorFactory.ThrowException(ret);
+ Log.Error(InformationErrorFactory.LogTag, "Interop failed to add event handler");
+ InformationErrorFactory.ThrowException(ret);
}
}
}
{
if (s_vibrationEnabled == null)
{
- int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.Vibration), s_runtimeInfoChangedCallback, IntPtr.Zero);
- if (ret != (int)RuntimeInfoError.None)
+ InformationError ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.Vibration), s_runtimeInfoChangedCallback, IntPtr.Zero);
+ if (ret != InformationError.None)
{
- Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler");
- RuntimeInfoErrorFactory.ThrowException(ret);
+ Log.Error(InformationErrorFactory.LogTag, "Interop failed to add event handler");
+ InformationErrorFactory.ThrowException(ret);
}
}
s_vibrationEnabled += value;
s_vibrationEnabled -= value;
if (s_vibrationEnabled == null)
{
- int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.Vibration));
- if (ret != (int)RuntimeInfoError.None)
+ InformationError ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.Vibration));
+ if (ret != InformationError.None)
{
- Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler");
- RuntimeInfoErrorFactory.ThrowException(ret);
+ Log.Error(InformationErrorFactory.LogTag, "Interop failed to add event handler");
+ InformationErrorFactory.ThrowException(ret);
}
}
}
{
if (s_audioJackConnected == null)
{
- int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.AudioJack), s_runtimeInfoChangedCallback, IntPtr.Zero);
- if (ret != (int)RuntimeInfoError.None)
+ InformationError ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.AudioJack), s_runtimeInfoChangedCallback, IntPtr.Zero);
+ if (ret != InformationError.None)
{
- Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler");
- RuntimeInfoErrorFactory.ThrowException(ret);
+ Log.Error(InformationErrorFactory.LogTag, "Interop failed to add event handler");
+ InformationErrorFactory.ThrowException(ret);
}
}
s_audioJackConnected += value;
s_audioJackConnected -= value;
if (s_audioJackConnected == null)
{
- int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.AudioJack));
- if (ret != (int)RuntimeInfoError.None)
+ InformationError ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.AudioJack));
+ if (ret != InformationError.None)
{
- Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler");
- RuntimeInfoErrorFactory.ThrowException(ret);
+ Log.Error(InformationErrorFactory.LogTag, "Interop failed to add event handler");
+ InformationErrorFactory.ThrowException(ret);
}
}
}
{
if (s_gpsStatusChanged == null)
{
- int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.Gps), s_runtimeInfoChangedCallback, IntPtr.Zero);
- if (ret != (int)RuntimeInfoError.None)
+ InformationError ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.Gps), s_runtimeInfoChangedCallback, IntPtr.Zero);
+ if (ret != InformationError.None)
{
- Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler");
- RuntimeInfoErrorFactory.ThrowException(ret);
+ Log.Error(InformationErrorFactory.LogTag, "Interop failed to add event handler");
+ InformationErrorFactory.ThrowException(ret);
}
}
s_gpsStatusChanged += value;
s_gpsStatusChanged -= value;
if (s_gpsStatusChanged == null)
{
- int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.Gps));
- if (ret != (int)RuntimeInfoError.None)
+ InformationError ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.Gps));
+ if (ret != InformationError.None)
{
- Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler");
- RuntimeInfoErrorFactory.ThrowException(ret);
+ Log.Error(InformationErrorFactory.LogTag, "Interop failed to add event handler");
+ InformationErrorFactory.ThrowException(ret);
}
}
}
{
if (s_batteryIsCharging == null)
{
- int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.BatteryIsCharging), s_runtimeInfoChangedCallback, IntPtr.Zero);
- if (ret != (int)RuntimeInfoError.None)
+ InformationError ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.BatteryIsCharging), s_runtimeInfoChangedCallback, IntPtr.Zero);
+ if (ret != InformationError.None)
{
- Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler");
- RuntimeInfoErrorFactory.ThrowException(ret);
+ Log.Error(InformationErrorFactory.LogTag, "Interop failed to add event handler");
+ InformationErrorFactory.ThrowException(ret);
}
}
s_batteryIsCharging += value;
s_batteryIsCharging -= value;
if (s_batteryIsCharging == null)
{
- int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.BatteryIsCharging));
- if (ret != (int)RuntimeInfoError.None)
+ InformationError ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.BatteryIsCharging));
+ if (ret != InformationError.None)
{
- Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler");
- RuntimeInfoErrorFactory.ThrowException(ret);
+ Log.Error(InformationErrorFactory.LogTag, "Interop failed to add event handler");
+ InformationErrorFactory.ThrowException(ret);
}
}
}
{
if (s_tvOutConnected == null)
{
- int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.TvOut), s_runtimeInfoChangedCallback, IntPtr.Zero);
- if (ret != (int)RuntimeInfoError.None)
+ InformationError ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.TvOut), s_runtimeInfoChangedCallback, IntPtr.Zero);
+ if (ret != InformationError.None)
{
- Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler");
- RuntimeInfoErrorFactory.ThrowException(ret);
+ Log.Error(InformationErrorFactory.LogTag, "Interop failed to add event handler");
+ InformationErrorFactory.ThrowException(ret);
}
}
s_tvOutConnected += value;
s_tvOutConnected -= value;
if (s_tvOutConnected == null)
{
- int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.TvOut));
- if (ret != (int)RuntimeInfoError.None)
+ InformationError ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.TvOut));
+ if (ret != InformationError.None)
{
- Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler");
- RuntimeInfoErrorFactory.ThrowException(ret);
+ Log.Error(InformationErrorFactory.LogTag, "Interop failed to add event handler");
+ InformationErrorFactory.ThrowException(ret);
}
}
}
{
if (s_audioJackConnectorChanged == null)
{
- int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.AudioJackConnector), s_runtimeInfoChangedCallback, IntPtr.Zero);
- if (ret != (int)RuntimeInfoError.None)
+ InformationError ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.AudioJackConnector), s_runtimeInfoChangedCallback, IntPtr.Zero);
+ if (ret != InformationError.None)
{
- Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler");
- RuntimeInfoErrorFactory.ThrowException(ret);
+ Log.Error(InformationErrorFactory.LogTag, "Interop failed to add event handler");
+ InformationErrorFactory.ThrowException(ret);
}
}
s_audioJackConnectorChanged += value;
s_audioJackConnectorChanged -= value;
if (s_audioJackConnectorChanged == null)
{
- int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.AudioJackConnector));
- if (ret != (int)RuntimeInfoError.None)
+ InformationError ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.AudioJackConnector));
+ if (ret != InformationError.None)
{
- Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler");
- RuntimeInfoErrorFactory.ThrowException(ret);
+ Log.Error(InformationErrorFactory.LogTag, "Interop failed to add event handler");
+ InformationErrorFactory.ThrowException(ret);
}
}
}
{
if (s_chargerConnected == null)
{
- int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.Charger), s_runtimeInfoChangedCallback, IntPtr.Zero);
- if (ret != (int)RuntimeInfoError.None)
+ InformationError ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.Charger), s_runtimeInfoChangedCallback, IntPtr.Zero);
+ if (ret != InformationError.None)
{
- Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler");
- RuntimeInfoErrorFactory.ThrowException(ret);
+ Log.Error(InformationErrorFactory.LogTag, "Interop failed to add event handler");
+ InformationErrorFactory.ThrowException(ret);
}
}
s_chargerConnected += value;
s_chargerConnected -= value;
if (s_chargerConnected == null)
{
- int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.Charger));
- if (ret != (int)RuntimeInfoError.None)
+ InformationError ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.Charger));
+ if (ret != InformationError.None)
{
- Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler");
- RuntimeInfoErrorFactory.ThrowException(ret);
+ Log.Error(InformationErrorFactory.LogTag, "Interop failed to add event handler");
+ InformationErrorFactory.ThrowException(ret);
}
}
}
{
if (s_autoRotationEnabled == null)
{
- int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.AutoRotation), s_runtimeInfoChangedCallback, IntPtr.Zero);
- if (ret != (int)RuntimeInfoError.None)
+ InformationError ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.AutoRotation), s_runtimeInfoChangedCallback, IntPtr.Zero);
+ if (ret != InformationError.None)
{
- Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler");
- RuntimeInfoErrorFactory.ThrowException(ret);
+ Log.Error(InformationErrorFactory.LogTag, "Interop failed to add event handler");
+ InformationErrorFactory.ThrowException(ret);
}
}
s_autoRotationEnabled += value;
s_autoRotationEnabled -= value;
if (s_autoRotationEnabled == null)
{
- int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.AutoRotation));
- if (ret != (int)RuntimeInfoError.None)
+ InformationError ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(ConvertKeyIfTvProduct(RuntimeInformationKey.AutoRotation));
+ if (ret != InformationError.None)
{
- Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler");
- RuntimeInfoErrorFactory.ThrowException(ret);
+ Log.Error(InformationErrorFactory.LogTag, "Interop failed to add event handler");
+ InformationErrorFactory.ThrowException(ret);
}
}
}
/// </summary>
public 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;
}
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;
}
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;
}
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;
}
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;
}