[Application] Fix widget instance id bug (#1197)
authorSeungkeun Lee <sngn.lee@samsung.com>
Mon, 13 Jan 2020 08:37:00 +0000 (17:37 +0900)
committerpjh9216 <jh9216.park@samsung.com>
Mon, 13 Jan 2020 08:37:00 +0000 (17:37 +0900)
* Fix widget instance id bug

* Update Introp method name

src/Tizen.Applications.WidgetApplication/Interop/Interop.Widget.cs [changed mode: 0755->0644]
src/Tizen.Applications.WidgetApplication/Tizen.Applications/WidgetType.cs [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
index 390227d..87abc41
@@ -107,6 +107,14 @@ internal static partial class Interop
         [DllImport(Libraries.AppcoreWidget, EntryPoint = "widget_app_get_elm_win")]
         internal static extern ErrorCode GetWin(IntPtr handle, out IntPtr win);
 
+        [DllImport(Libraries.AppcoreWidget)]
+        internal static extern IntPtr widget_app_get_id(IntPtr handle);
+
+        internal static string GetId(IntPtr handle)
+        {
+            return Marshal.PtrToStringAnsi(widget_app_get_id(handle));
+        }
+
         [DllImport(Libraries.AppCommon, EntryPoint = "app_event_get_low_memory_status")]
         internal static extern Tizen.Internals.Errors.ErrorCode AppEventGetLowMemoryStatus(IntPtr handle, out LowMemoryStatus status);
 
old mode 100755 (executable)
new mode 100644 (file)
index c19e81e..f63052a
@@ -52,7 +52,7 @@ namespace Tizen.Applications
             if (b == null)
                 return 0;
 
-            b.Bind(context, Id);
+            b.Bind(context, Interop.Widget.GetId(context));
             WidgetInstances.Add(b);
             if (content != IntPtr.Zero)
                 bundle = new Bundle(new SafeBundleHandle(content, false));