[Applications.Common] Add a new internal API (#4625)
[platform/core/csapi/tizenfx.git] / src / Tizen.Applications.Common / Tizen.Applications / ApplicationRunningContext.cs
index c7196e7..9c791e9 100755 (executable)
@@ -287,6 +287,32 @@ namespace Tizen.Applications
         }
 
         /// <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>