internal static extern ErrorCode AppManagerTerminateApp(IntPtr handle);
//int app_manager_terminate_app (app_context_h app_context);
+ [DllImport(Libraries.AppManager, EntryPoint = "app_manager_terminate_app_without_restarting")]
+ internal static extern ErrorCode AppManagerTerminateAppWithoutRestarting(IntPtr handle);
+ //int app_manager_terminate_app_without_restarting (app_context_h app_context);
+
[DllImport(Libraries.AppManager, EntryPoint = "app_manager_get_app_context_by_instance_id")]
internal static extern ErrorCode AppManagerGetAppContextByInstanceId(string applicationId, string instanceId, out IntPtr handle);
//int app_manager_get_app_context_by_instance_id (const char *app_id, const char *instance_id, app_context_h *app_context);
}
/// <summary>
+ /// Terminates the application without restarting.
+ /// </summary>
+ /// <exception cref="ArgumentException">Thrown when failed of invalid argument.</exception>
+ /// <exception cref="UnauthorizedAccessException">Thrown when failed because of permission denied.</exception>
+ /// <exception cref="InvalidOperationException">Thrown when failed because of system error.</exception>
+ /// <privilege>http://tizen.org/privilege/appmanager.kill</privilege>
+ /// <since_tizen> 10 </since_tizen>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void TerminateWithoutRestarting()
+ {
+ err = Interop.ApplicationManager.AppManagerTerminateAppWithoutRestarting(_contextHandle);
+ if (err != Interop.ApplicationManager.ErrorCode.None)
+ {
+ switch (err)
+ {
+ case Interop.ApplicationManager.ErrorCode.InvalidParameter:
+ throw new ArgumentException("Invalid argument.");
+ case Interop.ApplicationManager.ErrorCode.PermissionDenied:
+ throw new UnauthorizedAccessException("Permission denied.");
+ default:
+ throw new InvalidOperationException("Invalid Operation.");
+ }
+ }
+ }
+
+ /// <summary>
/// Resumes the running application.
/// </summary>
/// <exception cref="ArgumentException">Thrown when failed of invalid argument.</exception>