From: Jyothi Kumar Sambolu Date: Wed, 6 Apr 2016 15:31:43 +0000 (+0530) Subject: Fixed reference path to dependent tizen dlls X-Git-Tag: submit/tizen/20161214.063015~44 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a123a99cbf026eb332649483605a7995f774b5a8;p=platform%2Fcore%2Fcsapi%2Fsystem.git Fixed reference path to dependent tizen dlls Patch set #17: Removed SystemTest containing test code Patch set #16: Fixed merged conflict Patch set #15: Added log statements for error cases and incorporated review comments(#14) Patch set #14: Fixed issues found during testing and added Test application(console). Change-Id: I9daf44eefb1750a93307a89d7a1741d86f8568c8 Signed-off-by: Jyothi Kumar Sambolu --- diff --git a/Tizen.System/Interop/Interop.Device.cs b/Tizen.System/Interop/Interop.Device.cs index 31c2ea3..69644b4 100644 --- a/Tizen.System/Interop/Interop.Device.cs +++ b/Tizen.System/Interop/Interop.Device.cs @@ -21,7 +21,7 @@ namespace Tizen.System FlashBrightness } } -internal static class Interop +internal static partial class Interop { internal static partial class Device { diff --git a/Tizen.System/Interop/Interop.Libraries.cs b/Tizen.System/Interop/Interop.Libraries.cs new file mode 100644 index 0000000..f4ceadc --- /dev/null +++ b/Tizen.System/Interop/Interop.Libraries.cs @@ -0,0 +1,22 @@ +/// 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. + + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +internal static partial class Interop +{ + internal static partial class Libraries + { + public const string RuntimeInfo = "libcapi-system-runtime-info.so.0"; + } +} diff --git a/Tizen.System/Interop/Interop.RuntimeInfo.cs b/Tizen.System/Interop/Interop.RuntimeInfo.cs new file mode 100644 index 0000000..73ee692 --- /dev/null +++ b/Tizen.System/Interop/Interop.RuntimeInfo.cs @@ -0,0 +1,97 @@ +/// 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. + + +using System; +using System.Runtime.InteropServices; +using Tizen.System; + +internal static partial class Interop +{ + internal static partial class RuntimeInfo + { + public delegate void RuntimeInformationChangedCallback(RuntimeInformationKey key, IntPtr userData); + + [StructLayout(LayoutKind.Sequential)] + public struct MemoryInfo + { + public readonly int Total; + public readonly int Used; + public readonly int Free; + public readonly int Cache; + public readonly int Swap; + } + + [StructLayout(LayoutKind.Sequential)] + public struct ProcessMemoryInfo + { + public readonly int Vsz; + public readonly int Rss; + public readonly int Pss; + public readonly int SharedClean; + public readonly int SharedDirty; + public readonly int PrivateClean; + public readonly int PrivateDirty; + } + + [StructLayout(LayoutKind.Sequential)] + public struct CpuUsage + { + public readonly double User; + public readonly double System; + public readonly double Nice; + public readonly double IoWait; + } + + [StructLayout(LayoutKind.Sequential)] + public struct ProcessCpuUsage + { + public readonly uint UTime; + public readonly uint STime; + } + + [DllImport(Libraries.RuntimeInfo, EntryPoint = "runtime_info_get_value_int")] + public static extern int GetValue(RuntimeInformationKey key, out int status); + + [DllImport(Libraries.RuntimeInfo, EntryPoint = "runtime_info_get_value_bool")] + public static extern int GetValue(RuntimeInformationKey key, out bool status); + + [DllImport(Libraries.RuntimeInfo, EntryPoint = "runtime_info_get_value_double")] + public static extern int GetValue(RuntimeInformationKey key, out double status); + + [DllImport(Libraries.RuntimeInfo, EntryPoint = "runtime_info_get_value_string")] + public static extern int GetValue(RuntimeInformationKey key, out string status); + + [DllImport(Libraries.RuntimeInfo, EntryPoint = "runtime_info_get_system_memory_info")] + public static extern int GetSystemMemoryInfo(out MemoryInfo memoryInfo); + + [DllImport(Libraries.RuntimeInfo, EntryPoint = "runtime_info_get_process_memory_info")] + public static extern int GetProcessMemoryInfo(int[] pid, int size, out ProcessMemoryInfo[] array); + + [DllImport(Libraries.RuntimeInfo, EntryPoint = "runtime_info_get_cpu_usage")] + public static extern int GetCpuUsage(out CpuUsage cpuUsage); + + [DllImport(Libraries.RuntimeInfo, EntryPoint = "runtime_info_get_process_cpu_usage")] + public static extern int GetProcessCpuUsage(int[] pid, int size, out ProcessCpuUsage[] array); + + [DllImport(Libraries.RuntimeInfo, EntryPoint = "runtime_info_get_processor_count")] + public static extern int GetProcessorCount(out int processorCount); + + [DllImport(Libraries.RuntimeInfo, EntryPoint = "runtime_info_get_processor_current_frequency")] + public static extern int GetProcessorCurrentFrequency(int coreId, out int cpuFreq); + + [DllImport(Libraries.RuntimeInfo, EntryPoint = "runtime_info_get_processor_max_frequency")] + public static extern int GetProcessorMaxFrequency(int coreId, out int cpuFreq); + + [DllImport(Libraries.RuntimeInfo, EntryPoint = "runtime_info_set_changed_cb")] + public static extern int SetRuntimeInfoChangedCallback(RuntimeInformationKey runtimeInfoKey, RuntimeInformationChangedCallback cb, IntPtr userData); + + [DllImport(Libraries.RuntimeInfo, EntryPoint = "runtime_info_unset_changed_cb")] + public static extern int UnsetRuntimeInfoChangedCallback(RuntimeInformationKey runtimeInfoKey); + } +} diff --git a/Tizen.System/RuntimeInfo/CpuUsage.cs b/Tizen.System/RuntimeInfo/CpuUsage.cs new file mode 100644 index 0000000..0775491 --- /dev/null +++ b/Tizen.System/RuntimeInfo/CpuUsage.cs @@ -0,0 +1,67 @@ +/// 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. + + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tizen.System +{ + /// + /// Structure for cpu usage. + /// + public class CpuUsage + { + internal CpuUsage(Interop.RuntimeInfo.CpuUsage usage) + { + IoWait = usage.IoWait; + Nice = usage.IoWait; + System = usage.System; + User = usage.User; + } + /// + /// Time running un-niced user processes (Percent) + /// + public double User { get; internal set; } + /// + /// Time running kernel processes (Percent) + /// + public double System { get; internal set; } + /// + /// Time running niced user processes (Percent) + /// + public double Nice { get; internal set; } + /// + /// Time waiting for I/O completion (Percent) + /// + public double IoWait { get; internal set; } + } + + /// + /// Structure for cpu usage per processes + /// + public class ProcessCpuUsage + { + internal ProcessCpuUsage(Interop.RuntimeInfo.ProcessCpuUsage usage) + { + UTime = usage.UTime; + STime = usage.STime; + } + /// + /// Amount of time that this process has been scheduled in user mode (clock ticks) + /// + public uint UTime { get; internal set; } + /// + /// Amount of time that this process has been scheduled in kernel mode (clock ticks) + /// + public uint STime { get; internal set; } + } +} diff --git a/Tizen.System/RuntimeInfo/Enumerations.cs b/Tizen.System/RuntimeInfo/Enumerations.cs new file mode 100644 index 0000000..d1f0702 --- /dev/null +++ b/Tizen.System/RuntimeInfo/Enumerations.cs @@ -0,0 +1,148 @@ +/// 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. + + +using System; + +namespace Tizen.System +{ + /// + /// Enumeration for keys for runtime information + /// + public enum RuntimeInformationKey + { + /// + /// Indicates whether Bluetooth is enabled. + /// + Bluetooth = 2, + /// + /// Indicates whether Wi-Fi hotspot is enabled. + /// + /// + WifiHotspot = 3, + /// + /// Indicates whether Bluetooth tethering is enabled. + /// + BluetoothTethering = 4, + /// + /// Indicates whether USB tethering is enabled. + /// + UsbTethering = 5, + /// + /// Indicates whether the location service is allowed to use location data from GPS satellites. + /// + LocationService = 6, + /// + /// Indicates whether the location service is allowed to use location data from cellular and Wi-Fi. + /// + LocationNetworkPosition = 8, + /// + /// Indicates Whether the packet data through 3G network is enabled. + /// + PacketData = 9, + /// + /// Indicates whether data roaming is enabled. + /// + DataRoaming = 10, + /// + /// Indicates whether vibration is enabled. + /// + Vibration = 12, + /// + /// Indicates whether audio jack is connected. + /// + AudioJack = 17, + /// + /// Indicates the current status of GPS. + /// + /// + Gps = 18, + /// + /// Indicates the battery is currently charging. + /// + BatteryIsCharging = 19, + /// + /// Indicates whether TV out is connected. + /// + TvOut = 20, + /// + /// Indicates the change in audio jack connector type. + /// + /// + AudioJackConnector = 21, + /// + /// Indicates whether USB is connected. + /// + Usb = 23, + /// + /// Indicates whether charger is connected. + /// + Charger = 24, + /// + /// Indicates whether auto rotation is enabled. + /// + AutoRotation = 26 + } + + /// + /// Enumeration for Wi-Fi status + /// + public enum WifiStatus + { + /// + /// Wi-Fi is disabled. + /// + Disabled, + /// + /// Wi-Fi is enabled and network connection is not established. + /// + Unconnected, + /// + /// Network connection is established in Wi-Fi network. + /// + Connected + } + + /// + /// Enumeration for GPS status. + /// + public enum GpsStatus + { + /// + /// GPS is disabled. + /// + Disabled, + /// + /// GPS is searching for satellites. + /// + Searching, + /// + /// GPS connection is established. + /// + Connected + } + + /// + /// Enumeration for type of audio jack connected. + /// + public enum AudioJackConnectionType + { + /// + /// Audio jack is not connected + /// + Unconnected, + /// + /// 3-conductor wire is connected. + /// + ThreeWireConnected, + /// + /// 4-conductor wire is connected. + /// + FourWireConnected + } +} diff --git a/Tizen.System/RuntimeInfo/MemoryInformation.cs b/Tizen.System/RuntimeInfo/MemoryInformation.cs new file mode 100644 index 0000000..3554700 --- /dev/null +++ b/Tizen.System/RuntimeInfo/MemoryInformation.cs @@ -0,0 +1,97 @@ +/// 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. + + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tizen.System +{ + /// + /// Memory information. + /// + public class SystemMemoryInformation + { + internal SystemMemoryInformation(Interop.RuntimeInfo.MemoryInfo info) + { + Total = info.Total; + Used = info.Used; + Cache = info.Cache; + Free = info.Free; + Swap = info.Swap; + } + /// + /// Total memory (KiB) + /// + public int Total { get; internal set; } + /// + /// Used memory (KiB) + /// + public int Used { get; internal set; } + /// + /// Free memory (KiB) + /// + public int Free { get; internal set; } + /// + /// Cache memory (KiB) + /// + public int Cache { get; internal set; } + /// + /// Swap memory (KiB) + /// + public int Swap { get; internal set; } + } + + /// + /// Memory information per processes + /// + public class ProcessMemoryInformation + { + internal ProcessMemoryInformation(Interop.RuntimeInfo.ProcessMemoryInfo info) + { + PrivateClean = info.PrivateClean; + PrivateDirty = info.PrivateDirty; + Pss = info.Pss; + Rss = info.Rss; + SharedClean = info.SharedClean; + SharedDirty = info.SharedDirty; + Vsz = info.Vsz; + } + /// + /// Virtual memory size (KiB) + /// + public int Vsz { get; internal set; } + /// + /// Resident set size (KiB) + /// + public int Rss { get; internal set; } + /// + /// Proportional set size (KiB) + /// + public int Pss { get; internal set; } + /// + /// Not modified and mapped by other processes (KiB) + /// + public int SharedClean { get; internal set; } + /// + /// Modified and mapped by other processes (KiB) + /// + public int SharedDirty { get; internal set; } + /// + /// Not modified and available only to that process (KiB) + /// + public int PrivateClean { get; internal set; } + /// + /// Modified and available only to that process (KiB) + /// + public int PrivateDirty { get; internal set; } + } +} diff --git a/Tizen.System/RuntimeInfo/RuntimeInfoErrorFactory.cs b/Tizen.System/RuntimeInfo/RuntimeInfoErrorFactory.cs new file mode 100755 index 0000000..860e876 --- /dev/null +++ b/Tizen.System/RuntimeInfo/RuntimeInfoErrorFactory.cs @@ -0,0 +1,55 @@ +using System; +using Tizen.Internals.Errors; + +namespace Tizen.System +{ + internal enum RuntimeInfoError + { + None = ErrorCode.None, + InvalidParameter = ErrorCode.InvalidParameter, + OutOfMemory = ErrorCode.OutOfMemory, + Io = ErrorCode.IoError, + RemoteIo = ErrorCode.RemoteIo, + InvalidOperation = ErrorCode.InvalidOperation, + PermissionDenied = ErrorCode.PermissionDenied, + NotSupported = ErrorCode.NotSupported + } + + internal static class RuntimeInfoErrorFactory + { + internal const string LogTag = "Tizen.System.RuntimeInformation"; + + internal static void ThrowException(int err) + { + RuntimeInfoError error = (RuntimeInfoError)err; + if (error == RuntimeInfoError.OutOfMemory) + { + throw new InvalidOperationException("Out of memory"); + } + else if (error == RuntimeInfoError.InvalidParameter) + { + throw new ArgumentException("Invalid parameter"); + } + else if (error == RuntimeInfoError.Io) + { + throw new ArgumentException("I/O Error"); + } + else if (error == RuntimeInfoError.RemoteIo) + { + throw new ArgumentException("Remote I/O Error"); + } + else if (error == RuntimeInfoError.InvalidOperation) + { + throw new ArgumentException("Invalid operation"); + } + else if (error == RuntimeInfoError.PermissionDenied) + { + throw new ArgumentException("Permission denied"); + } + else if (error == RuntimeInfoError.NotSupported) + { + throw new ArgumentException("Not supported"); + } + } + } +} diff --git a/Tizen.System/RuntimeInfo/RuntimeInformation.cs b/Tizen.System/RuntimeInfo/RuntimeInformation.cs new file mode 100644 index 0000000..4e83868 --- /dev/null +++ b/Tizen.System/RuntimeInfo/RuntimeInformation.cs @@ -0,0 +1,905 @@ +/// 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. + + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tizen.System +{ + /// + /// The RuntimeInformation provides functions to obtain runtime information of various system preferences. + /// + public static class RuntimeInformation + { + private static event EventHandler s_bluetoothEnabled; + private static event EventHandler s_wifiHotspotEnabled; + private static event EventHandler s_bluetoothTetheringEnabled; + private static event EventHandler s_usbTetheringEnabled; + private static event EventHandler s_locationServiceEnabled; + private static event EventHandler s_locationNetworkPositionEnabled; + private static event EventHandler s_packetDataEnabled; + private static event EventHandler s_dataRoamingEnabled; + private static event EventHandler s_vibrationEnabled; + private static event EventHandler s_audioJackConnected; + private static event EventHandler s_gpsStatusChanged; + private static event EventHandler s_batteryIsCharging; + private static event EventHandler s_tvOutConnected; + private static event EventHandler s_audioJackConnectorChanged; + private static event EventHandler s_usbConnected; + private static event EventHandler s_chargerConnected; + private static event EventHandler s_autoRotationEnabled; + + private static readonly Interop.RuntimeInfo.RuntimeInformationChangedCallback s_runtimeInfoChangedCallback = (RuntimeInformationKey key, IntPtr userData) => + { + RuntimeKeyStatusChangedEventArgs eventArgs = new RuntimeKeyStatusChangedEventArgs() + { + Key = key + }; + switch (key) + { + case RuntimeInformationKey.Bluetooth: + { + s_bluetoothEnabled?.Invoke(null, eventArgs); + break; + }; + case RuntimeInformationKey.WifiHotspot: + { + s_wifiHotspotEnabled?.Invoke(null, eventArgs); + break; + }; + case RuntimeInformationKey.BluetoothTethering: + { + s_bluetoothTetheringEnabled?.Invoke(null, eventArgs); + break; + }; + case RuntimeInformationKey.UsbTethering: + { + s_usbTetheringEnabled?.Invoke(null, eventArgs); + break; + }; + case RuntimeInformationKey.LocationService: + { + s_locationServiceEnabled?.Invoke(null, eventArgs); + break; + }; + case RuntimeInformationKey.LocationNetworkPosition: + { + s_locationNetworkPositionEnabled?.Invoke(null, eventArgs); + break; + }; + case RuntimeInformationKey.PacketData: + { + s_packetDataEnabled?.Invoke(null, eventArgs); + break; + }; + case RuntimeInformationKey.DataRoaming: + { + s_dataRoamingEnabled?.Invoke(null, eventArgs); + break; + }; + case RuntimeInformationKey.Vibration: + { + s_vibrationEnabled?.Invoke(null, eventArgs); + break; + }; + case RuntimeInformationKey.AudioJack: + { + s_audioJackConnected?.Invoke(null, eventArgs); + break; + }; + case RuntimeInformationKey.Gps: + { + s_gpsStatusChanged?.Invoke(null, eventArgs); + break; + }; + case RuntimeInformationKey.BatteryIsCharging: + { + s_batteryIsCharging?.Invoke(null, eventArgs); + break; + }; + case RuntimeInformationKey.TvOut: + { + s_tvOutConnected?.Invoke(null, eventArgs); + break; + }; + case RuntimeInformationKey.AudioJackConnector: + { + s_audioJackConnectorChanged?.Invoke(null, eventArgs); + break; + }; + case RuntimeInformationKey.Usb: + { + s_usbConnected?.Invoke(null, eventArgs); + break; + }; + case RuntimeInformationKey.Charger: + { + s_chargerConnected?.Invoke(null, eventArgs); + break; + }; + case RuntimeInformationKey.AutoRotation: + { + s_autoRotationEnabled?.Invoke(null, eventArgs); + break; + }; + default: + break; + }; + }; + + internal static readonly Dictionary s_keyDataTypeMapping = new Dictionary + { + [RuntimeInformationKey.Bluetooth] = typeof(bool), + [RuntimeInformationKey.WifiHotspot] = typeof(bool), + [RuntimeInformationKey.BluetoothTethering] = typeof(bool), + [RuntimeInformationKey.UsbTethering] = typeof(bool), + [RuntimeInformationKey.LocationService] = typeof(bool), + [RuntimeInformationKey.LocationNetworkPosition] = typeof(bool), + [RuntimeInformationKey.PacketData] = typeof(bool), + [RuntimeInformationKey.DataRoaming] = typeof(bool), + [RuntimeInformationKey.Vibration] = typeof(bool), + [RuntimeInformationKey.AudioJack] = typeof(bool), + [RuntimeInformationKey.BatteryIsCharging] = typeof(bool), + [RuntimeInformationKey.TvOut] = typeof(bool), + [RuntimeInformationKey.Usb] = typeof(bool), + [RuntimeInformationKey.Charger] = typeof(bool), + [RuntimeInformationKey.AutoRotation] = typeof(bool), + [RuntimeInformationKey.Gps] = typeof(int), + [RuntimeInformationKey.AudioJackConnector] = typeof(int) + }; + + /// + /// This function gets current state of the given key which represents specific runtime information + /// + /// The runtime information key for which the current should be read + /// The current status of the given key + internal static object GetStatus(RuntimeInformationKey key) + { + if (s_keyDataTypeMapping[key] == typeof(int)) + { + int status; + int ret = Interop.RuntimeInfo.GetValue(key, out status); + if (ret != (int)RuntimeInfoError.None) + { + Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to get value for key {0}", key.ToString()); + RuntimeInfoErrorFactory.ThrowException(ret); + } + + return status; + } + else + { + bool status; + int ret = Interop.RuntimeInfo.GetValue(key, out status); + if (ret != (int)RuntimeInfoError.None) + { + Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to get value for key {0}", key.ToString()); + RuntimeInfoErrorFactory.ThrowException(ret); + } + + return status; + } + } + + /// + /// Validates the data type of the status represented by Runtime Key. + /// Note that this is a generic method. + /// + /// The generic type to validate. + /// The runtime information key for which the status type is validated + /// true if the data type matches. + public static bool Is(RuntimeInformationKey key) + { + if (!s_keyDataTypeMapping.ContainsKey(key)) + { + Log.Error(RuntimeInfoErrorFactory.LogTag, "Invalid data type"); + throw new ArgumentException("Invalid parameter"); + } + + return s_keyDataTypeMapping[key] == typeof(T); + } + + /// + /// Gets the status of Runtime Key. + /// Note that this is a generic method. + /// + /// The generic type to return. + /// The runtime information key for which the current should be read + /// The current status of the given key. + public static T GetStatus(RuntimeInformationKey key) + { + return (T)GetStatus(key); + } + + /// + /// The System memory information + /// + public static SystemMemoryInformation GetSystemMemoryInformation() + { + Interop.RuntimeInfo.MemoryInfo info = new Interop.RuntimeInfo.MemoryInfo(); + int ret = Interop.RuntimeInfo.GetSystemMemoryInfo(out info); + if (ret != (int)RuntimeInfoError.None) + { + Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to get System memory information"); + RuntimeInfoErrorFactory.ThrowException(ret); + } + + return new SystemMemoryInformation(info); + } + + /// + /// Gets memory information per processes + /// + /// List of unique process ids + /// List of memory information per processes + public static IDictionary GetProcessMemoryInformation(IEnumerable pid) + { + int[] processArray = pid.ToArray(); + Interop.RuntimeInfo.ProcessMemoryInfo[] processMemoryArray = new Interop.RuntimeInfo.ProcessMemoryInfo[pid.Count()]; + Dictionary map = new Dictionary(); + int ret = Interop.RuntimeInfo.GetProcessMemoryInfo(processArray, pid.Count(), out processMemoryArray); + if (ret != (int)RuntimeInfoError.None) + { + Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to get Process memory information"); + RuntimeInfoErrorFactory.ThrowException(ret); + } + + int idx = 0; + foreach (Interop.RuntimeInfo.ProcessMemoryInfo cur in processMemoryArray) + { + ProcessMemoryInformation processMemory = new ProcessMemoryInformation(cur); + map.Add(processArray[idx], processMemory); + idx++; + } + + return map; + } + + /// + /// The CPU runtime + /// + public static CpuUsage GetCpuUsage() + { + Interop.RuntimeInfo.CpuUsage usage = new Interop.RuntimeInfo.CpuUsage(); + int ret = Interop.RuntimeInfo.GetCpuUsage(out usage); + if (ret != (int)RuntimeInfoError.None) + { + Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to get cpu usage"); + RuntimeInfoErrorFactory.ThrowException(ret); + } + return new CpuUsage(usage); + } + + /// + /// The CPU run time per process + /// + /// List of unique process ids + /// List of CPU usage information per processes + public static IDictionary GetProcessCpuUsage(IEnumerable pid) + { + int[] processArray = pid.ToArray(); + Interop.RuntimeInfo.ProcessCpuUsage[] processCpuUsageArray = new Interop.RuntimeInfo.ProcessCpuUsage[pid.Count()]; + Dictionary map = new Dictionary(); + int ret = Interop.RuntimeInfo.GetProcessCpuUsage(processArray, pid.Count(), out processCpuUsageArray); + if (ret != (int)RuntimeInfoError.None) + { + Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to get Process cpu usage"); + RuntimeInfoErrorFactory.ThrowException(ret); + } + + int idx = 0; + foreach (Interop.RuntimeInfo.ProcessCpuUsage cur in processCpuUsageArray) + { + ProcessCpuUsage processUsage = new ProcessCpuUsage(cur); + map.Add(processArray[idx], processUsage); + idx++; + } + + return map; + } + + /// + /// The number of processors + /// + public static int ProcessorCount + { + get + { + int count; + int ret = Interop.RuntimeInfo.GetProcessorCount(out count); + if (ret != (int)RuntimeInfoError.None) + { + Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to get Processor count"); + RuntimeInfoErrorFactory.ThrowException(ret); + } + + return count; + } + } + + /// + /// Gets the current frequency of processor + /// + /// The index (from 0) of CPU core that you want to know the frequency + /// The current frequency(MHz) of processor + public static int GetProcessorCurrentFrequency(int coreId) + { + int frequency; + int ret = Interop.RuntimeInfo.GetProcessorCurrentFrequency(coreId, out frequency); + if (ret != (int)RuntimeInfoError.None) + { + Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to get Processor current frequency"); + RuntimeInfoErrorFactory.ThrowException(ret); + } + return frequency; + } + + /// + /// Gets the max frequency of processor + /// + /// The index (from 0) of CPU core that you want to know the frequency + /// The max frequency(MHz) of processor + public static int GetProcessorMaxFrequency(int coreId) + { + int frequency; + int ret = Interop.RuntimeInfo.GetProcessorMaxFrequency(coreId, out frequency); + if (ret != (int)RuntimeInfoError.None) + { + Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to get Processor max frequency"); + RuntimeInfoErrorFactory.ThrowException(ret); + } + return frequency; + } + + /// + /// (event) BluetoothEnabled is rasied when system preference for bluetooth is changed. + /// + public static event EventHandler BluetoothEnabled + { + add + { + if (s_bluetoothEnabled == null) + { + int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(RuntimeInformationKey.Bluetooth, s_runtimeInfoChangedCallback, IntPtr.Zero); + if (ret != (int)RuntimeInfoError.None) + { + Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); + RuntimeInfoErrorFactory.ThrowException(ret); + } + } + s_bluetoothEnabled += value; + } + remove + { + s_bluetoothEnabled -= value; + if (s_bluetoothEnabled == null) + { + int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(RuntimeInformationKey.Bluetooth); + if (ret != (int)RuntimeInfoError.None) + { + Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); + RuntimeInfoErrorFactory.ThrowException(ret); + } + } + } + } + /// + /// (event) WifiHotspotEnabled is rasied when system preference for Wi-Fi is changed. + /// + public static event EventHandler WifiHotspotEnabled + { + add + { + if (s_wifiHotspotEnabled == null) + { + int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(RuntimeInformationKey.WifiHotspot, s_runtimeInfoChangedCallback, IntPtr.Zero); + if (ret != (int)RuntimeInfoError.None) + { + Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); + RuntimeInfoErrorFactory.ThrowException(ret); + } + } + s_wifiHotspotEnabled += value; + } + remove + { + s_wifiHotspotEnabled -= value; + if (s_wifiHotspotEnabled == null) + { + int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(RuntimeInformationKey.WifiHotspot); + if (ret != (int)RuntimeInfoError.None) + { + Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); + RuntimeInfoErrorFactory.ThrowException(ret); + } + } + } + } + /// + /// (event) BluetoothTetheringEnabled is rasied when system preference for bluetooth tethering is changed. + /// + public static event EventHandler BluetoothTetheringEnabled + { + add + { + if (s_bluetoothTetheringEnabled == null) + { + int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(RuntimeInformationKey.BluetoothTethering, s_runtimeInfoChangedCallback, IntPtr.Zero); + if (ret != (int)RuntimeInfoError.None) + { + Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); + RuntimeInfoErrorFactory.ThrowException(ret); + } + } + s_bluetoothTetheringEnabled += value; + } + remove + { + s_bluetoothTetheringEnabled -= value; + if (s_bluetoothTetheringEnabled == null) + { + int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(RuntimeInformationKey.BluetoothTethering); + if (ret != (int)RuntimeInfoError.None) + { + Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); + RuntimeInfoErrorFactory.ThrowException(ret); + } + } + } + } + /// + /// (event) UsbTetheringEnabled is rasied when system preference for USB terhering is changed. + /// + public static event EventHandler UsbTetheringEnabled + { + add + { + if (s_usbTetheringEnabled == null) + { + int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(RuntimeInformationKey.UsbTethering, s_runtimeInfoChangedCallback, IntPtr.Zero); + if (ret != (int)RuntimeInfoError.None) + { + Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); + RuntimeInfoErrorFactory.ThrowException(ret); + } + } + s_usbTetheringEnabled += value; + } + remove + { + s_usbTetheringEnabled -= value; + if (s_usbTetheringEnabled == null) + { + int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(RuntimeInformationKey.UsbTethering); + if (ret != (int)RuntimeInfoError.None) + { + Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); + RuntimeInfoErrorFactory.ThrowException(ret); + } + } + } + } + /// + /// (event) LocationServiceEnabled is rasied when system preference for location service is changed. + /// + public static event EventHandler LocationServiceEnabled + { + add + { + if (s_locationServiceEnabled == null) + { + int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(RuntimeInformationKey.LocationService, s_runtimeInfoChangedCallback, IntPtr.Zero); + if (ret != (int)RuntimeInfoError.None) + { + Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); + RuntimeInfoErrorFactory.ThrowException(ret); + } + } + s_locationServiceEnabled += value; + } + remove + { + s_locationServiceEnabled -= value; + if (s_locationServiceEnabled == null) + { + int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(RuntimeInformationKey.LocationService); + RuntimeInfoErrorFactory.ThrowException(ret); + } + } + } + /// + /// (event) LocationNetworkPositionEnabled is rasied when system preference for allowing location service to use location data from cellular and Wi-Fi is changed. + /// + public static event EventHandler LocationNetworkPositionEnabled + { + add + { + if (s_locationNetworkPositionEnabled == null) + { + int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(RuntimeInformationKey.LocationNetworkPosition, s_runtimeInfoChangedCallback, IntPtr.Zero); + if (ret != (int)RuntimeInfoError.None) + { + Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); + RuntimeInfoErrorFactory.ThrowException(ret); + } + } + s_locationNetworkPositionEnabled += value; + } + remove + { + s_locationNetworkPositionEnabled -= value; + if (s_locationNetworkPositionEnabled == null) + { + int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(RuntimeInformationKey.LocationNetworkPosition); + if (ret != (int)RuntimeInfoError.None) + { + Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); + RuntimeInfoErrorFactory.ThrowException(ret); + } + } + } + } + /// + /// (event) PacketDataEnabled is rasied when system preference for package data through 3G network is changed. + /// + public static event EventHandler PacketDataEnabled + { + add + { + if (s_packetDataEnabled == null) + { + int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(RuntimeInformationKey.PacketData, s_runtimeInfoChangedCallback, IntPtr.Zero); + if (ret != (int)RuntimeInfoError.None) + { + Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); + RuntimeInfoErrorFactory.ThrowException(ret); + } + } + s_packetDataEnabled += value; + } + remove + { + s_packetDataEnabled -= value; + if (s_packetDataEnabled == null) + { + int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(RuntimeInformationKey.PacketData); + if (ret != (int)RuntimeInfoError.None) + { + Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); + RuntimeInfoErrorFactory.ThrowException(ret); + } + } + } + } + /// + /// (event) DataRoamingEnabled is rasied when system preference for data roaming is changed. + + /// + public static event EventHandler DataRoamingEnabled + { + add + { + if (s_dataRoamingEnabled == null) + { + int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(RuntimeInformationKey.DataRoaming, s_runtimeInfoChangedCallback, IntPtr.Zero); + if (ret != (int)RuntimeInfoError.None) + { + Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); + RuntimeInfoErrorFactory.ThrowException(ret); + } + } + s_dataRoamingEnabled += value; + } + remove + { + s_dataRoamingEnabled -= value; + if (s_dataRoamingEnabled == null) + { + int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(RuntimeInformationKey.DataRoaming); + if (ret != (int)RuntimeInfoError.None) + { + Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); + RuntimeInfoErrorFactory.ThrowException(ret); + } + } + } + } + /// + /// (event) VibrationEnabled is rasied when system preference for vibration is changed. + /// + public static event EventHandler VibrationEnabled + { + add + { + if (s_vibrationEnabled == null) + { + int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(RuntimeInformationKey.Vibration, s_runtimeInfoChangedCallback, IntPtr.Zero); + if (ret != (int)RuntimeInfoError.None) + { + Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); + RuntimeInfoErrorFactory.ThrowException(ret); + } + } + s_vibrationEnabled += value; + } + remove + { + s_vibrationEnabled -= value; + if (s_vibrationEnabled == null) + { + int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(RuntimeInformationKey.Vibration); + if (ret != (int)RuntimeInfoError.None) + { + Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); + RuntimeInfoErrorFactory.ThrowException(ret); + } + } + } + } + /// + /// (event) AudioJackConnected is rasied when audio jack is connected/disconnected. + /// + public static event EventHandler AudioJackConnected + { + add + { + if (s_audioJackConnected == null) + { + int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(RuntimeInformationKey.AudioJack, s_runtimeInfoChangedCallback, IntPtr.Zero); + if (ret != (int)RuntimeInfoError.None) + { + Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); + RuntimeInfoErrorFactory.ThrowException(ret); + } + } + s_audioJackConnected += value; + } + remove + { + s_audioJackConnected -= value; + if (s_audioJackConnected == null) + { + int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(RuntimeInformationKey.AudioJack); + if (ret != (int)RuntimeInfoError.None) + { + Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); + RuntimeInfoErrorFactory.ThrowException(ret); + } + } + } + } + /// + /// (event) GpsStatusChanged is rasied when status of GPS is changed. + /// + public static event EventHandler GpsStatusChanged + { + add + { + if (s_gpsStatusChanged == null) + { + int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(RuntimeInformationKey.Gps, s_runtimeInfoChangedCallback, IntPtr.Zero); + if (ret != (int)RuntimeInfoError.None) + { + Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); + RuntimeInfoErrorFactory.ThrowException(ret); + } + } + s_gpsStatusChanged += value; + } + remove + { + s_gpsStatusChanged -= value; + if (s_gpsStatusChanged == null) + { + int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(RuntimeInformationKey.Gps); + if (ret != (int)RuntimeInfoError.None) + { + Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); + RuntimeInfoErrorFactory.ThrowException(ret); + } + } + } + } + /// + /// (event) BatteryIsCharging is rasied battery is currently charging. + /// + public static event EventHandler BatteryIsCharging + { + add + { + if (s_batteryIsCharging == null) + { + int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(RuntimeInformationKey.BatteryIsCharging, s_runtimeInfoChangedCallback, IntPtr.Zero); + if (ret != (int)RuntimeInfoError.None) + { + Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); + RuntimeInfoErrorFactory.ThrowException(ret); + } + } + s_batteryIsCharging += value; + } + remove + { + s_batteryIsCharging -= value; + if (s_batteryIsCharging == null) + { + int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(RuntimeInformationKey.BatteryIsCharging); + if (ret != (int)RuntimeInfoError.None) + { + Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); + RuntimeInfoErrorFactory.ThrowException(ret); + } + } + } + } + /// + /// (event) TvOutConnected is rasied when TV out is connected/disconnected. + /// + public static event EventHandler TvOutConnected + { + add + { + if (s_tvOutConnected == null) + { + int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(RuntimeInformationKey.TvOut, s_runtimeInfoChangedCallback, IntPtr.Zero); + if (ret != (int)RuntimeInfoError.None) + { + Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); + RuntimeInfoErrorFactory.ThrowException(ret); + } + } + s_tvOutConnected += value; + } + remove + { + s_tvOutConnected -= value; + if (s_tvOutConnected == null) + { + int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(RuntimeInformationKey.TvOut); + if (ret != (int)RuntimeInfoError.None) + { + Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); + RuntimeInfoErrorFactory.ThrowException(ret); + } + } + } + } + /// + /// (event) AudioJackConnectorChanged is rasied when audio jack connection changes. + /// + public static event EventHandler AudioJackConnectorChanged + { + add + { + if (s_audioJackConnectorChanged == null) + { + int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(RuntimeInformationKey.AudioJackConnector, s_runtimeInfoChangedCallback, IntPtr.Zero); + if (ret != (int)RuntimeInfoError.None) + { + Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); + RuntimeInfoErrorFactory.ThrowException(ret); + } + } + s_audioJackConnectorChanged += value; + } + remove + { + s_audioJackConnectorChanged -= value; + if (s_audioJackConnectorChanged == null) + { + int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(RuntimeInformationKey.AudioJackConnector); + if (ret != (int)RuntimeInfoError.None) + { + Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); + RuntimeInfoErrorFactory.ThrowException(ret); + } + } + } + } + /// + /// (event) UsbConnected is rasied when USB is connected/disconnected. + /// + public static event EventHandler UsbConnected + { + add + { + if (s_usbConnected == null) + { + int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(RuntimeInformationKey.Usb, s_runtimeInfoChangedCallback, IntPtr.Zero); + if (ret != (int)RuntimeInfoError.None) + { + Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); + RuntimeInfoErrorFactory.ThrowException(ret); + } + } + s_usbConnected += value; + } + remove + { + s_usbConnected -= value; + if (s_usbConnected == null) + { + int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(RuntimeInformationKey.Usb); + if (ret != (int)RuntimeInfoError.None) + { + Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); + RuntimeInfoErrorFactory.ThrowException(ret); + } + } + } + } + /// + /// (event) ChargerConnected is rasied when charger is connected/disconnected. + /// + public static event EventHandler ChargerConnected + { + add + { + if (s_chargerConnected == null) + { + int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(RuntimeInformationKey.Charger, s_runtimeInfoChangedCallback, IntPtr.Zero); + if (ret != (int)RuntimeInfoError.None) + { + Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); + RuntimeInfoErrorFactory.ThrowException(ret); + } + } + s_chargerConnected += value; + } + remove + { + s_chargerConnected -= value; + if (s_chargerConnected == null) + { + int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(RuntimeInformationKey.Charger); + if (ret != (int)RuntimeInfoError.None) + { + Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); + RuntimeInfoErrorFactory.ThrowException(ret); + } + } + } + } + /// + /// (event) AutoRotationEnabled is rasied when system preference for auto rotaion is changed. + /// + public static event EventHandler AutoRotationEnabled + { + add + { + if (s_autoRotationEnabled == null) + { + int ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(RuntimeInformationKey.AutoRotation, s_runtimeInfoChangedCallback, IntPtr.Zero); + if (ret != (int)RuntimeInfoError.None) + { + Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); + RuntimeInfoErrorFactory.ThrowException(ret); + } + } + s_autoRotationEnabled += value; + } + remove + { + s_autoRotationEnabled -= value; + if (s_autoRotationEnabled == null) + { + int ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(RuntimeInformationKey.AutoRotation); + if (ret != (int)RuntimeInfoError.None) + { + Log.Error(RuntimeInfoErrorFactory.LogTag, "Interop failed to add event handler"); + RuntimeInfoErrorFactory.ThrowException(ret); + } + } + } + } + } +} diff --git a/Tizen.System/RuntimeInfo/RuntimeKeyStatusChangedEventArgs.cs b/Tizen.System/RuntimeInfo/RuntimeKeyStatusChangedEventArgs.cs new file mode 100755 index 0000000..f567252 --- /dev/null +++ b/Tizen.System/RuntimeInfo/RuntimeKeyStatusChangedEventArgs.cs @@ -0,0 +1,28 @@ +/// 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. + + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tizen.System +{ + /// + /// RuntimeInfoChangedEventArgs is an extended EventArgs class. This class contains event arguments for runtime event listeners + /// + public class RuntimeKeyStatusChangedEventArgs : EventArgs + { + /// + /// The key indicating the runtime system preference which was changed. + /// + public RuntimeInformationKey Key { get; internal set; } + } +} diff --git a/Tizen.System/Tizen.System.csproj b/Tizen.System/Tizen.System.csproj index 6c61840..2e6a0d7 100644 --- a/Tizen.System/Tizen.System.csproj +++ b/Tizen.System/Tizen.System.csproj @@ -1,5 +1,5 @@  - + Debug @@ -12,6 +12,8 @@ v4.0 512 + 8.0.30703 + 2.0 true @@ -21,8 +23,6 @@ DEBUG;TRACE prompt 4 - - pdbonly @@ -47,12 +47,12 @@ - - ..\..\tizen\Tizen\bin\Debug\Tizen.dll - ..\..\tizen\Tizen.Internals\bin\Debug\Tizen.Internals.dll + + ..\..\tizen\Tizen\bin\Debug\Tizen.dll + @@ -64,7 +64,15 @@ + + + + + + + + diff --git a/packaging/csapi-tizen.system.spec b/packaging/csapi-tizen.system.spec index c7cb90c..4b05ac1 100755 --- a/packaging/csapi-tizen.system.spec +++ b/packaging/csapi-tizen.system.spec @@ -22,15 +22,17 @@ Requires(postun): mono-core # P/Invoke Dependencies BuildRequires: pkgconfig(capi-system-device) +BuildRequires: pkgconfig(capi-system-runtime-info) # P/Invoke Runtime Dependencies # TODO: It should be removed after fix tizen-rpm-config Requires: capi-system-device +Requires: capi-system-runtime-info # DLL Dependencies #BuildRequires: ... %description -Tizen System Device API for C# +Tizen System API for C# %package devel Summary: Development package for %{name} @@ -56,7 +58,15 @@ mcs -target:library -out:%{dllname} -keyfile:Tizen.System/Tizen.System.snk \ Tizen.System/Device/Haptic.cs \ Tizen.System/Device/Led.cs \ Tizen.System/Device/Power.cs \ - Tizen.System/Interop/Interop.Device.cs + Tizen.System/Interop/Interop.Device.cs \ + Tizen.System/Interop/Interop.Libraries.cs \ + Tizen.System/Interop/Interop.RuntimeInfo.cs \ + Tizen.System/RuntimeInfo/CpuUsage.cs \ + Tizen.System/RuntimeInfo/Enumerations.cs \ + Tizen.System/RuntimeInfo/MemoryInformation.cs \ + Tizen.System/RuntimeInfo/RuntimeInfoErrorFactory.cs \ + Tizen.System/RuntimeInfo/RuntimeInformation.cs \ + Tizen.System/RuntimeInfo/RuntimeKeyStatusChangedEventArgs.cs # check p/invoke if [ -x %{dllname} ]; then