[Applications.Service] Add a new internal API (#4626)
authorhjhun <36876573+hjhun@users.noreply.github.com>
Wed, 5 Oct 2022 23:10:45 +0000 (08:10 +0900)
committerGitHub <noreply@github.com>
Wed, 5 Oct 2022 23:10:45 +0000 (08:10 +0900)
To exit the main loop without restarting, the method is added.

Adds:
 - ServiceApplication.ExitWithoutRestarting()

Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/Tizen.Applications.Service/Interop/Interop.Service.cs
src/Tizen.Applications.Service/Tizen.Applications/ServiceApplication.cs

index 5b841ba..4d2a8f6 100755 (executable)
@@ -38,6 +38,9 @@ internal static partial class Interop
         [DllImport(Libraries.AppcoreAgent, EntryPoint = "service_app_exit")]
         internal static extern void Exit();
 
+        [DllImport(Libraries.AppcoreAgent, EntryPoint = "service_app_exit_without_restart")]
+        internal static extern void ExitWithoutRestarting();
+
         [DllImport(Libraries.AppcoreAgent, EntryPoint = "service_app_add_event_handler")]
         internal static extern ErrorCode AddEventHandler(out IntPtr handle, DefaultCoreBackend.AppEventType eventType, AppEventCallback callback, IntPtr data);
 
index 7da954a..109c1d7 100755 (executable)
@@ -14,6 +14,7 @@
  * limitations under the License.
  */
 
+using System.ComponentModel;
 using Tizen.Applications.CoreBackend;
 
 namespace Tizen.Applications
@@ -41,5 +42,15 @@ namespace Tizen.Applications
         {
             base.Run(args);
         }
+
+        /// <summary>
+        /// Exits the main loop of the application without restarting.
+        /// </summary>
+        /// <since_tizen> 10 </since_tizen>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void ExitWithoutRestarting()
+        {
+            Interop.Service.ExitWithoutRestarting();
+        }
     }
 }