ApplicationManager : Fix some parameter type
authorsung-su.kim <sung-su.kim@samsung.com>
Wed, 20 Apr 2016 02:41:38 +0000 (11:41 +0900)
committersung-su.kim <sung-su.kim@samsung.com>
Wed, 20 Apr 2016 02:50:57 +0000 (11:50 +0900)
Change-Id: Ibde94ef78f4b9a58767a973a4b5b48473d406153

Tizen.Applications/Interop/Interop.ApplicationManager.cs
Tizen.Applications/Tizen.Applications/ApplicationInfo.cs
Tizen.Applications/Tizen.Applications/ApplicationInfoFilter.cs
Tizen.Applications/Tizen.Applications/ApplicationLaunchedEventArgs.cs

index 31c4ee6..5bfc658 100755 (executable)
@@ -114,7 +114,7 @@ internal static partial class Interop
         //int app_context_destroy(app_context_h app_context)
 
         [DllImport(Libraries.AppManager, EntryPoint = "app_context_get_package")]
-        internal static extern ErrorCode AppContextGetPackage(IntPtr handle, out IntPtr package);
+        internal static extern ErrorCode AppContextGetPackage(IntPtr handle, out string package);
         //int app_context_get_package (app_context_h app_context, char **package);
 
         [DllImport(Libraries.AppManager, EntryPoint = "app_context_get_app_id")]
@@ -146,31 +146,31 @@ internal static partial class Interop
         //int app_info_destroy (app_info_h app_info);
 
         [DllImport(Libraries.AppManager, EntryPoint = "app_info_get_app_id")]
-        internal static extern ErrorCode AppInfoGetAppId(IntPtr handle, out IntPtr applicationId);
+        internal static extern ErrorCode AppInfoGetAppId(IntPtr handle, out string applicationId);
         //int app_info_get_app_id (app_info_h app_info, char **app_id);
 
         [DllImport(Libraries.AppManager, EntryPoint = "app_info_get_exec")]
-        internal static extern ErrorCode AppInfoGetExec(IntPtr handle, out IntPtr exec);
+        internal static extern ErrorCode AppInfoGetExec(IntPtr handle, out string exec);
         //int app_info_get_exec (app_info_h app_info, char **exec);
 
         [DllImport(Libraries.AppManager, EntryPoint = "app_info_get_label")]
-        internal static extern ErrorCode AppInfoGetLabel(IntPtr handle, out IntPtr label);
+        internal static extern ErrorCode AppInfoGetLabel(IntPtr handle, out string label);
         //int app_info_get_label (app_info_h app_info, char **label);
 
         [DllImport(Libraries.AppManager, EntryPoint = "app_info_get_localed_label")]
-        internal static extern ErrorCode AppInfoGetLocaledLabel(string applicationId, string locale, out IntPtr label);
+        internal static extern ErrorCode AppInfoGetLocaledLabel(string applicationId, string locale, out string label);
         //int app_info_get_localed_label (const char *app_id, const char *locale, char **label);
 
         [DllImport(Libraries.AppManager, EntryPoint = "app_info_get_icon")]
-        internal static extern ErrorCode AppInfoGetIcon(IntPtr handle, out IntPtr path);
+        internal static extern ErrorCode AppInfoGetIcon(IntPtr handle, out string path);
         //int app_info_get_icon (app_info_h app_info, char **path)
 
         [DllImport(Libraries.AppManager, EntryPoint = "app_info_get_package")]
-        internal static extern ErrorCode AppInfoGetPackage(IntPtr handle, out IntPtr package);
+        internal static extern ErrorCode AppInfoGetPackage(IntPtr handle, out string package);
         //int app_info_get_package (app_info_h app_info, char **package)
 
         [DllImport(Libraries.AppManager, EntryPoint = "app_info_get_type")]
-        internal static extern ErrorCode AppInfoGetType(IntPtr handle, out IntPtr type);
+        internal static extern ErrorCode AppInfoGetType(IntPtr handle, out string type);
         //int app_info_get_type (app_info_h app_info, char **type)
 
         [DllImport(Libraries.AppManager, EntryPoint = "app_info_foreach_metadata")]
index de37259..41c6dd5 100755 (executable)
@@ -41,17 +41,8 @@ namespace Tizen.Applications
         {
             get
             {
-                IntPtr ptr = IntPtr.Zero;
-                Interop.ApplicationManager.AppInfoGetAppId(_infoHandle, out ptr);
-                string appid = "";
-                if (ptr != IntPtr.Zero)
-                {
-                    appid = Marshal.PtrToStringAuto(ptr);
-                }
-                else
-                {
-                    Log.Warn(LogTag, "InstalledApplication get ApplicationId failed.");
-                }
+                string appid = string.Empty;
+                Interop.ApplicationManager.AppInfoGetAppId(_infoHandle, out appid);
                 return appid;
             }
         }
@@ -63,17 +54,8 @@ namespace Tizen.Applications
         {
             get
             {
-                IntPtr ptr = IntPtr.Zero;
-                Interop.ApplicationManager.AppInfoGetPackage(_infoHandle, out ptr);
-                string packageid = "";
-                if (ptr != IntPtr.Zero)
-                {
-                    packageid = Marshal.PtrToStringAuto(ptr);
-                }
-                else
-                {
-                    Log.Warn(LogTag, "InstalledApplication get PackageId failed.");
-                }
+                string packageid = string.Empty;
+                Interop.ApplicationManager.AppInfoGetPackage(_infoHandle, out packageid);
                 return packageid;
             }
         }
@@ -85,17 +67,8 @@ namespace Tizen.Applications
         {
             get
             {
-                IntPtr ptr = IntPtr.Zero;
-                Interop.ApplicationManager.AppInfoGetLabel(_infoHandle, out ptr);
-                string label = "";
-                if (ptr != IntPtr.Zero)
-                {
-                    label = Marshal.PtrToStringAuto(ptr);
-                }
-                else
-                {
-                    Log.Warn(LogTag, "InstalledApplication get Label failed.");
-                }
+                string label = string.Empty;
+                Interop.ApplicationManager.AppInfoGetLabel(_infoHandle, out label);
                 return label;
             }
         }
@@ -107,39 +80,21 @@ namespace Tizen.Applications
         {
             get
             {
-                IntPtr ptr = IntPtr.Zero;
-                Interop.ApplicationManager.AppInfoGetExec(_infoHandle, out ptr);
-                string exec = "";
-                if (ptr != IntPtr.Zero)
-                {
-                    exec = Marshal.PtrToStringAuto(ptr);
-                }
-                else
-                {
-                    Log.Warn(LogTag, "InstalledApplication get ExcutablePath failed.");
-                }
+                string exec = string.Empty;
+                Interop.ApplicationManager.AppInfoGetExec(_infoHandle, out exec);
                 return exec;
             }
         }
 
         /// <summary>
-        /// Gets the absolute path to the icon image. 
+        /// Gets the absolute path to the icon image.
         /// </summary>
         public string IconPath
         {
             get
             {
-                IntPtr ptr = IntPtr.Zero;
-                Interop.ApplicationManager.AppInfoGetIcon(_infoHandle, out ptr);
-                string path = "";
-                if (ptr != IntPtr.Zero)
-                {
-                    path = Marshal.PtrToStringAuto(ptr);
-                }
-                else
-                {
-                    Log.Warn(LogTag, "InstalledApplication get IconPath failed.");
-                }
+                string path = string.Empty;
+                Interop.ApplicationManager.AppInfoGetIcon(_infoHandle, out path);
                 return path;
             }
         }
@@ -151,17 +106,8 @@ namespace Tizen.Applications
         {
             get
             {
-                IntPtr ptr = IntPtr.Zero;
-                Interop.ApplicationManager.AppInfoGetType(_infoHandle, out ptr);
-                string type = "";
-                if (ptr != IntPtr.Zero)
-                {
-                    type = Marshal.PtrToStringAuto(ptr);
-                }
-                else
-                {
-                    Log.Warn(LogTag, "InstalledApplication get Type failed.");
-                }
+                string type = string.Empty;
+                Interop.ApplicationManager.AppInfoGetType(_infoHandle, out type);
                 return type;
             }
         }
@@ -276,17 +222,8 @@ namespace Tizen.Applications
         /// <param name="locale">locale.</param>
         public string GetLocalizedLabel(string locale)
         {
-            IntPtr ptr = IntPtr.Zero;
-            Interop.ApplicationManager.AppInfoGetLocaledLabel(ApplicationId, locale, out ptr);
             string label = Label;
-            if (ptr != IntPtr.Zero)
-            {
-                label = Marshal.PtrToStringAuto(ptr);
-            }
-            else
-            {
-                Log.Warn(LogTag, "InstalledApplication GetLocalizedLabel(" + locale + ") failed.");
-            }
+            Interop.ApplicationManager.AppInfoGetLocaledLabel(ApplicationId, locale, out label);
             return label;
         }
 
index def43b2..95e48b7 100755 (executable)
@@ -44,7 +44,7 @@ namespace Tizen.Applications
         }
 
         /// <summary>
-        /// 
+        ///
         /// </summary>
         public IDictionary<string, string> Filter
         {
index 3aa6877..75dfc48 100755 (executable)
@@ -18,7 +18,7 @@ namespace Tizen.Applications
         /// <summary>
         /// The information of the application.
         /// </summary>
-        public ApplicationInfo ApplicationInfo { get; internal set; }        
+        public ApplicationInfo ApplicationInfo { get; internal set; }
     }
 }